pr-review-fix-pipeline
Skill4 starsChanged 19 days agoMITView on GitHub
Reviews a PR and applies fixes for the non-controversial findings: review, fix, test, and commit in one pass. Writes code, so use it only on feature branches where automatic edits are fine. Trigger on: "review and fix PR", "auto-fix the PR", "review PR #X and fix issues", "run the review pipeline".
- Commits and pushes
In this repository34 other files it gives its agents.
- abstraction-finderSkill
- analyze-issueSkill
- backlog-routingSkill
- band-aid-finderSkill
- browser-debugger-cliSkill
- ci-fix-with-memorySkill
- code-health-auditSkill
- comment-reaperSkill
- cyoaSkill
- dead-code-cleanupSkill
- doc-rotSkill
- drupal-mental-modelSkill
- ds-guardSkill
- evidence-checkSkill
- github-screenshotSkill
- issue-maintenanceSkill
- kissSkill
- plain-language-auditSkill
- post-mergeSkill
- prioritize-issuesSkill
- project-bootstrapSkill
- project-pulseSkill
- routeSkill
- ship-issueSkill
- skill-paritySkill
- tdd-implementSkill
- test-fixSkill
- test-reaperSkill
- test-workflowSkill
- update-routingSkill
- visual-crawlSkill
- visual-qa-pipelineSkill
- worktree-enhancedSkill
- wrap-it-upSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
21 rules. About 0 are common, 21 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈21
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Use this skill when:
- Distinctive: line 25
Run tests and lint
- Distinctive: line 63
[BLOCKING]: Must be fixed before merge
- Distinctive: line 70
[RECOMMENDATION]: Should be fixed but not critical
- Distinctive: line 91
Wait for sub-agent completion: before proceeding to next issue.
- Distinctive: line 97
Critical: Verify dev server status BEFORE running tests
- Distinctive: line 122
If tests fail after fixes:
- Distinctive: line 192
Do NOT automatically fix:
- Distinctive: line 196
Test expectations (unless test is clearly wrong)
- Distinctive: line 199
If in doubt, flag for human review instead of auto-fixing.
- Distinctive: line 205
Run commands that interfere with running processes
- Distinctive: line 209
Check if dev server is running before running tests
- Distinctive: line 210
Run tests in separate process
- Distinctive: line 211
Ask user if you need to start dev server
- Distinctive: line 216
Verify no merge conflict markers
- Distinctive: line 217
Verify no debug code introduced
- Distinctive: line 218
Verify all auto-fixes are intentional
- Distinctive: line 219
Run full lint and test suite
- Distinctive: line 223
If the pipeline produces bad results:
- Distinctive: line 242
After fixes, runs lint/test suite
- Distinctive: line 252
Don't use this skill if:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Autonomous PR Review & Fix Pipeline
When to Use This Skill
Use this skill when:
- You want both review AND automatic fixes in one workflow
- PR has blocking issues that need immediate resolution
- You trust Claude to apply non-controversial fixes (typos, lint errors, obvious bugs)
- You want to minimize back-and-forth between review and implementation
⚠️ Important Notes
This is an autonomous workflow that will:
- Review the PR
- Apply fixes for blocking issues
- Run tests and lint
- Commit changes
- Push to the PR branch
Only use this when:
- You're comfortable with Claude modifying code without asking
- The PR is on a feature branch (not main/develop)
- You can review the resulting diff before merging
Pipeline Steps
Step 1: Fetch and Analyze
- Get PR information
gh pr view [NUMBER] --json headRefName,baseRefName,title,body - Fetch the diff (never cached)
gh pr diff [NUMBER] - Checkout the PR branch and record its head
git fetch origin [HEAD_REF] git checkout [HEAD_REF] git rev-parse HEAD # save as [START_SHA] for rollback Read the project's scripts
List the scripts the project defines (
scriptsinpackage.json, or the repo's equivalent such as a Makefile orpyproject.toml). Map lint, type check, CSS lint, and tests to the script that does each job. Script names differ between projects, so every command in this skill is an example. If a job has no matching script, skip that phase and say so in the report. Never run a script name you haven't confirmed exists.
Step 2: Categorize Issues
Analyze every file change and categorize issues:
- [BLOCKING]: Must be fixed before merge
- Bugs and logic errors
- TypeScript errors
- Breaking changes
- Security issues
- Missing error handling
- [RECOMMENDATION]: Should be fixed but not critical
- Performance improvements
- Better patterns available
- Code style issues
- [NIT]: Nice-to-have improvements
- Whitespace, formatting
- Comment improvements
- Variable naming
Step 3: Auto-Fix Blocking Issues
For each [BLOCKING] issue:
- Create a Task sub-agent to implement the fix
Task: Fix [specific issue] Context: [issue description and location] Constraint: Only fix this specific issue, don't refactor - Wait for sub-agent completion before proceeding to next issue. Fix agents run one at a time: they all edit the same branch, so parallel agents overwrite each other.
- Track fixes with TodoWrite for visibility
Step 4: Run Validation (with Dev Server Protection)
Critical: Verify dev server status BEFORE running tests
Find this checkout's dev-server port first: the dev server's entry in .claude/launch.json, the port in its dev script, or a PORT in its env. Don't assume 3000; in a worktree or another app, 3000 is usually someone else's server.
# PORT comes from the project (see above). No fallback: a guess checks the wrong server.
if [ -z "$PORT" ]; then
echo "No dev-server port found for this checkout"
elif lsof -ti:"$PORT" > /dev/null; then
echo "Dev server running on port $PORT; leave it alone"
else
echo "No dev server on port $PORT"
fi
# If tests need a server and none is running, ask the user before starting one.
# Run the validation scripts mapped in Step 1 (examples; skip any the project lacks)
npm run lint
npm run type-check
npm run lint:css
npm testStep 5: Handle Test Failures
If tests fail after fixes:
- Apply 3-attempt limit per test (use test-fix skill principles)
- If test fails after 3 attempts, flag it for human review
- Continue with other tests (don't block entire pipeline)
Step 6: Commit and Push
- Create a single commit with all fixes
git add -u git commit -m "fix: auto-applied blocking issue fixes from code review - [list of fixes applied] Applied via autonomous PR review pipeline" - Push to PR branch
git push origin [HEAD_REF]
Step 7: Report Results
Present this summary:
## Autonomous PR Review & Fix Pipeline Results
### Original Review Findings
#### 🔴 Blocking Issues (Auto-Fixed)
[List each blocking issue and how it was fixed]
#### 🔴 Blocking Issues (Flagged for Human Review)
[List issues that couldn't be auto-fixed]
#### 🟡 Recommendations (Not Auto-Fixed)
[List recommendations for user to consider]
#### 🟢 What Looks Good
[Positive observations]
### Fixes Applied
**Commit**: [commit hash]
**Files Modified**: [list of files]
[Detailed list of what was changed]
### Final CI Status
- **Lint**: [PASS/FAIL/SKIPPED - no script]
- **Type Check**: [PASS/FAIL/SKIPPED - no script]
- **CSS Lint**: [PASS/FAIL/SKIPPED - no script]
- **Tests**: [PASS/FAIL/SKIPPED - with details on any flagged tests]
### Next Steps
- [ ] Review the auto-applied fixes: `git diff [BASE]..[HEAD]`
- [ ] Address flagged blocking issues (if any)
- [ ] Consider recommendations
- [ ] Merge when readySafety Guardrails
Never Auto-Fix
Do NOT automatically fix:
- Architectural decisions
- API contract changes
- Feature behavior changes
- Test expectations (unless test is clearly wrong)
- Anything that changes user-facing behavior
If in doubt, flag for human review instead of auto-fixing.
Dev Server Protection
NEVER:
- Kill or restart the dev server
- Run commands that interfere with running processes
- Assume dev server state
ALWAYS:
- Check if dev server is running before running tests
- Run tests in separate process
- Ask user if you need to start dev server
Commit Safety
Before committing:
- Verify no merge conflict markers
- Verify no debug code introduced
- Verify all auto-fixes are intentional
- Run full lint and test suite
Rollback Instructions
If the pipeline produces bad results:
Step 6 already pushed the fix commit, so origin/[HEAD_REF] is the pipeline's own commit and resetting to it undoes nothing. Revert the pipeline's commit instead, which keeps the branch history intact for anyone who pulled it:
git revert [COMMIT_HASH]
git push origin [HEAD_REF]To confirm the branch is back where it started, git diff [START_SHA] HEAD (from Step 1) should print nothing.
Example Usage
User says: "Auto-review and fix PR #123"
Pipeline:
- Fetches PR #123 diff
- Finds 5 blocking issues: 3 lint errors, 1 TypeScript error, 1 missing await
- Spawns a Task agent per issue, one after another
- After fixes, runs lint/test suite
- All tests pass
- Commits: "fix: auto-applied blocking issue fixes from code review"
- Pushes to PR branch
- Reports what was fixed and final status
Total time: 3-5 minutes (vs. 15-30 minutes of back-and-forth)
When NOT to Use This Skill
Don't use this skill if:
- PR changes architectural patterns
- PR has controversial design decisions
- You want to review fixes before they're applied
- You're working on main/develop branch directly
In those cases, do a manual review instead.
Notes
- Uses Task sub-agents one at a time, since every fix lands on the same branch
- Combines review, implementation, and CI checking into one atomic operation
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

