Skip to content

Fix pr-create and pr-status command reliability #12

@tombakerjr

Description

@tombakerjr

Bug 1: pr-create fails when no PR exists yet

Location: commands/pr-create/SKILL.md (or equivalent)

Problem: The skill template runs gh pr view to check for an existing PR before creating one. This command exits non-zero when no PR exists (the expected/common case). The Bash pattern wrapper treats this as a fatal error and stops execution instead of interpreting it as "no PR exists, proceed to create."

Fix: Either:

  • Use gh pr view 2>/dev/null || true and check output
  • Use gh pr list --head $(git branch --show-current) --json number --jq '.[0].number' which returns empty instead of erroring

Bug 2: pr-status doesn't wait for CI or review comments

Location: commands/pr-status/SKILL.md (or equivalent)

Problem: Current implementation is a point-in-time snapshot. It doesn't:

  1. Watch CI checks to completion (gh pr checks --watch)
  2. Wait for the Claude review comment to be posted (which arrives ~10-12s after CI passes)
  3. Verify the review comment is from the most recent CI run (by timestamp comparison)

Expected behavior:

  1. Run gh pr checks --watch to block until CI completes
  2. After CI passes, wait briefly then fetch issue comments
  3. Find the Claude review comment (from claude[bot]) — it always posts something (suggestions or LGTM)
  4. Verify the comment timestamp is after the latest CI run started (ensures it's not a stale comment from a previous push)
  5. Report any blockers: 🔴 CRITICAL, 🟡 FIX, BLOCKER
  6. Never indicate "ready to merge" without finding the review comment from the current run

Context: Discovered during ATLAS PR #97 audit remediation workflow. Both bugs required manual workarounds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions