agent-conventions
Agent definition conventions. Validate frontmatter, update indexes. Use when creating or modifying agents. NOT for skills, MCP servers, or CLAUDE.md.
agent-conventions545 wordsMITRepo-owned
Agent definition conventions. Validate frontmatter, update indexes. Use when creating or modifying agents. NOT for skills, MCP servers, or CLAUDE.md.
Quick Start
Install:
npx skills add github:wyattowalsh/agents --skill agent-conventions -y -g --agent antigravity --agent claude-code --agent codex --agent crush --agent cursor --agent gemini-cli --agent github-copilot --agent grok --agent opencode Use: /agent-conventions
Works with Claude Code, Gemini CLI, OpenCode, and other agentskills.io-compatible agents.
What It Does
Section titled “What It Does”Apply these conventions when creating or modifying AI agent definitions.
| $ARGUMENTS | Action |
|---|---|
| Active (auto-invoked when working on agent files) | Apply all conventions below |
| Empty | Display convention summary |
check | Run validation checks only |
Conventions
Section titled “Conventions”Required Frontmatter
Section titled “Required Frontmatter”Every agent file must include these fields in YAML frontmatter:
name— kebab-case, must match filename without.mddescription— non-empty, describes the agent’s purpose
Optional Frontmatter
Section titled “Optional Frontmatter”tools— comma-separated tool allowlist (default: all)disallowedTools— comma-separated tool denylistmodel—sonnet|opus|haiku|inherit(default:inherit)permissionMode—default|acceptEdits|delegate|dontAsk|bypassPermissions|planmaxTurns— integer cap on agentic turnsskills— list of skills preloaded into agent contextmcpServers— list of MCP servers available to this agentmemory—user|project|localhooks— lifecycle hooks scoped to this agent
Memory field conventions:
- Choose the narrowest memory scope:
localfor temporary insights,projectfor shared patterns,userfor cross-project preferences - Keep memory entrypoint files under 200 lines — content beyond this is truncated at load time
- Organize memory by topic (e.g.,
debugging.md,api-patterns.md), not chronologically - Use MEMORY.md as the index file; create separate topic files for detailed notes
Naming
Section titled “Naming”- All agent names use kebab-case:
^[a-z0-9][a-z0-9-]*$ - Filename (without
.md) must match thenamefrontmatter field exactly - No consecutive hyphens, no leading/trailing hyphens
README Index Requirement
Section titled “README Index Requirement”When defining a new agent at any level:
~/.{gemini\|copilot\|codex\|claude}/agents/.claude/agents/(project-level)- Project-local agent directories
Update the corresponding README.md index in the same directory:
- Add a row to the index table with agent name, description, and key fields
- Add a description section with usage details
- Keep the table sorted alphabetically by name
Body Content
Section titled “Body Content”- Write the system prompt in imperative voice (“Check the logs” not “Checks the logs”)
- Keep agent definitions focused on a single responsibility
- Reference skills by name rather than inlining their content
Critical Rules
Section titled “Critical Rules”- Always update the README.md index when adding or modifying an agent
- Name every agent in kebab-case matching its filename exactly
- Include both
nameanddescriptionin frontmatter — they are required - Never duplicate agent functionality — check existing agents first
- Keep agent system prompts under 500 lines for maintainability
- Run
python skills/agent-conventions/scripts/validate_agent.py --check-indexafter any agent frontmatter change - Use imperative voice throughout the agent body text
Canonical terms (use these exactly):
agent— an AI agent definition file inagents/directoryfrontmatter— YAML metadata between---delimiterssystem prompt— the markdown body after frontmatterindex table— the markdown table in README.md listing all agentskebab-case— lowercase words separated by hyphens
Scaffolding
Section titled “Scaffolding”Create new agent definitions with:
python skills/agent-conventions/scripts/scaffold_agent.py <name>Validation Contract
Section titled “Validation Contract”Before declaring changes to this skill complete, run:
python skills/agent-conventions/scripts/check.pyCompletion criteria:
scripts/check.pyexits 0.- Agent frontmatter changes pass
scripts/validate_agent.py --check-index.
| Field | Value |
|---|---|
| Source Type | repo-owned |
| Display Source | github:wyattowalsh/agents |
| Source Kind | repo |
| Installability | portable command |
| Review State | reviewed |
| Target Agents | antigravity, claude-code, codex, crush, cursor, gemini-cli, github-copilot, grok, opencode |
| Field | Value |
|---|---|
| Name | agent-conventions |
| License | MIT |
| Version | 1.0.0 |
| Author | wyattowalsh |
| Field | Value |
|---|---|
| User Invocable | No |
View Full SKILL.md
---name: agent-conventionsdescription: >- Agent definition conventions. Validate frontmatter, update indexes. Use when creating or modifying agents. NOT for skills, MCP servers, or CLAUDE.md.user-invocable: falsedisable-model-invocation: falselicense: MITmetadata: author: wyattowalsh version: "1.0.0"---
# Agent Conventions
Apply these conventions when creating or modifying AI agent definitions.
## Dispatch
| $ARGUMENTS | Action ||------------|--------|| Active (auto-invoked when working on agent files) | Apply all conventions below || Empty | Display convention summary || `check` | Run validation checks only |
## References
| File | Purpose ||------|---------|| `references/readme-template.md` | Template for agent README.md index entries |
## Scaffolding
Create new agent definitions with:
```bashpython skills/agent-conventions/scripts/scaffold_agent.py <name>```
## Conventions
### Required Frontmatter
Every agent file must include these fields in YAML frontmatter:
- `name` -- kebab-case, must match filename without `.md`- `description` -- non-empty, describes the agent's purpose
### Optional Frontmatter
- `tools` -- comma-separated tool allowlist (default: all)- `disallowedTools` -- comma-separated tool denylist- `model` -- `sonnet` | `opus` | `haiku` | `inherit` (default: `inherit`)- `permissionMode` -- `default` | `acceptEdits` | `delegate` | `dontAsk` | `bypassPermissions` | `plan`- `maxTurns` -- integer cap on agentic turns- `skills` -- list of skills preloaded into agent context- `mcpServers` -- list of MCP servers available to this agent- `memory` -- `user` | `project` | `local`- `hooks` -- lifecycle hooks scoped to this agent
**Memory field conventions:**- Choose the narrowest memory scope: `local` for temporary insights, `project` for shared patterns, `user` for cross-project preferences- Keep memory entrypoint files under 200 lines — content beyond this is truncated at load time- Organize memory by topic (e.g., `debugging.md`, `api-patterns.md`), not chronologically- Use MEMORY.md as the index file; create separate topic files for detailed notes
### Naming
- All agent names use kebab-case: `^[a-z0-9][a-z0-9-]*$`- Filename (without `.md`) must match the `name` frontmatter field exactly- No consecutive hyphens, no leading/trailing hyphens
### README Index Requirement
When defining a new agent at **any** level:
- `~/.{gemini|copilot|codex|claude}/agents/`- `.claude/agents/` (project-level)- Project-local agent directories
Update the corresponding `README.md` index in the same directory:
1. Add a row to the index table with agent name, description, and key fields2. Add a description section with usage details3. Keep the table sorted alphabetically by name
### Body Content
- Write the system prompt in imperative voice ("Check the logs" not "Checks the logs")- Keep agent definitions focused on a single responsibility- Reference skills by name rather than inlining their content
## Critical Rules
1. Always update the README.md index when adding or modifying an agent2. Name every agent in kebab-case matching its filename exactly3. Include both `name` and `description` in frontmatter -- they are required4. Never duplicate agent functionality -- check existing agents first5. Keep agent system prompts under 500 lines for maintainability6. Run `python skills/agent-conventions/scripts/validate_agent.py --check-index` after any agent frontmatter change7. Use imperative voice throughout the agent body text
**Canonical terms** (use these exactly):- `agent` -- an AI agent definition file in `agents/` directory- `frontmatter` -- YAML metadata between `---` delimiters- `system prompt` -- the markdown body after frontmatter- `index table` -- the markdown table in README.md listing all agents- `kebab-case` -- lowercase words separated by hyphens
## Validation Contract
Before declaring changes to this skill complete, run:
```bashpython skills/agent-conventions/scripts/check.py```
Completion criteria:
1. `scripts/check.py` exits 0.2. Agent frontmatter changes pass `scripts/validate_agent.py --check-index`.Resources
Section titled “Resources” Skill Catalog Browse custom and external skills.
CLI Reference Install and manage skills.
agentskills.io The open ecosystem for cross-agent skills.