create-agent
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesecreate-agent
create-agent
新規サブエージェント定義を として scaffold し、品質チェックまで自動化します。
.claude/agents/<category>/<name>.mdScaffolds new sub-agent definitions as and automates the process up to quality checks.
.claude/agents/<category>/<name>.md使い方
Usage
/create-agent quality/lint-runner # カテゴリ指定で作成
/create-agent research/doc-fetcher # research カテゴリに追加
/create-agent author/template-writer # author カテゴリに追加
/create-agent # 引数省略時はインタラクティブに確認サブエージェントの雛形は本スキル同梱の を参照します。
sample/agent.sample.md/create-agent quality/lint-runner # Create with specified category
/create-agent research/doc-fetcher # Add to research category
/create-agent author/template-writer # Add to author category
/create-agent # Interactive confirmation when arguments are omittedRefer to included with this skill for the sub-agent template.
sample/agent.sample.mdカテゴリと model 選定指針
Category and Model Selection Guidelines
| カテゴリ | パス | 役割 | 推奨 model |
|---|---|---|---|
| research/ | | 調査・情報収集・WebFetch | |
| author/ | | 作成・編集(Edit/Write/Bash を使用) | |
| quality/ | | レビュー・lint・検証(読み取り専用) | |
| Category | Path | Role | Recommended Model |
|---|---|---|---|
| research/ | | Research, information gathering, WebFetch | |
| author/ | | Creation, editing (uses Edit/Write/Bash) | |
| quality/ | | Review, linting, validation (read-only) | |
model 詳細基準
Detailed Model Criteria
| ユースケース | model |
|---|---|
| 機械的・集計・lint・frontmatter 検証 | |
| 読解・生成・レビュー・調査 | |
| 複雑な設計判断・アーキテクチャ | |
| Use Case | model |
|---|---|
| Mechanical, aggregation, linting, frontmatter validation | |
| Reading comprehension, generation, review, research | |
| Complex design decisions, architecture | |
tools 最小権限原則
Tools Least Privilege Principle
| Agent カテゴリ | 許可ツール |
|---|---|
| 読み取り専用(research/・quality/) | |
| 作成・編集(author/) | 上記 + |
読み取り専用 Agent には ・・ を 含めない。
EditWriteBash| Agent Category | Allowed Tools |
|---|---|
| Read-only (research/・quality/) | Only |
| Creation/editing (author/) | Above + |
Do not include , , or in read-only Agents.
EditWriteBashsubagent フォールバック(skills add 導入先向け)
Subagent Fallback (for skills add adopters)
本スキルが委譲する subagent(・)は Fandhe-AI/agent-cli-skills リポジトリの 定義を前提とする。導入先リポジトリに該当 subagent が存在しない場合は委譲せず、各 Step の委譲プロンプトに記載した入力・適用ルール・必須項目を main が直接実行して同じ成果物を作成する。 の代替としては Step 4 の検証観点の手動確認で足りる。適用ルール( 等)は導入先に存在するもののみ適用し、存在しない場合は へ直接作成してよい。
agent-authorfrontmatter-linter.claude/agents/frontmatter-linterdotclaude-via-temp.md.claude/agents/The subagents delegated by this skill (・) assume the definitions from the Fandhe-AI/agent-cli-skills repository. If the corresponding subagent does not exist in the target repository, do not delegate; instead, the main skill will directly execute the input, application rules, and required items described in the delegation prompt for each step to create the same artifact. Manual confirmation of the validation points in Step 4 is sufficient as an alternative to . Apply only the rules that exist in the target repository (such as ); if they do not exist, you may create them directly in .
agent-authorfrontmatter-linter.claude/agents/frontmatter-linterdotclaude-via-temp.md.claude/agents/フロー
Flow
Step 1: カテゴリと responsibilities を確認する
Step 1: Confirm Category and Responsibilities
引数から を解析する。
<category>/<agent-name>- カテゴリが ・
research/・author/のいずれかであることを確認するquality/ - 上記以外のカテゴリが指定された場合はユーザーに確認して適切なカテゴリを選択する
- Agent の責務(担当スコープ、委譲される場面)をユーザーに確認する
Parse from the arguments.
<category>/<agent-name>- Verify that the category is one of ,
research/, orauthor/quality/ - If a category outside the above is specified, confirm with the user to select an appropriate category
- Confirm the Agent's responsibilities (scope, scenarios for delegation) with the user
Step 2: agent-author に委譲してファイルを作成する
Step 2: Delegate to agent-author to Create File
**agent-author(subagent_type: agent-author)**に委譲してファイルを作成させる(存在しない場合は「subagent フォールバック」に従い main が直接作成する)。
重要: は に従い、 を経由して最終配置する( への直接書き込みは行わない)。
agent-authordotclaude-via-temp.md_/dotclaude/agents/<category>/<name>.md.claude/agents/委譲プロンプト例:
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名 → ## 役割 → ## 対象スコープ → ## 遵守する規約 → ## 手順/観点 →
## 完了条件 → ## 報告フォーマット
- 読み取り専用 Agent には Edit・Write・Bash を含めないDelegate to agent-author (subagent_type: agent-author) to create the file (if it does not exist, the main skill will create it directly according to "Subagent Fallback").
Important: follows and finalizes the placement via (does not write directly to ).
agent-authordotclaude-via-temp.md_/dotclaude/agents/<category>/<name>.md.claude/agents/Example Delegation Prompt:
subagent_type: agent-author
prompt: |
Purpose: Create a sub-agent definition for <category>/<agent-name>
Input:
- Agent Name: <agent-name>
- Category: <category> (research/author/quality/)
- Role & Responsibilities: <content received from user>
- Template: sample/agent.sample.md included with this skill
- Reference Existing Agents: Existing files under .claude/agents/
Output Path: .claude/agents/<category>/<agent-name>.md
Application Rules:
- .claude/rules/agent-authoring.md (frontmatter, tools least privilege, category placement, body outline)
- .claude/rules/dotclaude-via-temp.md (create via _/dotclaude/ and finalize with mv)
Required Items:
- frontmatter: name (kebab-case), description (specifically describe delegation scenarios),
model (follow selection criteria), tools (least privilege principle)
- Body: # Agent Name → ## Role → ## Target Scope → ## Compliance Rules → ## Procedures/Perspectives →
## Completion Criteria → ## Report Format
- Do not include Edit, Write, or Bash in read-only AgentsStep 3: model 選定と tools 設定を確認する
Step 3: Confirm Model Selection and Tools Configuration
agent-author- がカテゴリ・用途に合った選定になっているか
model - が最小権限原則を守っているか
tools - カテゴリなのに
quality/・Edit・Writeが含まれていないかBash
Review the creation result from and verify the following:
agent-author- Whether is appropriately selected for the category and use case
model - Whether adhere to the least privilege principle
tools - Whether ,
Edit, orWriteare not included forBashcategory Agentsquality/
Step 4: frontmatter-linter で検証する
Step 4: Validate with frontmatter-linter
**frontmatter-linter(subagent_type: frontmatter-linter)**に委譲して検証させる(存在しない場合は下記観点の手動確認で代替する)。
検証観点:
- が kebab-case で正しく設定されているか
name - が規定値(haiku/sonnet/opus)のいずれかか
model - に最小権限を超えるものが含まれていないか
tools - が委譲される場面を具体的に説明しているか
description - に正しく配置されているか
.claude/agents/<category>/
問題があれば に差し戻して修正させる。
agent-authorDelegate to frontmatter-linter (subagent_type: frontmatter-linter) for validation (if it does not exist, substitute with manual confirmation of the following points).
Validation Points:
- Whether is correctly set in kebab-case
name - Whether is one of the specified values (haiku/sonnet/opus)
model - Whether do not include items exceeding least privilege
tools - Whether specifically explains delegation scenarios
description - Whether it is correctly placed in
.claude/agents/<category>/
If there are issues, send it back to for correction.
agent-authorStep 5: CLAUDE.md の Sub-agents 表更新を案内する
Step 5: Guide to Update Sub-agents Table in CLAUDE.md
Agent 追加が完了したら以下を案内する。
✅ .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>After Agent addition is complete, guide the user with the following:
✅ Created .claude/agents/<category>/<agent-name>.md
Agent frontmatter summary:
name: <agent-name>
model: <model>
tools: [<tool-list>]
To update the Sub-agents table and structure tree in CLAUDE.md:
/update-docs
Please execute the above command.
To call this sub-agent within a skill, use:
subagent_type: <agent-name>検証
Validation
- が正しいパスに存在することを確認する(
.claude/agents/<category>/<agent-name>.mdが dotclaude-via-temp に従いagent-authorへの一時作成から_/dotclaude/agents/への.claude/agents/まで一貫して実行するため、mv側でcreate-agentを別途実行する必要はない)mv - frontmatter の フィールドが
name:と一致していることを確認する<agent-name> - リストがカテゴリの最小権限ポリシーを遵守していることを確認する
tools - で呼び出せる状態になっているか確認する
subagent_type: <agent-name>
- Confirm that exists in the correct path (since
.claude/agents/<category>/<agent-name>.mdfollows dotclaude-via-temp to execute everything from temporary creation inagent-authorto_/dotclaude/agents/tomv, there is no need for.claude/agents/to executecreate-agentseparately)mv - Confirm that the field in frontmatches
name:<agent-name> - Confirm that the list complies with the category's least privilege policy
tools - Confirm that it can be called with
subagent_type: <agent-name>
注意事項
Notes
- dotclaude-via-temp 必須: は
agent-authorに直接書き込まず、.claude/agents/への一時作成から_/dotclaude/agents/への.claude/agents/まで一貫して実行する。mv側でcreate-agentを別途実行する必要はない(詳細:mv).claude/rules/dotclaude-via-temp.md - は禁止:
rm -rf _/dotclaudeで空ディレクトリのみ削除する(他の並行作業との共有ディレクトリ)rmdir - 読み取り専用 Agent の tools: と
research/カテゴリにはquality/・Edit・Writeを含めないBash - name の解決: による呼び出しは frontmatter の
subagent_type:フィールドで解決される。カテゴリを移動しても呼び出しコードの変更が不要name: - update-docs の実行: Agent 追加後は必ず で
/update-docsを最新化するCLAUDE.md
- dotclaude-via-temp is mandatory: does not write directly to
agent-author, but executes the entire process from temporary creation in.claude/agents/to_/dotclaude/agents/tomv. There is no need for.claude/agents/to executecreate-agentseparately (details:mv).claude/rules/dotclaude-via-temp.md - is prohibited: Only delete empty directories with
rm -rf _/dotclaude(shared directory with other concurrent operations)rmdir - Tools for read-only Agents: Do not include ,
Edit, orWriteinBashandresearch/categoriesquality/ - Name resolution: Calls via are resolved using the
subagent_type:field in frontmatter. No changes to calling code are needed even if the category is movedname: - Execute update-docs: Always run to update
/update-docsafter adding an AgentCLAUDE.md