Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "#283"
goal_ref: "SDD 駆動運用方針の確定と不足 product SSOT の child 起票(product spec lifecycle policy 文書と最小局所ルールを整備する)"
change_kind: workflowParent Issue
Parent Goal Ref
- Goal: Spec Driven Development(SDD)駆動運用を採用しつつ、既存 docs/SSOT・Skill/SubAgent・Issue/PR 運用と整合させ、AI が実装前に必ず参照すべきプロダクト SSOT(game-thesis / game-design / game-logic / mvp-scope / playtest / lifecycle / release)を child Issue として段階起票する
- Desired Destination: SDD ツール採否が ADR(
docs/adr/0002-sdd-tool-adoption.md)で確定し、不足 product SSOT 7 種が child Issue としてマージ済み。docs/dev/ssot-registry.mdに上記 SSOT が登録され、CLAUDE.mdまたは.claude/rules/project-constitution.mdの「まず読む順序」に新規 product SSOT が追加されている
Current Validated Scope
.claude/skills/issue-contract-review/SKILL.mdに Product Spec Preflight セクション(短い skill 手順 + 判定表)を追加するCONTRACT_REVIEW_RESULT_V1.checks.product_spec_checkを optional-compatible に追加する(既存 field は削除・改名しない).claude/skills/issue-contract-review/scripts/check_product_spec_contract.pyを追加し、6 条件を rule_idPS001〜PS006として JSON 判定する.claude/skills/issue-contract-review/scripts/tests/test_product_spec_check.pyとscripts/tests/fixtures/を追加し、fixture-driven に PASS / FAIL / n/a を検証する
Remaining Parent Gaps
- Follow-up A —
issue-refinement-loopに Spec Kit phase 分類を追加(後続 Issue) - Follow-up C —
impl-review-loopに Spec Kit task preflight を追加(後続 Issue) - Follow-up D — Spec Kit template override / preset / extension 調査(後続 Issue)
- C254-3〜C254-8 の未起票 child issue 群
Outcome
.claude/skills/issue-contract-review/SKILL.md に Product Spec Preflight セクションが追加され、6 条件すべてが stop condition / 判定規則として定義され、CONTRACT_REVIEW_RESULT_V1.checks.product_spec_check が optional-compatible に追加され、pnpm typecheck/lint/test/build が PASS している状態
In Scope
-
issue-contract-reviewに Product Spec Preflight を追加する(baseline VC preflight より前に実行) -
CONTRACT_REVIEW_RESULT_V1.checks.product_spec_checkを optional-compatible に追加する。schema は下記固定:product_spec_check: applicability: applicable | not_applicable decision: pass | fail | human_judgment triggers: docs_product_allowed_paths: true | false tasks_md_mentioned: true | false specify_artifact_mentioned: true | false generated_task_mentioned: true | false product_spec_context_present: true | false conditions: docs_product_requires_spec_evidence: status: pass | fail | n/a evidence: [] tasks_md_not_direct_source: status: pass | fail | n/a evidence: [] specify_not_canonical: status: pass | fail | n/a evidence: [] diff_first_rationale_present: status: pass | fail | n/a | human_judgment evidence: [] generated_task_trace_present: status: pass | fail | n/a evidence: [] task_dependencies_materialized: status: pass | fail | n/a | human_judgment evidence: [] blocked_reasons: - rule_id: PS001 | PS002 | PS003 | PS004 | PS005 | PS006 source: issue_body | allowed_paths | dependencies excerpt: "<short excerpt>"
-
判定規則を固定する:
decision: failの場合:CONTRACT_REVIEW_RESULT_V1.status: blocked、next_action: propose_refinement_loopdecision: human_judgmentの場合:status: blocked、next_action: human_judgmentapplicability: not_applicableの場合: go / blocked を変更しない
-
product spec preflight は以下の authority docs を参照する(SKILL.md には全文転載せず短い参照のみ):
docs/adr/0002-sdd-tool-adoption.mddocs/dev/product-spec-lifecycle.mddocs/product/CLAUDE.mddocs/dev/agent-skill-boundaries.md
-
tasks.md/.specify//docs/product/**は 禁止対象ではなく役割境界 で判定する:tasks.md: staging artifact としての参照は PASS、direct implementation source / tracking SSOT / canonical source としての参照は BLOCKED.specify/: derived workbench としての参照は PASS、docs/SSOT より優先する canonical source 化は BLOCKED
-
Stop Condition 1(
allowed_paths: docs/product/**)は次のように分解する:- implementation issue が code change と
docs/product/**update を同時に含み、product spec delta Issue(または同一 PR 内の spec/update Issue 参照)がない場合: BLOCKED - Issue 自体が docs-only product spec/update Issue として
issue_kind/change_kind/Outcome/AC/Allowed Pathsを明示している場合: PASS - product spec update が implementation の副作用として混入している場合: BLOCKED
- implementation issue が code change と
-
generated task 由来 Issue には
requirement_idとsource_task_idを要求する -
generated task dependency は GitHub native dependency または line-anchored
Depends on #Nとして materialize されている必要がある。再利用する dependency checker は 専用に新設(check_product_spec_contract.py内に閉じる)し、既存check_blockers.shの挙動は変えない(既存 grep は line-anchored 仕様と不一致だが、本 Issue では触らない)
Out of Scope
- 実 diff が full-document rewrite かどうかの判定(PR review 側 follow-up)
- 既存
check_blockers.shの line-anchored 化(別 Issue / 既存 dependency 判定への影響波及を避けるため本 Issue では触らない) implement-issue/impl-review-loop/pr-review-judgeがproduct_spec_checkを必須入力に昇格させる変更(optional-compatible に留め、必要なら follow-up)
Acceptance Criteria
- AC1:
.claude/skills/issue-contract-review/SKILL.mdにProduct Spec Preflight(またはProduct Spec Contract Gate)セクションが追加され、baseline VC preflight より前に実行されると明記されている - AC2: 6 条件すべてが Stop Condition / 判定規則として定義され、各条件に
trigger、pass、blocked、n/a(必要に応じてhuman_judgment)の判定が rule_idPS001〜PS006として明示されている - AC3:
CONTRACT_REVIEW_RESULT_V1.checks.product_spec_checkの schema が SKILL.md に定義されており、applicability/decision/triggers/conditions/blocked_reasonsの値域が固定されている - AC4:
product_spec_check.applicability: not_applicableの経路があり、無関係 Issue を block しない - AC5:
.claude/skills/issue-contract-review/scripts/check_product_spec_contract.pyが存在し、Issue body / allowed_paths / dependencies を入力に 6 条件を rule_idPS001〜PS006として JSON 判定する - AC6:
.claude/skills/issue-contract-review/scripts/tests/test_product_spec_check.pyとscripts/tests/fixtures/配下に最低 8 ケースの fixture が存在し、PASS する(少なくとも以下を含む):- PASS: docs/product/** unrelated →
applicability: not_applicable - FAIL: allowed_paths に
docs/product/**ありで implementation issue かつ spec delta Issue リンクなし(PS001) - FAIL: tasks.md を implementation source として指定(PS002)
- PASS: tasks.md を staging artifact として参照し GitHub Issue 化を要求
- FAIL:
.specify/artifact を canonical source と明記(PS003) - PASS:
.specify/artifact を derived workbench と明記 - FAIL: generated task に
requirement_id/source_task_id欠落(PS005) - FAIL: dependency が materialize されていない(PS006)
- PASS: docs/product/** unrelated →
- AC7:
tasks.mdは staging artifact としての正当な参照と direct implementation source としての禁止参照を区別する判定が SKILL.md / checker / fixture に存在する - AC8:
.specify/は derived workbench としての正当な参照と canonical source としての禁止参照を区別する判定が SKILL.md / checker / fixture に存在する - AC9: product spec update Issue には
diff_rationale/changed_requirement_id/affected_sections相当の contract evidence が要求される(PS004)。実 diff の全文書き換え検出は Out of Scope(PR review 側)と明記されている - AC10:
CONTRACT_REVIEW_RESULT_V1の schema delta としてproduct_spec_checkが optional-compatible に追加され、既存 field は削除・改名されていない - AC11:
pnpm typecheck && pnpm lint && pnpm test && pnpm buildが PASS する
Verification Commands
# AC1
$ rg -n "Product Spec Preflight|Product Spec Contract Gate" .claude/skills/issue-contract-review/SKILL.md
# AC2
# AC3
$ rg -n "product_spec_check|PS00[1-6]" .claude/skills/issue-contract-review/SKILL.md
$ rg -n "applicability:[[:space:]]*applicable[[:space:]]*\|[[:space:]]*not_applicable" .claude/skills/issue-contract-review/SKILL.md
# AC4
$ rg -n "applicability:[[:space:]]*not_applicable" .claude/skills/issue-contract-review/SKILL.md
# AC5
$ test -f .claude/skills/issue-contract-review/scripts/check_product_spec_contract.py
# AC6
$ uv run pytest .claude/skills/issue-contract-review/scripts/tests/test_product_spec_check.py -q
# AC7
$ rg -n "tasks\.md.*staging artifact|direct implementation.*tasks\.md.*(prohibited|BLOCKED)|source_task_id|requirement_id" .claude/skills/issue-contract-review/SKILL.md
# AC8
$ rg -n "\.specify.*derived workbench|canonical source.*\.specify.*BLOCKED" .claude/skills/issue-contract-review/SKILL.md
# AC9
$ rg -n "diff_rationale|changed_requirement_id|affected_sections" .claude/skills/issue-contract-review/SKILL.md
# AC10
$ rg -n "product_spec_check" .claude/skills/issue-contract-review/SKILL.md
# AC11
$ pnpm typecheck && pnpm lint && pnpm test && pnpm buildRuntime Verification Applicability
- decision: deferred
- rationale: 本 Issue の AC は
issue-contract-reviewskill の挙動変更であり、AC4〜AC9 の決定論的検証はscripts/tests/test_product_spec_check.pyの fixture-driven test に集約される。pnpm typecheck/lint/test/buildは静的検証として AC11 で実行する。実 Issue body を通した end-to-end 実行は impl-review-loop / pr-review-judge 側の責務に分離するため、本 Issue では deferred とする。 - destination_type: pr_review
- destination_ref: 本 Issue の PR review 時に reviewer が
scripts/tests/test_product_spec_check.pyの fixture 網羅性とSKILL.mdの判定表整合(rule_id PS001〜PS006 /product_spec_checkschema /tasks.md.specify/の役割境界判定)を確認する。実 Issue body への適用と routing 検証は impl-review-loop / pr-review-judge へのproduct_spec_check連携(Out of Scope に明記、follow-up Issue で扱う)。 - runtime_check_required: false
Allowed Paths
.claude/skills/issue-contract-review/SKILL.md.claude/skills/issue-contract-review/scripts/.claude/skills/issue-contract-review/scripts/tests/.claude/skills/issue-contract-review/scripts/tests/fixtures/
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
CONTRACT_REVIEW_RESULT_V1の既存 field を削除・改名する必要が出た場合(optional-compatible に留められない場合)check_blockers.sh等の既存 dependency 判定の挙動を変更する必要が出た場合(影響範囲が広いため別 Issue に分離)- product spec preflight の判定が長文 prose になり SKILL.md に大量の policy を転載する形になった場合(短い手順 + script-backed checker + fixture test に寄せる方針から外れたら停止)
implement-issue/impl-review-loop/pr-review-judgeがproduct_spec_checkを必須入力として要求する変更が必要になった場合(optional-compatible 維持失敗のため別 Issue に分離)tasks.md/.specify//docs/product/**に対する判定が「全面禁止」に倒れ、staging artifact / derived workbench としての正当な参照まで BLOCKED するロジックを書き始めた場合(役割境界判定から外れたら停止)
Required Skills
なし
Scope Delta(任意)
N/A
Source
- dedupe_key: spec-kit-loop-integration:B
- 出典: PR docs(#283): docs/dev/product-spec-lifecycle.md を追加 — SDD ライフサイクル定義(C254-2) #322 人間レビューコメント docs(#283): docs/dev/product-spec-lifecycle.md を追加 — SDD ライフサイクル定義(C254-2) #322 (comment) にて「後続 Issue B」として提案
- parent_issue: "実装: docs/dev/product-spec-lifecycle.md を追加する — SDD ライフサイクル定義(C254-2) #283"(親: SDD 駆動運用方針の確定と不足 product SSOT の child 起票 #254 SDD 駆動運用方針の子)
Delivery Rule
1 Issue = 1 PR- Draft PR 既定
- worktree:
git worktree add ../loop-protocol-issue-<N> -b issue-<N>/spec-stop-conditions
Activity
fix(#332): B1-B4 修正 — signal regex 化 / tasks_md fail-closed 強化 / foll…
feat(#332): issue-refinement-loop に Product/Spec Kit routing gate を追加…
squne121 commentedon May 24, 2026
判定: REQUEST_CHANGES
Issue #335 の方向性は正しいです。
product-spec-lifecycle.mdで定義した「tasks.mdは staging artifact」「.specify/は canonical ではない」「docs/product/**は diff-first」という規律を、実装着手前のissue-contract-reviewに接続するのは必要です。ただし現状の #335 は SKILL.md に文言を足してrgで存在確認するだけでも AC PASS できる契約になっており、preflight としては弱すぎます。issue-contract-reviewは既に「実装着手直前に決定論的に preflight する skill」と定義され、CONTRACT_REVIEW_RESULT_V1も routing-critical な機械可読出力として扱われています。したがってproduct_spec_checkも、単なる説明文ではなく fail-closed の判定項目・証跡・blocked reason を持つ決定論的チェックにする必要があります。関連 Issue / PR から見た前提
#254 の親目的は、Spec Kit を使うかどうかではなく、SDD を既存の
docs/SSOT、.claude/skills、Issue/PR 運用に矛盾なく接続することです。特に Decision Points には「正本/派生境界」「Issue contract とtasks.mdの責務分担」「.claude/skill 共存」「token 対策」が含まれています。#283 / PR #322 では、
product-spec-lifecycle.mdは policy/reference 文書であり、直接の操作手順ではないと整理されています。tasks.mdは staging artifact、GitHub Issue が tracking SSOT、.specify/は派生 artifact、docs/product/**は product SSOT、という境界も既に文書化されています。つまり #335 の責務は「Product Spec policy を SKILL.md に転載すること」ではありません。責務は 実装 Issue が product spec / Spec Kit 由来の危険な契約を含む場合に、実装着手前に止めることです。
外部実装調査からの制約
Spec Kit は
specify → plan → tasks → taskstoissues → implementのような作業導線を持ち、speckit-taskstoissuesは generated task list を GitHub Issues に変換する役割を持ちます。さらに project-local overrides / presets / extensions でテンプレートやワークフローを拡張する仕組みがあります。したがって LOOP_PROTOCOL 側では、tasks.mdを直接実装ソースにせず、Issue 化された後の trace fields を検証する adapter 境界が必要です。([GitHub]1)Kiro Specs も
requirements.md/design.md/tasks.mdを分け、requirements で EARS を使い、tasks を実装進捗管理単位として扱います。これはtasks.mdが自然に「作業分解 artifact」になりやすいことを示しますが、LOOP_PROTOCOL ではtasks.mdを tracking SSOT にしないという追加制約が必要です。([Kiro]2)Claude Code skills は
SKILL.mdだけでなく supporting files / scripts を持てます。またpathsglob によるスコープ制御や、長い参照文書を都度読ませない構成が想定されています。#335 も prose 追加ではなく、短い skill 手順 + script-backed checker + fixture test に寄せるべきです。([Claude API Docs]3) ([Claude API Docs]3)Blockers
B1. AC / VC が文字列存在確認に寄りすぎている
現状の VC は
rg "product spec Stop Conditions"、rg "product_spec_check"、rg "tasks\.md" ... grep -q "Stop Condition"のような存在確認です。これだと、実際にtasks.md直接実装を検出できなくても PASS します。修正すべきです。
scripts/check_product_spec_contract.pyのような checker を追加し、6 条件それぞれについて pass / fail fixture を用意してください。rgは補助確認に留めるべきです。B2.
product_spec_checkのスキーマが未定義#335 は
CONTRACT_REVIEW_RESULT_V1にproduct_spec_checkを追加するとだけ書いていますが、型・enum・evidence・blocked reason が定義されていません。既存のCONTRACT_REVIEW_RESULT_V1はchecks.*配下に分類結果と証跡を持つ構造なので、ここに雑な boolean を足すと downstream routing が壊れます。最低限、以下のような形に固定すべきです。
B3. 「linked spec/update Issue」が曖昧
条件 1 の「
allowed_pathsがdocs/product/**を含むが、リンクされた spec/update Issue がない」は危険です。docs/product/**を更新する Issue 自体が spec/update Issue である場合、さらに別 Issue を要求するのか不明です。より正確には、
docs/product/**を含む Issue にはProduct Spec Traceセクションを要求すべきです。これがあれば、追加 Issue を必須にせず、contract-review が決定論的に判定できます。
B4. 「全文書き換え」は issue-contract-review 単体では完全検出できない
条件 4 の「product spec 更新が diff rationale なしに全文書き換えになっている」は重要ですが、実装前の Issue contract だけでは実 diff を見られません。
issue-contract-reviewが判定できるのは「Issue 本文が full regeneration / rewrite all を宣言しているのに diff rationale がない」までです。実際の差分が全文書き換えかどうかはimpl-review-loopまたは PR review 側の責務です。#335 では、以下のように責務を分けるべきです。
#333 側の impl-review-loop preflight と責務が重なるため、#335 は「実 diff 判定をしない」と明記した方がよいです。#335 自身も Follow-up C を Out of Scope にしています。
B5.
tasks.mddependency materialization は入力がないと検証不能条件 6 は「
tasks.mdからの dependency が GitHub native dependency またはDepends onに materialize されていない」場合を止めるものですが、Issue contract にsource_task_idと dependency list がなければ、何と照合すべきか分かりません。既存の
issue-contract-reviewには GitHub native dependency API とDepends on #Nfallback の確認手順があります。これを再利用するのは妥当ですが、前提としてtasks.md由来 Issue にはsource_task_id/requirement_id/parent_issue/dependenciesを必須にすべきです。B6. #327 / #329 との衝突リスク
#327 は Issue body validator を作り、rule ID と JSON error で Issue body を機械検証する計画です。#329 は baseline VC preflight を
issue-contract-review/scripts/に追加し、JSON をissue-contract-reviewとimpl-review-loopが共有する計画です。#335 で新しい checker を足すなら、
validate_issue_body.pyとbaseline_vc_preflight.pyの設計と重複しないようにする必要があります。推奨は、#335 の checker をissue-contract-review専用の readiness gate とし、出力は rule ID ベースの JSON にして、後で #327 側からも再利用可能にすることです。推奨 contract patch
#335 は実装前に、少なくとも次のように修正してください。
In Scope 追加
Acceptance Criteria 差し替え
Verification Commands 例
実装方針
SKILL.mdには長い policy を貼らず、次の短い分岐だけを追加するのがよいです。check_product_spec_contract.pyは、product-spec-lifecycle.mdの内容を読ませる代わりに、同文書から抽出した最小ルールだけを機械判定する構成にしてください。policy/reference 文書を作業のたびに全文ロードする設計は、#322 で人間が疑問視した点と同じ失敗になります。結論
#335 は そのまま実装しない方がよいです。現状のまま進めると、「Product Spec Stop Conditions が書いてある」だけで、実際には
tasks.md直接実装、.specify/canonical 化、trace 欠落、dependency 未 materialize を止められない可能性が高いです。高品質化するなら、#335 は
issue-contract-reviewの product spec readiness gate を script-backed / fixture-tested / schema-defined にする Issueへ contract patch してください。文言追加 Issue ではなく、Product Spec / Spec Kit 由来の実装事故を実装前に止めるための決定論的 gate として扱うべきです。squne121 commentedon May 24, 2026
判定: REQUEST_CHANGES / contract patch 必須
#335 の方向性は正しいです。ただし現状の Issue contract は「
issue-contract-reviewに文言とproduct_spec_checkフィールドを足す」粒度に留まっており、このまま実装すると Stop Condition が決定論的 preflight ではなく、運用ポエム化する 可能性が高いです。対象 skill は実装前ゲートであり、現行CONTRACT_REVIEW_RESULT_V1は handoff 用の routing-critical フィールドを持つ設計です。そこへproduct_spec_checkを追加するなら、形・値域・適用条件・fail 時のnext_actionまで固定しないと壊れます。確認した前提
親 #254 / #283 / PR #322 の流れでは、
docs/dev/product-spec-lifecycle.mdは policy / reference 文書であり、作業手順そのものは既存ループ、特にissue-refinement-loop/issue-contract-review/impl-review-loop側で扱う設計に着地しています。PR #322 では一度 dedicated skill / rule を追加した後、人間レビューを受けて撤回し、既存ループへ寄せる方針に戻しています。したがって #335 は dedicatedproduct-spec-lifecycleskill を再導入する Issue ではなく、既存issue-contract-reviewの preflight 能力を拡張する Issueとして扱うべきです。ADR 0002 は、
docs/を正本、.specify/等を derived workbench、tasks.mdを staging artifact、GitHub Issue を tracking SSOT と定義しています。さらにtasks.md由来の task はrequirement_id/source_task_id/parent_issueを保持し、dependency を GitHub native dependency またはDepends onfallback に materialize してから実装へ進む必要があります。外部実装上もこの警戒は妥当です。Spec Kit は
/speckit.taskstoissuesで task list を GitHub Issues に変換し、/speckit.implementで task 実行へ進むコマンド体系を持ちます。Kiro Specs もrequirements.md/design.md/tasks.mdを分け、tasks.mdを trackable な実装計画として扱います。つまり外部 SDD ツールの自然な流れはtasks.mdを実装入口にしやすいため、LOOP_PROTOCOL 側の gate で明示的に止める必要があります。([GitHub]1) ([Kiro]2)Claude Code の skill は、
descriptionで選択され、読み込まれた本文はセッション context に残るため、長大な汎用手順を増やすほど token cost と遵守率のリスクが上がります。したがって #335 の実装は、既存issue-contract-reviewに小さく決定論的な checker を足す方向が適切です。([Claude API Docs]3)Blockers
B1.
product_spec_checkの出力スキーマが未定義#335 は
CONTRACT_REVIEW_RESULT_V1にproduct_spec_checkを追加するとしていますが、値域・構造・status: go | blockedへの反映規則がありません。現行 skill の出力契約はtemplate_compliance、vc_preflight、ac_verifiabilityなどの routing-critical fields を持ち、next_actionを決める構造です。ここへ曖昧な自由記述 field を足すと、後続のimplement-issue/ judge / ledger が消費できません。最低限、次のような shape を #335 本文に固定してください。
判定規則も固定すべきです。
B2. 検証コマンドが
rg文字列確認に偏りすぎている#335 の VC は、セクションや語の存在確認が中心です。これは「書いた」ことは確認できますが、「実装前 gate として止まる」ことは確認できません。今回の対象は docs ではなく preflight skill の挙動変更です。最低でも fixture issue body を使う script/unit test が必要です。
追加すべき Allowed Paths:
追加すべき VC:
fixture は最低 8 ケース必要です。
B3. Stop Condition 1 が曖昧で、正当な product doc Issue まで止める
現状の条件は「
allowed_pathsがdocs/product/**を含むが、リンクされた spec/update Issue がない」です。しかし #283 系の child Issue では、Issue 自体が product spec/update Issue になることがあります。単純に「リンクされた別 Issue が必要」と解釈すると、正当なdocs/product/**変更 Issue を誤 BLOCK します。条件は次のように分解するべきです。
この分岐は ADR 0002 の「spec delta issue → implementation issue → PR」順序、および
product-spec-lifecycle.mdの Product Spec Delta Flow と整合します。B4.
Depends onfallback parser に既存不整合がある現行
SKILL.mdはDepends on #Nfallback を専用セクションの line-anchored 宣言だけに限定すると説明しています。一方、現在のcheck_blockers.shはまず本文全体からDepends on #Nを grep しており、Delivery Rule や注記内の文言を dependency と誤検出し得ます。#335 の条件 6 は dependency materialization を扱うため、この既存スクリプトをそのまま根拠に使うと false positive / false negative が混入します。選択肢は二つです。
check_blockers.shを仕様通り line-anchored に修正し、regression test を追加する。#335 の Allowed Paths は
scripts/を許可しているため実装は可能ですが、既存 dependency 判定全体を変えるなら影響範囲が広くなります。安全なのは 2 です。B5.
product_spec_checkは schema change なのに consumer inventory がない#335 の Stop Conditions には「In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要なら停止」とあります。一方で #335 自身は
CONTRACT_REVIEW_RESULT_V1の schema に field を追加する Issue です。これは矛盾ではありませんが、Issue 本文で「今回の schema delta は意図された scope」と明示し、consumer inventory を要求しないと、実装者が自分で Stop Condition に当たって停止する設計になります。追加すべき AC:
Major findings
M1.
tasks.md検出は単純 grep ではなく「役割」を見るべき#335 の VC には
rg "tasks\.md" ... | grep -q "Stop Condition"がありますが、これは弱すぎます。tasks.mdは完全禁止ではなく、staging artifact として参照することは正当です。禁止なのはtasks.mdを direct implementation source / tracking SSOT / canonical source として扱うことです。ADR 0002 と lifecycle doc はこの境界を明確にしています。Stop Condition はこう書くべきです。
M2.
.specify/条件も「参照」と「正本化」を区別する.specify/は derived workbench として存在します。PR #308 で.specify/と 9 本のspeckit-*skills は main に入っていますが、Safety Claim Matrix でも direct execution や existing flow bypass を抑制する前提になっています。したがって.specify/への言及自体を止めるのではなく、「canonical source として扱う」「docs/SSOT に反するのに.specify/を優先する」場合に止めるべきです。M3.
full-document rewrite without diff rationaleは preflight だけでは完全判定できないIssue contract review は PR diff を見ません。したがって「全文書き換えかどうか」は preflight 時点では厳密に検出できません。#335 では次のように扱うべきです。
つまり #335 の責務は「diff-first で更新することを Issue contract に要求する」までです。実 diff の敵対的検査は PR review 側の follow-up に分けるのが妥当です。
M4.
ssot-catalog.mdには戻らないPR #302 で
.claude/skills/ssot-discovery/references/ssot-catalog.mdは削除され、docs/dev/ssot-registry.mdが唯一の registry 正本になっています。#335 で関連 SSOT discovery を追加する場合、参照先は registry のみです。古い catalog 同期や fallback を復活させないでください。#335 を高品質化する contract patch 案
Allowed Paths 修正
In Scope 修正
AC 修正案
VC 修正案
推奨実装方針
最小実装は、
SKILL.mdに巨大な説明を足すのではなく、Product Spec Preflightを 60〜100 行程度で追加し、判定の細部を script + tests に寄せる形です。Claude skill は一度ロードされると context に残るため、長大な規約再掲より、authority docs への短い参照と機械的判定表の方が安全です。([Claude API Docs]3)推奨ファイル構成:
GitHub コメント案
結論
#335 は実施すべきですが、現 contract のまま実装すると「Stop Conditions を書いたが、止め方が実装されていない」状態になります。
product_spec_checkを routing 可能な machine-readable check にし、tasks.md/.specify//docs/product/**の 禁止対象ではなく役割境界 を判定する設計へ直してから着手するのが妥当です。[-]実装: issue-contract-review に product spec Stop Conditions を追加する(Follow-up B)[/-][+]実装: issue-contract-review に product spec preflight gate を追加する(Follow-up B)[/+]squne121 commentedon May 24, 2026
Issue Contract Update via edit-issue skill
Change Summary
Updated by issue-refinement-loop Step 4 based on REQUEST_CHANGES anchor comments.
Scope Impact: amend (scope contract strengthened; Outcome maintained)
Applied Patches
Current Validated Scope — Reframed from "Stop Conditions section" to concrete deliverables:
product_spec_checkfield (optional-compatible)check_product_spec_contract.pyIn Scope — Expanded with schema definition and role-boundary rules:
product_spec_checkYAML schema (applicability / decision / triggers / conditions / blocked_reasons)tasks.md(staging artifact vs. direct source) and.specify/(derived workbench vs. canonical source)Out of Scope — Added clarifications:
check_blockers.shline-anchored fix (separate issue to avoid wave propagation)product_spec_checkpromotion (optional-compatible only)Acceptance Criteria — Expanded from AC1-4 to AC1-11:
not_applicablepath exists for non-spec issuestasks.mddistinction (staging vs. direct source).specify/distinction (derived vs. canonical)product_spec_checkoptional-compatible with no existing field changesVerification Commands — Replaced with rg-based grep, Python test runner, and fixture verification
Allowed Paths — Normalized to
scripts/tests/(matching existing project convention):.claude/skills/issue-contract-review/SKILL.md.claude/skills/issue-contract-review/scripts/.claude/skills/issue-contract-review/scripts/tests/.claude/skills/issue-contract-review/scripts/tests/fixtures/Stop Conditions — Added three hard stops:
check_blockers.shbehavior change riskTitle Update
実装: issue-contract-review に product spec Stop Conditions を追加する(Follow-up B)実装: issue-contract-review に product spec preflight gate を追加する(Follow-up B)preflight/checker/fixture.Contract Integrity
Status: ready for implementation
squne121 commentedon May 24, 2026
issue-refinement-loop iteration 1: Focused Patch Applied
Applied three deterministic blocking fixes per reviewer feedback:
Patch A: Stop Conditions expanded to 7 items
Patch B: Runtime Verification Applicability section added
## Verification Commandsand## Allowed PathsPatch C: Verification Commands reformatted with AC reference comments
# AC<N>bash hash commentsAll changes are isolated to listed sections only:
Protected sections remain unchanged:
Status: Ready for implementation phase
Co-Authored-By: Claude Code [email protected]
squne121 commentedon May 24, 2026
issue-refinement-loop iteration 2: Schema Compliance Patches Applied
Patches Applied
Patch D: Verification Commands — `$` prefix compliance (C4 check)
Patch E: Runtime Verification Applicability — Schema normalization (C9/C10 checks)
Sections Unchanged (per edit-issue guardrails)
Next Steps
squne121 commentedon May 24, 2026
issue-refinement-loop: 完了 (2026-05-24T04:22:00Z)
改善履歴
Stop Conditions→product spec preflight gateproduct_spec_checkschema (applicability / decision / triggers / conditions / blocked_reasons) を固定scripts/tests/配下を採用(reviewer 原案のtests/ルートは正規化)# AC<N>hash コメント形式に統一$prefix 追加applicability: deferred→decision: deferredliteraldestination_type: pr_review+destination_ref:追加確認済み repo facts
.claude/skills/issue-contract-review/scripts/check_blockers.sh:67は line-anchored 仕様と不一致(B4 妥当)— 本 Issue では触らない方針で Out of Scope / Stop Conditions に明記.claude/skills/issue-contract-review/tests/は不在、既存規約はscripts/tests/配下 — Allowed Paths は規約整合次アクション
issue-contract-reviewを起動して着手前 preflight (status: go) を確認squne121 commentedon May 24, 2026
Contract Snapshot (2026-05-24T04:29:20Z)
.claude/skills/issue-contract-review/SKILL.mdに Product Spec Preflight が追加され、6 条件が rule_id PS001〜PS006 として固定され、CONTRACT_REVIEW_RESULT_V1.checks.product_spec_checkが optional-compatible に追加され、pnpm typecheck/lint/test/build が PASS.claude/skills/issue-contract-review/SKILL.md,.claude/skills/issue-contract-review/scripts/,.claude/skills/issue-contract-review/scripts/tests/,.claude/skills/issue-contract-review/scripts/tests/fixtures/.claude/worktrees/issue-335-spec-stop-conditionsworktree-issue-335-spec-stop-conditionsfeat(#335): implement product spec preflight gate in issue-contract-r…
fix(#335): rename helper to avoid pytest collection error
squne121 commentedon May 24, 2026
Implementation Report (iteration 0)
Draft PR #348 を起票しました。pr-review-judge による LOOP_VERDICT 判定へ進みます。
Note: 初回 implementation-worker 委譲時に worktree が
git reset --hard origin/mainで誤って削除されましたが、reflog の commit fc2095c から復元し、pytest collection error(test_fixture_case が pytest にテスト関数と誤検出される問題)を修正した上で PR 起票しています。fix(#335): PR #348 REQUEST_CHANGES 修正 (B1-B6)
squne121 commentedon May 24, 2026
PR #348 REQUEST_CHANGES 修正完了
修正内容:
B1: live path bug 修正
gh issue view --jsonフィールドからbaseRefNameを削除 (issue view に存在しない field)subprocess.runを monkeypatch して検証B2: decision: n/a をスキーマ外で削除
passを返すconditions[].statusの n/a は individual rule level で維持decision in ("pass",)で 0、それ以外 1 に修正B3: PS004 spec delta issue で evidence 欠落を fail に
product_spec_update_without_rationale_fail.mdB4: PS002 source_task_id bypass を削除
tasks_md_direct_with_source_task_id_fail.mdB5: PS006 GitHub native dependency claim を削除
Depends on #Nのみ実装B6: PS001 change_kind pattern を厳密化
change_kind: update単体を除外change_kind_update_only_not_product_spec.mdテスト結果:
uv run pytest test_product_spec_check.py: 14/14 PASS ✓pnpm typecheck/lint/test/build: PASS ✓PR #348 は自動更新済み。
fix(#335): remove n/a from product_spec_check.decision schema (B2 res…
feat(#335): add Product Spec Preflight to issue-contract-review skill (…
docs(#352): add Spec Kit override/preset/extension investigation (#353)