Agent Instructions
Treat persistent agent instructions as a routing and policy layer, not a repository encyclopedia. Keep always-loaded files small enough to remain useful, but retain explicit guardrails that repository evidence or the user shows are important.
Modes
Infer the mode from the request:
- Audit: inspect and report. Do not edit files.
- Propose: show a replacement, patch, or file plan. Do not edit files.
- Apply: create or edit files when the user explicitly asks to create, fix, update, refactor, rewrite, or otherwise change them.
An audit may recommend changes, but a request to "audit" or "review" alone does not authorize them. In Apply mode, make the requested in-scope edits without asking for another confirmation. Pause only when a material policy choice or contradiction cannot be resolved from repository evidence.
Default to repository-owned instructions. Keep global, home-directory, private local, and session-history sources outside the audit unless the user explicitly includes them.
Workflow
- Establish the repository root, the working directories whose behavior matters, the target harnesses, and the mode.
- Discover all relevant instruction carriers and their evidence:
AGENTS.md, AGENTS.override.md, configured fallback files, CLAUDE.md, CLAUDE.local.md, .claude/CLAUDE.md, .claude/rules/, referenced documentation, repository configuration, and executable checks.
- If Python is available, run the bundled
scripts/inventory_agent_instructions.py --root <root> --cwd <cwd> for each materially different working directory. Resolve the script path from this skill's directory. Treat its output as discovery evidence, not a complete semantic audit.
- Compute what each harness actually loads. Read references/harness-loading.md whenever there is more than one instruction level, an override, fallback name, import, scoped rule, both Codex and Claude, or a context-size concern.
- Read references/audit-rubric.md. Test every material instruction against repository evidence and assign a disposition. Never grade solely from file length or a universal template.
- Report the effective loading behavior and highest-impact findings before proposing mutations. Separate observed facts, inferences, and user-owned policy.
- In Apply mode, read references/change-workflow.md, form a file plan, and make the smallest coherent change. Prefer one source of truth over duplicated
AGENTS.md and CLAUDE.md content.
- Validate the result: rerun discovery, resolve local references, recompute loading chains, check the Codex byte budget, and run only safe, relevant repository checks.
Completion Gate
Do not call the work complete until:
- every material instruction has an evidence-backed disposition;
- every affected harness and working-directory chain has been modeled;
- every retained pointer or import resolves and states when it matters;
- contradictions and unresolved policy choices are explicit;
- any changed files have been re-audited in their effective loaded form;
- the final response distinguishes changes made, recommendations not applied, and validation performed.
Boundaries
- Keep repository preferences repository-specific rather than promoting them to universal best practices.
- Route enforceable formatting, linting, and test policy to configuration, hooks, or CI when those mechanisms can own it.
- Keep specialized procedures behind a root-level trigger that states when to load them.
- Preserve emphatic or absolute guardrails until evidence shows whether they encode a costly past failure.
- Route
SKILL.md review to a skill-authoring or writing-for-agents workflow.
- Keep architecture, domain-model, ADR, documentation-drift, and issue-tracker readiness in a broader audit unless the user includes them.
1---2name: agent-instructions3description: Audit, create, or repair repository AGENTS.md and CLAUDE.md files using repository evidence and actual Codex or Claude loading behavior. Use for persistent coding-agent instructions; not for SKILL.md or broad workflow-readiness audits.4---56# Agent Instructions78Treat persistent agent instructions as a routing and policy layer, not a repository encyclopedia. Keep always-loaded files small enough to remain useful, but retain explicit guardrails that repository evidence or the user shows are important.910## Modes1112Infer the mode from the request:1314- **Audit**: inspect and report. Do not edit files.15- **Propose**: show a replacement, patch, or file plan. Do not edit files.16- **Apply**: create or edit files when the user explicitly asks to create, fix, update, refactor, rewrite, or otherwise change them.1718An audit may recommend changes, but a request to "audit" or "review" alone does not authorize them. In Apply mode, make the requested in-scope edits without asking for another confirmation. Pause only when a material policy choice or contradiction cannot be resolved from repository evidence.1920Default to repository-owned instructions. Keep global, home-directory, private local, and session-history sources outside the audit unless the user explicitly includes them.2122## Workflow23241. Establish the repository root, the working directories whose behavior matters, the target harnesses, and the mode.252. Discover all relevant instruction carriers and their evidence: `AGENTS.md`, `AGENTS.override.md`, configured fallback files, `CLAUDE.md`, `CLAUDE.local.md`, `.claude/CLAUDE.md`, `.claude/rules/`, referenced documentation, repository configuration, and executable checks.263. If Python is available, run the bundled `scripts/inventory_agent_instructions.py --root <root> --cwd <cwd>` for each materially different working directory. Resolve the script path from this skill's directory. Treat its output as discovery evidence, not a complete semantic audit.274. Compute what each harness actually loads. Read [references/harness-loading.md](references/harness-loading.md) whenever there is more than one instruction level, an override, fallback name, import, scoped rule, both Codex and Claude, or a context-size concern.285. Read [references/audit-rubric.md](references/audit-rubric.md). Test every material instruction against repository evidence and assign a disposition. Never grade solely from file length or a universal template.296. Report the effective loading behavior and highest-impact findings before proposing mutations. Separate observed facts, inferences, and user-owned policy.307. In Apply mode, read [references/change-workflow.md](references/change-workflow.md), form a file plan, and make the smallest coherent change. Prefer one source of truth over duplicated `AGENTS.md` and `CLAUDE.md` content.318. Validate the result: rerun discovery, resolve local references, recompute loading chains, check the Codex byte budget, and run only safe, relevant repository checks.3233## Completion Gate3435Do not call the work complete until:3637- every material instruction has an evidence-backed disposition;38- every affected harness and working-directory chain has been modeled;39- every retained pointer or import resolves and states when it matters;40- contradictions and unresolved policy choices are explicit;41- any changed files have been re-audited in their effective loaded form;42- the final response distinguishes changes made, recommendations not applied, and validation performed.4344## Boundaries4546- Keep repository preferences repository-specific rather than promoting them to universal best practices.47- Route enforceable formatting, linting, and test policy to configuration, hooks, or CI when those mechanisms can own it.48- Keep specialized procedures behind a root-level trigger that states when to load them.49- Preserve emphatic or absolute guardrails until evidence shows whether they encode a costly past failure.50- Route `SKILL.md` review to a skill-authoring or writing-for-agents workflow.51- Keep architecture, domain-model, ADR, documentation-drift, and issue-tracker readiness in a broader audit unless the user includes them.