Writing for Agents
Write clear, structured prompts and instructions optimized for AI agent consumption.
Use case
Use this skill when:
- Writing SKILL.md files
- Creating agent instructions or prompts
- Structuring documentation for AI readability
Principles
- Be explicit — Don't assume the agent knows context.
- Use structure — Headers, lists, and sections over prose.
- Define terms — Introduce domain vocabulary explicitly.
- Specify format — Show expected output format with examples.
- Set boundaries — What the agent should and shouldn't do.
Process
- Understand the audience — What agent model and capabilities?
- Define scope — What exactly should this instruction do?
- Write the prompt — Clear, structured, unambiguous.
- Add examples — Show, don't just tell.
- Test — Does the agent follow the instructions correctly?
Credit
This skill is based on the work of Matt Pocock (@mattpocock). Original source: mattpocock/skills. Licensed under MIT.
How to use?
1. Download
Go to the AGENT KD SKILL gallery and find this skill card. Click Download to save the SKILL.md file to your computer.
2. Install
Copy the downloaded SKILL.md into your agent's skills directory:
| Agent | Path |
|---|---|
| opencode | ~/.config/opencode/skills//SKILL.md |
| Claude Code | ~/.claude/skills//SKILL.md |
| Codex CLI | ~/.codex/skills//SKILL.md |
| Cursor | ~/.cursor/skills//SKILL.md |
| Gemini CLI | ~/.gemini/skills//SKILL.md |
Example for opencode:
ash mkdir -p ~/.config/opencode/skills/<skill-name> cp SKILL.md ~/.config/opencode/skills/<skill-name>/SKILL.md
3. Use
Restart your agent session. The skill will auto-load based on its description. You can also invoke it explicitly by typing @ in your agent.
4. Verify
Ask your agent something related to the skill's purpose. If it responds using the skill's instructions, you're all set.