/utils:add-agentfrom utils
Scaffolds a new agent definition file inside an existing addon or framework. Supports interactive design, multiple templates, and argument parsing.
Ships in utils. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Scaffold a new agent definition file inside an existing addon or framework.
Alternate expressions and non-obvious activations (primary phrases are matched automatically from the skill description):
| Pattern | Example | Action |
|---|---|---|
| Named add | "add agent security-auditor --to sdlc-complete" | Scaffold directly |
| Role description | "create an agent that reviews PRs" | Derive name, scaffold |
| Interactive | "add agent --interactive" | Guided mode, ask for name/target/template |
| Target omitted | "add agent code-reviewer" | Ask which addon or framework |
Extract from $ARGUMENTS:
<name> — kebab-case agent name (required)--to <target> — addon or framework directory name (required)--template <type> — one of simple (default), complex, orchestrator, validator--interactive — enable guided design questionsIf either <name> or --to is missing, ask before proceeding.
Confirm the target addon or framework exists:
# Check addons
ls agentic/code/addons/<target>/
# Check frameworks
ls agentic/code/frameworks/<target>/
If not found, report available targets and stop.
Ask the following before generating:
Templates live in $AIWG_ROOT/templates/agent-scaffolding/. The complex template
includes grounding, uncertainty handling, and recovery safeguards; the orchestrator
template includes workflow patterns and agent assignment tables.
| Template | Use When | Default Model | Tools |
|---|---|---|---|
simple | Single-purpose utility agent | haiku | Read, Write |
complex | Domain expert, reviewer, analyst | sonnet | Read, Write, Grep |
orchestrator | Coordinates other agents | opus | Task |
validator | Read-only quality/compliance gate | haiku | Read, Grep |
aiwg add-agent <name> --to <target> --template <type>
This generates <target>/agents/<name>.md with the appropriate frontmatter and section stubs.
The generated agent file requires population of these sections:
---
name: <name>
description: <one-sentence purpose>
model: <claude-haiku-4-5|claude-sonnet-5|claude-opus-5> # Pin specific variant; bare aliases (`sonnet`) inherit the parent session's 1M-context attributes and hit the usage-credit gate on subagent dispatch. See #1442.
tools: <comma-separated tool list>
category: <phase or domain>
---
# Agent Title
[Role description]
## Expertise
[Domain knowledge and skills]
## Responsibilities
[Numbered list of what this agent does]
## Workflow
[How it approaches tasks — research, draft, validate, output]
## Output Format
[Expected structure of deliverables]
After creation, run the agent linter:
aiwg lint agents <target>/agents/<name>.md --verbose
Follow the Agent Design Bible. Its failure prevention guidance draws on REF-001 (Bandara et al.) and REF-002 (Roig 2025).
| Rule | Check |
|---|---|
| 1. Single Responsibility | One clear purpose, no "and" overload |
| 2. Minimal Tools | 0-3 tools, each justified |
| 3. Explicit I/O | Inputs and outputs defined |
| 4. Grounding | Verify before acting (Archetype 1) |
| 5. Uncertainty | Escalate ambiguity (Archetype 2) |
| 6. Context Scope | Filter distractors (Archetype 3) |
| 7. Recovery | Handle errors (Archetype 4) |
| 8. Model Tier | Match task complexity |
| 9. Parallel Ready | Concurrent execution safe |
| 10. Observable | Traceable output |
The CLI tool updates <target>/manifest.json automatically. Verify:
{
"agents": ["existing-agent", "<name>"]
}
<target>/agents/<name>.md
Manifest updated: <target>/manifest.json
Agent Created: <name>
─────────────────────
Location: <target>/agents/<name>.md
Template: <type>
Model: <model>
Created:
✓ <target>/agents/<name>.md
✓ manifest.json updated
Validation:
✓ Single responsibility
✓ Tool count within limit
✓ I/O contract defined
Next Steps:
1. Edit Expertise section with domain knowledge
2. Define Responsibilities (3-5 items)
3. Specify Output Format structure
4. Run: aiwg lint agents <target>/agents/<name>.md
User: "add agent dependency-auditor --to aiwg-utils"
Action:
aiwg add-agent dependency-auditor --to aiwg-utils
Result: agentic/code/addons/aiwg-utils/agents/dependency-auditor.md scaffolded with simple template (haiku, Read + Grep tools).
User: "create a threat modeling agent for sdlc-complete"
Extraction: name=threat-modeler, target=sdlc-complete, template=complex
Action:
aiwg add-agent threat-modeler --to sdlc-complete --template complex
Result: agentic/code/frameworks/sdlc-complete/agents/threat-modeler.md scaffolded with sonnet model, Read/Write/Grep tools.
User: "add agent --interactive --to sdlc-complete"
Process: Guided questions gather role, expertise, responsibilities, tools, and model tier before scaffolding.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub jmagly/aiwg --plugin utils133 skills in this plugin
/activity-logQuery and manage the unified .aiwg/activity.log chronological record of AIWG-managed workflow operations/add-behaviorScaffold a new behavior definition with BEHAVIOR.md and optional scripts inside an existing addon or framework/add-commandScaffold a new command definition inside an existing addon or framework/add-skillScaffold a new SKILL.md inside an existing addon or frameworkOther plugins' skills for the same job