| name | metaharness |
| description | Design, evaluate, and iterate on Claude Code agents, commands, and skills with structural best practices. Use when creating a new .claude/agents/ file, updating an existing agent's prompt, reviewing agent quality, designing a new command or skill, or when the user says "create an agent", "improve this agent", "design an agent for X", or "write a command for Y". |
| allowed-tools | Read, Grep, Glob, Write, Edit, Bash |
Metaharness
Design, evaluate, and refine Claude Code harness components — agents (.claude/agents/*.md), commands (.claude/commands/*.md), and skills (SKILL.md). Produces components that follow structural best practices, maintain consistency with existing components, and serve as reliable artifacts in multi-agent systems.
When to Use
- Creating a new agent from scratch
- Updating or reworking an existing agent
- Reviewing an agent for quality and consistency
- The user describes a capability they want to delegate to a subagent
Workflow
Phase 1: Understand Intent
Before writing anything, answer these questions (ask the user if unclear):
- What is this agent's job? — One sentence. If you need two, it's two agents.
- What is it NOT? — The boundary matters more than the capability.
- Who consumes the output? — Another agent (structured contract), a human (readable prose), or both?
- What tools does it need? — Minimum viable set. Every extra tool is scope creep.
Phase 2: Research Existing Agents
Read ALL agents in .claude/agents/ to understand:
- Naming conventions (kebab-case filenames,
name field in frontmatter)
- Structural patterns (which sections exist and in what order)
- Tool allocation (which tools are shared, which are unique)
- Role boundaries (where one agent's job ends and another's begins)
Check for overlap — if the new agent's job partially overlaps an existing one, decide: expand the existing agent or create a new one with a clear boundary.
Phase 3: Design
Apply the agent anatomy template and best practices. Key decisions:
- Frontmatter — name, description (scannable, one sentence), tools (minimum set), model
- CRITICAL section — hard boundaries (all DON'Ts). What the agent must NEVER do.
- Core Responsibilities — exactly 3 numbered items. The agent's complete job description.
- Protocol/Strategy — the HOW. Numbered steps the agent follows.
- Output Format — mandatory template if output is consumed by other agents. Flexible if consumed by humans.
- What NOT to Do — anti-patterns specific to this agent's role.
- REMEMBER anchor — one-line identity statement. Gets disproportionate weight as the last thing in context.
Phase 4: Write
Write the agent file to .claude/agents/<name>.md. Follow the anatomy template exactly.
Phase 5: Evaluate
Run the evaluation checklist against the draft. The checklist catches:
- Redundancy (same instruction in multiple sections)
- Scope creep (responsibilities that belong to another agent)
- Missing sections (structural inconsistency with other agents)
- Frontmatter issues (description too long, wrong tool set)
- Anti-pattern violations (positive instructions in CRITICAL, rigid templates for human-facing output)
Present findings to the user. Fix issues.
Phase 6: Iterate
After the user reviews:
- Apply feedback
- Re-run the evaluation checklist
- Check consistency with existing agents one more time
- Present the final version
Resources
Quick Reference: Agent vs Skill vs Command
| Agent | Skill | Command |
|---|
| Location | .claude/agents/*.md | .agents/skills/*/SKILL.md | .claude/commands/*.md |
| Invoked by | Claude auto-dispatches or --agent | Auto-trigger or /skill-name | /command-name |
| Purpose | Isolated subtask with fresh context | Domain knowledge + workflow | User-invoked action |
| Output | Returns to parent agent | Guides current session | Executes inline |
| Context | Fresh — knows nothing about current conversation | In-session — sees conversation | In-session |