It routes to four references depending on the task: patterns.md for architecture choice (Single Agent, Orchestrator, Pipeline, Network, Supervisor, Hierarchical, Meta-Prompting), workflows.md for implementing APEX/TDD/Explore-Plan-Code/Review/Debug patterns inside an agent, templates.md for the full production frontmatter and Claude Code agent template, and anti-patterns.md for reviewing a design against common mistakes.
Agent Design
Skill for designing high-performance AI agents following 2025 patterns.
References
- patterns.md - Load when: choosing an agent architecture (Single Agent, Agent+Tools, Orchestrator, Pipeline, Network, Supervisor, Hierarchical, Meta-Prompting) or comparing their trade-offs
- workflows.md - Load when: implementing APEX, TDD, Explore-Plan-Code, Code Review, or Debugging workflows for an agent
- templates.md - Load when: writing a full agent definition (production frontmatter + sections) or a Claude Code agent template
- anti-patterns.md - Load when: reviewing an agent design for common mistakes (omniscient agent, implicit instructions, missing error handling)
Fundamental Distinction
Workflows vs Agents
| Type |
Control |
When to use |
| Workflow |
Code orchestrates LLM |
Predictable tasks, need for control |
| Agent |
LLM directs its actions |
Flexibility, adaptive decisions |
Golden rule: Start simple, add complexity if necessary.
Minimal Agent Structure
Agent:
identity: Who am I?
capabilities: What can I do?
tools: What tools do I have?
constraints: What are my limits?
workflow: How should I proceed?
For the complete production structure and the Claude Code agent template, see templates.md.
Fresh Eyes Principle
Key 2025 concept: Each sub-agent must have a "fresh" context.
❌ Bad: Pass entire history to each sub-agent
✅ Good: Give only necessary information
Orchestrator:
- Keeps complete history
- Extracts relevant context for each sub-agent
- Synthesizes results
Design Checklist
Before creating an agent
During design
After creation
For anti-patterns to avoid during design, see anti-patterns.md.
Forbidden
- Never create an agent without explicit workflow
- Never give access to all tools without necessity
- Never ignore the principle of least privilege
- Never forget security guardrails
1---2name: agent-design3description: Use when choosing between workflow vs agent patterns, structuring orchestrator/subagent pipelines, or writing a Claude Code agent template.4---56<objective>7Agent Design covers the architectural decisions behind building a high-performance AI agent: the workflow-vs-agent distinction (code-orchestrated vs LLM-directed control), the minimal agent structure (identity, capabilities, tools, constraints, workflow), and the "fresh eyes" principle -- each sub-agent gets only the context it needs, never the full orchestrator history.89It routes to four references depending on the task: `patterns.md` for architecture choice (Single Agent, Orchestrator, Pipeline, Network, Supervisor, Hierarchical, Meta-Prompting), `workflows.md` for implementing APEX/TDD/Explore-Plan-Code/Review/Debug patterns inside an agent, `templates.md` for the full production frontmatter and Claude Code agent template, and `anti-patterns.md` for reviewing a design against common mistakes.10</objective>1112# Agent Design1314Skill for designing high-performance AI agents following 2025 patterns.1516## References1718- [patterns.md](references/patterns.md) - Load when: choosing an agent architecture (Single Agent, Agent+Tools, Orchestrator, Pipeline, Network, Supervisor, Hierarchical, Meta-Prompting) or comparing their trade-offs19- [workflows.md](references/workflows.md) - Load when: implementing APEX, TDD, Explore-Plan-Code, Code Review, or Debugging workflows for an agent20- [templates.md](references/templates.md) - Load when: writing a full agent definition (production frontmatter + sections) or a Claude Code agent template21- [anti-patterns.md](references/anti-patterns.md) - Load when: reviewing an agent design for common mistakes (omniscient agent, implicit instructions, missing error handling)2223## Fundamental Distinction2425### Workflows vs Agents2627| Type | Control | When to use |28|------|---------|-------------|29| **Workflow** | Code orchestrates LLM | Predictable tasks, need for control |30| **Agent** | LLM directs its actions | Flexibility, adaptive decisions |3132**Golden rule:** Start simple, add complexity if necessary.3334## Minimal Agent Structure3536```yaml37Agent:38 identity: Who am I?39 capabilities: What can I do?40 tools: What tools do I have?41 constraints: What are my limits?42 workflow: How should I proceed?43```4445For the complete production structure and the Claude Code agent template, see [templates.md](references/templates.md).4647## Fresh Eyes Principle4849**Key 2025 concept:** Each sub-agent must have a "fresh" context.5051```52❌ Bad: Pass entire history to each sub-agent53✅ Good: Give only necessary information5455Orchestrator:56 - Keeps complete history57 - Extracts relevant context for each sub-agent58 - Synthesizes results59```6061## Design Checklist6263### Before creating an agent6465- [ ] Is the objective clear?66- [ ] Would a simple workflow suffice?67- [ ] What tools are needed?68- [ ] What guardrails are required?6970### During design7172- [ ] Is identity well defined?73- [ ] Is workflow explicit?74- [ ] Are error cases handled?75- [ ] Are examples relevant?7677### After creation7879- [ ] Standard case tests?80- [ ] Edge case tests?81- [ ] Security tests (jailbreak)?82- [ ] Acceptable performance?8384For anti-patterns to avoid during design, see [anti-patterns.md](references/anti-patterns.md).8586## Forbidden8788- Never create an agent without explicit workflow89- Never give access to all tools without necessity90- Never ignore the principle of least privilege91- Never forget security guardrails