```yaml contract_schema_version: v1 issue_kind: implementation parent_issue: "none" goal_ref: "issue-refinement-loop → issue-contract-review → impl-review-loop の chain を skill 内で自動化し、操作コストを削減する" change_kind: workflow ``` ## Parent Issue none ## Parent Goal Ref - Goal: refinement-loop APPROVE 後の手動起動ステップをなくし、contract-review → impl-review-loop を自動 chain させる - Desired Destination: N/A(standalone improvement) ## Current Validated Scope - `impl-review-loop` skill の preparation step に fallback パスを追加 - fallback パス: contract-review が未実行なら自動委譲(status: go まで進めてから本ループ開始) ## Remaining Parent Gaps なし ## Outcome `impl-review-loop` の preparation step で「contract-review が未実行なら自動委譲(status: go まで進めてから本ループ開始)」する fallback パスが実装されており、main session が明示的に contract-review を起動しなくても impl-review-loop が完走できる。 ## In Scope - `.claude/skills/impl-review-loop/SKILL.md` の preparation step 更新 - contract-review 未実行判定ロジックの定義 - fallback 委譲パスの記述 ## Out of Scope - refinement-loop 本体の変更 - contract-review skill 本体のロジック変更 - main session orchestration の変更 ## Acceptance Criteria - [ ] `impl-review-loop` SKILL.md の preparation step に「contract-review 未実行時の fallback 委譲」手順が明記されている - [ ] fallback 判定条件(何をもって「未実行」とするか)が 1 文以上で定義されている - [ ] 既存の通常フロー(contract-review 実行済み)に影響しない旨が明示されている ## Verification Commands - `rg "contract-review" .claude/skills/impl-review-loop/SKILL.md` # AC1: fallback パスの記載確認 - `rg "fallback\|未実行\|not.*run" .claude/skills/impl-review-loop/SKILL.md` # AC2: fallback 判定条件の存在確認 ## Allowed Paths - `.claude/skills/impl-review-loop/SKILL.md` ## Stop Conditions - Allowed Paths 外の変更が必要と判明した場合 - In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合 - 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合) - 後続 Phase / 別スコープへの波及が判明した場合 - nested SubAgent delegation が必要になった場合 - 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合 ## Required Skills - skill authoring(SKILL.md Markdown 構造) ## Scope Delta(任意) N/A ## Source - origin_skill: post-merge-cleanup - origin_pr: https://github.com/squne121/loop-protocol/pull/226 - dedupe_key: `refinement-contract-impl-chain` - extracted_from: PR #226 本文 `## Process Observations` セクション
Activity
squne121 commentedon May 23, 2026
人間意見
人間介入ループ運用設計原則にしたがって、必ず実装=issueの作業依頼は人間が行うこととするため、このissueはクローズする。
issue-refinement-loop → issue-contract-review → impl-review-loop の自動化は採用しないが、作業契約を整理して作業計画と実装の整合性を高めたり、実装品質を向上したり、AIエージェントのトークン消費を抑える改善は採用する。
squne121 commentedon May 23, 2026
(Gmail)(Gmail)(Gmail)(Gmail)(Gmail)(Gmail)(Gmail)(Gmail)(Gmail)(Gmail)(Gmail)(Gmail)(Gmail)(Gmail)(Gmail)(Gmail)(Gmail)(Gmail)(Gmail)(Gmail)(Gmail)(Gmail)
判定
Issue #231 は Close / not planned が妥当です。理由は、提案の中核が「
impl-review-loopがcontract-review未実行を検出したら自動でissue-contract-reviewを走らせ、そのまま実装ループに入る」設計であり、これは人間コメントで明示された 「実装=Issue の作業依頼は必ず人間が行う」 原則と衝突します。Issue 本文自体も、contract-review → impl-review-loopの自動 chain を目的にしているため、部分修正ではなく方針棄却が適切です。ただし、PR #226 の観測から出てきた「作業契約の整理」「VC 厳密化」「baseline VC preflight の共通化」「トークン節約」は有効です。つまり、自動起動は捨てるが、手動起動を失敗しにくく・低トークンに・証跡駆動にする改善へ分解するのが高品質化方針です。
敵対的レビュー
BLOCKER-1: 人間ゲートを optional 化している
現行
impl-review-loopはcontract_snapshot_urlを必須入力としており、issue-contract-reviewでstatus: goを返したコメント URL を受け取る前提です。さらに preparation では、contract_snapshot_urlが不一致なら「issue-contract-reviewを先に通すよう人間に提案して停止」となっています。一方、#231 は「contract-review 未実行なら自動委譲して status: go まで進め、本ループ開始」という fallback を入れようとしています。これは、必須入力を「なければ作る」に変える変更であり、作業契約の存在確認ではなく作業契約の自動生成・自動通過になります。
issue-contract-review側もgo出力後は「implement-issue 呼び出しの最終承認」は人間承認待ちと定義しているため、この自動 chain は既存契約と逆方向です。BLOCKER-2: #227 / ORCHESTRATOR_IO_BOUNDARY_V1 と衝突する
#227 は、orchestrator の worker step で direct Skill 実行を廃止し、SubAgent 境界へ統一する設計です。背景には、Skill tool 完了が
end_turn境界になり、Agent tool はtool_resultとして親へ返るという非対称性があります。agent-skill-boundaries.mdも、orchestrator が worker step でSkilltool を直接呼ばない原則を明記しています。正しい形はorchestrator → SubAgent → Skillであり、orchestrator が詳細な domain judgment や raw content を保持して routing しない設計です。Claude Code 公式ドキュメントでも、SubAgent は独立したコンテキスト・ツール権限を持ち、複数段のワークフローは main conversation から SubAgent を chain する設計が示されています。また、SubAgent は他の SubAgent を spawn できないため、複雑な nested delegation は main conversation で順序制御するのが安全です。(Claude API Docs) (Claude API Docs)
BLOCKER-3: #224 / #204 の停止原因を再発させる方向
#224 は、
review-issueなどの nested Skill が完了した後に orchestrator が次 step へ進まず停止する問題への safety net です。#224 本文は、通常停止の支配的原因がnormal_stop_without_loop_completionであり、nested Skill 完了時のend_turnが構造的原因だったと説明しています。#204 でも、単なる SKILL.md 文言不足ではなく、Stop / StopFailure / hook / transcript のレイヤーで原因分類する必要があると整理されています。 Claude Code の hooks 仕様上、
Stopはdecision: blockで停止を防げますが、StopFailureは decision control を持たず side effect のみです。したがって hook safety net は補助であり、自動 chain を通常経路にする根拠にはなりません。(Claude API Docs)MAJOR-1: AC/VC が「危険な実装」も通してしまう
#231 の AC は「fallback 委譲が明記されている」「未実行判定が 1 文以上ある」「通常フローに影響しない旨がある」という grep レベルです。
これは品質ゲートとして弱すぎます。たとえば、実際には人間ゲートを迂回していても、「通常フローに影響しない」と一文書けば pass します。今回必要なのは逆で、次のような negative check です。
MAJOR-2: Allowed Paths が不適切
#231 は Allowed Paths を
.claude/skills/impl-review-loop/SKILL.mdのみにしています。 しかし現行の実際の入力確認・停止挙動はsteps/preparation.mdにあります。 また、人間ゲートの明文化はdocs/dev/agent-skill-boundaries.mdの原則に入れるべきです。したがって、仮に改善 issue に切り直すなら Allowed Paths は少なくとも次です。
MAJOR-3: ready tuple が既存 contract-review とズレている
impl-review-loop/steps/preparation.mdはphase/implementation + state/queuedを canonical ready tuple とし、不一致なら停止としています。 しかしissue-contract-reviewはstate/queued不在やstate/blocked残存だけでは blocking しない、primary signal は blocker/dependency 確認だとしています。これは #231 の本旨ではないものの、実運用では無駄停止・人間介入増加の原因です。自動 chain ではなく、ready tuple の整合修正が先です。
関連 Issue / PR の読み替え
高品質化するならこう分解する
1. #231 は close する
推奨 close コメント案:
contract_snapshot_url時の fail-closed handoff 表示raw Issue body / raw diff を main context に展開しない token reduction
2. 代替 Issue:
impl-review-looppreparation の fail-closed handoff 改善自動実行ではなく、次のような構造化出力にする。
"/impl-review-loop 231 <contract_snapshot_url>"
invariant:
contract_snapshot_url_required: true
auto_chain_allowed: false
これなら、人間起点を保ったまま操作ミスを減らせます。
3.
agent-skill-boundaries.mdに人間ゲートを追記既存文書は「ユーザーがループを起動した時点でループ全体の実行が承認される」としています。 ここに例外として、次を追記すべきです。
4. token 削減は「自動 chain」ではなく「参照渡し」で行う
Claude Code skills は、使われると SKILL.md 本文が文脈に入り、読み込まれた内容は後続ターンにも残ります。したがって長い共通ルールを SKILL.md に重複させるほど token 消費が増えます。(Claude API Docs) Agent Skills の設計も、discovery → activation → execution の progressive disclosure で必要時だけ詳細を読む形です。(Agent Skills)
採用すべき削減策は次です。
PR 本文は ledger summary、正本は comment / artifact / CI check にする
この方向は ORCHESTRATOR_IO_BOUNDARY_V1 の forbidden context / opaque forwarding 方針とも一致します。
最終提案
#231 は close。代わりに採用する改善は以下に限定するのが安全です。
contract_snapshot_urlは必須のまま維持する。missing 時は自動実行せず、構造化された handoff と次コマンドだけ提示して停止する。
issue-contract-reviewのgoは「実装開始承認」ではなく「実装開始可能な契約 snapshot」と明記する。impl-review-looppreparation の ready tuple をissue-contract-reviewと整合させる。PR docs: post-M1 playable outcome roadmap を docs/product/playable-roadmap.md に記録する (#148) #226 の
baseline-vc-preflight-helper-scriptとplayable-roadmap-vc-tighteningのような検証品質改善は別 Issue に分ける。agent-skill-boundaries.mdに “implementation work order は人間起点” を上位原則として追加する。これで、人間介入ループの設計原則を守りつつ、作業契約の精度・実装品質・トークン効率だけを改善できます。
([[Gmail](https://mail.google.com/mail/#all/19d8941a9ddf87b4)][1])([[Gmail](https://mail.google.com/mail/#all/19d8941a926ad282)][2])([[Gmail](https://mail.google.com/mail/#all/19d8941a509c5f56)][3])([[Gmail](https://mail.google.com/mail/#all/19d8941a178ad1e7)][4])([[Gmail](https://mail.google.com/mail/#all/19d8949a7b5f318c)][5])([[Gmail](https://mail.google.com/mail/#all/19d8949a7703207b)][6])([[Gmail](https://mail.google.com/mail/#all/19d8949a76131fbb)][7])([[Gmail](https://mail.google.com/mail/#all/19d8949a44a91e2d)][8])([[Gmail](https://mail.google.com/mail/#all/19d86fe074975ca1)][9])([[Gmail](https://mail.google.com/mail/#all/19d86fe014c1c37b)][10])([[Gmail](https://mail.google.com/mail/#all/19d86fdff9cfdefa)][11])([[Gmail](https://mail.google.com/mail/#all/19d86fdfc8d5be46)][12])([[Gmail](https://mail.google.com/mail/#all/19d86f5030d5ce3d)][13])([[Gmail](https://mail.google.com/mail/#all/19d894e44122d1e0)][14])([[Gmail](https://mail.google.com/mail/#all/19d894e16f8907a3)][15])([[Gmail](https://mail.google.com/mail/#all/19d894e156e287ed)][16])([[Gmail](https://mail.google.com/mail/#all/19d894e12e3f168e)][17])([[Gmail](https://mail.google.com/mail/#all/19e4050db3652270)][18])([[Gmail](https://mail.google.com/mail/#all/19e4054a978e315e)][19])([[Gmail](https://mail.google.com/mail/#all/19e405c2a872231a)][20])([[Gmail](https://mail.google.com/mail/#all/19e40c640fc80e0d)][21])([[Gmail](https://mail.google.com/mail/#all/19e41a5d603e4e66)][22])判定
Issue #231 は Close / not planned が妥当です。理由は、提案の中核が「
impl-review-loopがcontract-review未実行を検出したら自動でissue-contract-reviewを走らせ、そのまま実装ループに入る」設計であり、これは人間コメントで明示された 「実装=Issue の作業依頼は必ず人間が行う」 原則と衝突します。Issue 本文自体も、contract-review → impl-review-loopの自動 chain を目的にしているため、部分修正ではなく方針棄却が適切です。ただし、PR #226 の観測から出てきた「作業契約の整理」「VC 厳密化」「baseline VC preflight の共通化」「トークン節約」は有効です。つまり、自動起動は捨てるが、手動起動を失敗しにくく・低トークンに・証跡駆動にする改善へ分解するのが高品質化方針です。
敵対的レビュー
BLOCKER-1: 人間ゲートを optional 化している
現行
impl-review-loopはcontract_snapshot_urlを必須入力としており、issue-contract-reviewでstatus: goを返したコメント URL を受け取る前提です。さらに preparation では、contract_snapshot_urlが不一致なら「issue-contract-reviewを先に通すよう人間に提案して停止」となっています。一方、#231 は「contract-review 未実行なら自動委譲して status: go まで進め、本ループ開始」という fallback を入れようとしています。これは、必須入力を「なければ作る」に変える変更であり、作業契約の存在確認ではなく作業契約の自動生成・自動通過になります。
issue-contract-review側もgo出力後は「implement-issue 呼び出しの最終承認」は人間承認待ちと定義しているため、この自動 chain は既存契約と逆方向です。BLOCKER-2: #227 / ORCHESTRATOR_IO_BOUNDARY_V1 と衝突する
#227 は、orchestrator の worker step で direct Skill 実行を廃止し、SubAgent 境界へ統一する設計です。背景には、Skill tool 完了が
end_turn境界になり、Agent tool はtool_resultとして親へ返るという非対称性があります。agent-skill-boundaries.mdも、orchestrator が worker step でSkilltool を直接呼ばない原則を明記しています。正しい形はorchestrator → SubAgent → Skillであり、orchestrator が詳細な domain judgment や raw content を保持して routing しない設計です。Claude Code 公式ドキュメントでも、SubAgent は独立したコンテキスト・ツール権限を持ち、複数段のワークフローは main conversation から SubAgent を chain する設計が示されています。また、SubAgent は他の SubAgent を spawn できないため、複雑な nested delegation は main conversation で順序制御するのが安全です。([Claude API Docs]23) ([Claude API Docs]23)
BLOCKER-3: #224 / #204 の停止原因を再発させる方向
#224 は、
review-issueなどの nested Skill が完了した後に orchestrator が次 step へ進まず停止する問題への safety net です。#224 本文は、通常停止の支配的原因がnormal_stop_without_loop_completionであり、nested Skill 完了時のend_turnが構造的原因だったと説明しています。#204 でも、単なる SKILL.md 文言不足ではなく、Stop / StopFailure / hook / transcript のレイヤーで原因分類する必要があると整理されています。 Claude Code の hooks 仕様上、
Stopはdecision: blockで停止を防げますが、StopFailureは decision control を持たず side effect のみです。したがって hook safety net は補助であり、自動 chain を通常経路にする根拠にはなりません。([Claude API Docs]24)MAJOR-1: AC/VC が「危険な実装」も通してしまう
#231 の AC は「fallback 委譲が明記されている」「未実行判定が 1 文以上ある」「通常フローに影響しない旨がある」という grep レベルです。
これは品質ゲートとして弱すぎます。たとえば、実際には人間ゲートを迂回していても、「通常フローに影響しない」と一文書けば pass します。今回必要なのは逆で、次のような negative check です。
MAJOR-2: Allowed Paths が不適切
#231 は Allowed Paths を
.claude/skills/impl-review-loop/SKILL.mdのみにしています。 しかし現行の実際の入力確認・停止挙動はsteps/preparation.mdにあります。 また、人間ゲートの明文化はdocs/dev/agent-skill-boundaries.mdの原則に入れるべきです。したがって、仮に改善 issue に切り直すなら Allowed Paths は少なくとも次です。
MAJOR-3: ready tuple が既存 contract-review とズレている
impl-review-loop/steps/preparation.mdはphase/implementation + state/queuedを canonical ready tuple とし、不一致なら停止としています。 しかしissue-contract-reviewはstate/queued不在やstate/blocked残存だけでは blocking しない、primary signal は blocker/dependency 確認だとしています。これは #231 の本旨ではないものの、実運用では無駄停止・人間介入増加の原因です。自動 chain ではなく、ready tuple の整合修正が先です。
関連 Issue / PR の読み替え
高品質化するならこう分解する
1. #231 は close する
推奨 close コメント案:
2. 代替 Issue:
impl-review-looppreparation の fail-closed handoff 改善自動実行ではなく、次のような構造化出力にする。
これなら、人間起点を保ったまま操作ミスを減らせます。
3.
agent-skill-boundaries.mdに人間ゲートを追記既存文書は「ユーザーがループを起動した時点でループ全体の実行が承認される」としています。 ここに例外として、次を追記すべきです。
4. token 削減は「自動 chain」ではなく「参照渡し」で行う
Claude Code skills は、使われると SKILL.md 本文が文脈に入り、読み込まれた内容は後続ターンにも残ります。したがって長い共通ルールを SKILL.md に重複させるほど token 消費が増えます。([Claude API Docs]25) Agent Skills の設計も、discovery → activation → execution の progressive disclosure で必要時だけ詳細を読む形です。([Agent Skills]26)
採用すべき削減策は次です。
この方向は ORCHESTRATOR_IO_BOUNDARY_V1 の forbidden context / opaque forwarding 方針とも一致します。
最終提案
#231 は close。代わりに採用する改善は以下に限定するのが安全です。
contract_snapshot_urlは必須のまま維持する。issue-contract-reviewのgoは「実装開始承認」ではなく「実装開始可能な契約 snapshot」と明記する。impl-review-looppreparation の ready tuple をissue-contract-reviewと整合させる。baseline-vc-preflight-helper-scriptとplayable-roadmap-vc-tighteningのような検証品質改善は別 Issue に分ける。agent-skill-boundaries.mdに “implementation work order は人間起点” を上位原則として追加する。これで、人間介入ループの設計原則を守りつつ、作業契約の精度・実装品質・トークン効率だけを改善できます。
squne121 commentedon May 23, 2026
issue-refinement-loop: クローズ (2026-05-23T05:09:15Z)
Rejected
contract_snapshot_urlの optional 化impl-review-loopからの hidden preflight / implementation chainAccepted follow-up Issues
次アクション
代替 Issues #259 / #260 を
impl-review-loopで実装してください。#251 は既存 open Issue として継続中。