Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "issue-refinement-loop の feedback_update_required / reframe_in_place 分岐において、issue-author SubAgent と edit-issue skill が Issue タイトルも body と同時に更新するよう SKILL.md に手順を追記する"
change_kind: workflowParent Issue
なし(単独改善)
Parent Goal Ref
- Goal: なし(単独改善のため親 Issue なし)
- Desired Destination: なし
Current Validated Scope
.claude/skills/issue-refinement-loop/SKILL.mdの Step 4 仕様に、final_classificationがfeedback_update_required/reframe_in_placeの場合に issue-author SubAgent へのインプットへタイトル更新指示を含める旨を追記する.claude/skills/edit-issue/SKILL.mdの Procedure にgh issue edit --titleによるタイトル更新手順を追記する
Remaining Parent Gaps
なし
Outcome
.claude/skills/issue-refinement-loop/SKILL.md と .claude/skills/edit-issue/SKILL.md に、feedback_update_required / reframe_in_place 分岐でタイトルも更新する手順が追記されたコミットが存在する状態。
Background
Issue #127 の issue-refinement-loop 実行(2026-05-21)において、anchor comment(issuecomment-4508382829)が feedback_update_required に分類され Issue 本文(Goal / In Scope / AC / VC)を全面改訂した。しかし Issue タイトルは旧スコープのまま残った。
旧タイトル: 実装: issue-refinement-loop に任意入力 anchor_comment_url を追加し Step 1 調査依頼へコメント主張の事実確認を必須注入する
改訂後スコープ: ANCHOR_COMMENT_CONTEXT_V1 / ANCHOR_COMMENT_FACT_CHECK_RESULT_V1 / requires_fact_check の入出力契約固定
body と乖離したタイトルは GitHub 一覧・検索・sub-issue 表示での誤解を招き、実装者が着手前に body との齟齬に気づきにくくなる。
feedback_update_required は Issue の Outcome そのものが変化するケースであり、タイトルも body と同時に更新する必要がある。edit-issue の gh issue edit コマンドは --title オプションで --body-file と同時にタイトル更新ができるため、追加コストなく対応可能。
Refs #127
In Scope
.claude/skills/issue-refinement-loop/SKILL.mdの Step 4(issue-author SubAgent 起動仕様)に、final_classificationがfeedback_update_requiredまたはreframe_in_placeの場合に issue-author へのインプットへ「タイトル更新案を提示し、issue-author がタイトルもgh issue edit --titleで更新する」指示を含める旨を追記する.claude/skills/edit-issue/SKILL.mdの Procedure(gh issue edit実行ステップ)に--titleオプションの使用条件(スコープ変更を伴う feedback 適用時)を追記するanchor_comment_feedbackにtitle_update.required / proposed_title / reason相当の正規化済み title 更新指示フィールドを含める(main thread が確定した後 issue-author へ渡す)feedback_update_required/reframe_in_placeでも、Goal / Outcome / In Scope の意味が変わらない場合はtitle_update.required=falseとする条件を定義するedit-issueはtitle_update.required=trueの場合のみgh issue edit --title "$NEW_TITLE" --body-file "$NEW_BODY"を実行する- title 更新時は old title を backup / rollback 対象に含める
Out of Scope
superseded_by_decisionの場合(Issue をクローズするためタイトル更新は不要)- 本文スコープに変化のない needs-fix(AC/VC の構造修正のみ、C5 fix 等)の場合
issue-contract-review/pr-review-judgeなど他 skill の変更- タイトルの自動生成ロジックの実装(issue-author が既存 goal_ref / Outcome から適切なタイトル案を導出する判断は既存能力の範囲)
- title 自動生成アルゴリズムの機械実装
- Agent SDK schema enforcement(feat: issue-refinement-loop SubAgent 入出力契約を Agent SDK schema で型強制する #168)
superseded_by_decisionの代替 Issue title 生成- body 更新を伴わない title-only rename
Acceptance Criteria
- AC1:
anchor_comment_feedbackにtitle_update.required / proposed_title / reason相当の正規化済み title 更新指示が定義されている - AC2: raw anchor comment snapshot を title 生成・
reviewer_feedback_textに直接使わないことが SKILL.md に明記されている - AC3:
edit-issueはtitle_update.required=trueの場合にgh issue edit --title ... --body-file ...を使うことが SKILL.md に明記されている - AC4:
superseded_by_decision、title-impact のない structural-onlyneeds-fix、AC/VC 整形のみは title 更新対象外であることが SKILL.md のいずれかに明記されている - AC5: title 更新時の backup / rollback 対象に old title が含まれることが
edit-issue/SKILL.mdに明記されている - AC6:
ISSUE_EDIT_RESULT_V1に optionaltitle_update結果が含まれる、または明示的に out of scope として別 Issue 化されていることが明記されている
Verification Commands
# AC1: anchor_comment_feedback に title_update 正規化済み指示が定義されている
rg "title_update\.(required|proposed_title|reason)|title_update_required|proposed_title" \
.claude/skills/issue-refinement-loop/SKILL.md && echo "PASS: AC1" || echo "FAIL: AC1"
# AC2: raw snapshot を title 生成に直接使わないことが明記されている
rg "raw.*snapshot.*title|raw anchor.*title|snapshot.*title|title.*raw.*snapshot" \
.claude/skills/issue-refinement-loop/SKILL.md && echo "PASS: AC2" || echo "FAIL: AC2"
# AC3: --title オプションの使用条件が edit-issue に明記されている
rg "\-\-title" \
.claude/skills/edit-issue/SKILL.md && echo "PASS: AC3" || echo "FAIL: AC3"
# AC4: superseded_by_decision と structural-only needs-fix がタイトル更新対象外と明記されている
rg "superseded_by_decision.*(title|タイトル).*対象外|title.*superseded_by_decision|title_update.*required.*false.*superseded|structural.*only.*(title|タイトル).*対象外" \
.claude/skills/issue-refinement-loop/SKILL.md .claude/skills/edit-issue/SKILL.md && echo "PASS: AC4" || echo "FAIL: AC4"
# AC5: title の backup / rollback 対象への追加が明記されている
rg "title.*backup|backup.*title|old.*title.*rollback|rollback.*title|old_title" \
.claude/skills/edit-issue/SKILL.md && echo "PASS: AC5" || echo "FAIL: AC5"
# AC6: ISSUE_EDIT_RESULT_V1 に title_update 結果または out of scope 明記がある
rg "ISSUE_EDIT_RESULT_V1.*(title_update|title)|title_update.*(ISSUE_EDIT_RESULT_V1)|title.*out of scope.*#[0-9]|title_update.*別.*Issue" \
.claude/skills/issue-refinement-loop/SKILL.md .claude/skills/edit-issue/SKILL.md && echo "PASS: AC6" || echo "FAIL: AC6"Allowed Paths
.claude/skills/issue-refinement-loop/SKILL.md.claude/skills/edit-issue/SKILL.md.claude/skills/edit-issue/scripts/backup-and-parse-issue.py(title backup 対応のため追加。不要な場合は Out of Scope として別 Issue 化する)
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
ISSUE_EDIT_RESULT_V1への backward-compatible な optional field 追加(既存 required key の削除・意味変更なし)は In Scope とする(Stop しない)
Runtime Verification Applicability
decision: not_applicable
reason: >
変更対象は SKILL.md のテキスト記述のみ。
実装後にランタイムで動作確認すべき挙動(UI 描画・ゲームロジック・API コール等)は含まれない。
AC/VC は rg による静的テキスト存在確認で完結する。Required Skills
なし
Scope Delta(任意)
N/A
Delivery Rule
1 Issue = 1 PR- 変更対象は
.claude/skills/issue-refinement-loop/SKILL.mdと.claude/skills/edit-issue/SKILL.mdのみ - Issue 実装: issue-refinement-loop に ANCHOR_COMMENT_CONTEXT_V1 / ANCHOR_COMMENT_FACT_CHECK_RESULT_V1 / requires_fact_check を追加し anchor comment fact-check の入出力契約を固定する #127 マージ後に着手すること(
issue-refinement-loop/SKILL.mdのコンフリクト回避) - Draft PR で開始し、AC 全項目 PASS を確認してから ready for review とする
Activity
squne121 commentedon May 21, 2026
create-issue transaction partial-failure
Issue: #162
Failure stage: label-readback
Message: label read-back mismatch
Requested:
Completed steps: create, label
Failure context:
matching_issue_numbers=[162]
issue_number=162
Recovery hint: label-readback failed for #162.
Manual re-apply command (idempotent: yes):
gh issue edit 162 --repo squne121/loop-protocol --add-label
Verify:
gh issue view 162 --repo squne121/loop-protocol --json labels
Please recover deterministically before re-running the create issue transaction.
squne121 commentedon May 21, 2026
Dependency Note: この Issue は Issue #127 のマージ後に着手してください。
issue-refinement-loop/SKILL.mdを共有 Allowed Path として持つためマージコンフリクト回避が必要です。\n\n- Blocked by: #127squne121 commentedon May 21, 2026
判定
Issue #162 は方向性は妥当。ただし、そのまま実装に回すと不足です。
#127 / PR #163 で
final_classification、anchor_comment_feedback、SubAgent / main thread の責務分離は既に入っています。#162 はその上に「body だけ更新され、title が旧スコープのまま残る」事故を潰す Issue なので、問題設定は正しいです。#127 の背景でも、Issue #127 は reviewer feedback によりスコープが再設計され、タイトルも更新済みの新スコープへ変わっています。ただし #162 の現在の AC は「
--titleを追記する」レベルに寄りすぎています。実際に必要なのは、title 更新を誰が決め、どの入力からタイトル案を作り、どの条件で更新対象外にし、失敗時にどう復旧するかの control-plane 設計です。関連Issue / PRから見た前提
#96 / PR #128 で、
anchor_comment_url、4分類、superseded_by_decision分岐、reframe_in_place/feedback_update_requiredが導入されています。#96 は「前提否決済み Issue を approve へ磨かない」ための分岐追加が目的でした。#127 / PR #163 で、
ANCHOR_COMMENT_CONTEXT_V1、ANCHOR_COMMENT_FACT_CHECK_RESULT_V1、requires_fact_check、final_classificationの main thread 確定責務、Step 4 への raw snapshot 禁止が導入されています。PR #163 は #127 を close し、Step 4 はanchor_comment_feedbackのみ受け取る仕様にしています。現在の
issue-refinement-loop/SKILL.mdでも、Step 4 は raw anchor comment ではなく、main thread がfinal_classification確定後に生成したanchor_comment_feedbackのみ渡す、と明記されています。#168 は #127 の follow-up として、Agent SDK schema で
ANCHOR_COMMENT_FACT_CHECK_RESULT_V1を型強制し、SubAgent の mutation 制限や schema validation 失敗時の retry / human escalation を扱う Issue です。#162 でここまで広げるべきではありません。Blockers
Blocker 1: 「どの分類なら必ず title 更新するか」が粗い
#162 は
feedback_update_required/reframe_in_placeの場合にタイトルも更新するとしていますが、この2分類が常にタイトル変更を意味するわけではありません。例えば、AC の追加だけならタイトルは維持してよい場合があります。一方、Outcome / Goal / In Scope が変わる場合はタイトル更新が必要です。
修正案:
title_update_requiredを明示する。anchor_comment_feedbackに次のようなフィールドを追加するのが安全です。これにより、
feedback_update_requiredだから機械的に title を変える、という過剰更新を避けられます。Blocker 2: issue-author が raw comment から title を推測する経路を作ってはいけない
現在の設計では、Step 4 に raw anchor comment を渡さず、正規化済み
anchor_comment_feedbackのみ渡すことが重要な安全境界です。#162 の文面だと「issue-author が既存 goal_ref / Outcome から適切なタイトル案を導出する」と読めますが、これだけでは弱いです。issue-author に raw comment やレビュー全文から自由推測させると、#127 で潰したはずの「SubAgent が文脈を推測して mutation に近い判断をする」問題が戻ります。
修正案: title 案は main thread が正規化済み入力として渡す。
責務はこう分けるべきです。
final_classificationとtitle_update.requiredを確定するtitle_update.proposed_titleと body draft の整合を取るgh issue edit --title ... --body-file ...を実行するClaude Code の SubAgent は独自 context window / system prompt / tool access / permissions で動き、親会話の全履歴を自動で持つ前提ではないため、渡す入力契約を明示する設計は妥当です。([Claude API Docs]1)
Blocker 3:
edit-issueのバックアップが body のみで、title 更新の復旧設計がない現行
edit-issue/SKILL.mdのバックアップ手順はgh issue view <N> --json body --jq .bodyを保存する設計です。title はバックアップ対象に入っていません。title も更新するなら、最低限どちらかが必要です。
または、既存の
backup-and-parse-issue.pyを title 対応に拡張する必要があります。ここが #162 の Allowed Paths と衝突します。#162 は
.claude/skills/issue-refinement-loop/SKILL.mdと.claude/skills/edit-issue/SKILL.mdだけを Allowed Paths にしていますが、安全にやるなら.claude/skills/edit-issue/scripts/backup-and-parse-issue.pyの変更が必要になる可能性が高いです。選択肢:
edit-issue/SKILL.mdに「title 更新時は old title を別途取得し、abort 復旧時に--title "$OLD_TITLE"も戻す」と明記するbackup-and-parse-issue.pyと関連テストを追加する個人的には 2 を推奨します。title 更新は mutation 対象を増やすため、復旧設計も同時に持つべきです。
Blocker 4: Stop Conditions が自分の実装を止めかねない
#162 の Stop Conditions には「In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合」とあります。
しかし title 更新をきれいに扱うには、
ISSUE_EDIT_RESULT_V1に次のようなフィールドを足したくなります。これは出力契約の additive schema change です。つまり、Issue 自身の Stop Conditions が高品質実装を止める可能性があります。
修正案: Stop Conditions を次のように緩める。
Major issues
Major 1: AC / VC が文字列存在確認に偏っている
現在の AC は
--titleやfeedback_update_required.*titleの存在確認中心です。これは低品質 PR を通します。特に AC1 の VC は英語
titleに寄っており、日本語で「タイトル」と書くと落ちる可能性があります。一方で、どこかにtitleがあるだけでも通る可能性があります。追加すべき negative / semantic checks はこれです。
Major 2:
gh issue edit --title --body-fileの仕様は正しいが、手順はもっと具体化すべきGitHub CLI の
gh issue editは--body-fileと--titleをサポートしています。公式マニュアルでも--body-file <file>は body をファイルから読み、--title <string>は新タイトルを設定すると説明されています。(GitHub CLI)したがって #162 の技術前提は正しいです。
ただし、
edit-issue/SKILL.mdには次のような明示が必要です。加えて、
NEW_TITLEは inline で組み立てず、tmp file または構造化 draft から読み出す方が安全です。Major 3: issue title の品質基準がない
title 更新を入れるなら、タイトル生成ルールも必要です。
最低限のルール:
#162 の発端は「旧タイトルが旧スコープを示し、body が新スコープを示す」齟齬なので、単に title を変えるだけでなく、旧スコープ語の残存検査を入れるべきです。
推奨パッチ方針
#162 を高品質化するなら、Issue 本文を次のように修正するのがよいです。
In Scope に追加
Out of Scope に追加
AC を差し替え
最終判断
#162 は実装してよいが、現状のままでは「
--titleを足しただけ」の低品質 PR になりやすいです。最小修正なら、
issue-refinement-loopの Step 4 inputs にtitle_updateを追加し、edit-issueに--title使用条件を明記してください。高品質化するなら、Allowed Paths を広げて
backup-and-parse-issue.pyとテストも更新し、title を body と同じ rollback 対象にしてください。これをしない場合、#162 は「タイトル同期の事故」を減らしますが、「title mutation の安全性」は保証できません。squne121 commentedon May 21, 2026
Issue 本文更新(edit-issue による自動適用)
anchor_comment_feedback(classification:feedback_update_required, scope_impact:amend)に基づき、以下のセクションを更新しました。変更セクション一覧
## In Scopetitle_update.required/proposed_title/reasonフィールド定義・条件・実行条件・backup 対象を追加## Out of Scopesuperseded_by_decisiontitle 生成・body なし title-only rename を追加## Acceptance Criteriaanchor_comment_feedback構造化・raw snapshot 禁止・--title条件・対象外分類・backup/rollback・ISSUE_EDIT_RESULT_V1拡張)## Verification Commands## Stop ConditionsISSUE_EDIT_RESULT_V1への backward-compatible optional field 追加は Stop しない条件を追加## Allowed Pathsbackup-and-parse-issue.pyを title backup 対応のため追加(不要な場合は別 Issue 化の明記付き)Guard 結果サマリ
バックアップ
tmp/issue_162_backup_1779373834.mdsqune121 commentedon May 21, 2026
issue-refinement-loop: 完了 (2026-05-21T14:33:02Z)
改善履歴
anchor comment (issuecomment-4509208400) の feedback を適用:
anchor_comment_feedbackにtitle_update.required / proposed_title / reasonフィールド定義・title_update.required=false条件・edit-issue 実行条件・old title の backup/rollback 対象化を追記superseded_by_decisiontitle 生成・body なし title-only rename を追加title_updateスキーマ検証・raw snapshot 禁止・--title使用条件・除外分類・backup/rollback・ISSUE_EDIT_RESULT_V1拡張)ISSUE_EDIT_RESULT_V1への backward-compatible optional field 追加は Stop しない旨を追加backup-and-parse-issue.pyを title backup 対応のため追加次アクション
issue-contract-reviewを実行して着手可能かを確認してください。squne121 commentedon May 21, 2026
Contract Snapshot (2026-05-21T14:42:49Z)
.claude/skills/issue-refinement-loop/SKILL.mdと.claude/skills/edit-issue/SKILL.mdに、feedback_update_required/reframe_in_place分岐でタイトルも更新する手順が追記されたコミットが存在する状態。.claude/skills/issue-refinement-loop/SKILL.md.claude/skills/edit-issue/SKILL.md.claude/skills/edit-issue/scripts/backup-and-parse-issue.py(必要時).claude/worktrees/issue-162-issue-refinement-loop-feedback-update-reworktree-issue-162-issue-refinement-loop-feedback-update-resqune121 commentedon May 21, 2026
implement-issue: 実装完了 (2026-05-21T14:49:24Z)
.claude/worktrees/issue-162-issue-refinement-loop-feedback-update-reworktree-issue-162-issue-refinement-loop-feedback-update-resqune121 commentedon May 21, 2026
impl-review-loop: 完了 (2026-05-21T14:53:57Z)
実装サマリー
変更ファイル:
.claude/skills/issue-refinement-loop/SKILL.md—anchor_comment_feedbackにtitle_update.required / proposed_title / reasonフィールド追加、raw snapshot 使用禁止ルール追記、title 更新非対象ケース(superseded_by_decision/ structural-onlyneeds-fix)定義.claude/skills/edit-issue/SKILL.md—OLD_TITLEbackup 追加(Step 1)、--title --body-file結合更新(Step 5)、--title "$OLD_TITLE"rollback(Step 7)、ISSUE_EDIT_RESULT_V1への optionaltitle_updateフィールド追加AC 全項目 PASS (AC1〜AC6)
PR #177: Ready for Review(マージは人間が判断)
fix: edit-issue Step 5 二重 mutation・rollback title 欠落・inline gh 禁止違反を修正 (
squne121 commentedon May 21, 2026
impl-review-loop: 完了 (2026-05-21T15:08:12Z)
実装サマリー
iteration 0: 初回実装 → 人間レビュー REQUEST_CHANGES(Blocker 1-5)
iteration 1: 全 Blocker 修正 → APPROVE
変更ファイル
.claude/skills/issue-refinement-loop/SKILL.mdanchor_comment_feedbackにtitle_update.required / proposed_title / reasonフィールド追加superseded_by_decision/ structural-onlyneeds-fix)定義title_update.required: true条件に「Goal / Outcome / In Scope の意味変化」「旧 title 主要語との矛盾」を追加title_qualityセクション(生成ルール)追加.claude/skills/edit-issue/SKILL.mdtitle_updateを正式追加rollback_issue_edit()共通関数追加(Step 5・7 統一)ISSUE_EDIT_RESULT_V1に optionaltitle_updateフィールド追加.claude/skills/edit-issue/scripts/backup-and-parse-issue.pyfetch_title_and_body()追加(title,body を 1 call で取得)titleフィールド追加AC 全項目 PASS (AC1〜AC6)
PR #177: Ready for Review — マージは人間が判断してください
fix: rollback定義・REPO初期化・metadata分離・title_update境界を修正する (#162)
squne121 commentedon May 21, 2026
impl-review-loop: 完了 (2026-05-21T15:23:22Z)
実装サマリー(最終)
最終変更ファイル(3件)
.claude/skills/issue-refinement-loop/SKILL.md: title_update スキーマ・更新条件・quality ルール・Step 4 edit_issue_inputs mapping 追加.claude/skills/edit-issue/SKILL.md: rollback_issue_edit() を Step 1 直後に移動、REPO 初期化、if/else 排他分岐、top-level title_update 参照統一、ISSUE_EDIT_RESULT_V1 拡張.claude/skills/edit-issue/scripts/backup-and-parse-issue.py: fetch_title_and_body()・metadata JSON 分離・stdout を metadata_file のみに変更AC 全項目 PASS(AC1〜AC6)
PR #177: マージは人間が判断してください
docs: issue-refinement-loop/edit-issue に title 更新手順を追加する (#177)