add-agent
Scaffold a new agent definition file inside an existing addon or framework
What this skill does
# Add Agent
Scaffold a new agent definition file inside an existing addon or framework.
## Triggers
Alternate expressions and non-obvious activations (primary phrases are matched automatically from the skill description):
- "I need a new agent" → scaffold agent in specified target
- "build me an agent" → scaffold agent with interactive guidance
- "write an agent for X" → scaffold agent named after the described role
- "agent for <role>" → derive name from role, prompt for target
## Trigger Patterns Reference
| 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 |
## Process
### 1. Parse Arguments
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 questions
If either `<name>` or `--to` is missing, ask before proceeding.
### 2. Validate Target
Confirm the target addon or framework exists:
```bash
# Check addons
ls agentic/code/addons/<target>/
# Check frameworks
ls agentic/code/frameworks/<target>/
```
If not found, report available targets and stop.
### 3. Interactive Design (if --interactive)
Ask the following before generating:
1. **Role**: What is this agent's primary role?
2. **Expertise**: What domains or technologies does it specialize in?
3. **Responsibilities**: What are its 3-5 key responsibilities?
4. **Tools needed**: Which tools does it require? (Read, Write, Bash, Grep, WebFetch, Task)
5. **Model tier**: haiku (fast/utility), sonnet (balanced), opus (reasoning-heavy)
6. **Output format**: What structured output should it produce?
### 4. Select Template
| 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 |
### 5. Run Scaffolding
```bash
aiwg add-agent <name> --to <target> --template <type>
```
This generates `<target>/agents/<name>.md` with the appropriate frontmatter and section stubs.
### 6. Customize the Generated File
The generated agent file requires population of these sections:
```markdown
---
name: <name>
description: <one-sentence purpose>
model: <claude-haiku-4-5|claude-sonnet-4-6|claude-opus-4-7> # 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]
```
### 7. Validate Against 10 Golden Rules
After creation, run the agent linter:
```bash
aiwg lint agents <target>/agents/<name>.md --verbose
```
Key checks:
- Single responsibility (no "and" overload in description)
- Minimal tools (0-3 tools, each justified)
- Explicit I/O contract defined
- Model tier matches task complexity
### 8. Update Manifest
The CLI tool updates `<target>/manifest.json` automatically. Verify:
```json
{
"agents": ["existing-agent", "<name>"]
}
```
## Generated Structure
```
<target>/agents/<name>.md
```
Manifest updated: `<target>/manifest.json`
## Output Format
```
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
```
## Examples
### Example 1: Simple utility agent
**User**: "add agent dependency-auditor --to aiwg-utils"
**Action**:
```bash
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).
### Example 2: Complex domain expert
**User**: "create a threat modeling agent for sdlc-complete"
**Extraction**: name=`threat-modeler`, target=`sdlc-complete`, template=`complex`
**Action**:
```bash
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.
### Example 3: Interactive guided creation
**User**: "add agent --interactive --to sdlc-complete"
**Process**: Guided questions gather role, expertise, responsibilities, tools, and model tier before scaffolding.
## References
- @$AIWG_ROOT/agentic/code/addons/aiwg-utils/skills/devkit-create-agent/SKILL.md — Devkit equivalent (interactive design)
- @$AIWG_ROOT/src/cli/handlers/scaffolding.ts — CLI handler implementation
- @$AIWG_ROOT/docs/cli-reference.md — Full CLI reference
- @$AIWG_ROOT/agentic/code/frameworks/sdlc-complete/agents/ — Example agent definitions
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.