Repair PR
Goal
Repair the current or specified GitHub PR once, then stop. Handle merge conflicts, review feedback from chatgpt-codex-connector[bot], and CI failures in that order. Commit after each coherent repair phase, but push only once after all local changes are complete.
Workflow
Resolve the PR context.
- Read the repository
AGENTS.md before changing code.
- Confirm
gh auth status works.
- If the user provided a PR number or URL, use it; otherwise use
gh pr view --json number,url,baseRefName,headRefName.
- Run
node .agents/skills/repair-pr/scripts/repair-pr.mjs status --pr <pr> to collect merge state, unresolved bot review threads, and failing checks.
Resolve merge conflicts first.
- Treat
mergeStateStatus: DIRTY or GitHub reporting conflicts as the conflict signal.
- Fetch the PR base branch and merge it into the PR branch; do not rebase.
- Use
git merge origin/<baseRefName> or the correct remote-tracking base ref for the repository.
- If conflicts occur, resolve them by reading the source, fixtures, and tests. Do not choose
--ours or --theirs blindly.
- Run focused verification for the resolved area, then
git add the intended files and commit the merge/conflict resolution before moving on.
Apply bot review feedback.
- Consider only unresolved, non-outdated review threads with at least one comment authored by
chatgpt-codex-connector[bot].
- Ignore approvals, resolved threads, outdated threads, duplicates, and non-actionable notes.
- Group related review threads by behavior or file, implement the smallest correct fix, and run focused tests.
- Commit each coherent review-fix group.
- After the relevant fix is committed, resolve each handled thread with
node .agents/skills/repair-pr/scripts/repair-pr.mjs resolve-thread <thread-id>.
- If a bot comment is ambiguous or would cause a regression, leave the thread unresolved and report the blocker.
Fix CI failures.
- Use
gh pr checks <pr> --json name,state,bucket,link,workflow to identify failing checks.
- For GitHub Actions failures, inspect logs with
gh run view <run-id> --log or job logs from gh api when needed.
- Treat external checks as report-only unless their logs are available through
gh.
- Fix the observed root cause, run focused local verification, and commit the CI fix.
Finish once.
- Run the repository-required verification from
AGENTS.md when feasible; if full verification is too expensive or blocked, run the most relevant subset and clearly report the gap.
- Re-run
node .agents/skills/repair-pr/scripts/repair-pr.mjs status --pr <pr> once for a final summary.
- If any commits were created, push once with
git push for the current branch. Because this workflow merges instead of rebasing, do not force-push.
- Do not start a monitoring loop or keep polling checks after the final status check.
Helper
Use the helper from the repository root:
node .agents/skills/repair-pr/scripts/repair-pr.mjs status
node .agents/skills/repair-pr/scripts/repair-pr.mjs status --pr 123 --json
node .agents/skills/repair-pr/scripts/repair-pr.mjs resolve-thread PRRT_kwDO...
The helper is an inventory and review-thread mutation aid. It does not implement code fixes, stage changes, commit, push, or decide whether a review comment is correct.
Commit And Push Rules
- Commit after each coherent phase that changes files: merge-conflict repair, bot-review repair group, CI repair group.
- Stage only files that belong to the current repair.
- Push exactly once at the end if at least one commit was created.
- If no local changes were needed, do not create an empty commit and do not push.
1---2name: repair-pr3description: One-shot repair workflow for SWC pull requests. Use when asked to repair a PR by resolving merge conflicts, applying unresolved actionable reviews from chatgpt-codex-connector[bot], resolving those review threads, fixing failing CI, committing the repair work in coherent chunks, and pushing once at the end.4---56# Repair PR78## Goal910Repair the current or specified GitHub PR once, then stop. Handle merge conflicts, review feedback from `chatgpt-codex-connector[bot]`, and CI failures in that order. Commit after each coherent repair phase, but push only once after all local changes are complete.1112## Workflow13141. Resolve the PR context.15 - Read the repository `AGENTS.md` before changing code.16 - Confirm `gh auth status` works.17 - If the user provided a PR number or URL, use it; otherwise use `gh pr view --json number,url,baseRefName,headRefName`.18 - Run `node .agents/skills/repair-pr/scripts/repair-pr.mjs status --pr <pr>` to collect merge state, unresolved bot review threads, and failing checks.19202. Resolve merge conflicts first.21 - Treat `mergeStateStatus: DIRTY` or GitHub reporting conflicts as the conflict signal.22 - Fetch the PR base branch and merge it into the PR branch; do not rebase.23 - Use `git merge origin/<baseRefName>` or the correct remote-tracking base ref for the repository.24 - If conflicts occur, resolve them by reading the source, fixtures, and tests. Do not choose `--ours` or `--theirs` blindly.25 - Run focused verification for the resolved area, then `git add` the intended files and commit the merge/conflict resolution before moving on.26273. Apply bot review feedback.28 - Consider only unresolved, non-outdated review threads with at least one comment authored by `chatgpt-codex-connector[bot]`.29 - Ignore approvals, resolved threads, outdated threads, duplicates, and non-actionable notes.30 - Group related review threads by behavior or file, implement the smallest correct fix, and run focused tests.31 - Commit each coherent review-fix group.32 - After the relevant fix is committed, resolve each handled thread with `node .agents/skills/repair-pr/scripts/repair-pr.mjs resolve-thread <thread-id>`.33 - If a bot comment is ambiguous or would cause a regression, leave the thread unresolved and report the blocker.34354. Fix CI failures.36 - Use `gh pr checks <pr> --json name,state,bucket,link,workflow` to identify failing checks.37 - For GitHub Actions failures, inspect logs with `gh run view <run-id> --log` or job logs from `gh api` when needed.38 - Treat external checks as report-only unless their logs are available through `gh`.39 - Fix the observed root cause, run focused local verification, and commit the CI fix.40415. Finish once.42 - Run the repository-required verification from `AGENTS.md` when feasible; if full verification is too expensive or blocked, run the most relevant subset and clearly report the gap.43 - Re-run `node .agents/skills/repair-pr/scripts/repair-pr.mjs status --pr <pr>` once for a final summary.44 - If any commits were created, push once with `git push` for the current branch. Because this workflow merges instead of rebasing, do not force-push.45 - Do not start a monitoring loop or keep polling checks after the final status check.4647## Helper4849Use the helper from the repository root:5051```bash52node .agents/skills/repair-pr/scripts/repair-pr.mjs status53node .agents/skills/repair-pr/scripts/repair-pr.mjs status --pr 123 --json54node .agents/skills/repair-pr/scripts/repair-pr.mjs resolve-thread PRRT_kwDO...55```5657The helper is an inventory and review-thread mutation aid. It does not implement code fixes, stage changes, commit, push, or decide whether a review comment is correct.5859## Commit And Push Rules6061- Commit after each coherent phase that changes files: merge-conflict repair, bot-review repair group, CI repair group.62- Stage only files that belong to the current repair.63- Push exactly once at the end if at least one commit was created.64- If no local changes were needed, do not create an empty commit and do not push.