mcpField
S
sub-agents

sub-agents

github.com/parcadeiエージェントワークフロー3.9k536 回インストール39 週間前に更新
リポジトリ

sub-agents について

sub-agentsは、独立したコンテキストを持つ専門エージェントの作成・管理を扱うリファレンススキルです。設定、組み込みエージェント、モデル選択、連携のほか、メニュー、ファイル、コマンドラインでの操作を説明します。

主な機能

  1. 01独立コンテキストのエージェント作成
  2. 02ツールとモデルの設定
  3. 03組み込みエージェントの利用
  4. 04メニュー、ファイル、コマンドラインでの管理
  5. 05エージェントの再開と連携

活用シーン

  1. 01コードレビュー担当の設定
  2. 02タスクに応じたモデル選択
  3. 03エージェントの利用ツールを制限
  4. 04分析と実装のエージェントを連携

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/parcadei/continuous-claude-v3 --skill sub-agents

インストール後、Claude Code で/sub-agentsを入力して読み込まれたか確認します。

詳細

サブエージェントのリファレンス

特定のタスク向けに、コンテキストが分離された専門的な AI エージェントを作成します。

使用するタイミング

  • 「サブエージェントを作成するにはどうすればよいですか?」
  • 「エージェントのツールを設定する」
  • 「組み込みエージェントには何がありますか?」
  • 「エージェントのモデル選択」
  • 「エージェントのチェーン化パターン」

クイックスタート

対話形式(推奨)
/agents

エージェントの作成、編集、管理を行うメニューが開きます。

手動での作成
mkdir -p .claude/agents
cat > .claude/agents/reviewer.md << 'EOF'
---
name: reviewer
description: Code review specialist. Use proactively after code changes.
tools: Read, Grep, Glob, Bash
model: sonnet
---

You are a senior code reviewer focusing on quality and security.

## Review Checklist
- Code clarity and naming
- Error handling
- Security vulnerabilities
- Test coverage
EOF
CLI ベース
claude --agents '{
  "reviewer": {
    "description": "Code reviewer",
    "prompt": "Review for quality and security",
    "tools": ["Read", "Bash"],
    "model": "sonnet"
  }
}'

エージェントのファイル形式

---
name: agent-name
description: When/why to use this agent
tools: Read, Edit, Bash      # Optional, inherits all if omitted
model: sonnet                 # sonnet, haiku, claude-opus-4-5-20251101, inherit
---

System prompt content here...

設定フィールド

フィールド必須オプション
nameはい小文字、ハイフン
descriptionはい使用するタイミング
toolsいいえツール一覧(省略するとすべて継承)
modelいいえsonnet、haiku、claude-opus-4-5-20251101、inherit

組み込みエージェント

エージェントモデルツール用途
汎用Sonnetすべて複雑な複数ステップのタスク
PlanSonnet読み取り専用計画モードでの調査
ExploreHaiku読み取り専用コードベースの高速検索

モデルの選択

モデル速度最適な用途
Haiku最速検索、簡単な情報確認
Sonnet高速ほとんどのタスク(デフォルト)
Opus低速複雑な推論

ツールの組み合わせ

# Code Reviewer (read-only)
tools: Read, Grep, Glob, Bash

# Debugger
tools: Read, Edit, Bash, Grep, Glob

# Implementer
tools: Read, Write, Edit, Bash, Glob

エージェントの例

コードレビュー担当
---
name: code-reviewer
description: Reviews code for quality and security. Use after code changes.
tools: Read, Grep, Glob, Bash
model: sonnet
---

Review code for:
- Security vulnerabilities
- Code quality issues
- Missing error handling
- Test coverage gaps

Output findings by priority: Critical > Warning > Suggestion
デバッガー
---
name: debugger
description: Debug errors and test failures.
tools: Read, Edit, Bash, Grep, Glob
model: inherit
---

Debugging process:
1. Capture error details
2. Identify failure location
3. Form hypotheses
4. Test and verify
5. Implement fix

ファイルの場所

種類場所優先度
プロジェクト.claude/agents/最高
ユーザー~/.claude/agents/低

高度なパターン

再開可能なエージェント
[Agent returns agentId: "abc123"]

# Later: resume with context
claude -r "abc123" "Continue analysis"
エージェントのチェーン化
Use code-analyzer to find issues,
then use optimizer to fix them

ベストプラクティス

  1. 単一責任 - エージェントごとに明確な目的を1つ設定します
  2. ツールを制限する - 必要なものだけを許可します
  3. 明確な説明 - 行動を促す内容にし、「proactively」を含めます
  4. バージョン管理 - .claude/agents/ を git に追加します

コメント