Agent Create
Create a focused custom agent following repository conventions.
Read ../shared/AUTHORING.md,
../shared/WRITING_FOR_AGENTS.md, and
../shared/SUBAGENT_PROTOCOL.md. They are the single
sources for writing, identity, tools, models, lifecycle, and permission mechanics.
Workflow
Fetch current mechanics. Spawn claude-code-guide with the prompt: “Return the
current Claude Code custom-agent frontmatter, packaging, delegation, tool, model, and
permission mechanics; separate requirements from general writing advice.” Classify
fetched claims as platform mechanics and exclude general writing advice.
Gather requirements. In one numbered request ask for purpose; distinct delegation
branches and phrases; inputs and outputs; ordered actions; points where premature or
false completion is plausible; reference needs; read-only or read-write scope; required
tools; mechanical, standard, or advanced model class; color; and parent-facing output
shape. Use $ARGUMENTS for known answers, have every remaining field answered or
marked not applicable, and define each branch's expected result.
Design the hierarchy. Give every requirement one source. Keep universal ordered
actions in the workflow, co-locate branch rules, and disclose branch-only reference
through precise pointers so each run can identify what it needs. Keep one responsibility
and a body under 100 lines; split only when a real branch or sequence boundary earns the
extra context hop.
Draft agents/<agent-name>.md. Use lowercase hyphenated identity (except an exact
built-in override), a one-line description under 250 characters that front-loads all
distinct delegation branches, minimal tools, a concrete haiku, sonnet, or opus
model, and a color. Include a focused role, numbered workflow, and parseable output
contract. Follow SUBAGENT_PROTOCOL for MCP, overrides, model parameters, and grants
rather than restating that lifecycle here. Align filename and identity, grant every
used capability and no unused capability, account for all requested branches in the
output, and write concise imperative steps with semantic endpoints. Integrate needed
validation or stop conditions into their actions; add a standalone gate only under the
shared policy.
Validate and prune. Compare the draft against fetched mechanics and all three
shared references. Apply the single-source, environment-cache, relevance, positive-
target, no-op, and semantic-completion tests. Leave uncertain no-ops as manual
behavioral findings and record unmet applicable rules with exact reasons.
Review with the user. Present the file, delegation branches, hierarchy, model and
tool rationale, guideline-driven edits, and unresolved findings. Apply requested
revisions, revalidate, and iterate until the user approves and all findings are resolved
or explicitly accepted.
Final report
Report the created file, branch coverage, model and grants, validation results, manual
no-op tests, and an accounting of every gathered requirement and changed artifact.
1---2name: agent-create3description: Creates or restructures a custom agent when a user needs a delegated role, distinct delegation branches, tools, workflow, or structured output.4---56# Agent Create78Create a focused custom agent following repository conventions.910Read [`../shared/AUTHORING.md`](../shared/AUTHORING.md),11[`../shared/WRITING_FOR_AGENTS.md`](../shared/WRITING_FOR_AGENTS.md), and12[`../shared/SUBAGENT_PROTOCOL.md`](../shared/SUBAGENT_PROTOCOL.md). They are the single13sources for writing, identity, tools, models, lifecycle, and permission mechanics.1415## Workflow16171. **Fetch current mechanics.** Spawn `claude-code-guide` with the prompt: “Return the18 current Claude Code custom-agent frontmatter, packaging, delegation, tool, model, and19 permission mechanics; separate requirements from general writing advice.” Classify20 fetched claims as platform mechanics and exclude general writing advice.21222. **Gather requirements.** In one numbered request ask for purpose; distinct delegation23 branches and phrases; inputs and outputs; ordered actions; points where premature or24 false completion is plausible; reference needs; read-only or read-write scope; required25 tools; mechanical, standard, or advanced model class; color; and parent-facing output26 shape. Use `$ARGUMENTS` for known answers, have every remaining field answered or27 marked not applicable, and define each branch's expected result.28293. **Design the hierarchy.** Give every requirement one source. Keep universal ordered30 actions in the workflow, co-locate branch rules, and disclose branch-only reference31 through precise pointers so each run can identify what it needs. Keep one responsibility32 and a body under 100 lines; split only when a real branch or sequence boundary earns the33 extra context hop.34354. **Draft `agents/<agent-name>.md`.** Use lowercase hyphenated identity (except an exact36 built-in override), a one-line description under 250 characters that front-loads all37 distinct delegation branches, minimal tools, a concrete `haiku`, `sonnet`, or `opus`38 model, and a color. Include a focused role, numbered workflow, and parseable output39 contract. Follow SUBAGENT_PROTOCOL for MCP, overrides, model parameters, and grants40 rather than restating that lifecycle here. Align filename and identity, grant every41 used capability and no unused capability, account for all requested branches in the42 output, and write concise imperative steps with semantic endpoints. Integrate needed43 validation or stop conditions into their actions; add a standalone gate only under the44 shared policy.45465. **Validate and prune.** Compare the draft against fetched mechanics and all three47 shared references. Apply the single-source, environment-cache, relevance, positive-48 target, no-op, and semantic-completion tests. Leave uncertain no-ops as manual49 behavioral findings and record unmet applicable rules with exact reasons.50516. **Review with the user.** Present the file, delegation branches, hierarchy, model and52 tool rationale, guideline-driven edits, and unresolved findings. Apply requested53 revisions, revalidate, and iterate until the user approves and all findings are resolved54 or explicitly accepted.5556## Final report5758Report the created file, branch coverage, model and grants, validation results, manual59no-op tests, and an accounting of every gathered requirement and changed artifact.