Writing AGENTS.md
When to use this skill
Use this skill when the user explicitly requests:
- Generation of a new AGENTS.md file for a repository.
- Review or improvement of an existing AGENTS.md.
- Conversion of project conventions into agent-actionable guidance.
Base the output on best practices for agent guidance, project conventions,
explicit rules, and examples.
Objective
Produce an AGENTS.md that:
- Is clear and unambiguous about agent behavior expectations.
- Includes explicit rules, boundaries, and escalation points.
- Is actionable and machine-readable (do not rely on narrative prose alone).
- Provides commands, conventions, and examples the agent can follow.
- Contains sections relevant to the user’s project context.
Structure to output
- Title and purpose
- One sentence summarizing the role of the AGENTS.md file for this project.
- Scope
- Which agents the file governs (AI assistants, bots, CI tools).
- Which parts of the project are in scope vs restricted.
- Non-negotiable rules
- Project architecture summary
- A short, bullet list description of the main code boundaries (e.g., frontend/backend layers, APIs, core modules).
- Coding and workflow conventions
- Toolchain commands (e.g. build/test/lint) with exact flags the agent should use.
- Formatting, error handling, commit conventions.
- Testing and validation requirements
- Explicit instructions on when tests must be added or updated.
- Expected test commands to run and criteria to meet.
- Change and escalation policies
- When the agent must stop and ask for human approval.
Example: “If a breaking API change is required, prompt for approval.”
- Examples
- Minimal examples showing correct application of key rules.
- Safety, security, and sensitive areas
- List areas where modifications are high-risk and require explicit verification.
- Final checklist
- A bullet list of items the agent should ensure before submitting changes.
Output guidelines
- Use clear, short commands (no narrative prose) in rules and conventions.
- Avoid generalities; prefer specific examples or exact commands.
- Do not assume project context; ask clarifying questions if needed.
- Do not generate hypothetical rules; ensure each rule is relevant to the target repository.
Example prompt
When the user asks:
“Write an AGENTS.md for my TypeScript web app using React and Vitest”
You should prompt:
- “What are the test, lint, and build commands?”
- “Which parts of the project should not be modified by an agent?”
Use their answers to tailor the output.
Edge cases to include
- If the project has multiple services (monorepo), clarify scope by directory.
- If there are security-relevant config files, include explicit error-prevention rules.
- If no explicit test suite exists, generate fallback instructions for test scaffolding.
Important notes
- The agent should treat AGENTS.md not as optional commentary, but as a normative contract for autonomous behaviors.
- Output must be usable by other agent products that understand AGENTS.md semantics (avoid product-specific jargon).
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: writing-agents-md3description: Teach an agent how to create a high-quality AGENTS.md file for a code project, including structure, rules, conventions, and examples. Use when the user requests guidance or generation of an AGENTS.md file. Use when this capability is needed.4---56# Writing AGENTS.md78## When to use this skill9Use this skill when the user explicitly requests:101. Generation of a new AGENTS.md file for a repository.112. Review or improvement of an existing AGENTS.md.123. Conversion of project conventions into agent-actionable guidance.1314Base the output on best practices for agent guidance, project conventions,15explicit rules, and examples.1617## Objective18Produce an AGENTS.md that:191. Is **clear and unambiguous** about agent behavior expectations.202. Includes **explicit rules, boundaries, and escalation points**.213. Is **actionable and machine-readable** (do not rely on narrative prose alone).224. Provides **commands, conventions, and examples** the agent can follow.235. Contains **sections relevant to the user’s project context**.2425## Structure to output261. Title and purpose27 - One sentence summarizing the role of the AGENTS.md file for this project.282. Scope29 - Which agents the file governs (AI assistants, bots, CI tools).30 - Which parts of the project are *in scope* vs *restricted*.313. Non-negotiable rules32 - Explicit statements of `MUST`, `MUST NOT`, `SHOULD`, or `SHOULD NOT`.33 - Example:34 ```35 MUST NOT modify database schema migrations.36 MUST run tests before proposing a patch.37 ```384. Project architecture summary39 - A short, bullet list description of the main code boundaries (e.g., frontend/backend layers, APIs, core modules).405. Coding and workflow conventions41 - Toolchain commands (e.g. build/test/lint) with exact flags the agent should use.42 - Formatting, error handling, commit conventions.436. Testing and validation requirements44 - Explicit instructions on when tests must be added or updated.45 - Expected test commands to run and criteria to meet.467. Change and escalation policies47 - When the agent **must stop and ask for human approval**.48 Example: “If a breaking API change is required, prompt for approval.”498. Examples50 - Minimal examples showing correct application of key rules.519. Safety, security, and sensitive areas52 - List areas where modifications are high-risk and require explicit verification.5310. Final checklist54 - A bullet list of items the agent should ensure before submitting changes.5556## Output guidelines57- Use **clear, short commands** (no narrative prose) in rules and conventions.58- Avoid generalities; prefer **specific examples or exact commands**.59- Do not assume project context; **ask clarifying questions** if needed.60- Do not generate hypothetical rules; ensure each rule is **relevant to the target repository**.6162## Example prompt63When the user asks:64> “Write an AGENTS.md for my TypeScript web app using React and Vitest”65You should prompt:661. “What are the test, lint, and build commands?”672. “Which parts of the project should not be modified by an agent?”6869Use their answers to tailor the output.7071## Edge cases to include72- If the project has *multiple services* (monorepo), clarify **scope by directory**.73- If there are *security-relevant config files*, include explicit error-prevention rules.74- If no explicit test suite exists, generate fallback instructions for test scaffolding.7576## Important notes77- The agent should treat **AGENTS.md not as optional commentary, but as a normative contract** for autonomous behaviors.78- Output must be usable by other agent products that understand AGENTS.md semantics (avoid product-specific jargon).7980---81> Converted and distributed by [TomeVault](https://tomevault.io/claim/redkenrok) — claim your Tome and manage your conversions.82<!-- tomevault:4.0:skill_md:2026-04-16 -->