gpsaggese/helpers / .claude/skills/github.get_pr_to_pass_local_tests
github.get_pr_to_pass_local_tests
VerifiedMake the local unit tests pass for the current PR
Goal
- Run, monitor, and fix the local unit tests for the current PR
Workflow
Create and Update a Plan
- Create
plan-github.get_pr_to_pass_local_tests.md: a bullet list of actions - Keep it updated, marking each action
[.]in progress,[x]done,[F]failed
Get the PR Number and Branch Name
-
Get the PR number
> GH_PR_NUM=$(gh pr view --json number -q .number) -
Get the branch name
> BRANCH_NAME=$(git branch --show-current)
Run Local Regressions
- Run full test suite locally:
> pytest_multi_build.py --target . 2>&1 --timeout -1 | tee tmp.auto_task.pytest_multi_build.log - Wait for the script to terminate
Check Regressions to Complete
- Check the output of the local regressions with:
> pytest_failed_multi_build.py 2>&1 | tee tmp.auto_task.pytest_failed_multi_build.log
Report Status on the PR
- If local regressions are passing:
> gh pr comment $GH_PR_NUM --body "Local tests passing" - If any failures, document error and post:
> gh pr comment $GH_PR_NUM --body "Local test failures found: [error summary]. Investigating..."
Fix the Failures
- If failures were found, run
tmp.pytest_failed_multi_build.repro.shto understand what failed and use/pytest.fix_local_teststo analyze and fix them- If the fix is simple, just fix it and commit
- If the fix is not clear, stop and ask for the user to help
Never Commit Junk Files
- Never run
git add -Aorgit add .to stage a fix: they sweep in every untracked file (logs,tmp.*scratch files, test-run artifacts like.pkl/.jsoncaches), not just the intended files - Always stage files explicitly by path, e.g.
git add <file1> <file2> - Before committing, run
git status --shortand drop anything that is not part of the intended fix - If junk was already committed and pushed, amend the commit to hold only the
intended files and force-push (
git push --force-with-lease)
Loop
- Keep repeating until the PR is passing all the local tests
Constraints
- This skill runs both when executed locally on a dev computer and remotely on cloud (e.g., on GitHub or Anthropic infrastructure)
Verification
-
pytest_failed_multi_build.pyreports no failing tests - A PR comment reports the final local test status
-
git status --shortshows only the intended files staged before commit
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 318k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 318k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 318k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |