# Agent Rigor – Stop your AI coding assistant from doom-looping

> Source: <https://github.com/MeherBhaskar/agent-rigor>
> Published: 2026-06-20 18:10:50+00:00

**Strict empirical discipline for your AI coding assistant.**

*Stop watching your AI agent code itself into a corner. Give it discipline.*

Most AI coding agents fail not because they lack intelligence, but because they lack **discipline**. When left to their own devices, they:

- ❌ Skip planning and jump straight to implementation.
- ❌ Write plausible-looking code that doesn't actually work.
- ❌ Get trapped in "doom loops" (fix-forward spirals).
- ❌ Forget what they learned between sessions (context amnesia).
- ❌ Suffer from "context rot" by loading too many instructions at once.

**Agent Rigor solves this.** It provides a structured, multi-layer progressive disclosure framework: a set of mandatory protocols, verification gates, and anti-rationalization safeguards that force empirical discipline at every step.

**Actionable Protocols**: Every instruction is a verifiable step with exit criteria, not an essay.** Empirical Sovereignty**: Claims require evidence. "Seems right" is never sufficient.** Atomic State Transitions**: The codebase moves between known-good states. Broken states are never committed.** Anti-Rationalization**: Every skill actively anticipates and rebuts the excuses agents use to skip discipline.** Progressive Disclosure**: The agent reads only the files it needs for the current phase, saving tokens and preventing instruction neglect.

The system is organized into a robust 3-tier hierarchy using **Progressive Disclosure** to prevent context window collapse.

**L1: Apex Kernel (**: Always-on routing and non-negotiable laws.`SYSTEM_CORE.md`

)**L2: Phase Directors (**: Just-in-time orchestration loaded only when entering a phase.`00_PHASE_DIRECTOR.md`

)**L3: Skill Protocols (**: Deep execution guidelines loaded`skills/*.md`

)*only*when requested by the Director.

``` php
graph TD
    A[Phase 1: Mission Synthesis] -->|PLAN.md| B(Phase 2: Execution Engine)
    B -->|Committed Code| C{Phase 3: Verification Matrix}
    C -->|CRITICAL Findings| B
    C -->|Zero Findings| D[Phase 4: Cognitive Persistence]
    D -->|Context Snapshot| A
    
    subgraph Phase 6: Adaptive Protocols
    Z[Self-Correction / Scope Defense / Consolidation]
    end
    
    B -.->|3-Strike Failure| Z
    Z -.->|Recovery| B
```

| Phase | Purpose | Key Skills |
|---|---|---|
01. Mission Synthesis |
Requirements & Planning | Requirement Distillation, Strategic Decomposition |
02. Execution Engine |
Implementation & Testing | Convergent Iteration, State Checkpointing |
03. Verification Matrix |
Quality & Review Gates | Pentagonal Audit, Entropy Reduction |
04. Cognitive Persistence |
Memory & Knowledge | Context Lifecycle, Structural Cartography |
05. Interface Protocols |
Safe Environment Interaction | Bounded Observation, Semantic Navigation |
06. Adaptive Protocols |
The Immune System | Recursive Self-Correction, Scope Containment |

Get Agent Rigor working in your project in under 2 minutes.

Run the installation script in your project root:

```
curl -sSL https://raw.githubusercontent.com/MeherBhaskar/agent-rigor/main/install.sh | bash
```

*(Alternatively, clone this repo into an .agents/ directory).*

Simply prompt your agent with:

"I need to build [feature]. Read

`.agents/SYSTEM_CORE.md`

and begin Phase 1 (Mission Synthesis)."

The agent will automatically read the Phase 1 Director, create a `PLAN.md`

, and orchestrate its own work through implementation, review, and context saving.

Agent Rigor is pure markdown and **platform-agnostic**. It works natively with:

| Agent / IDE | Integration Method |
|---|---|
Cursor |
Point to `.agents/SYSTEM_CORE.md` in your `.cursorrules` or `.mdc` files. |
Claude Code |
Include a reference in your `CLAUDE.md` . |
GitHub Copilot |
Reference in `.github/copilot-instructions.md` . |
Gemini CLI / Antigravity |
Include in `.agents/AGENTS.md` . |
Aider |
Pass via `--read .agents/SYSTEM_CORE.md` . |

*See the *

`examples/`

folder for ready-to-use configuration templates.We welcome contributions to make agents smarter and more disciplined!
Please see our [Contributing Guidelines](/MeherBhaskar/agent-rigor/blob/main/CONTRIBUTING.md) to understand how to design skills that agents actually follow.
