Agent Creator
Create custom Claude Code agents: autonomous subprocesses with isolated
context, specific tools, and tailored system prompts. [EXPLICIT]
When To Activate
Use this skill when the user asks for a persistent subagent or custom agent
definition, for example:
- "create an agent"
- "add a subagent"
- "make a custom agent"
- "define agent definition"
- "build an agent for X"
- "I need something to handle X automatically"
Use agent-constitution-creator instead when the user needs a full
governance constitution with identity, authority, memory, handoff, and
multi-agent operating rules.
Deterministic Contract
- Use
assets/agent-spec-schema.json as the canonical structured input shape.
- Use
assets/tool-policy.json to choose least-privilege tools and reject
wildcard access.
- Use
assets/model-selection-policy.json to map complexity to haiku,
sonnet, or opus.
- Use
assets/description-trigger-policy.json to keep descriptions focused on
WHEN the parent should spawn the agent.
- Use
assets/agent-template.md as the rendering skeleton.
- Run
scripts/compile-agent.py before finalizing an agent definition from
structured input.
- Run
scripts/check.sh to verify positive and negative fixtures offline.
- Do not call external APIs, MCP servers, network resources, or live agent
registries from the skill scripts.
Procedure
Step 1: Decide Whether An Agent Is Appropriate
Do not create an agent when a lighter artifact fits better:
| Situation |
Better alternative |
| One-off task instruction |
Inline response |
| Reusable multi-step workflow |
Skill with assets and scripts |
| Simple output format change |
Output style |
| Always-run automation |
Hook |
| Persistent project rule |
CLAUDE.md or AGENTS.md source |
If the request is underspecified, ask only for the missing fields required by
assets/agent-spec-schema.json: responsibility, scope, read/write authority,
expected output, and complexity.
Step 2: Discover Existing Agents
- Read project-local agent definitions, usually
.claude/agents/*.md.
- Read global definitions only when the user asks for a global agent.
- Check for name collisions with built-ins:
Explore, Plan,
general-purpose.
- Check for scope overlap. If another agent owns the same responsibility,
propose rename, merge, split, or non-goals before writing.
Step 3: Normalize The Spec
Normalize the request into five sections:
agent: name, display name, role, responsibility, scope, and non-goals.
routing: trigger phrases, negative triggers, destination scope, model,
color, and tools.
behavior: task statement, ordered process, output format, constraints, and
reasoning tier.
quality: quality bar, validation checks, escalation triggers, and residual
risks.
evidence: source labels and evidence tags for decisions that came from the
user, codebase, or inference.
Step 4: Compile
python3 skills/agent-creator/scripts/compile-agent.py \
--input skills/agent-creator/scripts/fixtures/agent-spec-input.json
The compiler emits Markdown by default and stable JSON with --format json.
It fails if the name is invalid, trigger conditions are missing, model or tools
are unsafe, process steps are too thin, output format is absent, constraints
lack a negative boundary, or collision rules are violated.
Step 5: Validate
- Run
bash skills/agent-creator/scripts/check.sh.
- Run
python3 -B scripts/validate-skill-dod.py --skill agent-creator.
- Run
python3 -B scripts/validate-skill-scripts.py --strict --run-checks --skill agent-creator.
- Treat runtime installation into
.claude/agents/ or ~/.claude/agents/ as a
separate user-approved mutation.
Agent File Anatomy
Project file: .claude/agents/{name}.md
Global file: ~/.claude/agents/{name}.md
---
name: "{kebab-case-name}"
description: "{When Claude should spawn this agent - be specific about trigger conditions}"
model: "{haiku|sonnet|opus}"
color: "{hex, e.g. #4CAF50}"
tools: ["{minimum tool set}"]
---
# {Agent Name}
You are {Name}, a specialized agent that {concrete role}.
## Your Task
{Specific, bounded description. Include what to analyze, what to produce, and
what format to use.}
## Process
{Numbered steps the agent follows. Each step is a concrete action.}
## Output Format
{Exact structure of the expected output. Use code blocks or tables.}
## Constraints
- {Hard boundaries: what NOT to do}
- {Escalation triggers: when to report back instead of acting}
## Reasoning Discipline
Apply structured thinking to every analysis and recommendation.
## Quality Bar
- {Minimum standard each output must meet}
Frontmatter Decision Matrix
| Field |
Required |
Decision Logic |
name |
Yes |
Kebab-case id for logs and routing. |
description |
Yes |
Must state WHEN to spawn, not just WHAT it does. |
model |
Recommended |
haiku for simple checks, sonnet for balanced analysis, opus for deep reasoning. |
color |
Optional |
Hex color for terminal UI. |
tools |
Recommended |
Explicit list following least privilege. Empty list is advisory-only. |
Tool Restriction Patterns
| Pattern |
Tools |
Use Case |
Risk Level |
| Advisory |
[] |
Planning, brainstorming |
None |
| Read-only |
["Read", "Glob", "Grep"] |
Review, analysis, audit |
Low |
| Read with shell |
["Read", "Glob", "Grep", "Bash"] |
Deterministic inspection |
Medium |
| Read-write |
["Read", "Write", "Edit", "Glob", "Grep"] |
Artifact generation |
Medium |
| Builder |
["Read", "Write", "Edit", "Bash", "Glob", "Grep"] |
Build and test |
High |
Default to read-only unless the agent must create or modify artifacts.
System Prompt Design Principles
| Principle |
Rationale |
Anti-pattern |
| Self-sufficient context |
Agent has no parent history |
Referencing "the file we discussed" |
| Bounded scope |
Prevents scope creep |
"Handle anything related to X" |
| Explicit output format |
Enables downstream consumption |
"Summarize your findings" |
| Concrete process steps |
Reproducible behavior |
"Use your best judgment" |
| Negative constraints |
Prevents common mistakes |
No constraints section |
Validation Gate
Edge Cases
- If the agent needs project-specific context, include discovery steps in the
prompt instead of copying parent chat history.
- If the agent spawns too often, narrow trigger phrases and add negative
triggers.
- If the output is too verbose, add a hard line limit to the output format.
- If related agents overlap, define a team only when ownership boundaries are
explicit per file, module, or workflow stage.
Related Assets
assets/source-map.md
references/domain-knowledge.md
scripts/compile-agent.py
Source: JaviMontano/jm-adk-alfa — distributed by TomeVault.
1---2name: agent-creator-73description: Create deterministic Claude Code custom agent definitions with trigger conditions, bounded system prompts, least-privilege tools, model selection, and validation checks. Use when the user asks to create an agent, add a subagent, make a custom agent, define an agent definition, or build an autonomous subprocess for a specific project responsibility. [EXPLICIT] Use when this capability is needed.4---56# Agent Creator78Create custom Claude Code agents: autonomous subprocesses with isolated9context, specific tools, and tailored system prompts. [EXPLICIT]1011## When To Activate1213Use this skill when the user asks for a persistent subagent or custom agent14definition, for example:1516- "create an agent"17- "add a subagent"18- "make a custom agent"19- "define agent definition"20- "build an agent for X"21- "I need something to handle X automatically"2223Use `agent-constitution-creator` instead when the user needs a full24governance constitution with identity, authority, memory, handoff, and25multi-agent operating rules.2627## Deterministic Contract2829- Use `assets/agent-spec-schema.json` as the canonical structured input shape.30- Use `assets/tool-policy.json` to choose least-privilege tools and reject31 wildcard access.32- Use `assets/model-selection-policy.json` to map complexity to `haiku`,33 `sonnet`, or `opus`.34- Use `assets/description-trigger-policy.json` to keep descriptions focused on35 WHEN the parent should spawn the agent.36- Use `assets/agent-template.md` as the rendering skeleton.37- Run `scripts/compile-agent.py` before finalizing an agent definition from38 structured input.39- Run `scripts/check.sh` to verify positive and negative fixtures offline.40- Do not call external APIs, MCP servers, network resources, or live agent41 registries from the skill scripts.4243## Procedure4445### Step 1: Decide Whether An Agent Is Appropriate4647Do not create an agent when a lighter artifact fits better:4849| Situation | Better alternative |50|---|---|51| One-off task instruction | Inline response |52| Reusable multi-step workflow | Skill with assets and scripts |53| Simple output format change | Output style |54| Always-run automation | Hook |55| Persistent project rule | CLAUDE.md or AGENTS.md source |5657If the request is underspecified, ask only for the missing fields required by58`assets/agent-spec-schema.json`: responsibility, scope, read/write authority,59expected output, and complexity.6061### Step 2: Discover Existing Agents62631. Read project-local agent definitions, usually `.claude/agents/*.md`.642. Read global definitions only when the user asks for a global agent.653. Check for name collisions with built-ins: `Explore`, `Plan`,66 `general-purpose`.674. Check for scope overlap. If another agent owns the same responsibility,68 propose rename, merge, split, or non-goals before writing.6970### Step 3: Normalize The Spec7172Normalize the request into five sections:7374- `agent`: name, display name, role, responsibility, scope, and non-goals.75- `routing`: trigger phrases, negative triggers, destination scope, model,76 color, and tools.77- `behavior`: task statement, ordered process, output format, constraints, and78 reasoning tier.79- `quality`: quality bar, validation checks, escalation triggers, and residual80 risks.81- `evidence`: source labels and evidence tags for decisions that came from the82 user, codebase, or inference.8384### Step 4: Compile8586```bash87python3 skills/agent-creator/scripts/compile-agent.py \88 --input skills/agent-creator/scripts/fixtures/agent-spec-input.json89```9091The compiler emits Markdown by default and stable JSON with `--format json`.92It fails if the name is invalid, trigger conditions are missing, model or tools93are unsafe, process steps are too thin, output format is absent, constraints94lack a negative boundary, or collision rules are violated.9596### Step 5: Validate9798- Run `bash skills/agent-creator/scripts/check.sh`.99- Run `python3 -B scripts/validate-skill-dod.py --skill agent-creator`.100- Run `python3 -B scripts/validate-skill-scripts.py --strict --run-checks --skill agent-creator`.101- Treat runtime installation into `.claude/agents/` or `~/.claude/agents/` as a102 separate user-approved mutation.103104## Agent File Anatomy105106Project file: `.claude/agents/{name}.md`107Global file: `~/.claude/agents/{name}.md`108109```markdown110---111name: "{kebab-case-name}"112description: "{When Claude should spawn this agent - be specific about trigger conditions}"113model: "{haiku|sonnet|opus}"114color: "{hex, e.g. #4CAF50}"115tools: ["{minimum tool set}"]116---117118# {Agent Name}119120You are {Name}, a specialized agent that {concrete role}.121122## Your Task123124{Specific, bounded description. Include what to analyze, what to produce, and125what format to use.}126127## Process128129{Numbered steps the agent follows. Each step is a concrete action.}130131## Output Format132133{Exact structure of the expected output. Use code blocks or tables.}134135## Constraints136137- {Hard boundaries: what NOT to do}138- {Escalation triggers: when to report back instead of acting}139140## Reasoning Discipline141142Apply structured thinking to every analysis and recommendation.143144## Quality Bar145146- {Minimum standard each output must meet}147```148149## Frontmatter Decision Matrix150151| Field | Required | Decision Logic |152|---|---|---|153| `name` | Yes | Kebab-case id for logs and routing. |154| `description` | Yes | Must state WHEN to spawn, not just WHAT it does. |155| `model` | Recommended | `haiku` for simple checks, `sonnet` for balanced analysis, `opus` for deep reasoning. |156| `color` | Optional | Hex color for terminal UI. |157| `tools` | Recommended | Explicit list following least privilege. Empty list is advisory-only. |158159## Tool Restriction Patterns160161| Pattern | Tools | Use Case | Risk Level |162|---|---|---|---|163| Advisory | `[]` | Planning, brainstorming | None |164| Read-only | `["Read", "Glob", "Grep"]` | Review, analysis, audit | Low |165| Read with shell | `["Read", "Glob", "Grep", "Bash"]` | Deterministic inspection | Medium |166| Read-write | `["Read", "Write", "Edit", "Glob", "Grep"]` | Artifact generation | Medium |167| Builder | `["Read", "Write", "Edit", "Bash", "Glob", "Grep"]` | Build and test | High |168169Default to read-only unless the agent must create or modify artifacts.170171## System Prompt Design Principles172173| Principle | Rationale | Anti-pattern |174|---|---|---|175| Self-sufficient context | Agent has no parent history | Referencing "the file we discussed" |176| Bounded scope | Prevents scope creep | "Handle anything related to X" |177| Explicit output format | Enables downstream consumption | "Summarize your findings" |178| Concrete process steps | Reproducible behavior | "Use your best judgment" |179| Negative constraints | Prevents common mistakes | No constraints section |180181## Validation Gate182183- [ ] Request is better served by a subagent than by CLAUDE.md, a skill, an184 output style, or a hook.185- [ ] File is valid Markdown with YAML frontmatter.186- [ ] `name` and `description` are present and non-empty.187- [ ] `description` states trigger conditions (WHEN), not just capabilities188 (WHAT).189- [ ] `tools` is explicitly listed and limited by least privilege.190- [ ] System prompt is self-sufficient; no parent-context references.191- [ ] Output format is explicitly defined with a code block or table.192- [ ] Constraints include at least one "do not" or "never" boundary.193- [ ] No naming collision with `Explore`, `Plan`, or `general-purpose`.194- [ ] Model selection is justified by task complexity.195- [ ] Reasoning discipline section is present.196- [ ] Assets and scripts are used for deterministic compilation.197- [ ] Runtime write or installation is user-approved.198199## Edge Cases200201- If the agent needs project-specific context, include discovery steps in the202 prompt instead of copying parent chat history.203- If the agent spawns too often, narrow trigger phrases and add negative204 triggers.205- If the output is too verbose, add a hard line limit to the output format.206- If related agents overlap, define a team only when ownership boundaries are207 explicit per file, module, or workflow stage.208209## Related Assets210211- `assets/source-map.md`212- `references/domain-knowledge.md`213- `scripts/compile-agent.py`214215---216> Source: [JaviMontano/jm-adk-alfa](https://github.com/JaviMontano/jm-adk-alfa) — distributed by [TomeVault](https://tomevault.io).217<!-- tomevault:4.0:skill_md:2026-06-16 -->