Skip to content

docs: follow-up Issue 自動起票運用と triage モデル原則を各 skill に明記する (#89) - #179

Merged
squne121 merged 4 commits into
mainfrom
worktree-issue-89-post-merge-cleanup-skill-follow-up-issue
May 21, 2026
Merged

squne121 merged 4 commits into
mainfrom
worktree-issue-89-post-merge-cleanup-skill-follow-up-issue

Conversation

@squne121

@squne121 squne121 commented May 21, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • 各オーケストレーション skill に「follow-up 候補は create-issue 経由で即時自動起票する」運用を明記した
  • docs/dev/agent-skill-boundaries.md に triage モデル原則・FOLLOW_UP_ISSUE_REQUEST_V1 スキーマを追加した
  • docs/dev/github-ops.md に triage-required ラベルの運用ルールを追加した

Schema Change Applicability

schema_change_applicability: not_schema_change

本 PR は docs-only 変更であり、consumer 境界をまたぐ contract への変更は含まない(新規 schema 定義の追加のみ)。

Safety Claim Matrix

本 PR は safety-sensitive 変更(.claude/skills/**)を含むため Safety Claim Matrix を提出する。

Claim Implemented? Not controlled Evidence Follow-up
pr-review-judge が直接 Issue 起票しない Yes なし SKILL.md に「Issue 起票は行わない」記述 + ! grep negative check なし
follow-up 起票は main thread のみが実行 Yes なし step-5 / post-merge-cleanup Delegation セクション なし

受け入れ条件の達成状況

  • AC1: post-merge-cleanup/SKILL.md に「follow_up_candidates は main thread が即時 issue-author 経由で自動起票する」運用を明記
  • AC2: impl-review-loop/steps/step-5-feedback-and-termination.md に「pr-review-judge non-blocker NOTE は follow-up Issue として自動起票」を明記
  • AC3: issue-refinement-loop/SKILL.md に「refinement 中の派生改善候補も自動起票対象」を明記
  • AC4: pr-review-judge/SKILL.md に follow_up_issue_requests フィールドと「起票は main thread」を明記(直接起票記述なし)
  • AC5: docs/dev/agent-skill-boundaries.md に「主インターフェース原則」と「triage モデル(不要なら close)」を記載
  • AC6: docs/dev/github-ops.md に triage-required ラベルの運用ルールを記載
  • AC7: docs/dev/agent-skill-boundaries.md に FOLLOW_UP_ISSUE_REQUEST_V1 スキーマ(dedupe_key / source.url / source.note_id / severity)を定義

検証コマンド結果

コマンド 結果
AC1: grep -E '自動起票|auto-create|即時.*issue-author' post-merge-cleanup/SKILL.md PASS(2 件ヒット)
AC2: grep -E '自動起票|follow-up.*Issue' step-5-...md PASS(3 件ヒット)
AC3: grep -E '派生.*自動起票|follow-up.*自動' issue-refinement-loop/SKILL.md PASS(3 件ヒット)
AC4 positive: grep -E 'follow_up_issue_requests|起票.*main thread|main thread.*起票' pr-review-judge/SKILL.md PASS(2 件ヒット)
AC4 negative: ! grep -E 'issue-author|create-issue.*起票|gh issue create' pr-review-judge/SKILL.md PASS(0 件)
AC5: grep -E '主インターフェース|primary interface|triage.*モデル' agent-skill-boundaries.md PASS(3 件ヒット)
AC6: grep -E 'triage-required|triage.*ラベル' github-ops.md PASS(5 件ヒット)
AC7: grep -E 'FOLLOW_UP_ISSUE_REQUEST_V1|dedupe_key' agent-skill-boundaries.md PASS(5 件ヒット)
pnpm typecheck PASS
pnpm lint FAIL(既存 93 errors、main ブランチと同一。本 PR の docs 変更とは無関係)
pnpm test PASS(28 files / 35 tests)
pnpm build PASS

Allowed Paths 遵守

変更ファイルはすべて contract に記載の Allowed Paths に含まれる:

  • .claude/skills/post-merge-cleanup/SKILL.md ✓
  • .claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md ✓
  • .claude/skills/issue-refinement-loop/SKILL.md ✓
  • .claude/skills/pr-review-judge/SKILL.md ✓
  • docs/dev/agent-skill-boundaries.md ✓
  • docs/dev/github-ops.md ✓

改善観察事項(Non-blocker / optional_follow_up)

pr-review-judge が LOOP_VERDICT に記録した follow_up_issue_requests から抽出。follow-up Issue として自動起票予定。

  1. pnpm lint 既存 93 errors の系統的解消 — main ブランチ由来の既存問題。本 PR の変更とは無関係だが、CI を green に保つためには別 Issue での解消が望ましい。
  2. issue-refinement-loop AC3 の SubAgent 名未明示 — SKILL.md の「派生改善候補を自動起票する」文脈で「どの SubAgent が候補を返すか」が明示されていない。読者がどこで候補を拾うか判断しにくい。
  3. FOLLOW_UP_ISSUE_REQUEST_V1 の note_only severity の記録先が未定義 — agent-skill-boundaries.md に severity が note_only の場合、ループ終了報告コメントのどのフィールドに記録するかのルールが書かれていない。

作業手順・運用上の観察事項

  • git branch --list "$BRANCH" は branch が存在しない場合も exit 0 を返すため、[WARN] branch 既存 の false positive が発生した。git branch --list "$BRANCH" | grep -q . を使うべき(issue-contract-review step 6 の修正候補)。
  • impl-review-loop の contract_snapshot_url は inputs として必須だが、ユーザーが直接提供しない場合(/impl-review-loop 89 のみ指定)は orchestrator が issue-contract-review 実行後に自動取得する設計にすると UX が改善できる。

Closes #89

🤖 Generated with Claude Code

各オーケストレーション skill の SKILL.md に「follow-up 候補は create-issue 経由で
即時自動起票する」運用を追記し、docs/dev に triage モデル原則・ラベル運用・
FOLLOW_UP_ISSUE_REQUEST_V1 スキーマを定義した。

- post-merge-cleanup: follow_up_candidates の自動起票フローを明記
- impl-review-loop step-5: non-blocker NOTE の follow-up Issue 自動起票を追加
- issue-refinement-loop: 派生改善候補の自動起票を明記
- pr-review-judge: follow_up_issue_requests フィールドを LOOP_VERDICT に追加(起票は main thread 責務)
- agent-skill-boundaries.md: 主インターフェース原則・triage モデル・FOLLOW_UP_ISSUE_REQUEST_V1 スキーマ追加
- github-ops.md: triage-required ラベル運用ルール追加

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Mergeability

  • mergeable=MERGEABLE, mergeStateStatus=CLEAN

Evidence Check

  • AC coverage: 全 7 AC が [x] でチェック済み、根拠記述あり。実ファイルへの grep 検証でも全件確認済み(詳細は下記)
  • Allowed Paths: 完全遵守。変更 6 ファイルすべてが Issue #89 の Allowed Paths 内に含まれる
  • CI Verification: build/lint/python-test/test/typecheck 全 5 チェック pass(https://github.com/squne121/loop-protocol/actions/runs/26234024666)
  • 検証コマンド結果: PR 本文の検証コマンド表に全項目記録済み。pnpm lint は既存 93 errors(main ブランチと同一)を注記しており、本 PR の変更と無関係であることを説明済み
  • Safety Claim Matrix: safety-sensitive PR(.claude/skills/** 変更)として正しく識別し、Matrix を提出。Not controlled 列はすべて「なし」で、無限定の安全主張なし
  • Schema Change Applicability: not_schema_change を明示。docs-only 変更(新規スキーマ定義の追加のみ)であり consumer 境界への変更なし。根拠も diff と一致
  • Runtime Verification Applicability: not_applicable(docs-only 変更、grep による決定論的検査で完結)。正しく判定済み

AC 個別検証サマリ

AC grep 結果
AC1 2 件ヒット(即時 + 自動起票フロー セクション)
AC2 3 件ヒット(自動起票・follow-up Issue 等)
AC3 3 件ヒット(派生改善候補・自動起票)
AC4 positive 2 件ヒット(follow_up_issue_requests・起票責務は impl-review-loop Step 5 等の main thread)
AC4 negative 0 件(直接起票記述なし、PASS)
AC5 3 件ヒット(主インターフェース・primary interface・triage モデル)
AC6 5 件ヒット(triage-required・triage.*ラベル)
AC7 5 件ヒット(FOLLOW_UP_ISSUE_REQUEST_V1・dedupe_key)

Blockers

なし

Non-blockers(任意改善)

  1. pnpm lint の既存 93 errors: PR 本文では「main ブランチと同一」と説明されているが、lint エラーの系統的解消は別 Issue として追跡することを検討してよい(本 PR のスコープ外)。
  2. issue-refinement-loop の SubAgent 名未定義: AC3 で「各 SubAgent の出力中に含まれる派生改善候補」と書かれているが、具体的にどの SubAgent が候補を返すか(codebase-investigator / review-issue 等)が未定義のまま。実装時に曖昧さが生じる可能性がある。
  3. FOLLOW_UP_ISSUE_REQUEST_V1 の note_only severity の扱い: note_only は「起票せず終了報告コメントに記録のみ」とあるが、step-5-feedback-and-termination.md の終了報告コメントフォーマットに note_only 記録用のフィールドが未定義。将来の実装時に混乱する可能性がある。

LOOP_VERDICT

verdict: APPROVE
blockers: []
follow_up_issue_requests:
  - title: "pnpm lint 既存 93 errors の系統的解消"
    issue_kind: chore
    severity: optional_follow_up
    source:
      url: "https://github.com/squne121/loop-protocol/pull/179"
      note_id: "1"
    dedupe_key: "follow-up:squne121/loop-protocol:pr/179:1"
    labels: []
  - title: "issue-refinement-loop AC3 の派生改善候補を返す SubAgent 名を明示する"
    issue_kind: docs
    severity: optional_follow_up
    source:
      url: "https://github.com/squne121/loop-protocol/pull/179"
      note_id: "2"
    dedupe_key: "follow-up:squne121/loop-protocol:pr/179:2"
    labels: []
  - title: "FOLLOW_UP_ISSUE_REQUEST_V1 note_only severity の終了報告コメントフォーマットを定義する"
    issue_kind: docs
    severity: optional_follow_up
    source:
      url: "https://github.com/squne121/loop-protocol/pull/179"
      note_id: "3"
    dedupe_key: "follow-up:squne121/loop-protocol:pr/179:3"
    labels: []
mergeable: MERGEABLE
mergeStateStatus: CLEAN
reviewed_head_sha: 6ec046f1eb1e0d02a4b0c32924b2b2bd68c4d7e0

@squne121

Copy link
Copy Markdown
Owner Author

判定: REQUEST_CHANGES

PR #179 は、#89 の主目的である「follow-up 候補を人間が後追い判断するモデルから、自動起票 + triage モデルへ移行する」方向性には合っています。#89 の契約も、FOLLOW_UP_ISSUE_REQUEST_V1、triage-required、pr-review-judge は直接起票しない、という要件を明示しています。

ただし現状の PR は、“自動起票する” という記述は増えたが、実際に安全に起票できる機械契約が閉じていません。 マージすると、重複 Issue、enum 不整合、create-issue 連携失敗、note_only の記録漏れが起きる可能性が高いです。


Blocker 1: FOLLOW_UP_ISSUE_REQUEST_V1 が create-issue の受け入れ契約と噛み合っていない

PR #179 が追加した FOLLOW_UP_ISSUE_REQUEST_V1 は title / issue_kind / severity / source.url / source.note_id / dedupe_key / labels だけです。

一方、既存の create-issue skill は、orchestrator から follow-up 候補を受ける場合に desired_destination と validated_scope_delta を必須にしています。欠落していれば failure_reason: destination mapping required で返す設計です。

つまり PR #179 の schema だけでは、main thread が issue-author / create-issue に委譲しても、既存の create-issue ガードを通れません。

修正案:

FOLLOW_UP_ISSUE_REQUEST_V1:
  title: string
  issue_kind: implementation | research | parent
  severity: mandatory_follow_up | optional_follow_up | note_only
  source:
    kind: pr_body | pr_review | issue_comment | post_merge_cleanup | refinement
    url: string
    note_id: string
  dedupe_key: string
  desired_destination: string
  validated_scope_delta: string
  origin_skill: impl-review-loop | post-merge-cleanup | issue-refinement-loop | pr-review-judge
  labels: []

少なくとも desired_destination / validated_scope_delta は必須にしないと、既存 skill の責務境界に対して片手落ちです。


Blocker 2: issue_kind enum が PR 内・既存実装・schema 間で破綻している

PR #179 の schema は issue_kind: implementation | research | docs としています。

しかし既存 create_issue_txn.py の --issue-kind help は implementation | research | parent | (empty) で、docs は存在しません。

さらに PR #179 の review comment 内 LOOP_VERDICT では issue_kind: chore が使われています。これは PR 自身が追加した schema の enum に違反しています。

これは docs-only だから許容、ではありません。LOOP_VERDICT.follow_up_issue_requests は main thread が読む機械契約なので、enum 不整合はそのまま実行時の分岐不能になります。

修正案:

  • issue_kind は既存 create-issue に合わせて implementation | research | parent に寄せる。
  • docs / chore は labels か category に逃がす。
  • PR comment の LOOP_VERDICT サンプルも schema 準拠に直す。

例:

issue_kind: implementation
labels:
  - docs
  - chore
  - triage-required

Blocker 3: post-merge-cleanup の既存出力 schema が古いまま

PR #179 は docs/dev/agent-skill-boundaries.md に FOLLOW_UP_ISSUE_REQUEST_V1 を追加していますが、post-merge-cleanup の POST_MERGE_CLEANUP_REPORT_V1.follow_up_candidates は古い形のままです。

現状は:

follow_up_candidates:
  - title: "<候補タイトル>"
    kind: implementation | research
    source: "<出典: PR コメント等>"
    recommended_routing: create-issue | edit-issue

となっており、source.url、source.note_id、dedupe_key、severity、desired_destination がありません。

一方で PR 追加部分では、main thread が source.url + title で dedupe すると書いています。しかし source は文字列であり、source.url は存在しません。

修正案:

post-merge-cleanup の出力を FOLLOW_UP_ISSUE_REQUEST_V1[] に統一する。

follow_up_issue_requests:
  - title: "..."
    issue_kind: implementation
    severity: optional_follow_up
    source:
      kind: post_merge_cleanup
      url: "https://github.com/..."
      note_id: "followups-intentionally-deferred-1"
    dedupe_key: "follow-up:squne121/loop-protocol:pr/179:followups-intentionally-deferred-1"
    desired_destination: "..."
    validated_scope_delta: "..."
    labels:
      - triage-required

Blocker 4: dedupe が dedupe_key ではなく title 検索に退化している

PR #179 は dedupe_key を定義しているにもかかわらず、post-merge-cleanup の実行手順では:

gh issue list --search "<title>" --state open --json number,title

で確認すると書いています。

gh issue list --search 自体は GitHub issue search query を受け付けますが、title だけでは false positive / false negative が避けられません。GitHub CLI も --search は検索クエリであり、--state は open/closed/all の状態フィルタです。(GitHub CLI)

修正案:

起票する Issue 本文に必ず以下を入れ、dedupe はこのキーで行う。

## Source

- origin_skill: pr-review-judge
- source_url: https://github.com/squne121/loop-protocol/pull/179#...
- source_note_id: 2
- dedupe_key: follow-up:squne121/loop-protocol:pr/179:2

検索も title ではなく:

gh issue list \
  --repo squne121/loop-protocol \
  --state open \
  --search '"follow-up:squne121/loop-protocol:pr/179:2"' \
  --json number,title,url

に寄せるべきです。


Blocker 5: note_only の記録先が未定義

PR #179 は note_only を「起票せず終了報告コメント内に観察事項として記録」と定義しています。

しかし impl-review-loop の終了コメントテンプレートには follow_up_issues も note_only_observations もありません。追加された記述も「起票した follow-up Issue の番号を終了報告コメントの follow_up_issues フィールドに列挙する」だけです。

これは PR 自身の review comment でも non-blocker として指摘されていますが、schema を追加する PR では実行不能な曖昧さなので blocker 扱いでよいです。

修正案:

終了コメントテンプレートを機械可読にする。

follow_up_issues:
  - request_dedupe_key: "..."
    issue_number: 123
    issue_url: "..."
    status: created | reused | skipped_duplicate

note_only_observations:
  - dedupe_key: "..."
    source_url: "..."
    source_note_id: "..."
    summary: "..."

High: mandatory_follow_up の意味が Safety Claim / APPROVE gate と弱く整合していない

#89 の過去レビューでは、mandatory_follow_up は単なる任意改善ではなく、Safety Claim Matrix 等の gate と整合させる必要があると指摘されています。

ところが PR #179 の impl-review-loop では、APPROVE 確定直後に follow-up を起票すると書いています。

mandatory_follow_up が「APPROVE 前に open Issue 参照が必要」な性質を持つ場合、APPROVE 後の処理では遅いです。

修正案:

severity:
  blocking:
    action: REQUEST_CHANGES
  mandatory_follow_up:
    action: create_or_reuse_issue_before_approve
  optional_follow_up:
    action: create_or_reuse_issue_at_loop_termination
  note_only:
    action: record_only_no_issue

pr-review-judge 側にも、「mandatory_follow_up が未 materialize の場合は APPROVE しない」と書くべきです。


High: GitHub native dependencies / sub-issues との分岐がまだ足りない

GitHub の issue dependencies は「blocked by / blocking」を表す機能です。GitHub docs でも、依存関係は blocked / blocking の関係を表すものと説明されています。([GitHub Docs]2)

一方、sub-issues は大きな作業をタスクに分解するための parent-child 構造であり、依存関係そのものではありません。GitHub docs でも、sub-issues は大きな作業を tasks に分解し、parent issue との関係や進捗を追う用途とされています。([GitHub Docs]3)

#92/#95 は、AI 着手可能性の SSOT を blocker/dependency 全 close に寄せています。

PR #179 は triage-required を state ではなく補助ラベルとして扱う点は改善されています。 ただし、follow-up Issue を作るときに sub-issue にするのか、dependency にするのか、単独 Issue + backlink にするのか の分岐がまだありません。

修正案:

- 親 Issue の Outcome 達成に必須 → sub-issue または dependency
- 現 PR の安全性に必須 → mandatory_follow_up + APPROVE 前 create/reuse
- 将来改善・任意改善 → standalone Issue + Source backlink + triage-required
- 単なる記録 → note_only_observations

High: triage-required は docs だけでは運用保証にならない

GitHub labels は repository-specific な分類機能で、issue / PR / discussion に適用できます。ラベル適用・解除は少なくとも triage 権限で可能です。([GitHub Docs]4)

PR #179 は triage-required を「必ず付与」と書いていますが、create-issue script 側は implementation issue に標準 4 ラベルを付けるだけで、triage-required は標準付与に含まれていません。 PR #105 でも implementation issue 標準ラベル自動付与は state/queued / phase/implementation / agent/implementer / enhancement の 4 ラベルです。

gh issue create は --label でラベルを追加できます。([GitHub CLI]5) したがって main thread / issue-author に「必ず --label triage-required を渡す」契約を追加する必要があります。


Claude Code skill 設計としての問題

Claude Code skills は SKILL.md に手順を書き、必要時に読み込まれる仕組みです。公式 docs でも、skill 本文は使われたときだけロードされ、長い参照は必要時までほぼコストがかからないと説明されています。([Claude Code]6) また、複雑な skill では supporting files に詳細を逃がして SKILL.md を集中させ、本文は簡潔に保つことが推奨されています。([Claude Code]6)

PR #179 は中央ポリシーを docs/dev/agent-skill-boundaries.md に置いた点はよいです。ただし、各 skill に散らした追記が 中央 schema への参照だけでなく、独自 dedupe 手順・独自 follow-up 候補 schema を持ってしまっているため、SSOT 化が未完です。

特に post-merge-cleanup は FOLLOW_UP_ISSUE_REQUEST_V1 に統一せず、古い follow_up_candidates を残しているので、Claude Code skill 設計としては「中央 schema 追加」ではなく「似た契約の増殖」になっています。


推奨パッチ方針

最小修正なら以下の順です。

  1. FOLLOW_UP_ISSUE_REQUEST_V1 に desired_destination / validated_scope_delta / source.kind / origin_skill を追加する。
  2. issue_kind enum を implementation | research | parent に寄せる。docs / chore は labels に移す。
  3. post-merge-cleanup の follow_up_candidates を follow_up_issue_requests: FOLLOW_UP_ISSUE_REQUEST_V1[] に置換する。
  4. dedupe 手順を title 検索から dedupe_key 検索へ変更する。
  5. follow-up Issue 本文に ## Source と dedupe_key を必須化する。
  6. note_only_observations と follow_up_issues を終了コメントテンプレートに追加する。
  7. mandatory_follow_up は APPROVE 後ではなく APPROVE 前 create/reuse にする。
  8. triage-required を labels に必ず含める、または main thread が必ず追加する契約を明示する。

追加すべき検証コマンド例

# schema enum が create-issue の既存 issue-kind と矛盾していない
rg -n 'issue_kind: implementation \| research \| parent' docs/dev/agent-skill-boundaries.md
! rg -n 'issue_kind: .*docs|issue_kind: .*chore' docs/dev/agent-skill-boundaries.md .claude/skills/pr-review-judge/SKILL.md

# create-issue handoff 必須フィールドが follow-up schema に含まれる
rg -n 'desired_destination|validated_scope_delta|origin_skill|source:|kind:' docs/dev/agent-skill-boundaries.md

# post-merge-cleanup が旧 schema ではなく FOLLOW_UP_ISSUE_REQUEST_V1 に統一されている
rg -n 'follow_up_issue_requests|FOLLOW_UP_ISSUE_REQUEST_V1' .claude/skills/post-merge-cleanup/SKILL.md
! rg -n 'follow_up_candidates:|recommended_routing:|kind: implementation \| research' .claude/skills/post-merge-cleanup/SKILL.md

# dedupe が title ではなく dedupe_key ベース
rg -n 'dedupe_key' .claude/skills/post-merge-cleanup/SKILL.md .claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md
! rg -n 'gh issue list --search "<title>"' .claude/skills/post-merge-cleanup/SKILL.md

# note_only の記録先がある
rg -n 'note_only_observations|follow_up_issues' .claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md .claude/skills/issue-refinement-loop/SKILL.md

# triage-required が create/reuse 時に必ず付く
rg -n 'triage-required' docs/dev/agent-skill-boundaries.md docs/dev/github-ops.md .claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md .claude/skills/post-merge-cleanup/SKILL.md

そのまま貼れるレビューコメント案

## Verdict: REQUEST_CHANGES

PR #179 は #89 の方向性(follow-up 候補を自動起票 + triage-required で人間が後から close/keep 判断)には合っています。ただし現 HEAD は、実行可能な機械契約としてまだ閉じていません。

### Blockers

1. `FOLLOW_UP_ISSUE_REQUEST_V1` が `create-issue` の既存 handoff guard と不整合です。`create-issue` は orchestrator から follow-up 候補を受ける場合 `desired_destination` と `validated_scope_delta` を必須にしていますが、今回の schema にはありません。main thread が `issue-author/create-issue` に委譲しても guard で失敗します。

2. `issue_kind` enum が破綻しています。追加 schema は `implementation | research | docs` ですが、`create_issue_txn.py --issue-kind` は `implementation | research | parent | empty` です。さらに PR 内の `LOOP_VERDICT` サンプルでは `issue_kind: chore` が使われています。schema 自身に違反する PR になっています。

3. `post-merge-cleanup` の `POST_MERGE_CLEANUP_REPORT_V1.follow_up_candidates` が旧 schema のままです。`source` は文字列なのに、新規手順では `source.url + title` で dedupe すると書いており、実行不能です。`FOLLOW_UP_ISSUE_REQUEST_V1[]` に統一してください。

4. dedupe が `dedupe_key` ではなく title 検索に退化しています。follow-up Issue 本文に `## Source` / `dedupe_key` / `origin_skill` / `source_url` を必ず埋め、open Issue 検索も `dedupe_key` ベースにしてください。

5. `note_only` の記録先が未定義です。`note_only_observations` を終了コメント schema に追加してください。

### Required changes

- `FOLLOW_UP_ISSUE_REQUEST_V1` に `source.kind`, `origin_skill`, `desired_destination`, `validated_scope_delta` を追加
- `issue_kind` を `implementation | research | parent` に統一し、`docs/chore` は labels へ移す
- `post-merge-cleanup` の `follow_up_candidates` を `follow_up_issue_requests` に置換
- dedupe を title 検索から `dedupe_key` 検索へ変更
- follow-up Issue body に `## Source` セクションを必須化
- `mandatory_follow_up` は APPROVE 後ではなく APPROVE 前 create/reuse にする
- `note_only_observations` と `follow_up_issues` を終了コメントに追加
- `triage-required` が create/reuse 時に必ず付与されることを main thread 契約に明記

現状は docs-only 変更ではありますが、`LOOP_VERDICT.follow_up_issue_requests` を main thread が読む以上、これは内部 machine contract の変更です。`schema_change_applicability: not_schema_change` のまま扱うのも危険です。

…CHANGES に対応 (iter 1)

- B1: FOLLOW_UP_ISSUE_REQUEST_V1 に desired_destination / validated_scope_delta / source.kind / origin_skill を追加し create-issue handoff 契約に整合させる
- B2: issue_kind enum を implementation | research | parent に統一し docs/chore を labels に移す
- B3: post-merge-cleanup の follow_up_candidates を follow_up_issue_requests: FOLLOW_UP_ISSUE_REQUEST_V1[] に置換
- B4: dedupe を title 検索から dedupe_key ベースの gh issue list --search に変更し Source セクション必須化
- B5: impl-review-loop 終了コメントテンプレートに note_only_observations / follow_up_issues フィールドを追加

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Mergeability

  • mergeable=MERGEABLE, mergeStateStatus=CLEAN

Evidence Check

  • AC coverage: 全 AC1-AC7 チェック済み、PR 本文の ## 受け入れ条件の達成状況 で根拠付き記載あり
  • Allowed Paths: 遵守。変更ファイル 6 件はすべて Issue #89 の Allowed Paths 内
    • .claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md
    • .claude/skills/issue-refinement-loop/SKILL.md
    • .claude/skills/post-merge-cleanup/SKILL.md
    • .claude/skills/pr-review-judge/SKILL.md
    • docs/dev/agent-skill-boundaries.md
    • docs/dev/github-ops.md
  • CI Verification: build/lint/python-test/test/typecheck 全 pass(GitHub Actions 確認済み)
  • 検証コマンド結果: AC1-AC7 の grep コマンド全 PASS、standard gates 全 PASS(PR 本文に記録済み)
  • Schema Change Applicability: not_schema_change 明示あり、根拠は docs-only 変更のため妥当
  • Safety Claim Matrix: safety-sensitive(.claude/skills/**)として提出済み、Not controlled 列が空で Evidence 完備

Blockers チェック(iteration 1 修正)

B1: FOLLOW_UP_ISSUE_REQUEST_V1 フィールド追加
docs/dev/agent-skill-boundaries.md の diff を確認。desired_destination / validated_scope_delta / source.kind(pr_body | pr_review | issue_comment | post_merge_cleanup | refinement)/ origin_skill がすべてスキーマに追加された。フィールド定義テーブルにも説明あり。解消済み

B2: issue_kind enum 統一
docs/dev/agent-skill-boundaries.md の FOLLOW_UP_ISSUE_REQUEST_V1 スキーマが issue_kind: implementation | research | parent に統一された。フィールド定義で「docs/chore 等は labels に入れる」と明記。PR 本文・SKILL.md のサンプル YAML でも issue_kind: implementation が使われており enum 違反なし。解消済み

B3: post-merge-cleanup follow_up_candidates 置換
post-merge-cleanup/SKILL.md diff にて POST_MERGE_CLEANUP_REPORT_V1 の follow_up_candidates フィールドが follow_up_issue_requests に置換され、FOLLOW_UP_ISSUE_REQUEST_V1 形式(title / issue_kind / severity / source.kind / source.url / source.note_id / dedupe_key / desired_destination / validated_scope_delta / origin_skill / labels)に更新された。解消済み

B4: dedupe_key ベース dedupe + ## Source セクション
issue-refinement-loop/SKILL.md / post-merge-cleanup/SKILL.md / docs/dev/agent-skill-boundaries.md にて、dedupe は title 検索ではなく gh issue list --search '"<dedupe_key>"' ベースで実施すると明記された。agent-skill-boundaries.md の dedupe フローに ## Source セクション(dedupe_key 含む)を必須で付与する旨が明記された。解消済み

B5: impl-review-loop 終了コメントテンプレートへのフィールド追加
step-5-feedback-and-termination.md diff にて、終了報告コメントテンプレートに follow_up_issues(request_dedupe_key / issue_number / issue_url / status)と note_only_observations(dedupe_key / source_url / source_note_id / summary)の 2 フィールドが追加された。解消済み

Blockers

なし(iteration 0 の 5 件すべて解消済み)

Non-blockers(任意改善)

  1. issue-refinement-loop の自動起票 SubAgent 名未明示 — SKILL.md の「派生改善候補を自動起票する」文脈で「どの SubAgent が候補を返すか」が不明。読者が候補の収集元を特定しにくい。別 Issue での改善を推奨。
  2. note_only severity の終了コメント記録先ルール — agent-skill-boundaries.md に severity: note_only の場合は「起票せず終了コメントの note_only_observations に記録」と明記されたが、各 skill(impl-review-loop 以外)の終了コメントテンプレートでの同フィールド対応が未統一。別 Issue での整合を推奨。

LOOP_VERDICT

verdict: APPROVE
blockers: []
mergeable: MERGEABLE
mergeStateStatus: CLEAN
reviewed_head_sha: 3895033ca16b1d8ec7054523cbea12e7495c9874
follow_up_issue_requests:
  - title: "issue-refinement-loop: 派生改善候補を収集する SubAgent を明示する"
    issue_kind: implementation
    severity: optional_follow_up
    source:
      kind: pr_review
      url: "https://github.com/squne121/loop-protocol/pull/179"
      note_id: "1"
    dedupe_key: "follow-up:squne121/loop-protocol:pr/179:1"
    desired_destination: "issue-refinement-loop SKILL.md の「派生改善候補を自動起票する」セクションで、候補を収集する SubAgent(role)が明示されている"
    validated_scope_delta: ".claude/skills/issue-refinement-loop/SKILL.md の自動起票セクションに SubAgent 名または収集元の参照を追記する"
    origin_skill: pr-review-judge
    labels:
      - triage-required
      - docs
  - title: "impl-review-loop 以外の skill の終了コメントテンプレートに note_only_observations フィールドを追加する"
    issue_kind: implementation
    severity: optional_follow_up
    source:
      kind: pr_review
      url: "https://github.com/squne121/loop-protocol/pull/179"
      note_id: "2"
    dedupe_key: "follow-up:squne121/loop-protocol:pr/179:2"
    desired_destination: "各 skill の終了コメントテンプレートで note_only_observations フィールドが統一されている"
    validated_scope_delta: "issue-refinement-loop / post-merge-cleanup の終了コメントテンプレートに note_only_observations フィールドを追加する"
    origin_skill: pr-review-judge
    labels:
      - triage-required
      - docs

@squne121

Copy link
Copy Markdown
Owner Author

判定: REQUEST_CHANGES

PR #179 は #89 の目的、「follow-up 候補を人間が後追い判断する運用から、自動起票 + triage に移す」方向には合っています。特に、前回指摘されていた desired_destination / validated_scope_delta 追加、issue_kind enum 統一、post-merge-cleanup の follow_up_candidates 廃止、dedupe_key ベース化、note_only_observations の追加はかなり改善されています。

ただし、現 HEAD のままでは 自動起票した follow-up Issue が triage 前に state/queued になる、closed/not planned 済み Issue を再生成する、issue-refinement-loop の終了報告が機械可読にならない という実運用上の破綻が残っています。


Blocker 1: triage-required と create-issue の implementation 標準ラベル自動付与が衝突している

PR #179 は triage-required を「自動起票された follow-up Issue が未評価であることを示す補助ラベル」と定義し、triage 完了前は state/queued を付けない、と github-ops.md に明記しています。

一方、既存の create_issue_txn.py は issue_kind == "implementation" の場合、state/queued / phase/implementation / agent/implementer / enhancement を自動付与します。 PR #105 でもこの挙動は明示されています。

つまり、PR #179 の典型例どおり issue_kind: implementation の follow-up を create-issue 経由で作ると、triage 前なのに state/queued が付く 可能性が高いです。これは #92 の「AI 着手可能性は blocker/dependency close 状態が SSOT」「state ラベルは readiness の primary signal ではない」という整理とも衝突します。 GitHub labels は分類用メタデータであり、blocked/blocking の依存関係表現は issue dependencies の責務です。([GitHub Docs]1)

修正案:

どちらかを明示してください。

FOLLOW_UP_ISSUE_REQUEST_V1:
  issue_kind: implementation
  initial_label_profile: triage_only
  suppress_standard_state_labels_until_triaged: true
  labels:
    - triage-required

または、create-issue 側に --label-profile triage-only / --suppress-standard-labels 相当の実装 Issue を mandatory_follow_up として先に切る。#89 は create-issue logic 変更を Out of Scope にしているため、PR #179 だけで「安全に自動起票できる」と主張するのは過剰です。


Blocker 2: dedupe が --state open 固定なので、not planned / duplicate close 済み Issue を再生成する

PR #179 の dedupe フローは各所で次の形です。

gh issue list --repo squne121/loop-protocol --state open \
  --search '"<dedupe_key>"' --json number,title,url

これは agent-skill-boundaries.md、impl-review-loop、post-merge-cleanup、issue-refinement-loop に入っています。

しかし triage モデルは「不要なら not planned で close」「重複なら duplicate close」です。閉じた follow-up Issue は --state open では見つからないため、同じ PR / NOTE を再処理すると 人間が不要判断して close した Issue を再作成 します。これは idempotency の失敗です。

gh issue list は既定で open のみを返し、--state は open|closed|all を選べます。--search は GitHub issue search query なので、dedupe には --state all を使うべきです。([GitHub CLI]2)

修正案:

gh issue list --repo squne121/loop-protocol --state all \
  --search '"<dedupe_key>"' --json number,title,url,state,stateReason,labels

結果ステータスも増やしてください。

status: created | reused_open | skipped_closed_duplicate | skipped_closed_not_planned | skipped_closed_completed

closed を見つけた場合に再作成するなら、それは triage 決定の上書きなので、明示的な human escalation が必要です。


Blocker 3: issue-refinement-loop の終了報告テンプレートが follow_up_issues を持っていない

issue-refinement-loop/SKILL.md は「起票した Issue 番号を終了報告コメントに列挙する(follow_up_issues フィールド)」と書いています。

しかし直前の終了コメントテンプレートには follow_up_issues も note_only_observations もありません。実際に書かれるのは iteration / verdict / termination_reason / 改善履歴 / 次アクションだけです。

これは docs-only の表現漏れではなく、main thread / 後続 agent が parse できない機械契約の欠落です。

修正案:

impl-review-loop と同じ YAML ブロックを issue-refinement-loop の approved 終了テンプレートにも追加してください。

follow_up_issues:
  - request_dedupe_key: "..."
    issue_number: 123
    issue_url: "https://github.com/..."
    status: created | reused_open | skipped_closed_duplicate | skipped_closed_not_planned

note_only_observations:
  - dedupe_key: "..."
    source_url: "..."
    source_note_id: "..."
    summary: "..."

Blocker 4: mandatory_follow_up の APPROVE gate が pr-review-judge 自体にない

中央ポリシーと Step 5 では、mandatory_follow_up は APPROVE 前に create/reuse し、未 materialize のまま APPROVE してはならない、と書かれています。

しかし pr-review-judge/SKILL.md の Verdict テンプレートは follow_up_issue_requests を出力するだけで、mandatory_follow_up が未 materialize の場合に APPROVE を禁止する guardrail がありません。

特に他者 PR では gh pr review --approve を使う設計なので、pr-review-judge が APPROVE を投稿した時点で review gate は通ってしまいます。あとから Step 5 が「APPROVE 前に起票」と言っても遅いです。Claude Code の subagent は独立した context / tool permission を持たせられるため、read-only reviewer と write-capable main thread の分離自体は正しいですが、分離するなら gate 条件を reviewer 側に置く必要があります。([Claude API Docs]3)

修正案:

pr-review-judge に以下を追加してください。

mandatory_follow_up_gate:
  rule: "severity: mandatory_follow_up が存在し、かつ existing_issue_url / materialized_issue_number がない場合は APPROVE しない"
  action: REQUEST_CHANGES

または FOLLOW_UP_ISSUE_REQUEST_V1 に materialization 状態を追加します。

materialization:
  required_before_approve: true
  existing_issue_url: "https://github.com/..."
  status: already_materialized | missing

High: note_only_observations の終了コメント規約が impl-review-loop に偏っている

FOLLOW_UP_ISSUE_REQUEST_V1 は note_only を「起票せず終了コメントの note_only_observations に記録」と定義しています。 しかし実際に終了テンプレートが更新されているのは impl-review-loop だけで、post-merge-cleanup と issue-refinement-loop の完了コメント schema は統一されていません。

修正案: FOLLOW_UP_MATERIALIZATION_RESULT_V1 を中央定義し、全 skill が同じ終了報告フィールドを使うようにしてください。


Non-blocker: edit-issue 経由の意味が曖昧

post-merge-cleanup の責務表では follow-up 起票が create-issue / edit-issue 経由 と残っています。 一方、今回の新フローは issue-author / create-issue に寄せています。既存 Issue に追記する edit-issue 経路を残すなら、dedupe_key ヒット時に何を edit するのか、誰が判断するのかを定義してください。残さないなら削除でよいです。


最小修正方針

  1. dedupe search を全箇所で --state all に変更し、closed triage 済み Issue の再作成を禁止する。
  2. triage-required follow-up と create_issue_txn.py の implementation 標準ラベル自動付与の衝突を明文化し、triage_only 経路を設計する。
  3. issue-refinement-loop と post-merge-cleanup の終了報告に follow_up_issues / note_only_observations を追加する。
  4. pr-review-judge に mandatory_follow_up 未 materialize 時の APPROVE 禁止 guardrail を追加する。
  5. FOLLOW_UP_MATERIALIZATION_RESULT_V1 を agent-skill-boundaries.md に中央定義する。

検証コマンドも追加した方がよいです。

# dedupe が open 限定に戻っていないこと
! rg -n -- '--state open.*dedupe_key|dedupe_key.*--state open' \
  .claude/skills docs/dev

# 全 workflow の終了報告が follow-up materialization 結果を持つこと
rg -n 'follow_up_issues|note_only_observations' \
  .claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md \
  .claude/skills/issue-refinement-loop/SKILL.md \
  .claude/skills/post-merge-cleanup/SKILL.md

# mandatory follow-up gate が reviewer 側に存在すること
rg -n 'mandatory_follow_up.*APPROVE|APPROVE.*mandatory_follow_up|materialize' \
  .claude/skills/pr-review-judge/SKILL.md

現状の #179 は「前回 blocker の多くを潰したが、create-issue 実装との統合境界でまだ破綻する」状態です。マージ前に上記 4 blocker は解消した方がよいです。

- B1: FOLLOW_UP_ISSUE_REQUEST_V1 に initial_label_profile (triage_only|standard) と
  materialization フィールドを追加。triage_only 時は gh issue create 直接使用で
  state/queued 等の標準ラベルを付与しないフローを明記
- B2: dedupe 検索を --state open から --state all に変更し closed 重複 Issue の
  skipped_closed_* ステータスを定義。closed Issue の自動差し戻しは human escalation とした
- B3: issue-refinement-loop と post-merge-cleanup の終了コメントテンプレートに
  FOLLOW_UP_MATERIALIZATION_RESULT_V1 形式の follow_up_issues / note_only_observations を追加
- B4: pr-review-judge に mandatory_follow_up_gate guardrail を追加。
  mandatory_follow_up が未 materialize の場合は APPROVE 禁止とした
- High: agent-skill-boundaries.md に FOLLOW_UP_MATERIALIZATION_RESULT_V1 を中央定義として追加
- Non-blocker: post-merge-cleanup の edit-issue 言及を削除(create-or-skip の 2 択に整理)

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

iteration 2 修正により前回の 4 Blockers はすべて解消されました。

Mergeability

  • mergeable=MERGEABLE, mergeStateStatus=CLEAN

Evidence Check

AC coverage: 全 AC1-AC7 が [x] で記載され、根拠コマンドの結果も記録されている。placeholder 残存なし。

Allowed Paths: 変更ファイル 6 件はすべて Issue #89 の Allowed Paths に含まれる。impl-review-loop/SKILL.md 本体は変更されておらず、steps/step-5-feedback-and-termination.md のみ変更(これも Allowed Paths に含まれる)。

CI Verification: build / lint / python-test / test / typecheck の全 5 チェックが pass。lint は main ブランチ由来の既存 93 errors(本 PR の docs 変更と無関係)。

検証コマンド結果: AC1-AC7 の grep コマンドが各 1 件以上ヒット、negative check(AC4)も PASS が記録されている。

Schema Change Applicability: not_schema_change と明示され、変更は docs-only であることが diff と一致している。Schema Consumer Inventory の提出不要。

Safety Claim Matrix: .claude/skills/** の変更を含む safety-sensitive PR として Matrix を提出済み。Not controlled 列が全行「なし」で、無限定安全主張も PR タイトル / 本文に確認されない。Evidence は SKILL.md 内の記述 + negative check コマンドと対応している。

Runtime Verification: decision: not_applicable(docs-only)。deferred 先の参照確認不要。

Blocker 解消確認

B1(triage_only / create_issue_txn.py bypass): FOLLOW_UP_ISSUE_REQUEST_V1 に initial_label_profile: triage_only | standard と materialization フィールドが追加された。triage_only 時は create_issue_txn.py を使わず gh issue create を直接実行し state/queued 等を付与しないことが agent-skill-boundaries.md に明記されている。解消済み。

B2(dedupe --state all): post-merge-cleanup・impl-review-loop・issue-refinement-loop・agent-skill-boundaries.md の全箇所で --state all に変更済み。closed Issue の再起票を禁止する skipped_closed_not_planned / skipped_closed_completed / skipped_closed_duplicate ステータスが各所に追加されている。解消済み。

B3(issue-refinement-loop の終了コメントに FOLLOW_UP_MATERIALIZATION_RESULT_V1 追加): issue-refinement-loop/SKILL.md の approved 終了テンプレートに FOLLOW_UP_MATERIALIZATION_RESULT_V1 ブロック(follow_up_issues + note_only_observations)が追加されている。解消済み。

B4(pr-review-judge の mandatory_follow_up_gate): pr-review-judge/SKILL.md の Guardrails セクションに mandatory_follow_up_gate が追加され、未 materialize の場合は APPROVE 出力を禁止し REQUEST_CHANGES を出力する旨が明記されている。解消済み。

Blockers

なし

Non-blockers(任意改善)

以下の観察事項は blocker 扱いせず、必要に応じて後続 Issue で対処してください。

  1. pnpm lint 既存 93 errors の系統的解消 — main ブランチ由来の既存問題。本 PR の変更とは無関係だが、CI を green に保つためには別 Issue での解消が望ましい。

  2. issue-refinement-loop AC3 の「候補を返す SubAgent」未明示 — SKILL.md の「派生改善候補を自動起票する」文脈で、どの SubAgent が候補を返すか明記されていない(codebase-investigator / web-researcher / review-issue が候補)。読者の判断負荷が残る。

  3. FOLLOW_UP_ISSUE_REQUEST_V1 の note_only severity の記録先が未定義 — agent-skill-boundaries.md に severity: note_only の場合の終了報告先フィールド(note_only_observations)のルールは定義されているが、note_only を受け取る skill が終了報告コメントのどのフィールドに記録するかのフロー記述が軽薄。実装時に解釈ゆらぎが生じうる。

LOOP_VERDICT

verdict: APPROVE
blockers: []
mergeable: MERGEABLE
mergeStateStatus: CLEAN
reviewed_head_sha: 3c9008eb5c448dca6aebaba8febc1e463ffac99d
follow_up_issue_requests:
  - title: "pnpm lint 既存 93 errors の系統的解消"
    issue_kind: implementation
    severity: optional_follow_up
    source:
      kind: pr_review
      url: "https://github.com/squne121/loop-protocol/pull/179"
      note_id: "1"
    dedupe_key: "follow-up:squne121/loop-protocol:pr/179:1"
    desired_destination: "pnpm lint が 0 errors で CI が完全 green になっている"
    validated_scope_delta: "ESLint errors の修正(main ブランチ由来の既存エラー群)"
    origin_skill: pr-review-judge
    labels:
      - triage-required
    initial_label_profile: triage_only
  - title: "issue-refinement-loop の派生改善候補返却 SubAgent を明示する"
    issue_kind: implementation
    severity: note_only
    source:
      kind: pr_review
      url: "https://github.com/squne121/loop-protocol/pull/179"
      note_id: "2"
    dedupe_key: "follow-up:squne121/loop-protocol:pr/179:2"
    desired_destination: "refinement loop で派生改善候補を返す SubAgent が SKILL.md に明記されている"
    validated_scope_delta: "issue-refinement-loop/SKILL.md の派生改善候補セクションに SubAgent 名を追記"
    origin_skill: pr-review-judge
    labels:
      - triage-required
    initial_label_profile: triage_only
  - title: "note_only severity の終了報告フローを各 skill で統一する"
    issue_kind: implementation
    severity: note_only
    source:
      kind: pr_review
      url: "https://github.com/squne121/loop-protocol/pull/179"
      note_id: "3"
    dedupe_key: "follow-up:squne121/loop-protocol:pr/179:3"
    desired_destination: "note_only 受け取り時の終了報告手順が各 skill の SKILL.md に統一記述されている"
    validated_scope_delta: "各 skill の終了報告テンプレートに note_only フロー記述を追加"
    origin_skill: pr-review-judge
    labels:
      - triage-required
    initial_label_profile: triage_only

@squne121
squne121 merged commit 151e6ec into main May 21, 2026
5 checks passed
@squne121
squne121 deleted the worktree-issue-89-post-merge-cleanup-skill-follow-up-issue branch May 21, 2026 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

運用: post-merge-cleanup と関連オーケストレーション skill で follow-up Issue を自動起票化(候補列挙 → auto-create)する

1 participant