with one click
agent-design
Principles and patterns for writing agent definitions
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Principles and patterns for writing agent definitions
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Continue working on an OpenSpec change by creating the next artifact. Use when the user wants to progress their change, create the next artifact, or continue their workflow.
Fast-forward through OpenSpec artifact creation. Use when the user wants to quickly create all artifacts needed for implementation without stepping through each one individually.
Start a new OpenSpec change using the experimental artifact workflow. Use when the user wants to create a new feature, fix, or modification with a structured step-by-step approach.
How to write specs, name capabilities, and structure requirements. Load this when creating or reviewing proposals, specs, or capability lists.
How to invoke the openspec CLI. Load this BEFORE running any openspec commands.
Principles and patterns for writing slash command definitions
| name | agent-design |
| description | Principles and patterns for writing agent definitions |
How to write and maintain agent definitions in .opencode/agents/.
The description field in agent frontmatter is the single most
important line. It determines when the agent gets invoked by the
parent agent's routing logic.
Write descriptions that match natural-language requests a user would actually say:
| Bad | Good |
|---|---|
| Zenhub-based product management. Uses Zenhub MCP. | Handles project status ("where are we?"), board reviews, issue writing, and work tracking via Zenhub. |
| Executes git and gh CLI write operations. | Performs git and GitHub write operations (commits, pushes, PRs, branch management). Read ops use github-read skill. |
Description checklist:
Agents own their own routing. If you need to update a central config (like AGENTS.md) every time you add or change an agent, the design is wrong.
description fieldThe test: "Would I need to update AGENTS.md if I add/remove this agent?" If yes, the information is in the wrong place.
---
description: <routing-friendly description>
mode: subagent
color: "<hex>"
permission:
bash:
"*": deny
# Explicit allows...
tools:
<tool-pattern>: true
---
# <Agent Name>
<1-2 sentences: what this agent does and why it exists>
## Scope
### Owns
- <responsibility 1>
- <responsibility 2>
### Outside Scope
- <thing to route elsewhere> (route to @other-agent)
## Skills
Load these skills when performing specific workflows:
- `skill-name` — when doing X
## Common Workflows
### <Workflow Name>
<Steps>
Least privilege: Deny everything by default, explicitly allow
what's needed. Use wildcard denies ("*": deny) then specific allows.
Clear scope boundaries: Every agent should have "Owns" and "Outside Scope" sections. When something is outside scope, say where it should go.
Skill references: If the agent should follow specific practices, reference the skill by name so it can be loaded when needed.
Self-contained: An agent definition should contain everything needed to understand what it does, when it activates, and how it behaves -- without reading other files.
Routing fails (wrong agent handles a request): Fix the agent's description -- add the natural-language phrases that should have matched. Don't add routing rules elsewhere.
Agent produces poor output for a specific task: Check if a skill exists for the practice it got wrong. If yes, add a skill reference to the agent. If no, create a skill, then reference it.