task-research reference
task-research は、Issue 作成、既存 Issue 実装、Issue なし local plan 実装の前に read-only 調査を行い、下流 skill が再利用できる research packet を作る入口である。
Issue 作成、コード編集、commit、push、PR 作成、review 対応は行わない。
詳細 schema は task-research contract と claude/skills/task-research/SKILL.md を source of truth とし、この文書は利用者向けの引数早見表として扱う。
通常経路
target=とresearch=で調査対象と深度を決める。- コードや docs を read-only で調べ、
research-plan.json、research-packet.json、research-brief.mdを作る。 - 既存 packet を使う場合は validator で整合性と凍結済みのユーザー判断を確認する。
handoff=...を指定した場合も下流 skill は起動せず、次に実行する resume command だけをhandoff.jsonに残す。
未指定の出力先は repo identity scoped user state root 配下の repositories/<repo-key>/artifacts/task-research/<id> である。out=<dir> を明示した場合はその directory を使い、既存の tmp/task-research/<id> は legacy fallback 候補として読むだけで、自動移動や削除はしない。
停止と復旧
- high-impact な未確定事項が残る場合は
/grill-me research-packet=<path>で interview に戻すか、現在の会話でユーザー判断を記録する。 research-mode=parallelの worker が unavailable または timeout になった場合は成功扱いにしない。原因を解消して再実行するか、利用者が実行方式を選び直す。- 既存 packet が invalid または stale の場合は
task-research validateの結果に従い、packet の修正か再調査へ戻る。 blocked_optionsが残る handoff は成功ではない。渡し先が消費できる option に直して resume command を作り直す。
利用者が選ぶのは、調査深度、single / parallel の実行方式、handoff 先、出力先である。
research depth
| 引数 | 動作 |
|---|---|
research=auto |
要求と一次情報から light / standard / deep / spike を解決する。未指定 default |
research=off |
research packet を作らない |
research=light |
対象が明確で、公開 API / 設定形式 / データ形式 / UX 変更がない調査 |
research=standard |
複数 file や既存 contract に触るが repo 境界が増えない調査 |
research=deep |
skill contract、公開 API、設定形式、UX、複数 docs/tests に影響する調査 |
research=spike |
acceptance を定義する一次情報が足りない場合の調査 |
research=auto は research-plan.json に resolved_depth、reasons、required_outputs を残す。
深度は local reviewer 用 agents=、GitHub reviewer / trigger selector の reviewers=、validation 用 agent= とは別の概念である。
research mode
| 引数 | 動作 |
|---|---|
research-mode=single |
単一 context で調査する。未指定 default |
research-mode=parallel |
read-only worker を複数起動し、観点別 report と worker 数の解決理由を research-workers.json に分けて保存してから packet へ集約する |
research-mode= は実行方式であり、research= の調査深度とは別の概念である。research=deep は高度な調査深度を表すが、それだけで parallel worker 実行を意味しない。
research-mode=parallel を推奨するのは research=deep の時だけである。light / standard / spike では、ユーザー明示または上位 workflow の理由がある場合だけ使う。
research-mode=parallel の worker 数も固定値ではない。明示指定がなければ resolved_depth に応じて light=1、standard=2、spike=1、deep=必要な観点数に応じて 3 以上 に解決し、research-workers.json に worker_count_source: "auto_by_depth" と理由を残す。deep でも runtime 上限までの起動は強制せず、呼び出し側の AI Agent が調査観点とリスクから必要数を判断する。明示 override の場合は worker_count_source: "explicit" とする。
明示 research-mode=parallel で worker が unavailable / timeout になった場合、silent fallback で成功扱いにしない。timeout は短くせず、30 分程度を既定目安にする。
worker は read-only discovery だけを行い、Issue 作成、コード編集、test 追加、format、commit、push、PR 作成、GitHub comment を行わない。
input
| 引数 | 動作 |
|---|---|
target=<...> |
調査対象。Issue 番号 / URL、PR URL、自由文の要求など |
repo=<owner/repo> |
対象 repo を明示する |
out=<dir> |
出力先 directory。未指定時は repo identity scoped user state root 配下 |
research-packet=<path> |
既存 task-research-packet.v1 を入力として読む。grill-me の grill-packet.json も互換 packet として扱う |
research-packet=<path> を指定した場合は、調査前に review-orchestrator task-research validate --packet <path> を実行する。
入力 packet の decisions[] と source_facts[] は新しい packet の根拠として引き継げるが、chosen_by: "user" の decision は凍結済みとして上書きしない。
既存 packet から新しい packet を作った場合は、出力後に review-orchestrator task-research validate --packet <new-packet> --prior-packet <input-packet> を実行する。prior packet の user decision が新しい packet に chosen_by: "user" として残っていなければ blocked になる。
既存 Issue や Issue 起票前 target に対応する packet 候補を探す場合は、review-orchestrator task-research discover --issue <num|url> --repo <owner/repo> または review-orchestrator task-research discover --target <text> --repo <owner/repo> を使う。discover は task-research-discovery.v1 JSON に path/ref、digest、target、validation status、stale reason、candidate status だけを返し、packet 本文や private context は返さない。
high-impact な chosen_by: "agent" decision や handoff に影響する unresolved_questions[] が残る場合は、下流実行前に /grill-me research-packet=<path> で interview に戻せるよう question_adequacy_audit.passed=false かつ required_before_handoff[] に残す。
high-impact な未確定事項は /grill-me へ戻すのが既定だが、現在の会話でユーザーが直接回答できる場合は、その質問と回答、確認日を evidence に残し、decisions[] へ chosen_by: "user" として記録できる。直接確認後も task-research validate、必要な grill gate、下流 readiness / validation gate は省略しない。
handoff
| 引数 | 動作 |
|---|---|
handoff=github-issue-breakdown |
Issue draft 作成用の resume command を作る |
handoff=fix-github-issue |
既存 Issue 実装用の resume command を作る |
handoff=implement-from-plan |
Issue なし local plan 実装用の resume command を作る |
handoff=none |
packet だけ作る。未指定 default |
agent=auto|codex|claude|copilot |
handoff=github-issue-breakdown では起票前 validation agent selector、handoff=implement-from-plan では plan validation selector として resume command に残す |
ask-user |
question adequacy audit が未通過の場合に、下流実行へ進めない質問を明示して止める |
handoff は下流 skill を実行せず、handoff.json に target_skill、research_packet_path、任意の research_packet_ref、resume_command、consumed_options、blocked_options を残す。
research_packet_path は既存互換の repo 相対 path とし、user state root 配下の packet は research_packet_ref に state-root-relative ref として残す。
blocked_options がある場合は handoff 成功扱いにしない。
agent= の扱いは handoff 先ごとに次のとおり。
agent=claudeなどをhandoff=github-issue-breakdownと一緒に指定した場合、resume_commandは/github-issue-breakdown research-packet=... agent=claudeの形にする。このagent=は downstream option なので、consumed_optionsには入れない。有効な値ならblocked_optionsにも入れない。handoff=implement-from-plan agent=claudeの場合も、agent=は plan validation selector として/implement-from-plan research-packet=... agent=claudeの形で resume command に残し、consumed_optionsとblocked_optionsには入れない。handoff=fix-github-issue agent=claudeの場合は、fix-github-issue にagent=の消費先がないためblocked_optionsに入れて handoff 成功扱いにしない。
詳細 contract
調査から managed Issue 作成 family へ進む場合、進捗と完了は review-orchestrator issue workflow-family-status の issue-workflow-family.v1 JSON で確認する。packet や handoff の存在だけでは、validation、Issue create、post-create、sub-issue link、parent finalization の完了証跡にならない。
同じ時点の独立 gate は既存 command を同じ shell request で実行し、各 stdout schema の terminal field を一括評価する。前段の結果で後段の引数が決まる command と mutation は別 request に分ける。
artifacts
research packet は、一次情報、候補ファイル、既存 contract、採用方針、代替案、未解決質問、検証候補をまとめた再利用用の調査メモである。
research-brief.md は人間が読む要約で、research-packet.json は下流 skill が読む入力として扱う。
| artifact | 役割 |
|---|---|
research-plan.json |
調査対象、requested / resolved depth、調査方法、打ち切り条件 |
research-packet.json |
一次情報、candidate files、既存 contract、採用案、代替案、implementation sketch、未解決質問、risk flags、validation commands |
research-workers.json |
research-mode=parallel の worker report。worker_count、worker_count_source、worker_count_reason を含め、task-research-workers.v1 として packet とは別に保存する |
research-brief.md |
Mermaid、判断表、擬似コード、Rules / Examples / Questions を含められる人間向け要約 |
handoff.json |
target skill、resume command、packet path、消費済み option |
artifact-manifest.json |
artifact set の paths / refs、packet digest、target、created_at、validation status、Issue staleness metadata |
artifact-index.json |
repo-scoped user state root 配下にある artifact set の索引 |
artifact の field-level schema は task-research contract に合わせる。target object は kind、value、url を使い、val は使わない。
question_adequacy_audit.intent_policy_categories[] を使う場合は、各 category を decisions[] または source_facts[] で裏付ける。
research-workers.json の worker_count は worker_reports[] の件数と一致させる。worker_count_source: "auto_by_depth" の場合は、plan の resolved_depth の規則とも一致させる。deep では呼び出し側の AI Agent が必要な観点数を判断し、最低 3 worker にする。
artifact-manifest.json は task-research-artifact-manifest.v1、artifact-index.json は task-research-artifact-index.v1 とする。manifest は artifact_root_ref、packet_digest、issue_updated_at、issue_body_digest、artifacts[] を持ち、index は artifact_sets[] に manifest_ref と packet_digest を持つ。ref は repositories/<repo-key>/... の state-root-relative ref に限定し、GitHub 上へ /Users/... のような local absolute path を書かない。
既存 artifact を下流 skill へ渡す前の機械チェックには review-orchestrator task-research validate --packet <path> [--prior-packet <path>] [--plan <path>] [--workers <path>] [--handoff <path>] [--manifest <path>] [--index <path>] を使う。
validator は artifact shape と handoff safety だけを確認し、既存の validation、readiness、PR 前 simplify、multi-review の代替にはならない。
research artifact を下流へ渡す flow では、下流 skill の実装・起票・plan validation 前に review-orchestrator task-research grill-gate --plan <research-plan.json> --packet <research-packet.json> [--grill-mode skip] を使う。--plan は task-research の research-plan.json であり、fix-github-issue の implementation brief や implement-from-plan の plan.json ではない。deep / spike 相当の判断が残る場合は、この gate が block して /grill-me または明示 skip へ戻す。
family 全体の進捗は durable workflow state の phase、obligations、evidence、effect outcomes から再構築し、unknown や timeout を success として扱わない。
downstream use
grill-me は research-packet=<path> で task-research packet を読み、未解決質問や high-impact な chosen_by: "agent" decision を優先して interview できる。
grill-me が生成した grill-packet.json は task-research-packet.v1 互換なので、/task-research research-packet=tmp/grill-me/<id>/grill-packet.json や downstream skill の research-packet= に渡せる。
github-issue-breakdown は research=auto|off|light|standard|deep|spike と research-packet=<path> を扱い、packet から Issue draft を作る。research=off は明示 no-op として packet を作らない。
agent=claude の resume command への引き継ぎは、handoff 先の skill ごとに次のとおり。
task-research handoff=github-issue-breakdown agent=claudeのように指定した場合、agent=claudeはgithub-issue-breakdownの起票前 validation agent selector として下流に渡す。task-research handoff=implement-from-plan agent=claudeのように指定した場合、agent=claudeはimplement-from-planの plan validation selector として下流に渡す。resume command は/implement-from-plan research-packet=... agent=claudeのように、packet と validation selector を一緒に保持する。
packet を渡された下流 skill の扱いは次のとおり。
fix-github-issueは明示された場合だけ packet を claim gate 後の read-only discovery で読み、implementation brief の evidence / decisions に反映する。implement-from-planは明示された場合だけ packet から local plan draft / plan JSON を作る。
packet の facts は repo identity scoped user state root の task ledger、または legacy tmp/fix-github-issue/task-ledger-ISSUE_NUMBER.md / tmp/implement-from-plan/PLAN_ID/task-ledger.md の changed surfaces、contract sync、non-goals、acceptance、validation commands、E2E status、review scope、rerun scope へ転記できる。
どの downstream でも、research packet は validation、readiness、capability preflight、checkpoint、PR 前 simplify、multi-review の代替にならない。 task ledger も同じ gate の代替にならない。
実行例
| 入力 | 何が起きるか |
|---|---|
/task-research target="通知フィルタの設計を調べて" |
research=auto で packet と brief を作る |
/task-research research=deep handoff=github-issue-breakdown |
deep research の packet と Issue 化用 resume command を作る |
/task-research research=deep research-mode=parallel |
deep depth を read-only parallel worker で調査し、worker report と packet を作る |
/task-research research-packet=tmp/grill-me/<id>/grill-packet.json |
grill-me で確定した decisions を入力にして追加調査や handoff を作る |
/grill-me research-packet=tmp/task-research/<id>/research-packet.json |
task-research の未解決質問や high-impact decision を interview で確定する |
/task-research target=123 handoff=fix-github-issue |
既存 Issue 用 packet と /fix-github-issue 123 research-packet=... を作る |
/task-research handoff=implement-from-plan |
Issue なし plan 実装用の packet と resume command を作る |