Writing for Agents
Write skills, AGENTS.md and CLAUDE.md that agents actually follow.
From Matt Pocock's skills. Guidance for writing documents meant for agents, used when creating or editing skills or changing AGENTS.md and CLAUDE.md.
Install this skill
npx skills add https://github.com/mattpocock/skills --skill writing-for-agentsRuns the open-source skills CLI in your own terminal. It asks which agents to add the skill to. Read what it tells your agent to do before you install it.
Install for your agent
Claude Code
Run this in your project
npx skills add https://github.com/mattpocock/skills --skill writing-for-agents -a claude-codeAdd
-gto install it for every project instead.Or ask Claude Code to do it
Install the "writing-for-agents" skill from https://github.com/mattpocock/skills for Claude Code. Copy the skill folder (the one containing SKILL.md, with any scripts or reference files next to it) into .claude/skills/ in this project. Before copying, show me the SKILL.md and list any scripts it includes, and wait for me to confirm.
Or copy the folder yourself
Unzip the download into
.claude/skills/for this project, or~/.claude/skills/for all your projects.Picked up in the current session, no restart needed.
Claude Code skills docsClaude.ai
Upload the ZIP
- In Settings > Capabilities, turn on Code execution and file creation.
- Go to Customize > Skills, press +, then Create skill.
- Choose Upload a skill and pick the ZIP you downloaded.
Free, Pro and Max plans. On Team and Enterprise, an owner turns skills on in Organization settings first.
Claude.ai skills docsChatGPT
Upload the ZIP
- Open Skills in ChatGPT and select Create.
- Select Upload from your computer and pick the ZIP you downloaded.
- Wait for ChatGPT's safety scan. A skill marked Needs Review asks you to check it before use.
Skills that rely on scripts or a terminal may not work unchanged in ChatGPT.
ChatGPT skills docsCodex
Run this in your project
npx skills add https://github.com/mattpocock/skills --skill writing-for-agents -a codexAdd
-gto install it for every project instead.Or ask Codex to do it
Install the "writing-for-agents" skill from https://github.com/mattpocock/skills for Codex. Copy the skill folder (the one containing SKILL.md, with any scripts or reference files next to it) into .agents/skills/ in this project. Before copying, show me the SKILL.md and list any scripts it includes, and wait for me to confirm.
Or copy the folder yourself
Unzip the download into
.agents/skills/for this project, or~/.agents/skills/for all your projects.Restart Codex if the skill does not show up.
Codex skills docsCursor
Run this in your project
npx skills add https://github.com/mattpocock/skills --skill writing-for-agents -a cursorAdd
-gto install it for every project instead.Or ask Cursor to do it
Install the "writing-for-agents" skill from https://github.com/mattpocock/skills for Cursor. Copy the skill folder (the one containing SKILL.md, with any scripts or reference files next to it) into .cursor/skills/ in this project. Before copying, show me the SKILL.md and list any scripts it includes, and wait for me to confirm.
Or copy the folder yourself
Unzip the download into
.cursor/skills/for this project, or~/.cursor/skills/for all your projects.Run it by typing / and the skill name in chat.
Cursor skills docsGitHub Copilot
Run this in your project
npx skills add https://github.com/mattpocock/skills --skill writing-for-agents -a github-copilotAdd
-gto install it for every project instead.Or ask GitHub Copilot to do it
Install the "writing-for-agents" skill from https://github.com/mattpocock/skills for GitHub Copilot. Copy the skill folder (the one containing SKILL.md, with any scripts or reference files next to it) into .github/skills/ in this project. Before copying, show me the SKILL.md and list any scripts it includes, and wait for me to confirm.
Or copy the folder yourself
Unzip the download into
.github/skills/for this project, or~/.copilot/skills/for all your projects.Works in Copilot CLI, the cloud agent and agent mode in VS Code and JetBrains.
GitHub Copilot skills docsAntigravity
Run this in your project
npx skills add https://github.com/mattpocock/skills --skill writing-for-agents -a antigravityAdd
-gto install it for every project instead.Or ask Antigravity to do it
Install the "writing-for-agents" skill from https://github.com/mattpocock/skills for Antigravity. Copy the skill folder (the one containing SKILL.md, with any scripts or reference files next to it) into .agents/skills/ in this project. Before copying, show me the SKILL.md and list any scripts it includes, and wait for me to confirm.
Antigravity skills docsOr copy the folder yourself
Unzip the download into
.agents/skills/for this project, or~/.gemini/config/skills/for all your projects.Gemini CLI
Run this in your project
npx skills add https://github.com/mattpocock/skills --skill writing-for-agents -a gemini-cliAdd
-gto install it for every project instead.Or ask Gemini CLI to do it
Install the "writing-for-agents" skill from https://github.com/mattpocock/skills for Gemini CLI. Copy the skill folder (the one containing SKILL.md, with any scripts or reference files next to it) into .gemini/skills/ in this project. Before copying, show me the SKILL.md and list any scripts it includes, and wait for me to confirm.
Or copy the folder yourself
Unzip the download into
.gemini/skills/for this project, or~/.gemini/skills/for all your projects.Run /skills to check it was found.
Gemini CLI skills docs
- Installs
- 254.2K via skills.sh
- GitHub
- 261.4K stars ↗
- Last updated
- 4 Sept 2026
- Licence
- MIT
Security checks
Run by independent scanners and published on skills.sh. Their results, not a Viberation review.
- 20 Aug 2026
Gen Agent Trust Hub Pass
This skill consists of documentation providing guidelines and best practices for writing AI agent instructions. It contains no code, executable scripts, or external dependencies, and presents no security risk.
- 20 Aug 2026
Socket Pass
No alerts
- 20 Aug 2026
Snyk Pass
Risk: LOW · No issues
What's inside (3 files)
agents/openai.yaml102 charsSKILL-MECHANICS.md2.6K charsSKILL.md10.9K chars
SKILL.md, first part. Shown as plain text.
--- name: writing-for-agents description: Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md. --- Reference for writing any document an agent consumes: a skill, an `AGENTS.md` / `CLAUDE.md`, a doc reached by a pointer. The packaging differs; the writing does not: the same levers make each one predictable, since the agent takes the same _process_ every run rather than producing the same output. When the document you're writing is a skill, read [`SKILL-MECHANICS.md`](SKILL-MECHANICS.md) for frontmatter, invocation choice, and router skills. ## Context pointers A **context pointer** is a reference held in the agent's context that names some out-of-context material and encodes the condition for reaching it. A skill's description is one; a line in `AGENTS.md` naming a doc is the same object. The pointer's _wording_, not its target, decides when the agent reaches the material, and how reliably. A must-have target behind a weakly worded pointer is a variance bug: sharpen the wording first, and inline the material only if sharpening fails. A pointer does two jobs: state what the material is, and list the **branches** that should trigger reaching it (a branch is a distinct case the document handles, so different runs take different paths through it). Every word of an always-loaded pointer costs on every turn, so it earns even harder pruning than the body: - **Front-load the leading word**: the pointer is where it does its triggering work. - **One trigger per branch.** Synonyms that rename a single branch are one branch written twice; collapse them and keep only genuinely distinct branches. - **Cut identity the body already carries.** ## The two loads Every document and pointer you add spends one of two budgets: - **Context load** is the cost of always-loaded material on the agent's window: an `AGENTS.md` line, a skill description, anything sitting in context every turn, spending tokens and attention whether or not it fires. - **Cognitive load** is the cost on the human: which documents exist and when to reach for each. The human is the index. Not a cost to minimise: it is the price of human agency; spend it where human judgement matters, remove it where it does not. Material reached only through a pointer escapes context load at the price of the pointer's own line; material with no pointer at all rides entirely on cognitive load. ## Information hierarchy A document is built from two content types: **steps** (the ordered actions the agent performs) and **reference** (definitions, rules, facts consulted on demand). The two mix freely: all steps (a recipe), all reference (a review's rules, this skill), or both. The core decision is where each piece sits on the **information hierarchy**, a ladder ranked by how immediately the agent needs the material: 1. **In-file step** is the primary tier: what the agent does, in order. 2. **In-file reference** is consulted on demand. Often a legitimately flat peer-set (every rule of a review on one rung), which is a fine arrangement, not a smell. 3. **Disclosed reference** is pushed out into a separate file, reached by a context pointer, loaded only when the pointer fires. Spans a sibling file in the same folder through fully external reference that lives anywhere and any document can point at. Push too little down and the top bloats; push too much and you hide material the agent actually needs. That tension is the whole decision. **Progressive disclosure** is the move down the ladder (out of the main file and behind a pointer) so the top stays legible. Not primarily a token optimisation: it is how the hierarchy is protected. Branching is the cleanest disclosure test: inline what every branch needs, and push behind a pointer what only some branches reach. When a document has steps, in-file reference that should be disclosed buries them and turns attending to them into a coin-flip: a variance lever, not just a legibility one. **Co-locati
Key info
- Pricing
- Open source
- Category
- Skills
Related reading
- Context engineering
Writing your first skill
You already have a skill in you: the thing you keep typing into every session. Write it down once.
Intermediate