agents-md
Audits and writes AGENTS.md files using execution-first standards. Checks commands, gotchas, and signal-to-noise ratio. Use when asked to audit, review, score, refactor, or improve agent instruction files, fix stale commands, reduce bloat, or asking "my AGENTS.md is bad", "help me write a CLAUDE.md", or "improve my agent instructions".
What this skill does
# AGENTS.md Audit
AGENTS.md is the source of truth for agent instructions. Claude Code loads both `AGENTS.md` and `CLAUDE.md` natively — no symlink required. If a project already has a `CLAUDE.md`, rename it to `AGENTS.md` (the tool-agnostic name).
AGENTS.md files are execution contracts, not knowledge bases.
**Litmus test for every line:** "Would removing this cause the agent to make a mistake?" If no, cut it. Bloated instruction files cause agents to ignore actual rules. KISS applies to instruction files too — the simplest set of rules that prevents mistakes is the best set.
## Reference Files
| File | Read When |
|------|-----------|
| `references/quick-checklist.md` | Default: fast triage (10 checks, target >= 8/10) |
| `references/quality-criteria.md` | Full audit mode or when quick audit fails |
| `references/refactor-workflow.md` | File is bloated (>150 lines) or low-signal |
| `references/root-content-guidance.md` | Deciding what stays in root vs separate files |
| `references/templates.md` | Drafting new file or rebuilding from scratch |
## Quick Example
**Input:** AGENTS.md with stale commands and generic advice
**Quick audit result:** 5/10 (Fail)
**Key issues:** Missing test command, generic "follow best practices" advice, dead link to deleted folder
**Fix:** Add `npm test`, replace generic advice with specific gotcha, remove dead link
**After:** 9/10 (Pass)
## How to Use
Default path:
- Start with quick audit using `references/quick-checklist.md` (10 checks)
- Escalate to full audit (`references/quality-criteria.md`) only when quick audit fails, file is high-risk, or user requests it
- Apply edits only after reporting findings and getting confirmation
Progressive loading:
- Always load the checklist for the selected audit mode
- Load `references/refactor-workflow.md` only for low-signal files (below target score, stale commands, or root file over ~150 lines)
- Load `references/templates.md` only when drafting a new file or rebuilding from scratch
- Load `references/root-content-guidance.md` only when deciding what stays in root vs moved out
## Audit Workflow
Copy this checklist to track progress:
```
Audit Progress:
- [ ] Step 1: Discover files
- [ ] Step 2: Select audit mode (quick or full)
- [ ] Step 3: Run audit against checklist
- [ ] Step 4: Report findings with score table
- [ ] Step 5: Propose minimal diffs
- [ ] Step 6: Validate changes
- [ ] Step 7: Apply and verify
```
### Step 1: Discover files
Run:
```bash
find . \( -name "AGENTS.md" -o -name "CLAUDE.md" -o -name "CLAUDE.local.md" \) 2>/dev/null | sort
```
Also check for a home-level file: `~/.claude/CLAUDE.md` (applies to all sessions).
AGENTS.md is the source of truth. If a project has a CLAUDE.md without an AGENTS.md, recommend renaming it:
```bash
mv CLAUDE.md AGENTS.md
```
Claude Code loads `AGENTS.md`, `CLAUDE.md`, and `CLAUDE.local.md` natively from any level. No symlinks needed. Instruction files at multiple levels (project root, parent directories, child directories) are all loaded automatically. `CLAUDE.local.md` is the gitignored personal variant. Audit each level independently.
For monorepos, include workspace-level AGENTS.md files.
### Step 2: Select audit mode
- **Quick audit:** Default for most files (10 checks, target >= 8/10)
- **Full audit:** When quick audit fails, file is high-risk, or user requests full scoring
### Step 3: Run audit
- Quick audit target: **>= 8/10** checks from `references/quick-checklist.md`
- Full audit file-quality target: **>= 91% of applicable points** from `references/quality-criteria.md`
- Full audit execution target: **2/2** when producing an edit proposal
- Score each root file independently
### Step 4: Report findings
Output a concise report before edits:
```markdown
## AGENTS.md Audit Report
| File | Mode | Score | Grade | Key Issues |
|------|------|-------|-------|------------|
| ./AGENTS.md | Quick | 6/10 | Fail | Missing test command, stale path, doc-heavy section |
```
### Step 5: Propose minimal diffs
- Fix broken/stale commands first
- Remove generic, duplicate, or obsolete guidance
- Move deep detail into linked files using `@path/to/file.md` import syntax
- Use emphasis ("IMPORTANT:", "YOU MUST") on critical rules that agents tend to skip
- Keep rewrites incremental and preserve useful wording when possible
Show each proposed change with rationale and a diff snippet.
### Step 6: Validate changes
Validation loop:
1. Run smoke checks for core commands (`dev`, `test`, `build`, `lint/typecheck`) when applicable
2. If commands cannot be run, verify script existence and note the limitation
3. Check that linked paths resolve
4. Confirm no contradictory rules remain
5. If issues found → revise → validate again
6. Only proceed when validation passes
### Step 7: Apply and verify
- Apply approved edits
- After each PR, add at most one new gotcha only if it prevented or fixed a real mistake
- Verify changes by re-running relevant commands
## Gotchas
- Don't rewrite the entire file when targeted edits would pass audit — incremental fixes preserve useful wording and reduce review burden.
- Don't add gotchas that aren't grounded in a real failure — hypothetical warnings become noise the agent learns to ignore.
- Don't audit CLAUDE.local.md the same way as AGENTS.md — local files are personal and not committed, so enforce less strictly.
- Don't remove emphasis markers (IMPORTANT, YOU MUST) from rules agents consistently skip — these exist because the default phrasing was not enough.
- Don't treat a high quick-audit score as permission to skip validation — stale commands can hide behind passing checklists.
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.