# pragma

> Enforce Pragmatic Programmer principles through structured design, systematic debugging, and automated debt audits.

pragma is a free AI agent skill on Agensi by Lava Raju, in Code Quality & Review. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Lava Raju](https://www.agensi.io/creators/lava-raju)
- Category: [Code Quality & Review](https://www.agensi.io/skills/code-quality-review)
- Version: 1.0
- Last updated: 2026-11-24
- Security: scan passed (2026-11-24); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/pragma
- Tags: prompt-engineering, code-review, software-architecture, refactoring, clean-code

## About this skill

Maintaining code quality is easy at the start, but as complexity grows, the cost of change skyrockets. This skill enforces the 15 core principles of The Pragmatic Programmer to ensure your codebase remains decoupled, testable, and resilient to shifting requirements.

### What it does
- **Design Ladder Enforcement** ensures every new feature is evaluated for changeability, single responsibility, and knowledge duplication before code is written.
- **Deterministic Violation Detection** scans diffs and repositories for hardcoded secrets, injection risks, and accidental temporal coupling.
- **Systematic Debugging Protocol** replaces guesswork with a falsifiable hypothesis framework, ensuring every fix is rooted in a verified cause and backed by a regression test.
- **Contract Definition** establishes strict preconditions, postconditions, and invariants for modules to prevent boundary errors.
- **Refactoring Discipline** manages micro-step transformations to improve internal structure without breaking existing functionality.

### How it works
1. **Feature Planning** uses `/pragma:design <feature>` to map out units, boundaries, and interfaces before implementation begins.
2. **Review Cycles** use `/pragma:review` to scan uncommitted changes against pragmatic checklists and detector scripts.
3. **Repository Audits** run `/pragma:audit` to rank technical debt by safety risk and cost of change.
4. **Configuration** uses `/pragma:mode` to set enforcement intensity from lite to strict.

### Frameworks & tools
The skill uses a built-in `scan.js` detector and `mode.js` configuration script. It integrates with `git` for diff analysis and works across any language by focusing on architectural principles like DRY, orthogonality, and composition.

### Why this beats prompting it yourself
Generic prompts often overlook the "cost of change" and temporal coupling. This skill uses structured protocols and scripts that verify assumptions instead of just generating plausible-looking code.

### Use cases
- Auditing a legacy repository to identify high-risk technical debt.
- Designing a new service integration while maintaining strict decoupling.
- Debugging a production race condition using a formal investigation gate.
- Refactoring a complex module by enforcing composition over inheritance.

### Known limitations
Requires a local environment capable of running Node.js for the detector scripts. It focuses on structural design and safety rather than language-specific syntax linting.

## Requires

- Git

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the pragma skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### How does this skill differ from simply asking an AI to 'write clean code'?

While generic prompts provide style tips, 'pragma' uses built-in detector scripts like scan.js to programmatically identify technical debt, temporal coupling, and architectural violations that LLMs often miss during standard chat sessions.

### Are there any specific programming languages or technical requirements to use pragma?

The skill is language-agnostic because it focuses on architectural principles like DRY and orthogonality; however, your local environment must be able to run Node.js to execute the included detector and configuration scripts.

### What exactly is included in the 'pragma' skill package?

You receive the core logic for the 15 Pragmatic principles, the scan.js detector for repository audits, the mode.js configuration utility, and a set of structured commands for design, review, and debugging.

### Which AI agents or IDE extensions is this skill compatible with?

The skill functions as a logic layer for any AI agent with filesystem access and terminal execution capabilities, allowing it to bridge the gap between high-level architectural advice and actual file analysis via git.

### How do I get started with enforcing these principles on my existing codebase?

Simply import the skill into your agent's library and use the `/pragma:mode` command to calibrate the enforcement intensity to your project's specific safety requirements and tolerance for technical debt.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
