Repository navigation
Open
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phasestate/queuedQueued for implementation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: none
goal_ref: "削除確認 VC の設計原則を body-authoring.md に追記し、review-issue が否定 grep 型 VC を non-blocking warning として検出できるようにする"
change_kind: workflowParent Issue
なし(単独改善)
Parent Goal Ref
- Goal: Issue VC 設計改善として「削除確認 VC は削除対象 literal を列挙する」原則を確立し、否定 grep 型 VC の過広問題を構造的に防止する
- Desired Destination: N/A(単独改善 Issue のため)
Current Validated Scope
.claude/skills/create-issue/references/body-authoring.mdの「削除確認パターン」セクションを拡充し、「削除対象 literal を列挙する」原則・before/after 比較例・retro-fit ガイダンスを追記する.claude/skills/review-issue/SKILL.mdの Section 4(non-blocking improvement 候補)に「否定 grep 型 VC」の non-blocking warning check を追記する
Remaining Parent Gaps
- 既存 Issue の AC 系 VC 一括 retro-fit は手動運用(本 Issue の retro-fit ガイダンスを参照)
- 否定 grep 型 VC の自動禁止(blocking 化)は別途検討
Outcome
.claude/skills/create-issue/references/body-authoring.md の「削除確認パターン」セクションに「削除対象 literal を列挙する」原則・before/after 比較例・retro-fit ガイダンスが追記され、.claude/skills/review-issue/SKILL.md Section 4 に否定 grep 型 VC を non-blocking warning として提示する check が追記されたコミットが main ブランチに存在する。
In Scope
.claude/skills/create-issue/references/body-authoring.mdの「削除確認パターン」セクション拡充(原則追記・before/after 比較例・retro-fit ガイダンス).claude/skills/review-issue/SKILL.mdSection 4 への否定 grep 型 VC の non-blocking warning check 追記
Out of Scope
- 既存 Issue の VC 一括 retro-fit(手動運用)
- 否定 grep 型 VC の自動禁止(warning に留める)
- pytest / vitest 等のテスト型 VC への適用(実行型は別原則)
.claude/skills/issue-body-authoring/SKILL.md(skill として存在しないため対象外)create-issue/SKILL.md本体の変更
Acceptance Criteria
- AC1:
grep -n "削除確認\|literal.*列挙\|deletion target" .claude/skills/create-issue/references/body-authoring.mdがヒットする(body-authoring.md に原則が追記されている) - AC2:
.claude/skills/create-issue/references/body-authoring.mdに before/after 比較例が記載されている(grep -c "before:\|after:" .claude/skills/create-issue/references/body-authoring.mdの値が 2 以上) - AC3:
grep -n "削除確認 VC\|literal\|否定 grep" .claude/skills/review-issue/SKILL.mdがヒットする(review-issue に non-blocking warning check が追記されている) - AC4: 否定 grep 型 VC を含むサンプル記述に対し review-issue が non-blocking warning を返すことを示すテスト記述(サンプル例・判定フロー)が SKILL.md 内に存在する
- AC5: 既存の review-issue C1〜C8 の判定基準が変更されていない(
grep -c "^| C[1-8] " .claude/skills/review-issue/SKILL.mdの値が 8 以上) - AC6:
pnpm typecheck && pnpm lint && pnpm test && pnpm buildが PASS する
Verification Commands
# AC1: body-authoring.md に削除確認 VC 原則が追記されているか
grep -n "削除確認\|literal.*列挙\|deletion target" .claude/skills/create-issue/references/body-authoring.md && echo "PASS: AC1" || echo "FAIL: AC1"
# AC2: before/after 比較例が 2 件以上存在するか
COUNT=$(grep -c "before:\|after:" .claude/skills/create-issue/references/body-authoring.md 2>/dev/null || echo 0); [ "$COUNT" -ge 2 ] && echo "PASS: AC2 (count=$COUNT)" || echo "FAIL: AC2 (count=$COUNT)"
# AC3: review-issue に否定 grep 型 VC の warning check が追記されているか
grep -n "削除確認 VC\|literal\|否定 grep" .claude/skills/review-issue/SKILL.md && echo "PASS: AC3" || echo "FAIL: AC3"
# AC4: review-issue SKILL.md 内にサンプル例・判定フローの記述が存在するか
grep -n "サンプル\|example\|判定フロー\|non-blocking warning" .claude/skills/review-issue/SKILL.md | grep -i "grep\|literal\|削除" && echo "PASS: AC4" || echo "FAIL: AC4"
# AC5: 既存 C1〜C8 が変更されていないか(行数チェック)
COUNT=$(grep -c "^| C[1-8] " .claude/skills/review-issue/SKILL.md 2>/dev/null || echo 0); [ "$COUNT" -ge 8 ] && echo "PASS: AC5 (count=$COUNT)" || echo "FAIL: AC5 (count=$COUNT)"
# AC6: 品質ゲート全通過
pnpm typecheck && pnpm lint && pnpm test && pnpm build && echo "PASS: AC6" || echo "FAIL: AC6"Allowed Paths
.claude/skills/create-issue/references/body-authoring.md.claude/skills/review-issue/SKILL.md
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- review-issue の既存 deterministic check(C1〜C8)の判定基準を変更する場合
Required Skills
なし
Scope Delta(任意)
N/A
Delivery Rule
1 Issue = 1 PR- worktree は任意
- Draft PR 既定
- 依存関係: なし(実装: issue-body-authoring / edit-issue に必須セクション/VC形式チェックリストを追加し review-issue と整合させる #25 / 実装: create-issue/references/body-authoring.md に Python テスト系 VC の依存明示パターンを追加する #42 と Allowed Paths が一部重複するが scope は独立。並行実装は避け、実装: issue-body-authoring / edit-issue に必須セクション/VC形式チェックリストを追加し review-issue と整合させる #25 / 実装: create-issue/references/body-authoring.md に Python テスト系 VC の依存明示パターンを追加する #42 マージ後に着手推奨)
Background
観測元
PR #37(Issue #31 の実装)Iter 0 において、AC9 の VC:
! grep -nE "^[^#]*\b(gh |jq |awk ...)"が「保持対象の gh issue edit --body-file まで捕捉する過広な VC」と判定された(PARTIAL)。tighten 後も gh api --jq '.field' の単純抽出パターンを誤検出する構造的問題が残った。
根本原因
「削除確認 VC を否定 grep で書く」設計が削除対象 literal を明示しないため、「削除したい記述」と「保持したい記述」を区別できない。
決定論的修正 vs workaround の比較
| 方針 | 内容 | 採用 |
|---|---|---|
| 決定論的修正(採用) | body-authoring.md に「削除対象 literal を列挙」原則を明示 + review-issue で non-blocking warning | 採用 |
| workaround | AC9 だけを手動修正 | 非採用(再発防止にならない) |
| 自動禁止 | 否定 grep を blocking エラー化 | 非採用(over-engineering / Out of Scope) |
関連 Issue
- 実装: オーケストレーション skill 内 bash を scripts/ 集約 + .claude/settings allowlist 整備で permission prompt を削減する #31: VC 設計問題の観測元(post-merge-cleanup の follow-up 候補)
- feat: オーケストレーション skill bash を scripts/ 集約 + allowlist 整備 #37: PR(AC9 VC 過広問題を Improvement Notes に記録)
- 実装: issue-body-authoring / edit-issue に必須セクション/VC形式チェックリストを追加し review-issue と整合させる #25: body-authoring.md に rg 優先ガイダンスを追加(同ファイル変更 Issue、scope は独立)
- 実装: create-issue/references/body-authoring.md に Python テスト系 VC の依存明示パターンを追加する #42: body-authoring.md に Python テスト系 VC の依存明示パターンを追加(同ファイル変更 Issue、scope は独立)
Notes for Reviewer
- 実装: issue-body-authoring / edit-issue に必須セクション/VC形式チェックリストを追加し review-issue と整合させる #25 と 実装: create-issue/references/body-authoring.md に Python テスト系 VC の依存明示パターンを追加する #42 は同一 Allowed Paths(
body-authoring.md)を持つ。マージコンフリクト回避のため、実装: issue-body-authoring / edit-issue に必須セクション/VC形式チェックリストを追加し review-issue と整合させる #25 / 実装: create-issue/references/body-authoring.md に Python テスト系 VC の依存明示パターンを追加する #42 のマージ後に本 Issue の実装着手を推奨する。 review-issue/SKILL.mdは 実装: Out of Scope / Remaining Parent Gaps を実 Issue として必ず起票する手順を create-issue / review-issue / refinement-loop に組み込む #30 も Allowed Paths に含むが、実装: Out of Scope / Remaining Parent Gaps を実 Issue として必ず起票する手順を create-issue / review-issue / refinement-loop に組み込む #30 の scope(defer 提案に実 Issue 番号なし → needs-fix)と本 Issue の scope(否定 grep 型 VC → non-blocking warning)は独立しているため並行実装は技術的には可能。ただし同一ファイルへの変更競合を避けるため直列化を推奨する。
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phasestate/queuedQueued for implementation
Activity
squne121 commentedon May 21, 2026
関連改善提案: ハーネス機構 vs プロジェクトワークフロールールの混同検出 (#78 refinement 由来)
#78 の issue-refinement-loop 実行中に検出した改善点。#46 と 同一の 2 ファイル(
.claude/skills/review-issue/SKILL.md/.claude/skills/create-issue/references/body-authoring.md)を Allowed Paths に持ち、かつ #46 と 同一機構(review-issue の non-blocking warning check 追加 + body-authoring.md 明文化)のため、repo 憲法の「同一ファイル並行起票の禁止」に従い新規起票せず本 Issue への追記提案として記録する。背景
#78 は当初「Plan Mode スキップルールを
.claude/rules/project-constitution.mdに明文化」だった。しかし Claude Code の Plan Mode は人間が--permission-mode plan/Shift+Tab//planで選ぶ permission mode であり、ハーネスがセッション制御する。.claude/rules/やCLAUDE.mdは行動指示であって hard enforcement ではなく(強制は.claude/settings.json側)、prompt 層ファイルに「スキップ条件」を書いてもハーネスを決定論的に制御できない。この概念混同(ハーネス機構を prompt 層ファイルで制御しようとする)に review-issue の C1〜C8 決定論チェックは全 pass を返し、#78 は premise レベルの全面 reframe が必要になった(issuecomment-4507172490)。
提案する追加 non-blocking warning check
review-issue の Step 4 軽量構造評価に、以下の co-occurrence ヒューリスティックを追加:
## Allowed Pathsに.claude/rules/またはCLAUDE.mdが含まれ、かつ## Outcome/## In Scopeがハーネス機構キーワード(permission mode/Plan Mode/acceptEdits/bypassPermissions/--permission-mode/Shift+Tab/hook)を含む場合に「ハーネス機構を prompt 層ファイルで制御しようとしている可能性。permission mode / hooks / settings 強制はハーネス側 SSOT であり prompt 層では決定論的制御不可。意図がワークフロールールなら語を言い換えるべき」という non-blocking warning を出す。
false-positive(ハーネス挙動を正当に説明するだけの Issue 等)があり得るため blocking ではなく warning が妥当。
body-authoring.md 側にはアンチパターンとして「ハーネス機構(permission mode / hooks / settings 強制)を prompt 層ファイル(
.claude/rules//CLAUDE.md)の記述で制御しようとしない。それらの SSOT は.claude/settings.jsonまたは人間のセッション操作」を明記する。#46 実装者への判断委譲