SuperAPI AI Directory

create-agent

Agents & models

View repository

Updated 10-15 21:40

About this skill

create-agent

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.

  • model whether is selected appropriately for the category and use case
  • tools whether complies with the principle of least privilege
  • quality/・research/ to category Edit・Write whether is not included.Bash・WebFetch・ WebSearch if includes agent-authoring.md whether 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:

  • name whether is correctly set in kebab-case
  • model whether is one of the specified values (haiku/sonnet/opus)
  • tools whether contains anything exceeding least privilege
  • description whether 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

  1. .claude/agents/<category>/<agent-name>.md confirm that exists at the correct path (agent-author since follows dotclaude-via-temp and consistently executes from temporary creation in _/dotclaude/agents/ to .claude/agents/ to mv ,create-agent on the side, mv there is no need to run separately)
  2. frontmatter の name: field is <agent-name> confirm that it matches
  3. tools confirm that the list complies with the category's least privilege policy
  4. subagent_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/ to mv tocreate-agent on the side, mv there is no need to run separately (details: .claude/rules/dotclaude-via-temp.md)
  • rm -rf _/dotclaude is prohibited: rmdir delete only empty directories with (shared directory with other concurrent work)
  • tools of read-only Agents: research/ と quality/ to category Edit・Write do not include unconditionally.Bash・WebFetch・WebSearch is in principle not included, but.claude/rules/agent-authoring.md only 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 the name: 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.md update to the latest