Pattern for progressively refining context retrieval to solve the subagent context problem
日本語の概要は準備中です。原文の説明を表示しています。
Use at the START of every task, before writing any code, running tests, debugging, reviewing, or designing. This skill determines which methodology and domain skills must be invoked. MUST be invoked before any implementation, debugging, review, testing, or specification work begins.
インストール方法を見るインストールする前に、エージェントに与えられる指示の中身を確認できます。
1% でも適用される可能性があれば、そのスキルを呼び出せ。
スキルの呼び出しコストは低い。呼び出さなかったことによる品質低下コストは高い。 迷ったら呼び出す。迷わなくても呼び出す。
現在のコマンド名または作業内容からフェーズを判定する:
| コマンド / 作業内容 | フェーズ | Domain Skill 読み込み |
|---|---|---|
/brainstorm | design | Read: constraints.md |
/spec | spec | Read: design.md |
/implement | implementation | Skill ツール(SKILL.md 全体) |
/review | review | Skill ツール(SKILL.md 全体) |
/test | test | Skill ツール(SKILL.md 全体) |
/compound | documentation | Skill ツール(SKILL.md 全体) |
/ship | all(フェーズ遷移あり) | フェーズごとに切替 |
| バグ修正・エラー対応 | debug | Skill ツール(SKILL.md 全体) |
| コード変更・新機能追加 | implementation | Skill ツール(SKILL.md 全体) |
| コードレビュー依頼 | review | Skill ツール(SKILL.md 全体) |
| テスト実行・修正 | test | Skill ツール(SKILL.md 全体) |
| 設計・要件整理 | design / spec | Read: design.md |
対象ファイルのパスパターンに基づいてドメインを判定する。ドメインスキルは Auto-Discovery で自動検出される。
<project>/.claude/skills/)およびグローバルスキル(~/.claude/skills/)に配置されたドメインスキルを Claude Code が自動検出する| Skill 名 | 適用フェーズ | トリガー条件 |
|---|---|---|
test-driven-development | implementation, debug | コードを書く前。新機能実装、バグ修正、リファクタリング時 |
systematic-debugging | debug, implementation, test | バグ、テスト失敗、ビルドエラー、予期しない動作の発生時 |
verification-before-completion | ALL(完了境界) | タスク完了宣言の直前。「完了」と言う前に必ず |
iterative-retrieval | ALL | サブエージェントとして起動された時。コードベース探索の開始時 |
strategic-compact | ALL | コンテキストウィンドウ 80% 超過時。フェーズ切り替え時。大量出力処理後 |
dispatching-parallel-agents | debug, implementation | 3つ以上の独立した失敗・タスクが存在し、並列調査が可能な時 |
Domain Skills について: Domain Skills は Auto-Discovery 方式に移行済み。 プロジェクト固有スキル(
<project>/.claude/skills/)およびグローバルスキル(~/.claude/skills/)に 配置されたドメインスキルは Claude Code が自動検出するため、ここにレジストリとして列挙する必要はない。
サブエージェントにはスキル名を渡す。Claude Code がスキル名から自動的にスキル内容を解決・読み込みする。
親コマンド(/implement, /spec 等)の責務:
プロンプト記載テンプレート:
Phase-Aware テンプレート(/brainstorm, /spec 用):
REQUIRED SKILLS:
- iterative-retrieval
- verification-before-completion
DOMAIN CONTEXT FILES (Read ツールで直接読み込むこと):
- ~/.claude/skills/<your-domain-skill>/<phase-file>.md
※ ファイルが存在しない場合は Skill ツールで <your-domain-skill> を呼び出す
※ 関連ドメイン Skill がない場合、このセクションは省略する
Standard テンプレート(/implement, /review 等 用):
REQUIRED SKILLS:
- test-driven-development
- iterative-retrieval
- verification-before-completion
- [ドメイン固有スキル名]
例: <your-domain-skill>
Methodology Skills は常に Skill ツールで呼び出す。Phase-Aware ファイル(Read)はドメイン Skill のみに適用する。
スキル解決の優先順位:
<project>/.claude/skills/)が優先~/.claude/skills/)がフォールバックサブエージェントの責務:
skills frontmatter で宣言されたスキルに従うPhase-Aware ファイル(例: ~/.claude/skills/<your-domain-skill>/design.md)を Read ツールで読み込もうとしてファイルが存在しない場合:
<your-domain-skill>)を呼び出し、SKILL.md 全体を読み込む/skill-format <skill-name> で分割してください」フォールバックはファイル分割未実施の Skill への後方互換性を確保するための機構。 分割が完了した Skill では常に Phase-Aware ファイルが優先される。
START
│
├─ 1. フェーズ判定
│ └─ コマンド名 or 作業内容 → フェーズ検出テーブル → phases[], suffix
│
├─ 2. ドメイン判定
│ └─ 対象ファイルパス → Auto-Discovery でドメインスキル検出 → domains[]
│
├─ 3. スキル照合
│ ├─ Methodology Skills: phases[] でレジストリ照合 → matched_methodology[]
│ └─ Domain Skills: domains[] から Auto-Discovery(Claude Code が自動検出) → matched_domain[]
│
├─ 4. 読み込み方式決定
│ ├─ Methodology Skills: Skill ツールで呼び出し(常に SKILL.md 全体)
│ └─ Domain Skills:
│ ├─ Phase-Aware ファイルあり → Read ツールでファイルパスを指定
│ │ 例: phase-file="design" → ~/.claude/skills/<your-domain-skill>/design.md
│ │ ファイルが存在しない場合はフォールバック機構を適用
│ └─ Phase-Aware ファイルなし → Skill ツールで呼び出し(SKILL.md 全体)
│
├─ 5. Union
│ └─ skills_to_invoke = matched_methodology ∪ matched_domain(サフィックス付き)
│
├─ 6. 1% ルール適用
│ └─ 「本当に除外してよいか?」を各 Skill について確認
│ └─ 疑わしければ追加
│
├─ 7. プロジェクトスキル考慮
│ └─ Claude Code が検出したプロジェクト固有スキル(<project>/.claude/skills/)も
│ ドメイン・フェーズとの関連性を判断して追加
│
└─ 8. 呼び出し
├─ メインセッション: `Skill` ツールで各スキルを名前で呼び出す
└─ サブエージェント: プロンプトにテンプレートを記載
├─ Methodology Skills + Phase-Aware なし Domain Skills → REQUIRED SKILLS に記載
└─ Phase-Aware あり Domain Skills → DOMAIN CONTEXT FILES に Read パスを記載
/implement でプロジェクトファイル実装時(Standard テンプレート)implementation → サフィックス: なしtest-driven-development, verification-before-completion, iterative-retrieval<your-domain-skill> 等(サフィックスなし = SKILL.md 全体)/spec で仕様策定時(Phase-Aware テンプレート)spec → Phase-Aware ファイル: design.mditerative-retrieval, verification-before-completion~/.claude/skills/<your-domain-skill>/design.md/brainstorm でアイデア出し(Phase-Aware テンプレート)design → Phase-Aware ファイル: constraints.mditerative-retrieval~/.claude/skills/<your-domain-skill>/constraints.mddebug → サフィックス: なしsystematic-debugging, test-driven-development, iterative-retrieval<your-domain-skill> 等(サフィックスなし = SKILL.md 全体)debug → サフィックス: なしsystematic-debugging, dispatching-parallel-agents, iterative-retrievalまだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Pattern for progressively refining context retrieval to solve the subagent context problem
日本語の概要は準備中です。原文の説明を表示しています。
proposal.md が /spec の入力として十分な情報を含んでいるかを確認する。「ユーザーにとっての承認」ではなく「/spec にとっての準備完了度」を検証する軽量チェック
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, update or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
日本語の概要は準備中です。原文の説明を表示しています。
Use when splitting a domain Skill into Phase-Aware File Structure (SKILL.md / design.md / constraints.md). Defines the splitting criteria, procedures, sync procedures, and validation rules. Invoked by /skill-format command or manually when restructuring domain Skills.
日本語の概要は準備中です。原文の説明を表示しています。
/brainstorm のユーザーストーリー品質を INVEST 基準で軽量チェックする。proposal.md 生成前にストーリーの構造的品質を確認し、問題があれば対話で改善を促す
Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction.
日本語の概要は準備中です。原文の説明を表示しています。