Subagent Creator
Gather requirements
- •Identify the subagent's purpose and delegation trigger.
- •Decide whether the subagent should be read-only or allowed to edit/write files.
- •Choose a model (
auto,sonnet,opus,haiku, orinherit). - •Decide whether hooks are needed for validation or cleanup.
Choose scope and location
- •Use
.cursor/agents/for subagents.
Create the subagent
- •Create
<agent-name>.mdin the chosen scope directory. - •Add YAML frontmatter with required fields and optional config fields.
- •Write a focused system prompt in the body.
- •Restart the session to load the new file.
Example:
markdown
--- name: code-reviewer description: Expert code review specialist. Use after code changes to review quality, security, and maintainability. tools: Read, Grep, Glob, Bash model: auto permissionMode: default --- Review recent changes. Focus on correctness, security, and readability. Provide prioritized findings.
Configure capabilities
- •Use
toolsto allowlist specific tools; omittoolsto inherit all. - •Use
disallowedToolsto deny specific tools. - •Set
permissionModeto control approvals (default,acceptEdits,dontAsk,bypassPermissions, orplan). - •Define
hooksin frontmatter withPreToolUse,PostToolUse, orStop.
Validate and test
- •Ensure
nameis lowercase with hyphens and unique per scope. - •Ensure the description clearly matches the intended delegation trigger.
- •Invoke the subagent explicitly and confirm behavior.
- •Refine tools, prompt, and hooks based on results.
Provide usage examples
- •Include 1-2 short prompts that should trigger the subagent.
- •Keep examples aligned with the description.