Scaffold a new subagent definition as .claude/agents/<category>/<name>.md and automate through quality checks.
Usage
/create-agent quality/lint-runner # カテゴリ指定で作成
/create-agent research/doc-fetcher # research カテゴリに追加
/create-agent author/template-writer # author カテゴリに追加
/create-agent # 引数省略時はインタラクティブに確認
For the subagent template, refer to the sample/agent.sample.md bundled with this skill.
Category and model selection guidelines
| Category | Path | Role | Recommended model |
|---|---|---|---|
| research/ | .claude/agents/research/ |
Research, information gathering, WebFetch | sonnet |
| author/ | .claude/agents/author/ |
Creation/editing (uses Edit/Write/Bash) | sonnet |
| quality/ | .claude/agents/quality/ |
Review, lint, verification (read-only) | sonnet(reasoning/review) / haiku(mechanical lint only) |
model detailed criteria
| Use case | model |
|---|---|
| Mechanical, aggregation, lint, frontmatter validation | haiku |
| Reading comprehension, generation, review, research | sonnet |
| Complex design decisions, architecture | opus |
tools least-privilege principle
| Agent category | Permitted tools |
|---|---|
| Read-only (research/, quality/) | In principle, Read・Glob・Grep only. Exceptions are limited to cases satisfying the agent-authoring.md conditions |
| Creation/editing (author/) | The above + Edit・Write・Bash |
For read-only Agents, Edit・Write is unconditionally not included。Bash・WebFetch・WebSearch is also in principle not included, but.claude/rules/agent-authoring.mdonly when the conditions of "Exception: read-only Agent permitted to use Bash" and "Exception: read-only Agent permitted to use WebFetch / WebSearch" (mechanically verifying Agent, CLI failure investigating Agent, research-type Agent with explicitly permitted domains) are satisfied, treat it as an exception and state the purpose (limited to diagnostic purposes, destructive operations prohibited, permitted domains, etc.) in the body. For exception details and the permitted domain list, refer to agent-authoring.md as the authoritative source and do not duplicate it here.
subagent fallback (for skills add installation targets)
The subagent delegated to by this skill (agent-author・frontmatter-linter) is in the Fandhe-AI/agent-cli-skills repository .claude/agents/ definition is assumed.If the corresponding subagent does not exist in the installation target repository, do not delegate; the main agent directly executes the input, applicable rules, and required items described in each Step's delegation prompt to create the same deliverables。frontmatter-linter As an alternative, manual confirmation of the verification viewpoints in Step 4 is sufficient. Apply only the applicable rules (such asdotclaude-via-temp.md etc.) that exist in the installation target; if they do not exist, you may create directly in .claude/agents/ .
Flow
Step 1: Confirm the category and responsibilities
Parse <category>/<agent-name> from the arguments.
- Category is
research/・author/・quality/Confirm that it is one of the following - If a category other than the above is specified, confirm with the user and select an appropriate category
- Confirm the Agent's responsibilities (scope of responsibility, situations in which it is delegated to) with the user
Step 2: Delegate to agent-author to create the file
Delegate to **agent-author (subagent_type: agent-author)** to create the file (if it does not exist, the main agent creates it directly according to the "subagent fallback").
Important: agent-author は dotclaude-via-temp.md according to_/dotclaude/agents/<category>/<name>.md via.claude/agents/ do not write directly to).
Delegation prompt example:
subagent_type: agent-author
prompt: |
目的: <category>/<agent-name> のサブエージェント定義を作成する
入力:
- Agent 名: <agent-name>
- カテゴリ: <category>(research/author/quality/)
- 役割・責務: <ユーザーから受け取った内容>
- 雛形: 本スキル同梱の sample/agent.sample.md
- 既存 Agent の参考: .claude/agents/ 配下の既存ファイル
出力先: .claude/agents/<category>/<agent-name>.md
適用ルール:
- .claude/rules/agent-authoring.md(frontmatter・tools 最小権限・カテゴリ配置・本文骨子)
- .claude/rules/dotclaude-via-temp.md(_/dotclaude/ 経由で作成して mv で最終配置)
必須項目:
- frontmatter: name(kebab-case), description(委譲される場面を具体的に記載),
model(選定基準に従う), tools(最小権限の原則)
- 本文: # Agent名 → ## 役割 → ## 対象スコープ → ## 遵守する規約 → ## 手順/観点 →
## 完了条件 → ## 報告フォーマット
- research/・quality/ カテゴリには Edit・Write を含めない(author/ カテゴリは Edit・Write
を許可する)。Bash・WebFetch・WebSearch は agent-authoring.md の例外条件を満たす場合のみ
許可し、用途を本文に明記する
Step 3: Confirm model selection and tools settings
agent-author check the creation result of and verify the following.
modelwhether is selected appropriately for the category and use casetoolswhether complies with the principle of least privilegequality/・research/to categoryEdit・Writewhether is not included.Bash・WebFetch・WebSearchif includesagent-authoring.mdwhether the exception conditions of are met and the use case is explicitly stated in the body
Step 4: Verify with frontmatter-linter
Delegate to **frontmatter-linter (subagent_type: frontmatter-linter)** for verification (if it does not exist, substitute manual checking from the perspectives below).
Verification perspectives:
namewhether is correctly set in kebab-casemodelwhether is one of the specified values (haiku/sonnet/opus)toolswhether contains anything exceeding least privilegedescriptionwhether specifically explains the situations in which it is delegated to.claude/agents/<category>/whether is correctly placed in
If there are problems, agent-author send it back to for correction.
Step 5: Guide updating the Sub-agents table in CLAUDE.md
Once the Agent addition is complete, guide the following.
✅ .claude/agents/<category>/<agent-name>.md を作成しました。
Agent の frontmatter 概要:
name: <agent-name>
model: <model>
tools: [<tool-list>]
CLAUDE.md の Sub-agents 表・構造ツリーを更新するには:
/update-docs
を実行してください。
このサブエージェントを呼び出すには、スキル内で以下を使用します:
subagent_type: <agent-name>
Verification
.claude/agents/<category>/<agent-name>.mdconfirm that exists at the correct path (agent-authorsince follows dotclaude-via-temp and consistently executes from temporary creation in_/dotclaude/agents/to.claude/agents/tomv,create-agenton the side,mvthere is no need to run separately)- frontmatter の
name:field is<agent-name>confirm that it matches toolsconfirm that the list complies with the category's least privilege policysubagent_type: <agent-name>confirm whether it is in a state where it can be called with
Notes
- dotclaude-via-temp required:
agent-authorは.claude/agents/do not write directly to,_/dotclaude/agents/consistently execute from temporary creation in.claude/agents/tomvtocreate-agenton the side,mvthere is no need to run separately (details:.claude/rules/dotclaude-via-temp.md) rm -rf _/dotclaudeis prohibited:rmdirdelete only empty directories with (shared directory with other concurrent work)- tools of read-only Agents:
research/とquality/to categoryEdit・Writedo not include unconditionally.Bash・WebFetch・WebSearchis in principle not included, but.claude/rules/agent-authoring.mdonly when the exception conditions of (mechanically verifying Agent, CLI failure investigation Agent, investigation-type Agent with explicitly allowed domains) are met, treat it as an exception and explicitly state the use case in the body - name resolution:
subagent_type:invocation by is resolved by thename:field in frontmatter. Even if the category is moved, no change to the calling code is required - Running update-docs: after adding an Agent, always
/update-docsでCLAUDE.mdupdate to the latest