Pr driver protocol

From jleechanorg/claude-commands · View interactive version

Pr driver protocol is an AI agent skill from the GitHub repository jleechanorg/claude-commands. Use after every `git push` on a PR — enumerates ALL current gate failures, fixes ALL in one local pass, and pushes once. The fix-all-before-push invariant.

How to use this skill

Skill file

PR driver protocol — fix-all before push

A standalone, callable protocol for any agent (worker, babysit, human) that is driving a PR to green. The single rule: after every push, fix ALL known gate failures in one local pass before the next push. "CI pending" is not an idle state.

When to use this protocol

The 5-step loop

1. ENUMERATE   — read ALL current gate failures, not just the first
2. CLASSIFY    — group by file + root cause (same root cause = one fix)
3. FIX-ALL     — apply every fix locally; do not push until all are staged
4. VERIFY      — run the local equivalent of each failing gate
5. PUSH        — single commit covering all fixes; then back to step 1

Step 1: ENUMERATE

Do not stop at the first failure. Use /green <PR> or read the failure-class log and build a complete list. For each failure, capture:

Step 2: CLASSIFY

Group failures by the underlying root cause. Two failures with the same root cause are one fix:

F1: dist/index.js argv shape not recognized in non-canonical check   (cli/doctor.ts:142)
F2: worker binary path resolution fails when global npm is used        (cli/doctor.ts:203)
  → Same root cause: argv path normalization is regex-naive
  → ONE fix: switch to path.basename() comparison

Do not push two commits to fix one root cause; that partial-fix-then-push loop is what this protocol stops.

Step 3: FIX-ALL

Apply every fix in one local working tree. Stage selectively — never git add -A. The commit message should describe the bundle, not each individual fix; for example, <repo commit prefix> fix: doctor argv-path handling (resolves gate 1 + 2) with a body listing the changed lines and the added test.

Step 4: VERIFY

Run the local equivalent of each failing gate before pushing:

| Gate | Local verification |

|---|---|

| Green Gate (CI) | the repository's test command (and the relevant package test) |

| Evidence | Verify only the applicable proof for each changed claim under PR lifecycle and evidence standards. |

| Inline threads | gh api graphql ... isResolved — every thread resolved? |

If verification fails, do not push. Go back to step 3 with the new failures added to the list.

Step 5: PUSH

One commit, one push, then immediately back to step 1 (the loop continues). While CI is running, pre-diagnose the next likely failure by reading:

Worked example

Three gate failures arrive together: two share one root cause (a config value), one is separate logic. Partial

pushes would cost three CI round-trips. Instead: enumerate all three, classify them into two fixes, apply both in

one tree, run the repository's test command for each, and push one commit.

Anti-patterns (will be flagged by the harness)

Babysit pairing

The babysit skill is archived in this repository, so the observer-side DRIVER-mode pairing is inactive. This

protocol stands alone on the worker side.

Origin

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.