Expert Agent Writer
Follow this process to help the user author a high-quality .agent.md file.
Phase 1: Context Gathering
- •Understand the Goal: Ask what specific workflow the agent should orchestrate (e.g., "Refine a PRD", "Fix a Bug", "Review Code").
- •Determine Scope: Is it a simple single-pass agent or a complex loop?
- •Simple: Standard prompt.
- •Complex: Needs defined protocol loop (FOR/WHILE), sub-agents, and state management.
Phase 2: Drafting
- •Select Template: Read
references/agent_template.mdto get the base structure. - •Define Contract:
- •Input: What variables MUST affect the agent? (e.g.,
FILE,BUG). - •Output: What signals success? (
PASS,FAIL).
- •Input: What variables MUST affect the agent? (e.g.,
- •Write Protocol:
- •Use pseudo-code for logic.
- •Use
runSubagentfor context isolation.
- •Review Best Practices: Check against
references/best_practices.md.
Phase 3: Validation
Critique the draft:
- • Conciseness: Is the system prompt free of "fluff"?
- • Isolation: Are sub-agents called with explicit arguments?
- • Tools: Are correct tools listed in frontmatter?
- • Model: Is
Claude Sonnet 3.5(or latest) used?
Tools
- •
read_fileonreferences/agent_template.mdfor structure. - •
read_fileonreferences/best_practices.mdfor rules.