From agents-discipline
Agents Discipline & Good Project Management for Claude Code. Use when starting a new project, retrofitting an existing repo, or whenever the user mentions CLAUDE.md, AGENTS.md, specs/, INDEX.md, hooks, output-styles, permission allowlists, "spec first", or asks for an OpenAI Codex adversarial review of Claude's work. Bootstraps the "quiet files" that keep agents honest and wires a Claude ↔ Codex adversarial loop.
How this skill is triggered — by the user, by Claude, or both
Slash command
/agents-discipline:agents-disciplineThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
The skill that installs **good project management** for any Claude Code project — the quiet files nobody is posting about, plus an **AGENTS.md** so OpenAI Codex can adversarially review what Claude shipped.
The skill that installs good project management for any Claude Code project — the quiet files nobody is posting about, plus an AGENTS.md so OpenAI Codex can adversarially review what Claude shipped.
Tradeoff: Adds ~15 files of structure. On a 3-line script, skip it. On anything you'll touch more than once, the payoff is huge: less re-explaining, fewer permission prompts, deterministic guardrails, and a second pair of (adversarial) eyes.
CLAUDE.md — the team rule bookThe shared, committed contract. Keep it under 200 lines. Put cross-cutting rules here (tone, commit style, "never push to main", etc.). Path-specific rules go in .claude/rules/ instead.
CLAUDE.local.md — personal overrides (gitignored)Your voice, your tool preferences ("always run with pnpm"), your shortcuts. Never committed. Don't pollute the team file.
AGENTS.md — the Codex adversarial brief (this is the differentiator)A parallel rule book read by OpenAI Codex. Same project context as CLAUDE.md, but framed for an adversarial reviewer:
Codex reads AGENTS.md the same way Claude reads CLAUDE.md. Running the two agents against each other catches what either misses alone.
INDEX.md — the live monorepo mapEvery package, entry point, responsibility, and inter-module relationship. Stops Claude from blind grep-ing. Stops you from typing "where does X live?" five times a day.
specs/<feature>.md — spec-firstOne spec per feature: requirements, design decisions, tasks, acceptance criteria. The contract that keeps agents honest and lets you version the feature's evolution.
.claude/rules/ — path-scoped rules (glob-loaded)API rules don't bleed into frontend; frontend rules don't bleed into backend. Keeps CLAUDE.md lean.
.claude/output-styles/ — response presetse.g. writing.md — kills the "be shorter" prompt forever.
.claude/hooks/ — deterministic guardrailspre-push.sh — typecheck + tests before every push.on-mcp-call.sh — react when an MCP tool fires (log, gate, redact)..claude/settings.json + .claude/settings.local.json — permission allowlistPre-approve the ~30 commands you actually use (git, pnpm, docker, …). End the torture of approving the same command every time. settings.local.json is personal + gitignored.
tests/<file>.test.ts — the one file you can't skipWell-written tests are what let you move fast with confidence. Without them, every refactor is Russian roulette.
When invoked, ask the user which mode to run:
templates/.specs/<feature>.md from templates/specs/SPEC-TEMPLATE.md.AGENTS.md for the current branch's diff and explain how to run Codex against it.The plugin ships matching slash commands:
/agents-init — full bootstrap/agents-spec <feature> — new spec/agents-review — refresh AGENTS.md for the current diff and brief CodexCLAUDE.md, AGENTS.md, or INDEX.md. Append a clearly-marked <!-- agents-discipline --> section instead, or write the template to *.proposed.md and ask.CLAUDE.local.md and .claude/settings.local.json to .gitignore if not already ignored..claude/hooks/*.sh executable (chmod +x).CLAUDE.md under 200 lines. If it would exceed, move the overflow into .claude/rules/<scope>.md.CLAUDE.md exists but lacks an AGENTS.md counterpart, generate AGENTS.md by translating Claude-facing rules into adversarial-reviewer framing.A spec lives in specs/<feature>.md and contains:
Adopt "spec first": Claude reads the spec, you stop re-explaining, evolutions are versioned in git.
specs/<feature>.md, respecting CLAUDE.md.AGENTS.md loaded. Codex's job is to break it: reproduce bugs, find missing tests, surface assumptions Claude buried.REVIEW.md.This is not "two agents agree" — it's "one agent attacks, the other defends, the user adjudicates".
CLAUDE.md → move path-scoped stuff to .claude/rules/.CLAUDE.local.md or .claude/settings.local.json → must be gitignored.AGENTS.md echo CLAUDE.md verbatim → it must read adversarially or it adds no signal.pre-push.sh that runs nothing → if you have no typecheck or tests, the hook is theater. Either wire it up or delete it.All file templates live in templates/ of this plugin's repo:
templates/
├── CLAUDE.md
├── CLAUDE.local.md
├── AGENTS.md
├── INDEX.md
├── specs/SPEC-TEMPLATE.md
├── tests/.gitkeep
└── .claude/
├── settings.json
├── settings.local.json
├── hooks/pre-push.sh
├── hooks/on-mcp-call.sh
├── output-styles/writing.md
└── rules/{api,frontend}.md
Copy from there. Adapt to the target project. Don't add structure the project doesn't earn.
Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
npx claudepluginhub rodrigoterra/agents-discipline --plugin screenshot-annotator