원클릭으로
<Third-person summary, when to use. Trigger phrases. Concrete contexts.>
npx skills add https://github.com/anilcancakir/claude-code --skill agent-creator이 명령을 Claude Code에 복사하여 붙여넣어 스킬을 설치하세요
<Third-person summary, when to use. Trigger phrases. Concrete contexts.>
npx skills add https://github.com/anilcancakir/claude-code --skill agent-creator이 명령을 Claude Code에 복사하여 붙여넣어 스킬을 설치하세요
| name | agent-creator |
| description | Authors Claude Code custom subagents (`.claude/agents/<name>.md`, `~/.claude/agents/<name>.md`, or `<plugin>/agents/<name>.md`). Use whenever a new subagent is being designed, an existing agent is being edited, a tool allowlist or denylist is being chosen, a model and effort budget are being set, `permissionMode` is being picked, persistent `memory` (user/project/local) is being added, `skills:` are being preloaded into a subagent, `isolation: worktree` is being configured, the agent's system-prompt body is being structured (Identity/Execution/Output/Failures/Constraints), or an agent that fails to fire or returns the wrong shape is being debugged. Triggers on "create a custom subagent", "write a new agent", "add an `.claude/agents/` file", "make a `code-reviewer`", "tool restrictions for an agent", "agent system prompt", "preload skills into an agent", "agent memory", "agent worktree", "fix this agent". Use even when the user does not say the word "agent" but is asking to delegate a recurring task to a fresh isolated context. Pair with `ac:skill-creator` for the surrounding file-shape and scope decisions, and with `ac:prompt-writer` for the system-prompt body content. Target is Opus 4.7; Sonnet 4.6 follows the same shape at lower effort. Undertriggering is the failure mode, lean in when the request implies an isolated worker. |
You are about to write or edit a Claude Code custom subagent another Claude will delegate to. An agent is a markdown file that becomes a named worker the orchestrator can spawn with the Agent tool: the parent fills in subagent_type, prompt, and optional description, name, run_in_background, isolation; Claude Code spawns a fresh isolated context, injects the agent's body as the system prompt, and runs the agent until completion. The agent returns its final message to the parent as the tool result.
This skill is the playbook for designing tool restrictions, choosing model and effort, picking permissionMode, adding memory, preloading skills, structuring the system-prompt body, and routing the storage choice. Target is Opus 4.7. Same patterns work for Sonnet 4.6 and Haiku 4.5 at lower effort.
Writing a custom subagent splits into three tasks. Conflating them is the most common authoring mistake.
ac:skill-creator for the broader file-shape decisions (scope, name validation, char budget).permissionMode, memory, skills: preload, isolation, background. This file teaches that.ac:prompt-writer (architecture, snippets, anti-patterns, Opus 4.7 tuning) for the body, and apply the five-section pattern from ${CLAUDE_SKILL_DIR}/references/system-prompt-structure.md for the shape.A great agent body inside the wrong shape (wrong tools, wrong model, wrong permission mode) returns useless work. A modest body inside the right shape returns sharp results every time.
Source of truth: tools/AgentTool/loadAgentsDir.ts, tools/AgentTool/builtInAgents.ts, tools/AgentTool/built-in/<name>.ts, utils/plugins/loadPluginAgents.ts, tools/AgentTool/prompt.ts in the CC source.
The lifecycle:
--agents CLI flag > .claude/agents/ (project, walks up from cwd) > ~/.claude/agents/ (user) > <plugin>/agents/ > built-in. Higher-priority definitions override lower ones with the same name (tools/AgentTool/loadAgentsDir.ts:200-220, agents in later groups overwrite earlier in the map). Directories added with --add-dir are NOT scanned for agents; only file access is granted there. To share an agent across projects, use ~/.claude/agents/ or ship it via a plugin. SDK callers can disable all built-ins by setting CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS=1 in non-interactive mode.<plugin>:<agent-name>.Agent tool description: - {agentType}: {whenToUse} (Tools: {toolsDescription}). The orchestrator decides delegation based on these lines.Agent({subagent_type, prompt, ...}). Claude Code creates a fresh isolated context, applies the agent's tool restrictions, model, effort, permission mode, hooks, and any preloaded skills.${CLAUDE_PLUGIN_ROOT} and ${user_config.X} are substituted in the system prompt for plugin agents. Non-plugin agents get no substitution; the body is injected verbatim.prompt as the first user turn. CLAUDE.md is auto-loaded into its context unless the agent definition sets the internal omitClaudeMd flag (built-in only; saves token cost on read-only built-ins like Explore and Plan that do not need commit/PR/lint guidelines; kill-switch GrowthBook flag tengu_slim_subagent_claudemd). Subagents cannot spawn other subagents (the Agent tool is unavailable in subagent contexts).Agent tool result. Intermediate tool calls and reasoning stay in the agent's context, not the parent's.The parent never sees the agent's tool calls or scratch work; only the final summary. This is the central value: context isolation.
Route by the user's request.
Is a custom subagent the right tool at all?
├── Built-in (Explore / Plan / general-purpose) already fits → use it. Not a custom agent.
├── Repeatable workflow, no isolation needed → SKILL (route through `ac:skill-creator`).
├── User-typed `/name [args]` action → COMMAND (route through `ac:command-creator`).
├── Always-on enforcement → HOOK (route through `update-config`).
├── Single fact, not behavior → CLAUDE.md (route through `ac:claude-md-rules-creator`).
└── Recurring task that benefits from isolated context, custom tools, or distinct model → AGENT, continue.
Where does the agent live?
├── Project-scoped → `.claude/agents/<name>.md` (commit to share with team)
├── Personal cross-project → `~/.claude/agents/<name>.md`
├── Plugin-distributed → `<plugin>/agents/<name>.md` (auto-namespaced `<plugin>:<name>`)
├── Org-wide enforced → managed dir
└── One-off (no persistence) → `--agents` JSON flag
Is this an audit or fix of an existing agent?
├── YES → `${CLAUDE_SKILL_DIR}/references/anti-patterns.md` first, then specific reference as needed.
└── NO → walk the Workflow below.
For everything outside agent-specific concerns (file naming, char budget, generic frontmatter parsing), defer to ac:skill-creator rather than duplicating that material here.
A working agent needs only name + description. Everything else is opt-in.
Escape convention used in this documentation. This SKILL.md is itself a skill body inside a plugin. The Claude Code loader substitutes the plugin-root token, the skill-directory token, the session-id token, and the full-arguments token on every invocation. To document those tokens without corrupting the docs, this file uses the HTML entity
$standing in for the dollar sign whenever a token name is being NAMED rather than USED. Real path references (the skill-directory token followed by a slash and a relative path) stay literal so the loader resolves them to actual files the model can Read. In your own agent body, agents do NOT support full-arguments substitution or shell injection (only the plugin-context tokens). For plugin agents, write a plain dollar sign for${CLAUDE_PLUGIN_ROOT}and${user_config.X}. Non-plugin agents get no substitution at all; every token stays literal.
| Field | Required? | When to set |
|---|---|---|
name | yes | always; lowercase letters and hyphens, unique within scope |
description | yes | always; this is the trigger surface the orchestrator reads to decide delegation |
tools | optional | the agent should use only a specific subset of tools (allowlist). Omit to inherit every tool. Comma-separated string or YAML list. |
disallowedTools | optional | the agent should inherit most tools but be denied a few (denylist). Applied first, then tools filters the remainder. |
model | optional | the agent needs a specific model (sonnet/opus/haiku, full ID like claude-opus-4-7, or inherit). Default: inherit. |
effort | optional | the agent needs a different reasoning budget than the session (low/medium/high/xhigh/max). |
permissionMode | optional, NON-PLUGIN ONLY | the agent should run with a specific permission mode (default/acceptEdits/auto/dontAsk/bypassPermissions/plan). Ignored in plugin agents. |
maxTurns | optional | the agent should stop after N agentic turns. Positive integer. |
skills | optional | named skills to preload into the agent's context at startup (full content injected, not just made available). |
mcpServers | optional, NON-PLUGIN ONLY | MCP servers scoped to this agent. Inline definitions or names of already-configured servers. Ignored in plugin agents. |
hooks | optional, NON-PLUGIN ONLY | lifecycle hooks scoped to the agent. Same shape as project hooks. Ignored in plugin agents. |
memory | optional | persistent memory scope (user/project/local). Creates a directory the agent reads and updates across runs. Auto-injects Read/Write/Edit tools. |
background | optional | true to always spawn this agent in the background by default. |
isolation | optional | worktree to spawn the agent in a temporary git worktree, isolated from the main checkout. |
color | optional | display color in the task list (red/blue/green/yellow/purple/orange/pink/cyan). |
initialPrompt | optional, MAIN-AGENT MODE | first user turn auto-prepended when this agent runs as the main session via --agent. |
requiredMcpServers | optional | array of MCP server name patterns that must be configured for the agent to appear in the listing. Per loadAgentsDir.ts:233-242, agents missing required servers are filtered out (case-insensitive substring match). |
Anti-pattern: copying every optional field "just in case". Each unused field adds noise. A focused research agent usually needs just name + description + tools + model. A reviewer that updates a knowledge base adds memory:. Reach further only for specific needs.
Plugin-agent security boundary: per utils/plugins/loadPluginAgents.ts:161-168, plugin agents silently ignore permissionMode, hooks, and mcpServers. If your agent needs those, ship it as a user/project agent under .claude/agents/, not via a plugin. Plugins are third-party marketplace code; install-time trust boundaries cover plugin-level hooks/MCP, but per-agent escalation through a buried agent file is not allowed.
Three patterns cover almost every case. Detail and copy-paste templates: ${CLAUDE_SKILL_DIR}/references/tool-restrictions.md.
tools: Read, Grep, Glob, Bash
Agent can only use the listed tools. Default for read-only research agents.
disallowedTools: Write, Edit, NotebookEdit
Agent inherits every tool the parent has, minus the denied set. Useful for "do anything except touch files".
When both are set, disallowedTools is applied first to the inherited pool, then tools filters that pool. Tools listed in both are removed.
The Agent tool is itself a tool. Subagents cannot spawn other subagents (the Agent tool is unavailable in subagent contexts), so this matters only for agents that run as the main thread via claude --agent <name>:
tools: Agent(worker, researcher), Read, Bash
Agent(x, y) is an allowlist: only worker and researcher types can be spawned. To allow any: Agent without parentheses. To block all spawning: omit Agent from tools.
model: sonnet # or opus, haiku, claude-opus-4-7, inherit
effort: high # or low, medium, xhigh, max
Defaults: model: inherit (same as parent), no effort override.
Picking:
Set effort: high only for agents that do deep work in one shot (a plan-deep-review agent, a feasibility analyst). Most agents inherit fine.
Non-plugin agents can set permissionMode. Plugin agents ignore the field.
| Mode | Behavior |
|---|---|
default | Standard prompts for new permissions |
acceptEdits | Auto-accept file edits and common filesystem commands in working dirs |
auto | Background classifier reviews each command |
dontAsk | Auto-deny new prompts; only pre-approved tools work |
bypassPermissions | Skip prompts entirely; CC still protects .git, .claude, .vscode, .idea, .husky |
plan | Read-only exploration mode |
Parent precedence rule: if the parent session uses bypassPermissions or acceptEdits, that takes precedence and the agent cannot downgrade. If the parent uses auto, the agent's permissionMode is ignored entirely and the classifier evaluates the agent's calls.
For most agents, leave permissionMode unset and rely on tools/disallowedTools to constrain capability. Reach for permission mode only when the agent should run with looser-than-default automation (acceptEdits for an autonomous-edit agent the user trusted at install time, dontAsk for a strict read-only researcher).
Detail: ${CLAUDE_SKILL_DIR}/references/memory-and-skills.md.
memory: project # or user, local
Creates a directory the agent reads at startup and writes to during work:
user -> ~/.claude/agent-memory/<name>/project -> .claude/agent-memory/<name>/ (commit to share)local -> .claude/agent-memory-local/<name>/ (gitignored by default)When memory is enabled:
MEMORY.md in the memory directory is added to the agent's system prompt.Memory makes the agent stateful across runs. Use for code-reviewers, debuggers, domain analysts that benefit from accumulated knowledge.
skills:
- api-conventions
- error-handling-patterns
The full content of each named skill is injected into the agent's system context at startup. The agent gets the skill's body, not just the option to invoke it. Subagents do NOT inherit skills from the parent conversation; you must list every skill the agent needs.
Cannot preload skills with disable-model-invocation: true (security: those skills opted out of programmatic invocation).
isolation: worktree
Agent runs in a temporary git worktree, isolated from the main checkout. The worktree is auto-cleaned if the agent makes no changes; if it changes files, the worktree path and branch are returned in the tool result.
Use for agents that should not touch the main checkout, or for parallel agents that need separate working copies.
The body is the agent's system prompt. Treat it like any other system prompt and route through ac:prompt-writer for principles.
Skill-creator's standing body conventions all apply: persona at the top, static rules before dynamic, XML tags when needed, no aggressive caps (state the rule plain and explain the why), positive instructions over negative-only.
The single most useful agent-body convention is the five-section format (extracted from the prior ac MVP's 15 agents, applies to almost every focused agent):
## Identity
One or two sentences describing who the agent is and what it returns. Anchors the lens.
## Execution
Numbered steps the agent follows. Reads first, then acts. Sub-numbers for parallel steps.
## Output Format
Exact markdown shape the agent returns. Locked headers, citation format, length cap. The orchestrator parses this; commit to one shape.
## Failure Conditions
What makes the response BAD. "FAILED if: <list of quality-gate violations>." The agent self-checks against these before returning.
## Constraints
Hard rules. Scope limits. Tool restrictions explicit again ("Read-only, no Write or Edit"). Evidence requirements.
Detail and three worked structures (read-only researcher, code reviewer, action-taking debugger): ${CLAUDE_SKILL_DIR}/references/system-prompt-structure.md.
Plugin agents get one substitution pass before the system prompt is injected (utils/plugins/loadPluginAgents.ts:113-123):
${CLAUDE_PLUGIN_ROOT} resolves to the plugin's root directory. Use this when a plugin agent needs to reference bundled files: Read ${CLAUDE_PLUGIN_ROOT}/templates/foo.md.${user_config.X} resolves to the value of the X key in the plugin's userConfig (sensitive keys resolve to a placeholder).Non-plugin agents (.claude/agents/, ~/.claude/agents/) get NO substitution. Tokens stay literal in the system prompt.
Agents do NOT support $ARGUMENTS or ${CLAUDE_SKILL_DIR} (those are skill and command tokens). Agents also do NOT support shell injection (\!`<cmd>`); the agent system prompt is injected verbatim after the plugin substitution pass.
Walk these in order. Each step assumes the previous resolved.
Always-needed questions:
Conditional questions (ask only when intent surfaces a need):
Do not pre-ask about every optional field; pull each in only when intent makes it relevant.
.claude/agents/ for team-shared agents in a repo. ~/.claude/agents/ for cross-project personal agents. <plugin>/agents/ for distribution. --agents JSON flag for one-off testing.
Minimal:
---
name: <kebab-case-name>
description: <Third-person summary, when to use. Trigger phrases. Concrete contexts.>
---
Add fields only when the conditional questions surfaced a reason. The "Frontmatter: minimal by default" table above lists each field with its trigger condition.
description is the trigger surface; the orchestrator decides whether to delegate based on this line alone. Front-load the verb and noun, use third person, include "use proactively" if you want aggressive delegation. Cover synonyms and adjacent contexts.
Five-section pattern (above) unless the agent is genuinely trivial. For each section, name the success criterion: how does the agent know it has fulfilled this section? The Output Format section is locked; the orchestrator parses the agent's response and downstream work fails if shape drifts.
Hand off the prompt-writing details to /ac:prompt-writer after picking the shape.
Before shipping:
name is lowercase + hyphens, description is a string, tools/disallowedTools use the right format.description aloud. Would the orchestrator know when to delegate to this agent based on this line?tools is an allowlist excluding Write/Edit. If the body uses Bash for git status, Bash is in tools.Worked examples that pass all gates: ${CLAUDE_SKILL_DIR}/references/examples.md.
| Symptom | Fix |
|---|---|
| Orchestrator never delegates | Strengthen description: more specific verbs, more trigger phrases, "use proactively" |
| Orchestrator delegates too aggressively | Tighten description: remove broad keywords; specify when NOT to use |
| Agent does the wrong thing | Strengthen the body: clearer Identity, explicit steps, lock the Output Format |
| Agent writes files when it should not | Add disallowedTools: Write, Edit, NotebookEdit (or use tools: allowlist) |
| Agent times out / runs forever | Set maxTurns (positive integer) |
| Agent forgets context across runs | Add memory: project (or user/local) and instruct the body to update it |
| Agent re-discovers known patterns every time | Preload domain skills via skills: field |
| Agent prompts user repeatedly during run | Adjust permissionMode to acceptEdits or dontAsk (non-plugin only) |
| Spawning agents from within an agent fails | Subagents cannot spawn subagents. Restructure: parent orchestrates, agents return |
Deeper symptom-to-fix mapping: ${CLAUDE_SKILL_DIR}/references/anti-patterns.md.
| Producing | Route shape through | Use this skill for |
|---|---|---|
| The surrounding file-shape (scope, name, char budget) | ac:skill-creator | Agent-specific concerns (tools, model, memory, body structure) |
| The system-prompt body itself | ac:prompt-writer | The five-section pattern and per-section guidance (this file) |
| A slash command that delegates to an agent | ac:command-creator | Whether to write a custom agent at all (vs a forked-skill command) |
CLAUDE.md or .claude/rules/<topic>.md | ac:claude-md-rules-creator | Whether the work should be persistent context vs an isolated agent |
| Hook configuration | update-config | Whether the work should be deterministic enforcement vs an agent's negotiated behavior |
When the user request implies any of the rows above, do both: invoke the matching creator for shape, and keep this skill loaded for what is still agent-shaped.
Read ${CLAUDE_SKILL_DIR}/references/builtin-catalog.md for full details. Quick reference:
When designing a custom agent, check whether a built-in already fits. If yes, use it.
Full annotated blank template: ${CLAUDE_SKILL_DIR}/assets/AGENT.template.md.
Minimal form (covers most agents):
---
name: <kebab-case-name>
description: <Third-person summary, when to use. Include trigger phrases. Use proactively if desired.>
model: <sonnet | haiku | opus | inherit>
---
## Identity
<One or two sentences: who the agent is and what it returns.>
## Execution
1. <Step 1: read first>
2. <Step 2: act precisely>
3. <Step 3: verify>
## Output Format
<Locked markdown shape with citations / verdict / length cap.>
## Failure Conditions
FAILED if: <list of quality-gate violations the agent self-checks against>.
## Constraints
<Hard rules. Scope limits. Evidence requirements.>
Always check:
claude or anthropic).name and description. Other fields only when the agent needs them.description is third-person, names trigger conditions, covers synonyms.Check only the items that apply to the agent's specific shape:
tools: is set) it lists the tools the body actually uses (allowlist).disallowedTools: is set) it lists the tools the body avoids (denylist).model: is set) the choice matches the agent's complexity tier.memory: is set) the body includes instructions to update memory after the task.skills: is set) all listed skills exist and have disable-model-invocation: false.permissionMode: is set) the agent is NOT a plugin agent (plugins ignore it).hooks: or mcpServers: is set) the agent is NOT a plugin agent.isolation: worktree) the agent's work makes sense in an isolated checkout.ac:prompt-writer audit: no aggressive caps unless safety-critical, positive instructions, explained why.| File | Load when... |
|---|---|
${CLAUDE_SKILL_DIR}/references/frontmatter.md | Designing or auditing frontmatter: every field, valid values, plugin-agent restrictions. |
${CLAUDE_SKILL_DIR}/references/system-prompt-structure.md | Writing the body: the five-section pattern in depth, per-section guidance, three worked structures. |
${CLAUDE_SKILL_DIR}/references/tool-restrictions.md | Choosing tool allowlist/denylist; Agent(x, y) patterns; conditional Bash via PreToolUse hooks. |
${CLAUDE_SKILL_DIR}/references/memory-and-skills.md | Setting up persistent memory or preloading skills; auto-injected tools, MEMORY.md format. |
${CLAUDE_SKILL_DIR}/references/builtin-catalog.md | Case studies from built-in agents (Explore, Plan, general-purpose, claude-code-guide). |
${CLAUDE_SKILL_DIR}/references/examples.md | Five worked agents at different complexity tiers, ready to copy and adapt. |
${CLAUDE_SKILL_DIR}/references/anti-patterns.md | Diagnosing a misbehaving agent or auditing one before shipping. |
${CLAUDE_SKILL_DIR}/assets/AGENT.template.md | Starting a new agent from a blank annotated template. |
For surrounding skill shape, invoke /ac:skill-creator. For the prompt body itself, invoke /ac:prompt-writer. Sibling-skill files cannot be read by path from here, since the install layout is unknown at author time; invocation is the portable form.
Canonical Anthropic documentation, served as raw markdown by appending .md to the URL:
https://docs.claude.com/en/docs/claude-code/sub-agents.mdskills: preload field): https://docs.claude.com/en/docs/claude-code/skills.mdhttps://docs.claude.com/en/docs/claude-code/plugins.mdhttps://docs.claude.com/en/docs/claude-code/permission-modes.mdhttps://docs.claude.com/en/docs/claude-code/hooks.mdWhen canonical docs conflict with observed CLI behavior, trust the live binary.
Writes high-signal prompts for Claude Opus 4.7 (system prompts, subagent briefings, skill bodies, command bodies, agent bodies, CLAUDE.md files, .claude/rules/*.md) and audits existing ones. Use whenever instructions are being authored or edited for any Claude to execute, even when the user does not say the word "prompt". Triggers on "write a system prompt", "brief a subagent", "draft an agent body", "skill content", "command body", "CLAUDE.md", "rules file", "audit this prompt", "improve this instruction", "make this prompt better". Sibling creator skills (skill-creator, command-creator, agent-creator, claude-md-rules-creator) call this skill for the prompt body itself. Use aggressively; undertriggering is the failure mode.
Authors CLAUDE.md, CLAUDE.local.md, and `.claude/rules/*.md` (the standing-instruction layer Claude Code prepends as a `<system-reminder>` user message at every session start). Covers the four scopes (managed / user-global / project-team / project-personal), `paths:` for path-scoped rules, `@path` imports (depth 5, external-approval), splitting bloated files, `claudeMdExcludes`, HTML-comment maintainer notes, AGENTS.md interop, monorepo + worktree handling, and debugging "Claude is not following my CLAUDE.md". Use proactively when the user says "add to CLAUDE.md", "write a rule", "init memory", "global instructions", "user-level instructions", "team conventions", "project memory", "claude.md", "rules file", "agent instructions", or asks to refactor an oversized CLAUDE.md or fix instructions the model is ignoring. Triggers even when the user does not say "skill". Pair with `ac:skill-creator` for the surrounding shape, `ac:prompt-writer` for body content, `ac:agent-creator` for subagent CLAUDE.md inheritance.
Git expert - atomic commits with style detection, rebase/squash, and history archaeology (blame, bisect, pickaxe). Use for git operations.
Authors Claude Code slash commands (`/name [args]` markdown files at `.claude/commands/<name>.md` or `<plugin>/commands/<name>.md`, plus the equivalent `.claude/skills/<name>/SKILL.md` directory format). Use whenever a new slash command is being designed, an existing command is being edited, an argument-driven workflow is being captured, shell injection is being added to gather live context (git diff, PR data, env), multi-phase command bodies are being structured, `argument-hint` and `arguments` frontmatter are being chosen, approval gates with AskUserQuestion are being inserted before destructive actions, or a command that fires the wrong way is being debugged. Triggers on "create a slash command", "build a /command", "add a plugin command", "make a /pr-summary", "write a command body", "shell injection in command", "argument design for command", "fix this command". Use even when the user does not say the word "command" but is asking for `/name` invocation with arguments, a side-effect workflow, or a context
Authors Claude Code skills (`.claude/skills/<name>/SKILL.md`, project/user/plugin/managed scope). Use whenever a new skill is being written, an existing skill is being edited, a recurring workflow is being captured as a playbook, scope and invocation are being decided (inline vs forked, model-invocable vs user-only), `allowed-tools` patterns are being chosen, bundled `references/` or `scripts/` are being added, `paths:` is being scoped, or a skill that fails to trigger is being debugged. Triggers on "create a skill", "write a SKILL.md", "turn this into a skill", "make a slash command", "package this workflow", "playbook", "fix this skill", "skill not triggering", "skillify". Use even when the user does not say the word "skill" but is asking to capture a procedure they keep retyping. Pair with `ac:prompt-writer` for the body content, with `command-creator` for command-shaped skills (`/name [args]`), with `agent-creator` for context-isolated workers, with `ac:claude-md-rules-creator` for facts that belong in CL