playbook
Use this skill when the user asks to create, review, improve, trim, audit, or standardize an AGENTS.md file, or to derive agent instructions from a codebase. Produces compact, repo-specific, LLM-optimized AGENTS.md files and, when useful, companion authoring guidance such as AGENTS_MD_GUIDELINE.md.
What this skill does
# Playbook
`AGENTS.md` is an instruction file for coding agents. Optimize it for fast machine consumption, not human onboarding.
Examples in this skill are illustrative only. Never copy example terms, commands, or paths into the target `AGENTS.md`. Derive every word from the actual repository.
## Prime Directive: Minimalism
A bloated `AGENTS.md` is worse than no `AGENTS.md`. Every extra line:
- Pollutes the agent's context window on every task in the repo.
- Becomes long-term tech debt that drifts out of sync with the code.
- Dilutes the high-signal rules and degrades agent performance.
**Size budget**:
- Typical repo: 5–20 bullets total.
- Complex monorepo or unusual stack: up to ~40 bullets.
- Hard ceiling: if the file would exceed ~50 lines, you are almost certainly wrong. Cut.
A great `AGENTS.md` may have only 3 bullets. Short is the goal, not a side effect.
## The Justification Test (Mandatory)
For every candidate line, the agent MUST stop and answer all three questions out loud in its reasoning before keeping it:
1. **What concrete, expensive mistake does this prevent?** Name the failure. If you cannot name one, cut.
2. **Could a competent agent infer this in seconds from `ls`, manifests, imports, framework conventions, or the README?** If yes, cut.
3. **Is this specific to THIS repo?** If the same line would apply to any project in the same language/framework, cut.
A line survives only if it prevents a real, repo-specific mistake that an agent would not catch from a quick glance at the code.
**When in doubt, cut.** The bar for inclusion is intentionally high. Err on the side of an empty section over a marginal bullet.
## Mandatory Project-Maturity Interview
Before finalizing `AGENTS.md`, ask the user the following questions unless the repo answers them unambiguously through release docs, public API guarantees, migration history, or existing contributor guidance:
1. **Project stage**: early development / actively evolving / established and stable?
2. **Breaking changes**: freely allowed / allowed with care / forbidden?
3. **Backward compatibility**: required for public APIs, CLIs, schemas, or configs / not a concern?
Use the answers to set the maintenance posture, encoded as 1–2 directive bullets:
- **Fresh / early-development projects**: agents MUST prioritize clean, well-organized, maintainable code. Prefer large refactors over backward-compatible shims. Compatibility is explicitly not a goal.
- **Established / stable projects**: preserve public interfaces unless the task explicitly allows breaking them. Prefer minimal diffs and migration plans over sweeping rewrites.
- **Mixed**: state the rule per surface (e.g. "internal modules: refactor freely; HTTP API: preserve").
Skip a question only when the repo's answer is obvious. Do not pad the interview with unrelated questions.
## What Belongs (only if it passes the Justification Test)
- Canonical domain terminology when the repo uses non-obvious or overloaded terms.
- Generated / codegen paths that must not be hand-edited.
- Canonical validation, build, lint, test, or typecheck commands.
- Subproject or monorepo boundary rules.
- Maintenance posture from the interview above.
- Repo-specific footguns that have actually bitten contributors.
## What Does Not Belong (cut on sight)
- Generic engineering advice ("write clean code", "run tests before committing").
- Facts visible from `ls`, manifests, imports, or framework conventions ("this project uses Python").
- Setup or architecture content — belongs in `README.md`.
- Soft wording: "try to", "consider", "be aware", "where appropriate".
- Restated content from other docs that does not prevent a likely mistake.
- Volatile operational details that will go stale fast.
- Aspirational rules nobody in the repo actually follows.
## No Fixed Template
Do not impose a section structure. Sections invite padding because the agent feels obligated to fill them.
- If the file has 5 useful bullets, ship 5 bullets with no headings.
- Add a heading only when grouping genuinely helps scanning a longer file.
- Never include an empty or near-empty section as a placeholder.
The file should read like the shortest possible answer to: "What will an agent get wrong in this repo if nobody tells it?"
## Discovery Workflow
1. Inspect repo root docs, manifests, CI workflows, package scripts, lint/typecheck config.
2. Inspect codegen paths and generated artifacts.
3. Identify domain terminology that must stay consistent.
4. Identify subproject boundaries and local conventions.
5. Run the project-maturity interview if the repo does not already answer it.
6. Draft candidate bullets from findings.
7. Run every bullet through the Justification Test. Cut aggressively.
8. Order surviving bullets by cost-of-mistake, highest first.
Never invent constraints. Derive them from the repo or from the user's answers.
## Writing Style
- Imperative phrasing.
- Exact commands, filenames, paths, and terms — no placeholders, no hedging.
- Highest-cost mistakes first.
- No rationale unless the rationale itself changes agent behavior.
- No prose paragraphs.
Good:
```
- Use `Order` (not `Purchase`) as the canonical domain term.
- Do not hand-edit files under `gen/proto/`; regenerate via `bun run codegen`.
- Validate with `bun run check`. Full CI parity: `bun run verify`.
- Internal refactors welcome; preserve the public HTTP API.
```
Bad:
```
This project values clean code, so please try to write maintainable
implementations. There are some generated files which you should be
careful with. Tests should be run before committing changes.
```
## Updating an Existing AGENTS.md
- Apply the Justification Test to every existing line. Cut what fails — even lines that look reasonable.
- Preserve sharp, repo-specific guidance verbatim.
- Compress prose into bullets.
- Do not rewrite for style if a line is already correct and tight.
- A successful update almost always shrinks the file. If yours grew, re-check the Justification Test.
## AGENTS.md vs AGENTS_MD_GUIDELINE.md
When the user asks for both:
- **`AGENTS.md`** — for agents. Tiny, directive, repo-specific. LLM-oriented.
- **`AGENTS_MD_GUIDELINE.md`** — for humans authoring `AGENTS.md`. Explanatory, generalizable, may include rationale, heuristics, anti-patterns, and templates.
Never let the human-oriented guideline bleed into `AGENTS.md`.
## Final Review (run before delivering)
Answer each, honestly:
- Did every line pass the Justification Test out loud?
- Is the maintenance posture explicit, and does it match the user's interview answers?
- Are domain terms, codegen paths, and validation commands accurate and current?
- Would removing any single line genuinely hurt an agent's next task in this repo?
If the last answer is "no" for any line, cut that line and review again.
## One-Sentence Standard
A good `AGENTS.md` is the shortest possible set of repo-specific directives that prevents an agent from making expensive, hard-to-catch mistakes — and nothing more.
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.