Skip to content

運用: issue-contract-review の git branch --list false positive を修正する #182

Open

Description

@squne121

背景

Issue #89 の impl-review-loop 実行中(issue-contract-review step 6)に、git branch --list "$BRANCH" が branch 未存在でも exit 0 を返すため [WARN] branch 既存 の false positive が発生した。

出典: impl-review-loop issue #89 の issue-contract-review 実行結果。
FOLLOW_UP_ISSUE_REQUEST_V1.source: #179

問題のあるコード

.claude/skills/issue-contract-review/SKILL.md step 6:

# 問題のあるコード
git branch --list "$BRANCH" && echo "[WARN] branch 既存" || echo "[OK] branch 未作成"
# → branch が存在しなくても exit 0 のため WARN が出る

git branch --list "$BRANCH" は branch が存在しなくても空文字列を stdout に出力して exit 0 を返す。
&& の条件は exit code のみ評価するため、branch が未存在でも常に [WARN] branch 既存 が出力される。

修正内容

# 修正後
git branch --list "$BRANCH" | grep -q . && echo "[WARN] branch 既存" || echo "[OK] branch 未作成"

grep -q . により stdout が空かどうかを判定することで、branch 存在有無を正確に検出できる。

影響範囲

  • change_kind: docs(SKILL.md の手順修正のみ)
  • ファイル: .claude/skills/issue-contract-review/SKILL.md
  • severity: optional_follow_up(false positive は人間が目視で判断できるが、自動判定が誤るとループが不必要に停止する)

受け入れ条件

  • .claude/skills/issue-contract-review/SKILL.md の step 6 の branch 存在チェックが git branch --list "$BRANCH" | grep -q . を使う形に修正されている
  • branch が存在しない場合に [OK] branch 未作成 が出力される
  • branch が存在する場合に [WARN] branch 既存 が出力される

Activity

  1. added
    enhancement
    triage-required
    on May 21, 2026
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

    enhancementtriage-required

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions