mcpField
S
sadd:do-in-steps

sadd:do-in-steps

github.com/neolabhqエージェントワークフロー1.8k458 回インストール9 週間前に更新
リポジトリ

sadd:do-in-steps について

sadd:do-in-steps は、複雑なタスクを順序付きのサブタスクに分けて実行する Claude Code スキルです。複数のエージェントを調整し、各段階の結果を個別に検証してから次へ進みます。

主な機能

  1. 01タスクの段階的な分解
  2. 02サブタスクに応じたモデル選択
  3. 03実装と評価基準作成の並列実行
  4. 04各段階の独立した検証
  5. 05段階間でのコンテキスト共有
  6. 06検証失敗時の再試行

活用シーン

  1. 01依存関係のある複数の変更の分割
  2. 02実装エージェント間での結果共有
  3. 03次の段階へ進む前の成果確認

インストール

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

$npx skills add https://github.com/neolabhq/context-engineering-kit --skill sadd:do-in-steps

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

詳細

do-in-steps

複雑なタスクを逐次的なサブタスクに分解し、各ステップを順番に完了するようサブエージェントをオーケストレーションして実行します。タスクを自動的に分析して依存関係を特定し、各サブタスクに最適なモデルを選択し、完了したステップの関連コンテキストを後続のステップに渡します。また、次のステップに進む前に、各ステップを(メタジャッジ評価仕様を使用する)独立したジャッジで検証します。 このコマンドは、コンテキストの受け渡しを伴う逐次タスク実行の**スーパーバイザー/オーケストレーター・パターン**と、**メタジャッジ → LLM-as-a-judgeによる検証**を実装します。オーケストレーターとして複雑なタスクを分析して順序付けられたサブタスクに分解し、各ステップでメタジャッジと実装エージェントを**並列に**ディスパッチします。メタジャッジは、実装エージェントが並行して処理を進める間に、ステップごとの評価基準を生成します。各サブエージェントには、次の内容が渡されます。 - **分離されたコンテキスト** - 各サブタスク専用のクリーンなコンテキストウィンドウ - **最適なモデル** - サブタスクの複雑さに基づいて選択されたモデル(Opus/Sonnet/Haiku) - **前のステップのコンテキスト** - 先行するステップの出力から抽出した関連する要約 - **構造化された推論** - 体系的な思考のためのゼロショットCoTプレフィックス - **自己批評** - 提出前の内部検証 - **構造化された評価** - メタジャッジは、判定前に各ステップに合わせたルーブリックとチェックリストを作成します - **外部ジャッジ** - メタジャッジの仕様を用いて、反復ループを伴うLLM-as-a-judge検証を行います - **並列処理による高速化** - 各ステップでメタジャッジと実装エージェントを並列に実行します。メタジャッジの仕様は、同じステップ内の再試行でも再利用されます

重要: あなたはオーケストレーターに徹してください。タスクを自分で実行してはいけません。bashツールを使って読み取り、書き込み、または実行した場合、タスクは直ちに失敗です。最も重要な基準はこれです。サブエージェント以外を使った場合は、即座に強制終了されます。あなたの役割は次のとおりです。

  1. タスクを分析して分解する
  2. 各サブタスクに最適なモデルとエージェントを選択する
  3. 各ステップで、メタジャッジと実装エージェントを並列にディスパッチする(ディスパッチ順はメタジャッジが先)
  4. 両方の完了を待ってから、メタジャッジの仕様を渡してジャッジをディスパッチする
  5. ジャッジがステップを不合格にした場合、同じメタジャッジの仕様を再利用して反復する(最大3回)
  6. 出力を収集し、コンテキストを次のステップに引き継ぐ
  7. 最終結果を報告する

重大な警告 — 絶対に行わないこと

絶対に行わないこと:

  • コードの詳細を理解するために実装ファイルを読まないでください(サブエージェントに任せてください)
  • コードを書いたり、ソースファイルを直接変更したりしないでください
  • タスクを分解せず、実装に飛びつかないでください
  • 「時間を節約する」ために、複数のステップを自分で実行しないでください
  • ステップの出力を詳しく読み、コンテキストを使い切らないでください
  • ジャッジレポートを全文読まないでください(構造化されたヘッダーのみを解析してください)
  • ジャッジによる検証を省略して次のステップに進まないでください
  • どのような形式でも、ジャッジにスコアのしきい値を伝えないでください

必ず行うこと:

  • すべての実装作業で、Task ツールを使ってサブエージェントに依頼してください
  • 各ステップで、メタジャッジと実装エージェントを並行して(メタジャッジを先に)ディスパッチしてください
  • ジャッジをディスパッチする前に、メタジャッジと実装の両方が完了するまで待ってください
  • ステップのメタジャッジ評価仕様をジャッジエージェントに渡してください
  • メタジャッジおよびジャッジの各エージェントへのプロンプトに、CLAUDE_PLUGIN_ROOT=${CLAUDE_PLUGIN_ROOT}を含めてください
  • 同一ステップ内の再試行では、同じメタジャッジ仕様を再利用してください(再試行のためにメタジャッジを再実行しないでください)
  • 新しいステップごとに、新しいメタジャッジをディスパッチしてください(各ステップに専用の仕様を用意してください)
  • ステップ検証のために、Task ツールで独立したジャッジをディスパッチしてください
  • ファイルの全文ではなく、必要なコンテキストの要約のみを渡してください
  • 次のステップに進む前に、ジャッジ検証で合格を得てください
  • 検証に失敗した場合は、ジャッジのフィードバックを反映して修正してください(最大3回まで再試行)

オーケストレーションから逸脱する(自分でサブタスクを実装しようとする、実装ファイルを読む、ジャッジレポートを全文読む、または直接変更を加える)と、コンテキストが汚染され、最終的に失敗します。その結果、あなたは解雇されます!

プロセス

セットアップ:レポートディレクトリの作成

開始する前に、レポートディレクトリが存在することを確認してください。

mkdir -p .specs/reports

レポートの命名規則: .specs/reports/{task-name}-step-{N}-{YYYY-MM-DD}.md

各項目は以下のとおりです。

  • {task-name} — タスクの説明から導出します(例:user-dto-refactor)
  • {N} — ステップ番号
  • {YYYY-MM-DD} — 現在の日付

**注:**実装の出力先は指定された場所です。.specs/reports/に保存するのはジャッジ検証レポートのみです。

フェーズ1:タスクの分析と分解

Zero-shot Chain-of-Thought 推論を使って、タスクを体系的に分析してください。

Let me analyze this task step by step to decompose it into sequential subtasks:

1. **Task Understanding**
   "What is the overall objective?"
   - What is being asked?
   - What is the expected final outcome?
   - What constraints exist?

2. **Identify Natural Boundaries**
   "Where does the work naturally divide?"
   - Database/model changes (foundation)
   - Interface/contract changes (dependencies)
   - Implementation changes (core work)
   - Integration/caller updates (ripple effects)
   - Testing/validation (verification)
   - Documentation (finalization)

3. **Dependency Identification**
   "What must happen before what?"
   - "If I do B before A, will B break or use stale information?"
   - "Does B need any output from A as input?"
   - "Would doing B first require redoing work after A?"
   - What is the minimal viable ordering?

4. **Define Clear Boundaries**
   "What exactly does each subtask encompass?"
   - Input: What does this step receive?
   - Action: What transformation/change does it make?
   - Output: What does this step produce?
   - Verification: How do we know it succeeded?

分解のガイドライン:

パターン分解戦略例
インターフェースの変更1. インターフェースを更新、2. 実装を更新、3. 利用側を更新「getUserの戻り値の型を変更」
機能の追加1. コアロジックを追加、2. 統合ポイントを追加、3. API層を追加「UserServiceにキャッシュを追加」
リファクタリング1. コアを抽出・変更、2. 内部参照を更新、3. 外部参照を更新「Serviceからヘルパークラスを抽出」
影響を伴うバグ修正1. 根本原因を修正、2. 依存する問題を修正、3. テストを更新「レポートに影響する計算エラーを修正」
複数レイヤーにわたる変更1. データ層、2. ビジネス層、3. API層、4. クライアント層「Userエンティティに新しいフィールドを追加」

分解の出力形式:

## Task Decomposition

### Original Task
{task_description}

### Subtasks (Sequential Order)

| Step | Subtask | Depends On | Complexity | Type | Output |
|------|---------|------------|------------|------|--------|
| 1 | {description} | - | {low/med/high} | {type} | {what it produces} |
| 2 | {description} | Step 1 | {low/med/high} | {type} | {what it produces} |
| 3 | {description} | Steps 1,2 | {low/med/high} | {type} | {what it produces} |
...

### Dependency Graph
Step 1 ─→ Step 2 ─→ Step 3 ─→ ...
フェーズ 2:各サブタスクのモデル選択

各サブタスクについて分析し、最適なモデルを選択します。

Let me determine the optimal configuration for each subtask:

For Subtask N:
1. **Complexity Assessment**
   "How complex is the reasoning required?"
   - High: Architecture decisions, novel problem-solving, critical logic changes
   - Medium: Standard patterns, moderate refactoring, API updates
   - Low: Simple transformations, straightforward updates, documentation

2. **Scope Assessment**
   "How extensive is the work?"
   - Large: Multiple files, complex interactions
   - Medium: Single component, focused changes
   - Small: Minor modifications, single file

3. **Risk Assessment**
   "What is the impact of errors?"
   - High: Breaking changes, security-sensitive, data integrity
   - Medium: Internal changes, reversible modifications
   - Low: Non-critical utilities, documentation

4. **Domain Expertise Check**
   "Does this match a specialized agent profile?"
   - Development: implementation, refactoring, bug fixes
   - Architecture: system design, pattern selection
   - Documentation: API docs, comments, README updates
   - Testing: test generation, test updates

モデル選択マトリックス:

複雑さ範囲リスク推奨モデル
高任意任意opus
任意任意高opus
中大中opus
中中中sonnet
中小低sonnet
低任意低haiku

サブタスクごとの判断ツリー:

Is this subtask CRITICAL (architecture, interface, breaking changes)?
|
+-- YES --> Use Opus (highest capability for critical work)
|           |
|           +-- Does it match a specialized domain?
|               +-- YES --> Include specialized agent prompt
|               +-- NO --> Use Opus alone
|
+-- NO --> Is this subtask COMPLEX but not critical?
           |
           +-- YES --> Use Sonnet (balanced capability/cost)
           |
           +-- NO --> Is output LONG but task not complex?
                      |
                      +-- YES --> Use Sonnet (handles length well)
                      |
                      +-- NO --> Is this subtask SIMPLE/MECHANICAL?
                                 |
                                 +-- YES --> Use Haiku (fast, cheap)
                                 |
                                 +-- NO --> Use Sonnet (default for uncertain)

専門エージェント: 専門エージェントのリストは、プロジェクトと読み込まれているプラグインによって異なります。sdd プラグインに含まれる一般的なエージェントは、sdd:developer、sdd:tdd-developer、sdd:researcher、sdd:software-architect、sdd:tech-lead、sdd:team-lead、sdd:qa-engineer です。適切な専門エージェントが利用できない場合は、専門化されていない汎用エージェントにフォールバックします。

判断: サブタスクが専門知識の恩恵を明確に受け、かつ複雑さがそのオーバーヘッドに見合う場合に専門エージェントを使用します(Haiku クラスのタスクには使用しません)。

選択結果の形式:

## Model/Agent Selection

| Step | Subtask | Model | Agent | Rationale |
|------|---------|-------|-------|-----------|
| 1 | Update interface | opus | sdd:developer | Complex API design |
| 2 | Update implementations | sonnet | sdd:developer | Follow patterns |
| 3 | Update callers | haiku | - | Simple find/replace |
| 4 | Update tests | sonnet | sdd:tdd-developer | Test expertise |
フェーズ 3:並列メタジャッジとジャッジ検証による逐次実行

サブタスクを1つずつ実行します。各ステップで、メタジャッジと実装エージェントを並列にディスパッチしてから、メタジャッジの仕様を用いて独立したジャッジが検証します。必要に応じて反復し、その後、コンテキストを次のステップに引き継ぎます。

ステップごとの実行フロー:

┌──────────────────────────────────────────────────────────────────────────────┐
│ Step N                                                                       │
│                                                                              │
│   ┌──────────────┐                                                           │
│   │ Meta-Judge   │──┐ (parallel)                                             │
│   │ (Sub-agent)  │  │                                                        │
│   └──────────────┘  │   ┌──────────────┐     ┌──────────────────────┐       │
│                      ├──▶│    Judge     │────▶│ Parse Verdict        │       │
│   ┌──────────────┐  │   │ (Sub-agent)  │     │ (Orchestrator)       │       │
│   │ Implementer  │──┘   └──────────────┘     └──────────────────────┘       │
│   │ (Sub-agent)  │                                      │                    │
│   └──────────────┘                                      ▼                    │
│          ▲                              ┌─────────────────────────┐          │
│          │                              │ PASS (≥4.0)?            │          │
│          │                              │ ├─ YES → Next Step      │          │
│          │                              │ ├─ ≥3.0 + low → PASS   │          │
│          │                              │ └─ NO  → Retry?         │          │
│          │                              │     ├─ <3 → Retry       │          │
│          │                              │     └─ ≥3 → Escalate    │          │
│          │                              └─────────────────────────┘          │
│          │                                            │                      │
│          └────────────── feedback ────────────────────┘                      │
│          (retries reuse same meta-judge spec, no new meta-judge)             │
└──────────────────────────────────────────────────────────────────────────────┘
3.1 コンテキスト引き継ぎプロトコル

各サブタスクの完了後、後続ステップに関連するコンテキストを抽出します。

引き継ぐコンテキスト:

  • 変更したファイル(内容ではなくパスのみ)
  • 実施した主な変更(概要)
  • 新たに導入したインターフェース/API
  • 後続のステップに影響する決定事項
  • 後続のステップに関する警告や考慮事項

コンテキストのフィルタリング:

  • 残りのサブタスクに関連する情報のみを引き継ぎます
  • 後続のステップに影響しない実装の詳細は引き継ぎません
  • コンテキストの要約は簡潔に保ちます(1ステップあたり最大200語)

コンテキストサイズのガイドライン: 累積したコンテキストが約500語を超える場合は、以前のステップをより簡潔に要約します。詳細が必要な場合、サブエージェントはファイルを直接読み取れます。

コンテキスト累積の例(具体例):

## Completed Steps Summary

### Step 1: Define UserRepository Interface
- **What was done:** Created `src/repositories/UserRepository.ts` with interface definition
- **Key outputs:**
  - Interface: `IUserRepository` with methods: `findById`, `findByEmail`, `create`, `update`, `delete`
  - Types: `UserCreateInput`, `UserUpdateInput` in `src/types/user.ts`
- **Relevant for next steps:**
  - Implementation must fulfill `IUserRepository` interface
  - Use the defined input types for method signatures

### Step 2: Implement UserRepository
- **What was done:** Created `src/repositories/UserRepositoryImpl.ts` implementing `IUserRepository`
- **Key outputs:**
  - Class: `UserRepositoryImpl` with all interface methods implemented
  - Uses existing database connection from `src/db/connection.ts`
- **Relevant for next steps:**
  - Import repository from `src/repositories/UserRepositoryImpl`
  - Constructor requires `DatabaseConnection` injection
3.2 サブエージェントのプロンプト構成

各サブタスクについて、以下の必須要素を含むプロンプトを構成します。

3.2.1 ゼロショット・チェーン・オブ・ソートのプレフィックス(必須 — 必ず最初に記述)
## Reasoning Approach

Before taking any action, think through this subtask systematically.

Let's approach this step by step:

1. "Let me understand what was done in previous steps..."
   - What context am I building on?
   - What interfaces/patterns were established?
   - What constraints did previous steps introduce?

2. "Let me understand what this step requires..."
   - What is the specific objective?
   - What are the boundaries of this step?
   - What must I NOT change (preserve from previous steps)?

3. "Let me plan my approach..."
   - What specific modifications are needed?
   - What order should I make them?
   - What could go wrong?

4. "Let me verify my approach before implementing..."
   - Does my plan achieve the objective?
   - Am I consistent with previous steps' changes?
   - Is there a simpler way?

Work through each step explicitly before implementing.
3.2.2 タスク本文
<task>
{Subtask description}
</task>

<subtask_context>
Step {N} of {total_steps}: {subtask_name}
</subtask_context>

<previous_steps_context>
{Summary of relevant outputs from previous steps - ONLY if this is not the first step}
- Step 1: {what was done, key files modified, relevant decisions}
- Step 2: {what was done, key files modified, relevant decisions}
...
</previous_steps_context>

<constraints>
- Focus ONLY on this specific subtask
- Build upon (do not undo) changes from previous steps
- Follow existing code patterns and conventions
- Produce output that subsequent steps can build upon
</constraints>

<input>
{What this subtask receives - files, context, dependencies}
</input>

<output>
{Expected deliverable - modified files, new files, summary of changes}

CRITICAL: At the end of your work, provide a "Context for Next Steps" section with:
- Files modified (full paths)
- Key changes summary (3-5 bullet points)
- Any decisions that affect later steps
- Warnings or considerations for subsequent steps
</output>
3.2.3 セルフクリティークのサフィックス(必須 — 必ず最後に記述)
## Self-Critique Verification (MANDATORY)

Before completing, verify your work integrates properly with previous steps. Do not submit unverified changes.

### Verification Questions

Generate verification questions based on the subtask description and the previous steps context. Examples:

| # | Question | Evidence Required |
|---|----------|-------------------|
| 1 | Does my work build correctly on previous step outputs? | [Specific evidence] |
| 2 | Did I maintain consistency with established patterns/interfaces? | [Specific evidence] |
| 3 | Does my solution address ALL requirements for this step? | [Specific evidence] |
| 4 | Did I stay within my scope (not modifying unrelated code)? | [List any out-of-scope changes] |
| 5 | Is my output ready for the next step to build upon? | [Check against dependency graph] |

### Answer Each Question with Evidence

Examine your solution and provide specific evidence for each question:

[Q1] Previous Step Integration:
- Previous step output: [relevant context received]
- How I built upon it: [specific integration]
- Any conflicts: [resolved or flagged]

[Q2] Pattern Consistency:
- Patterns established: [list]
- How I followed them: [evidence]
- Any deviations: [justified or fixed]

[Q3] Requirement Completeness:
- Required: [what was asked]
- Delivered: [what you did]
- Gap analysis: [any gaps]

[Q4] Scope Adherence:
- In-scope changes: [list]
- Out-of-scope changes: [none, or justified]

[Q5] Output Readiness:
- What later steps need: [based on decomposition]
- What I provided: [specific outputs]
- Completeness: [HIGH/MEDIUM/LOW]

### Revise If Needed

If ANY verification question reveals a gap:
1. **FIX** - Address the specific gap identified
2. **RE-VERIFY** - Confirm the fix resolves the issue
3. **UPDATE** - Update the "Context for Next Steps" section

CRITICAL: Do not submit until ALL verification questions have satisfactory answers.
3.3 並列メタジャッジのディスパッチ

重要: 各ステップで、2つの Task ツール呼び出しを1つのメッセージ内で並列に実行し、メタジャッジと実装エージェントをディスパッチします。メタジャッジが実装エージェントによる変更前の成果物を確認できるよう、メッセージ内ではメタジャッジを最初のツール呼び出しにする必要があります。

両エージェントはフォアグラウンドエージェントとして実行します。ジャッジのディスパッチに進む前に、両方の完了を待ちます。

メタジャッジのプロンプト(ステップごと):

## Task

Generate an evaluation specification yaml for the following step. You will produce rubrics, checklists, and scoring criteria that a judge agent will use to evaluate the implementation artifact.

CLAUDE_PLUGIN_ROOT=`${CLAUDE_PLUGIN_ROOT}`

## User Prompt
{Original task description from user}

## Step Being Evaluated
Step {N}/{total}: {subtask_name}
{subtask_description}
- Input: {what this step receives}
- Expected output: {what this step should produce}

## Previous Steps Context
{Summary of what previous steps accomplished}

## Artifact Type
{code | documentation | configuration | etc.}

## Instructions
Return only the final evaluation specification YAML in your response.

ディスパッチの例

両方の Task ツール呼び出しを1つのメッセージ内に送信します。先にメタジャッジ、次に実装エージェントを指定します。

Message with 2 tool calls:
  Tool call 1 (meta-judge):
    - description: "Meta-judge Step {N}/{total}: {subtask_name}"
    - model: opus
    - subagent_type: "sadd:meta-judge"

  Tool call 2 (implementation):
    - description: "Step {N}/{total}: {subtask_name}"
    - model: {selected model}
    - subagent_type: "{selected agent type}"

ジャッジのディスパッチに進む前に、両方の応答を待ちます。

3.4 ジャッジ検証プロトコル

メタジャッジと実装エージェントの両方が完了した後、メタジャッジの評価仕様を用いてステップを検証する独立したジャッジをディスパッチします。

重要:メタジャッジの評価仕様 YAML をそのままジャッジに渡してください。省略や追加をせず、いかなる方法でも変更せず、テキストを短縮したり要約したりしないでください。

3.4.1 既存の変更セクションを分析する

各ステップでジャッジを実行する前に、ジャッジが把握しておく必要のある既存のコードベースの変更があるかどうかを評価します。「既存の変更」セクションは、以前の変更を現在のステップの実装エージェントによる作業とジャッジが混同しないようにするためのものです。

含める場合:

  • 同じ do-in-steps の実行における前のステップの変更(ステップ N を判定する場合、ステップ 1~N-1) — 順次実行で最もよくあるケースです。ステップ N を実行するとき、ステップ 1~N-1 の変更を既存の変更としてジャッジに必ず伝える必要があります。完了した各ステップの出力(作成・変更されたファイル、主な変更内容)は、後続のステップを判定するジャッジにとって既存のコンテキストになります。
  • 同じセッション内で以前に完了した do-in-steps または do-and-judge タスクの実行
  • スキルの実行前にユーザーが手動で行った変更(会話のコンテキストまたは git で確認できるもの)
  • このタスクの前に実行された他のツールやエージェントによる変更

省略する場合:

  • これがステップ 1 で、把握している以前の変更がない場合(以前のセッションタスクやユーザーによる変更がない場合) — セクション全体を省略します
  • 同じステップ内で再試行する場合、実装エージェント自身による前回の試行を「既存の変更」として含めないでください。これらは現在のステップの反復サイクルの一部です

内容のガイドライン:

  • 概要レベルでまとめます。タスクの説明、影響を受けるファイルやモジュールの一覧、変更の概要(作成、変更、削除)を記載します
  • コードブロック、差分、行単位の詳細は含めず、簡潔にまとめてください
  • 各変更元を明確に示します。「ステップ 1:{説明}」「ステップ 2:{説明}」「ユーザーによる変更(現在のタスクの前)」など
  • 既存の変更元が複数ある場合は、完了したステップごと、ならびに外部の変更元ごとに個別のサブセクションを使用します
  • Context Passing Protocol の出力(セクション 3.1)を活用します。「Completed Steps Summary」には、各ステップで生成された内容がすでに記録されています

重要:コードベース全体や git の履歴を読み込むのは避け、概要レベルの git diff/status のみを使って変更されたファイルを特定するか、会話のコンテキストや完了済みステップの要約を参照して既存の変更を判断してください。

ステップのジャッジ用プロンプトテンプレート:

You are evaluating Step {N}/{total}: {subtask_name} against an evaluation specification produced by the meta judge.

CLAUDE_PLUGIN_ROOT=`${CLAUDE_PLUGIN_ROOT}`

## Original Task
{overall_task_description}

## Step Requirements
{subtask_description}
- Input: {what this step receives}
- Expected output: {what this step should produce}

## Previous Steps Context
{Summary of what previous steps accomplished}

{IF pre-existing changes are known (previous steps, prior tasks, or user modifications), include the following section — otherwise omit entirely}

## Pre-existing Changes (Context Only)

The following changes were made BEFORE the current step's implementation agent started working. They are NOT part of the current step's output. Focus your evaluation on the current step's changes. Only verify pre-existing changed files/logic if they directly relate to the current step's requirements.

### {Source of changes: e.g., "Step 1: {step description}" or "Previous Task: {task description}" or "User modifications (before current task)"}
{High-level summary: what was done, which files/modules were created or modified}

### {Additional source if applicable}
{High-level summary}

{END conditional section}

## Evaluation Specification

```yaml
{meta-judge's evaluation specification YAML}

実装の出力

{実装エージェントによって変更されたファイルのパス} {実装エージェントからの Context for Next Steps セクション}

指示

エージェントの指示で定義されているジャッジの全プロセスに従ってください!

出力

重要:応答の冒頭には、必ず以下の正確な形式の評価レポートを YAML で記載してください!


CRITICAL: NEVER provide score threshold, in any format, including `threshold_pass` or anything different. Judge MUST not know what threshold for score is, in order to not be biased!!!

**Dispatch:**

Task ツールを使用:

  • description: "判定ステップ {N}/{total}:{subtask_name}"
  • prompt: {正確なメタ判定仕様 YAML と、該当する場合は既存の変更セクションを含む判定プロンプト}
  • model: opus
  • subagent_type: "sadd:judge"

#### 3.5 Dispatch, Verify, and Iterate

For each subtask in sequence:

  1. メタ判定エージェントと実装エージェントを並列でディスパッチします(1つのメッセージで2つのツール呼び出し)。 ツール呼び出し 1(メタ判定 — 必ず最初): Task ツールを使用: - description: "メタ判定ステップ {N}/{total}:{subtask_name}" - prompt: {ステップ要件とコンテキストを含むメタ判定プロンプト} - model: opus - subagent_type: "sadd:meta-judge"

    ツール呼び出し 2(実装): Task ツールを使用: - description: "ステップ {N}/{total}:{subtask_name}" - prompt: {CoT + タスク + 以前のコンテキスト + 自己批評を含む構成済みプロンプト} - model: {このサブタスクで選択したモデル} - subagent_type: "{選択したエージェントの種類}"

  2. 両方の完了を待ちます。出力を収集します:

    • メタ判定エージェントから:評価仕様 YAML を抽出します
    • 実装エージェントから:「次のステップへのコンテキスト」セクションを解析し、変更されたファイルを記録します
  3. このステップのメタ判定仕様を使って、判定サブエージェントをディスパッチします: Task ツールを使用:

    • description: "判定ステップ {N}/{total}:{subtask_name}"
    • prompt: {ステップ要件、実装の出力、メタ判定仕様 YAML を含む検証用判定プロンプト}
    • model: opus
    • subagent_type: "sadd:judge"
  4. 判定結果を解析します(レポート全文は読まないでください): 判定エージェントの応答から以下を抽出します:

    • VERDICT:PASS または FAIL
    • SCORE:X.X/5.0
    • ISSUES:問題の一覧(ある場合)
    • IMPROVEMENTS:改善案の一覧(ある場合)
  5. 判定結果に基づいて決定します:

    スコアが 4.0 以上の場合: → VERDICT:PASS → 蓄積したコンテキストを使って次のステップに進みます → 改善案は任意の拡張としてコンテキストに含めます

    スコアが 3.0 以上で、検出されたすべての問題の優先度が低い場合: → VERDICT:PASS → 蓄積したコンテキストを使って次のステップに進みます → 改善案は任意の拡張としてコンテキストに含めます

    スコアが 4.0 未満の場合: → VERDICT:FAIL → このステップの再試行回数を確認します

    再試行回数が 3 回未満の場合: → 次の情報を含めて、実装エージェントに再試行を指示します: - 元のステップ要件 - 判定エージェントの ISSUES 一覧(フィードバックとして) - 詳細確認用の判定レポートのパス - 特定された問題を修正する指示 → このステップと同じメタ判定仕様を使って、判定検証に戻ります → 再試行ではメタ判定を再実行しないでください

    再試行回数が 3 回以上の場合: → ユーザーにエスカレーションします(エラー処理を参照) → 次のステップには進まないでください

  6. 累積したコンテキストを引き継いで、次のサブタスクに進みます → 次のステップでは、新しいメタ判定を実装エージェントと並列でディスパッチします


**Retry prompt template for implementation agent:**

```markdown
## Retry Required: Step {N}/{total}

Your previous implementation did not pass judge verification.

<original_requirements>
{subtask_description}
</original_requirements>

<judge_feedback>
VERDICT: FAIL
SCORE: {score}/5.0
ISSUES:
{list of issues from judge}

Full report available at: {path_to_judge_report}
</judge_feedback>

<your_previous_output>
{files modified in previous attempt}
</your_previous_output>

Instructions:
Let's fix the identified issues step by step.

1. First, review each issue the judge identified
2. For each issue, determine the root cause
3. Plan the fix for each issue
4. Implement ALL fixes
5. Verify your fixes address each issue
6. Provide updated "Context for Next Steps" section

CRITICAL: Focus on fixing the specific issues identified. Do not rewrite everything.
フェーズ 4:最終要約とレポート

すべてのサブタスクが完了し、検証に合格した後、包括的なレポートを返信します:

## Sequential Execution Summary

**Overall Task:** {original task description}
**Total Steps:** {count}
**Total Agents:** {meta_judges(one per step) + implementation_agents + judge_agents + retry_agents}

### Step-by-Step Results

| Step | Subtask | Model | Judge Score | Retries | Status |
|------|---------|-------|-------------|---------|--------|
| 1 | {name} | {model} | {X.X}/5.0 | {0-3} | PASS |
| 2 | {name} | {model} | {X.X}/5.0 | {0-3} | PASS |
| ... | ... | ... | ... | ... | ... |

### Files Modified (All Steps)
- {file1}: {what changed, which step}
- {file2}: {what changed, which step}
...

### Key Decisions Made
- Step 1: {decision and rationale}
- Step 2: {decision and rationale}
...

### Integration Points
{How the steps connected and built upon each other}

### Judge Verification Summary
| Step | Initial Score | Final Score | Issues Fixed |
|------|---------------|-------------|--------------|
| 1 | {X.X} | {X.X} | {count or "None"} |
| 2 | {X.X} | {X.X} | {count or "None"} |

### Meta-Judge Specifications
One evaluation specification generated per step (in parallel with implementation), reused across retries within each step.


### Follow-up Recommendations
{Any improvements suggested by judges, tests to run, or manual verification needed}

エラー処理

判定検証に失敗した場合(スコアが 4.0 未満)

判定による反復ループで、ほとんどの失敗は自動的に処理されます:

Judge FAIL (Retry Available):
  1. Parse ISSUES from judge verdict
  2. Dispatch retry implementation agent with feedback
  3. Re-verify with judge (using same step's meta-judge specification — do NOT re-run meta-judge)
  4. Repeat until PASS or max retries (3)
最大再試行回数を経てもステップに失敗する場合

ステップが判定検証に 3 回失敗した場合:

  1. 停止 - 破綻した基盤のまま先に進まないでください
  2. 報告 - 次の失敗分析を提示します:
    • 元のステップ要件
    • すべての判定結果とスコア
    • 再試行を通じて解消されなかった問題
  3. エスカレーション - 次の選択肢をユーザーに提示します:
    • 再試行に向けて追加のコンテキストやガイダンスを提供する
    • ステップ要件を変更する
    • ステップをスキップする(任意の場合)
    • 中止して、部分的な進捗を報告する
  4. 待機 - ユーザーの判断なしに先に進まないでください

エスカレーションレポートの形式:

## Step {N} Failed Verification (Max Retries Exceeded)

### Step Requirements
{subtask_description}

### Verification History
| Attempt | Score | Key Issues |
|---------|-------|------------|
| 1 | {X.X}/5.0 | {issues} |
| 2 | {X.X}/5.0 | {issues} |
| 3 | {X.X}/5.0 | {issues} |
| 4 | {X.X}/5.0 | {issues} |

### Persistent Issues
{Issues that appeared in multiple attempts}

### Judge Reports
- .specs/reports/{task-name}-step-{N}-attempt-1.md
- .specs/reports/{task-name}-step-{N}-attempt-2.md
- .specs/reports/{task-name}-step-{N}-attempt-3.md
- .specs/reports/{task-name}-step-{N}-attempt-4.md

### Options
1. **Provide guidance** - Give additional context for another retry
2. **Modify requirements** - Simplify or clarify step requirements
3. **Skip step** - Mark as skipped and continue (if non-critical)
4. **Abort** - Stop execution and preserve partial progress

Awaiting your decision...

次のことは決してしないでください:

  • 最大再試行回数を経て失敗したステップを越えて続行する
  • 「時間を節約する」ために判定検証をスキップする
  • 再試行を通じて解消されなかった問題を無視する
  • 何がうまくいった可能性があるかを推測する
コンテキストが欠落している場合
  1. 推測しない — 前のステップが何を生成したかを推測してはいけません
  2. 再確認する — 欠落している情報がないか、前のステップの出力を再確認します
  3. ジャッジレポートを確認する — 欠落している要素が記録されている可能性があります
  4. 必要に応じて明確化サブエージェントを派遣する — 欠落しているコンテキストを抽出するため
  5. コンテキストの受け渡しを更新する — 今後の類似タスクのために
ステップが競合する場合
  1. 実行を停止する — 競合が発生した時点で
  2. 分析する: 分解が不適切だったか? ステップは実際に依存関係にあるか?
  3. ジャッジのフィードバックを確認する — 統合の問題が指摘されている可能性があります
  4. 選択肢:
    • 依存関係が見落とされていた場合はステップを並べ替える
    • 競合するステップを 1 つに統合する
    • 競合するステップの間に調整ステップを追加する

例

例 1: 互いに積み重なる逐次ステップ (前のステップからの既存の変更)

入力:

/do-in-steps implement user management feature

フェーズ 1 - 分解:

ステップサブタスク依存先複雑さ種類出力
1User モデルとデータベーススキーマを作成する-中実装User モデル、マイグレーションファイル
2ユーザー向けの CRUD エンドポイントを追加するステップ 1中実装REST API ルート、コントローラー
3認証統合を追加するステップ 1、2高実装認証ミドルウェア、JWT 処理

フェーズ 3 - 既存の変更の累積を伴う実行:

Step 1: Create User model and database schema
  Parallel dispatch: Meta-judge + Implementation
  Judge Verification (with step 1 meta-judge spec):
    NOTE: No pre-existing changes — this is step 1 with no prior session tasks.
    The "Pre-existing Changes" section is OMITTED from the judge prompt.

    Judge prompt sent:
    ┌─────────────────────────────────────────────────────────
    │ You are evaluating Step 1/3: Create User model and
    │ database schema against an evaluation specification
    │ produced by the meta judge.
    │
    │ CLAUDE_PLUGIN_ROOT=...
    │
    │ ## Original Task
    │ Implement user management feature
    │
    │ ## Step Requirements
    │ Create User model and database schema with proper
    │ fields and relationships.
    │
    │ ## Previous Steps Context
    │ None (first step)
    │
    │ ## Evaluation Specification
    │ ```yaml
    │ {meta-judge's evaluation specification YAML}
    │ ```
    │
    │ ## Implementation Output
    │ Files: src/models/User.ts (new), migrations/001_create_users.ts (new)
    │ Key changes: Created User model with id, email, name, passwordHash...
    │
    │ ## Instructions
    │ Follow your full judge process...
    └─────────────────────────────────────────────────────────

  → VERDICT: PASS, SCORE: 4.2/5.0
  → Context passed forward: User model fields, migration file paths

Step 2: Add CRUD endpoints for users
  Parallel dispatch: Meta-judge + Implementation
  Judge Verification (with step 2 meta-judge spec):
    NOTE: Pre-existing changes detected — Step 1 created the User model.
    Include "Pre-existing Changes" section so the judge does not confuse
    Step 1's files with Step 2's implementation work.

    Judge prompt sent:
    ┌─────────────────────────────────────────────────────────
    │ You are evaluating Step 2/3: Add CRUD endpoints for
    │ users against an evaluation specification produced by
    │ the meta judge.
    │
    │ CLAUDE_PLUGIN_ROOT=...
    │
    │ ## Original Task
    │ Implement user management feature
    │
    │ ## Step Requirements
    │ Add CRUD endpoints (create, read, update, delete) for
    │ user management with proper validation and error handling.
    │
    │ ## Previous Steps Context
    │ Step 1 created User model with fields: id, email, name,
    │ passwordHash, createdAt, updatedAt.
    │
    │ ## Pre-existing Changes (Context Only)
    │
    │ The following changes were made BEFORE the current
    │ step's implementation agent started working. They are
    │ NOT part of the current step's output. Focus your
    │ evaluation on the current step's changes. Only verify
    │ pre-existing changed files/logic if they directly
    │ relate to the current step's requirements.
    │
    │ ### Step 1: "Create User model and database schema"
    │ The following files were created as part of Step 1:
    │ - src/models/User.ts (new) - User model with fields:
    │   id, email, name, passwordHash, createdAt, updatedAt
    │ - migrations/001_create_users.ts (new) - Database
    │   migration for users table
    │
    │ These files exist in the codebase and may be referenced
    │ by the current step, but evaluate only the changes made
    │ by Step 2's implementation agent.
    │
    │ ## Evaluation Specification
    │ ```yaml
    │ {meta-judge's evaluation specification YAML}
    │ ```
    │
    │ ## Implementation Output
    │ Files: src/controllers/UserController.ts (new),
    │        src/routes/users.ts (new), src/app.ts (modified)
    │ Key changes: Added REST endpoints for user CRUD...
    │
    │ ## Instructions
    │ Follow your full judge process...
    └─────────────────────────────────────────────────────────

  → VERDICT: PASS, SCORE: 4.4/5.0
  → Context passed forward: API routes, controller patterns

Step 3: Add authentication integration
  Parallel dispatch: Meta-judge + Implementation
  Judge Verification (with step 3 meta-judge spec):
    NOTE: Pre-existing changes include BOTH Step 1 AND Step 2.
    The judge needs to know about all prior steps' output.

    Judge prompt sent:
    ┌─────────────────────────────────────────────────────────
    │ You are evaluating Step 3/3: Add authentication
    │ integration against an evaluation specification
    │ produced by the meta judge.
    │
    │ CLAUDE_PLUGIN_ROOT=...
    │
    │ ## Original Task
    │ Implement user management feature
    │
    │ ## Step Requirements
    │ Add JWT-based authentication with login/register
    │ endpoints and middleware for protecting user routes.
    │
    │ ## Previous Steps Context
    │ Step 1 created User model. Step 2 added CRUD endpoints
    │ at /api/users with UserController.
    │
    │ ## Pre-existing Changes (Context Only)
    │
    │ The following changes were made BEFORE the current
    │ step's implementation agent started working. They are
    │ NOT part of the current step's output. Focus your
    │ evaluation on the current step's changes. Only verify
    │ pre-existing changed files/logic if they directly
    │ relate to the current step's requirements.
    │
    │ ### Step 1: "Create User model and database schema"
    │ - src/models/User.ts (new) - User model with fields:
    │   id, email, name, passwordHash, createdAt, updatedAt
    │ - migrations/001_create_users.ts (new) - Database
    │   migration for users table
    │
    │ ### Step 2: "Add CRUD endpoints for users"
    │ - src/controllers/UserController.ts (new) - REST
    │   controller with create, read, update, delete handlers
    │ - src/routes/users.ts (new) - Express router for
    │   /api/users endpoints
    │ - src/app.ts (modified) - Registered user routes
    │
    │ These files exist in the codebase and may be modified
    │ by the current step, but evaluate only the changes made
    │ by Step 3's implementation agent.
    │
    │ ## Evaluation Specification
    │ ```yaml
    │ {meta-judge's evaluation specification YAML}
    │ ```
    │
    │ ## Implementation Output
    │ Files: src/auth/AuthMiddleware.ts (new),
    │        src/routes/auth.ts (new), src/app.ts (modified),
    │        src/routes/users.ts (modified)
    │ Key changes: Added JWT auth with login/register...
    │
    │ ## Instructions
    │ Follow your full judge process...
    └─────────────────────────────────────────────────────────

  → VERDICT: PASS, SCORE: 4.1/5.0

最終サマリー:

  • エージェント総数: 10 (メタジャッジ 3 + 実装 3 + リトライ 0 + ジャッジ 3)
  • 既存の変更の推移:
    • ステップ 1 のジャッジ: なし
    • ステップ 2 のジャッジ: ステップ 1 の出力 (2 ファイル)
    • ステップ 3 のジャッジ: ステップ 1+2 の出力 (5 ファイル)
  • すべてのジャッジスコア: 4.2、4.4、4.1

例 2: ユーザーが変更したコードベース + 逐次ステップ (既存の変更の発生源が混在)

シナリオ:

ユーザーは会話中に決済処理モジュールに取り組んでいました。do-in-steps を呼び出す前に、いくつかのファイルを変更しました (新しい PaymentGateway インターフェースの追加、設定の更新)。

入力:

/do-in-steps fix and improve payment processing

フェーズ 1 - 分解:

ステップサブタスク依存先複雑さ種類出力
1決済バリデーションのバグを修正する-中バグ修正修正されたバリデーションロジック
2失敗した決済のリトライロジックを追加するステップ 1高実装バックオフ付きリトライ機構

フェーズ 3 - 既存の変更が混在した状態での実行:

Step 1: Fix payment validation bugs
  Parallel dispatch: Meta-judge + Implementation
  Judge Verification (with step 1 meta-judge spec):
    NOTE: Pre-existing changes detected from USER modifications.
    The user modified payment files before this task — include those
    so the judge focuses only on the bug fix, not the user's prior work.

    Judge prompt sent:
    ┌─────────────────────────────────────────────────────────
    │ You are evaluating Step 1/2: Fix payment validation
    │ bugs against an evaluation specification produced by
    │ the meta judge.
    │
    │ CLAUDE_PLUGIN_ROOT=...
    │
    │ ## Original Task
    │ Fix and improve payment processing
    │
    │ ## Step Requirements
    │ Fix validation bugs in payment amount and currency
    │ checks that allow invalid transactions to proceed.
    │
    │ ## Previous Steps Context
    │ None (first step)
    │
    │ ## Pre-existing Changes (Context Only)
    │
    │ The following changes were made BEFORE the current
    │ step's implementation agent started working. They are
    │ NOT part of the current step's output. Focus your
    │ evaluation on the current step's changes. Only verify
    │ pre-existing changed files/logic if they directly
    │ relate to the current step's requirements.
    │
    │ ### User modifications (before current task)
    │ The user made changes to the following files/modules
    │ before this task was started:
    │ - src/payments/PaymentGateway.ts (new) - Payment
    │   gateway interface definition
    │ - src/payments/StripeAdapter.ts (modified) - Updated
    │   to implement new PaymentGateway interface
    │ - src/config/payment.config.ts (modified) - Added
    │   gateway configuration settings
    │
    │ The current task focuses on fixing validation bugs.
    │ Pre-existing changes to payment files may overlap with
    │ the current step's scope — evaluate whether the
    │ implementation agent's changes correctly fix the bugs
    │ without breaking the pre-existing modifications.
    │
    │ ## Evaluation Specification
    │ ```yaml
    │ {meta-judge's evaluation specification YAML}
    │ ```
    │
    │ ## Implementation Output
    │ Files: src/payments/PaymentValidator.ts (modified),
    │        tests/payments/PaymentValidator.test.ts (modified)
    │ Key changes: Fixed amount validation to reject negative
    │ values, added currency code format check...
    │
    │ ## Instructions
    │ Follow your full judge process...
    └─────────────────────────────────────────────────────────

  → VERDICT: PASS, SCORE: 4.3/5.0
  → Context passed forward: Validation fixes, affected files

Step 2: Add retry logic for failed payments
  Parallel dispatch: Meta-judge + Implementation
  Judge Verification (with step 2 meta-judge spec):
    NOTE: Pre-existing changes now include BOTH the user's modifications
    AND Step 1's output. The judge needs both sources to correctly
    attribute changes.

    Judge prompt sent:
    ┌─────────────────────────────────────────────────────────
    │ You are evaluating Step 2/2: Add retry logic for failed
    │ payments against an evaluation specification produced by
    │ the meta judge.
    │
    │ CLAUDE_PLUGIN_ROOT=...
    │
    │ ## Original Task
    │ Fix and improve payment processing
    │
    │ ## Step Requirements
    │ Add retry mechanism with exponential backoff for failed
    │ payment transactions, with configurable max retries.
    │
    │ ## Previous Steps Context
    │ Step 1 fixed payment validation bugs in
    │ PaymentValidator.ts (amount and currency checks).
    │
    │ ## Pre-existing Changes (Context Only)
    │
    │ The following changes were made BEFORE the current
    │ step's implementation agent started working. They are
    │ NOT part of the current step's output. Focus your
    │ evaluation on the current step's changes. Only verify
    │ pre-existing changed files/logic if they directly
    │ relate to the current step's requirements.
    │
    │ ### User modifications (before current task)
    │ - src/payments/PaymentGateway.ts (new) - Payment
    │   gateway interface definition
    │ - src/payments/StripeAdapter.ts (modified) - Updated
    │   to implement new PaymentGateway interface
    │ - src/config/payment.config.ts (modified) - Added
    │   gateway configuration settings
    │
    │ ### Step 1: "Fix payment validation bugs"
    │ - src/payments/PaymentValidator.ts (modified) - Fixed
    │   amount validation and currency code format checks
    │ - tests/payments/PaymentValidator.test.ts (modified) -
    │   Added regression tests for validation fixes
    │
    │ These files exist in the codebase and may be modified
    │ by the current step, but evaluate only the changes made
    │ by Step 2's implementation agent.
    │
    │ ## Evaluation Specification
    │ ```yaml
    │ {meta-judge's evaluation specification YAML}
    │ ```
    │
    │ ## Implementation Output
    │ Files: src/payments/PaymentRetryService.ts (new),
    │        src/payments/StripeAdapter.ts (modified),
    │        src/config/payment.config.ts (modified),
    │        tests/payments/PaymentRetryService.test.ts (new)
    │ Key changes: Added PaymentRetryService with exponential
    │ backoff, integrated into StripeAdapter...
    │
    │ ## Instructions
    │ Follow your full judge process...
    └─────────────────────────────────────────────────────────

  → VERDICT: PASS, SCORE: 4.5/5.0

最終サマリー:

  • エージェント総数: 7 (メタジャッジ 2 + 実装 2 + リトライ 0 + ジャッジ 2)
  • 既存の変更の推移:
    • ステップ 1 のジャッジ: ユーザーの変更 (3 ファイル)
    • ステップ 2 のジャッジ: ユーザーの変更 (3 ファイル) + ステップ 1 の出力 (2 ファイル)
  • すべてのジャッジスコア: 4.3、4.5

例 3: エスカレーションを伴う複数ファイルのリファクタリング

入力:

/do-in-steps Rename 'userId' to 'accountId' across the codebase - this affects interfaces, implementations, and callers

フェーズ 1 - 分解:

ステップサブタスク依存先複雑さ種類出力
1インターフェース定義を更新する-高リファクタリング更新されたインターフェース
2それらのインターフェースの実装を更新するステップ 1低リファクタリング更新された実装
3呼び出し元と利用側を更新するステップ 2低リファクタリング更新された呼び出し元ファイル
4テストを更新するステップ 3低テスト更新されたテストファイル
5ドキュメントを更新するステップ 4低ドキュメント更新されたドキュメント

フェーズ 2 - モデル選択:

ステップサブタスクモデル根拠
1インターフェースを更新するopus破壊的変更には慎重な対応が必要
2実装を更新するhaiku機械的な名前変更
3呼び出し元を更新するhaiku機械的な更新
4テストを更新するhaiku機械的なテスト修正
5ドキュメントを更新するhaiku単純なテキスト更新

フェーズ 3 - エスカレーションを伴う実行 (各ステップに並列のメタジャッジ + 実装):

Step 1: Update interfaces
  Parallel dispatch: Meta-judge + Implementation
  → Judge (Opus, sadd:judge, with step 1 meta-judge spec): PASS, 4.3/5.0

Step 2: Update implementations
  Parallel dispatch: Meta-judge + Implementation
  → Judge (Opus, sadd:judge, with step 2 meta-judge spec): PASS, 4.0/5.0

Step 3: Update callers (Problem Detected)
  Parallel dispatch: Meta-judge + Implementation
  Attempt 1: Judge FAIL, 2.5/5.0 (using step 3 meta-judge spec)
    → ISSUES: Missed 12 occurrences in legacy module
  Attempt 2: Judge FAIL, 2.8/5.0 (reusing same step 3 meta-judge spec)
    → ISSUES: Still missing 4 occurrences, found new deprecated API usage
  Attempt 3: Judge FAIL, 3.2/5.0 (reusing same step 3 meta-judge spec)
    → ISSUES: 2 occurrences in dynamically generated code
  Attempt 4: Judge FAIL, 3.3/5.0 (reusing same step 3 meta-judge spec)
    → ISSUES: Dynamic code generation still not fully addressed

  ESCALATION TO USER:
  "Step 3 failed after 4 attempts. Persistent issue: Dynamic code generation
   in LegacyAdapter.ts generates 'userId' at runtime.
   Options: 1) Provide guidance, 2) Modify requirements, 3) Skip, 4) Abort"

  User response: "Update LegacyAdapter to use string template with accountId"

  Attempt 5 (with user guidance, reusing same step 3 meta-judge spec): Judge PASS, 4.1/5.0

Step 4-5: Each with parallel meta-judge + implementation, complete without issues

エージェント総数: 20 (メタジャッジ 5 + 実装 5 + リトライ 5 + ジャッジ 5)


ベストプラクティス

タスクの分解
  • 明確にする: 各サブタスクには、明確で検証可能な成果を設定します
  • 検証ポイントを定義する: 各ステップで判定者が確認すべきことを定めます
  • ステップ数を最小限にする: 関連する作業をまとめ、過度な細分化は避けます
  • 依存関係を検証する: 各ステップに、前のステップから必要なものが引き継がれていることを確認します
  • コンテキストを計画する: ステップ間で引き継ぐ必要があるコンテキストを特定します
モデルの選択
  • 複雑さに合わせる: 簡単な変換に Opus は使いません
  • リスクに応じて上位モデルを選ぶ: 最初のステップと重要なステップには、より高性能なモデルを使います
  • 連鎖的な影響を考慮する: 初期段階のエラーは後続に波及するため、早い段階で品質を高めます
  • 迷ったら Opus を使う: 依存関係のあるステップでは、コストより品質を優先します
ステップの種類実装モデル
重要/破壊的Opus
標準Opus
長くて簡単Sonnet
簡単で短いHaiku
コンテキストの引き継ぎに関するガイドライン
シナリオ渡すもの省くもの
ステップ1でインターフェースを定義インターフェースの完全な定義実装の詳細
ステップ2で実装主要なパターン、ファイルの場所内部ロジック
ステップ3で統合使用パターン、エントリーポイントステップ2の内部詳細
再試行時の判定者からのフィードバックISSUES リスト、レポートのパスレポートの全文

コンテキストを絞り込みます:

  • 次のステップが作業を進めるうえで必要なものを渡します
  • 後続のステップに影響しない内部の詳細は省きます
  • 一貫性を保つためのパターンや規約を明示します
  • 判定者による IMPROVEMENTS は任意の改善点として含めます
  • 既存の変更を追跡します - 以前の変更(前のステップを含む)に関するコンテキストを判定者に渡し、誤った帰属を防ぎます
メタ判定者と判定者による検証
  • メタ判定者を省略しないでください - 個別に調整した評価基準は、汎用的なものより適切な判定につながります
  • ステップごとにメタ判定者を1つ用意します - 各ステップでは、実装と並行して専用のメタ判定者を起動します
  • 同じステップの再試行ではメタ判定者の仕様を再利用します - 再試行時には、そのステップのメタ判定者の仕様を再利用し、メタ判定者を再実行しないでください
  • 新しいステップごとに新しいメタ判定者を用意します - ステップごとに要件が異なるため、その都度新しいメタ判定者を用意します
  • 並列ディスパッチではメタ判定者を最初にします - メッセージ内で常に最初のツール呼び出しにしてください
  • 判定者の出力からはヘッダーだけを解析します - コンテキストの汚染を避けるため、レポート全文は読みません
  • CLAUDE_PLUGIN_ROOT を含めます - メタ判定者と判定者の両方に、解決済みのプラグインルートパスが必要です
  • メタ判定者の YAML - メタ判定者の YAML のみを判定者に渡し、追加のテキストやコメントは加えないでください!
  • 自己批評の後: 判定者は、すでに内部検証に合格した作業をレビューします
  • 独立した検証: 判定者は実装者とは別のエージェントにします
  • 構造化された出力: レポート全体ではなく、返信から VERDICT/SCORE を必ず解析します
  • 最大再試行回数: ユーザーにエスカレーションする前に、3回まで試行します
  • フィードバックループ: 再試行する実装エージェントに、判定者の ISSUES を渡します
  • 再試行時は、同じステップのメタ判定者の仕様を使って判定者による検証に戻ります
品質保証
  • 二層の検証: 自己批評(内部)+判定者(外部)
  • 最初に自己批評: 実装エージェントは提出前に自分の作業を検証します
  • 次に外部の判定者: 独立した判定者が、自己批評で見落とした盲点を確認します
  • 反復ループ: 合格するか再試行回数の上限に達するまで、フィードバックを受けて再試行します
  • 連鎖の検証: 判定者は、前のステップとの統合を確認します
  • エスカレーション: 不合格のステップを先に進めず、ユーザーに判断を求めます
  • 最終統合テスト: すべてのステップが完了したら、変更全体が連携して機能することを確認します

コンテキスト形式のリファレンス

実装エージェントの出力形式
## Context for Next Steps

### Files Modified
- `src/dto/UserDTO.ts` (new file)
- `src/services/UserService.ts` (modified)

### Key Changes Summary
- Created UserDTO with fields: id (string), name (string), email (string), createdAt (Date)
- UserDTO includes static `fromUser(user: User): UserDTO` factory method
- Added `toDTO()` method to User class for convenience

### Decisions That Affect Later Steps
- Used class-based DTO (not interface) to enable transformation methods
- Opted for explicit mapping over automatic serialization for better control

### Warnings for Subsequent Steps
- UserDTO does NOT include password field - ensure no downstream code expects it
- The `createdAt` field is formatted as ISO string in JSON serialization

### Verification Points
- TypeScript compiles without errors
- UserDTO.fromUser() correctly maps all User properties
- Existing service tests still pass
判定者の判定形式(構造化ヘッダー)
---
VERDICT: PASS
SCORE: 4.2/5.0
ISSUES:
  - None
IMPROVEMENTS:
  - Consider adding input validation to fromUser() method
  - Add JSDoc comments for better IDE support
---

## Detailed Evaluation
[Evidence and analysis following meta-judge specification rubrics...]
ジャッジ判定フォーマット(失敗例)
---
VERDICT: FAIL
SCORE: 2.8/5.0
ISSUES:
  - Missing User->UserDTO mapping logic in getUser() method
  - Return type annotation changed but actual return value still returns User object
  - No null handling for optional User fields
IMPROVEMENTS:
  - Add static fromUser() factory method to UserDTO
  - Implement toDTO() as instance method on User class
---

重要な洞察: 依存関係のある複雑なタスクでは、各ステップを新しいコンテキストで実行し、前のステップから関連する出力のみを受け取る逐次実行が効果的です。ステップごとのメタジャッジ評価仕様により、各ステップの要件に合わせた評価基準を設定し、実装と並行して実行することで高速化できます。外部ジャッジによる検証は、自己批評では見逃される盲点を発見します。また、反復ループ(同じステップのメタジャッジ仕様を再利用する)により、次へ進む前に品質を確保できます。これにより、コンテキストの汚染とエラーの伝播をどちらも防止できます。

コメント