Skip to content

実装: Issue VC 設計改善: 「削除確認 VC は削除対象 literal を列挙する」原則を body-authoring.md に追記し review-issue の non-blocking warning check に反映する #46

Open

Description

@squne121

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: workflow

Parent 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.md Section 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

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

Notes for Reviewer

Activity

  1. added
    enhancement
    phase/implementation
    state/queued
    agent/implementer
    on May 19, 2026
  2. squne121 commented on May 21, 2026

    @squne121
    OwnerAuthor

    関連改善提案: ハーネス機構 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 ヒューリスティックを追加:

    • Issue の ## 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 実装者への判断委譲

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/implementerenhancementphase/implementationstate/queued

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions