Create, review, and improve AGENTS.md or agent.md files using proven patterns from GitHub's analysis of 2,500+ repositories. Use when asked to author or refactor repository-level AGENTS.md guidance, .github/agents/*.md personas, command/runbook sections, safety boundaries, or agent templates.
Resources
1Install
npx skillscat add squirrel289/pax/writing-agents-md Install via the SkillsCat registry.
SKILL.md
Writing AGENTS.md
Overview
Use this skill to produce high-signal agent instructions: specific persona, executable commands, concrete examples, clear boundaries, and precise stack details. It codifies guidance from GitHub's "How to write a great agents.md" analysis of 2,500+ repositories. Prefer concise operational guidance over generic prose.
Workflow
- Determine the target file type.
- Repository policy file:
AGENTS.md - Persona file:
.github/agents/<name>.md
- Repository policy file:
- Gather project facts before drafting.
- Commands that are actually runnable (
test,build,lint,dev, docs checks) - Stack with versions and key frameworks
- File boundaries (read/write directories, sensitive paths)
- Existing style examples to mirror
- Commands that are actually runnable (
- Draft command-first instructions.
- Put runnable commands near the top.
- Include full commands with flags/options where relevant.
- Fill six core areas.
- Commands
- Testing
- Project structure
- Code style/output standards
- Git workflow
- Boundaries
- Add three-tier boundaries.
Always: safe/default actionsAsk first: risky or ambiguous actionsNever: forbidden actions (secrets, unsafe paths, destructive actions)
- Validate with the checklist in
references/agents-md-quality-checklist.md. - If requested, generate role-specific variants using
references/starter-templates.md.
Required Output Shape
Use this structure unless the user asks for a different format:
---
name: <agent_name>
description: <one sentence: role + scope>
---
You are <specific role> for this project.
## Commands
- Build: `<command>`
- Test: `<command>`
- Lint/Format: `<command>`
## Project Knowledge
- Tech stack with versions
- File structure and allowed write locations
## Standards
- Naming/style rules
- One concrete good example (code or output snippet)
## Boundaries
- ✅ Always: ...
- ⚠️ Ask first: ...
- 🚫 Never: ...Editing Existing Agent Files
- Preserve the current intent and role unless the user asks to change it.
- Remove vague language and replace with concrete, testable instructions.
- Promote any buried commands into the
Commandssection near the top. - Convert implicit constraints into explicit
Always/Ask first/Neverrules. - Keep instructions short, directive, and specific to the repo.
Guidance on References
- Use
references/agents-md-quality-checklist.mdfor scoring and gap analysis. - Use
references/starter-templates.mdwhen the user asks for examples or new personas.