prereview
Skill7 starsChanged 9 months agoMITView on GitHub
Review unpushed commits before pushing for code quality, bugs, security issues, and error handling. Use when preparing to push commits, want pre-push code review, or need to validate changes before pushing. Runs comprehensive analysis using specialized review agents.
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- plugin/CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- corpus-testSkill
- gen-testSkill
- prepare-releaseSkill
- publish-releaseSkill
- quality-gateSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 11 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Before checking for unpushed commits, check if there are uncommitted changes that should be committed first:
- Distinctive: line 23
Use the AskUserQuestion tool to ask:
- Distinctive: line 30
Commit staged only: - Commit just what's currently staged
- Distinctive: line 33
If the user chooses to commit:
- Very specific: line 36
Use the Skill tool to invoke commit-commands:commit to create a proper conventional commit
- Distinctive: line 37
After the commit succeeds, continue to Step 1
- Distinctive: line 84
When launching agents, provide them with:
- Distinctive: line 92
After all agents complete, provide a consolidated summary:
- Distinctive: line 103
After presenting the summary, use the AskUserQuestion tool to ask what the user wants to do next:
- Distinctive: line 111
Push as-is: - No changes needed, ready to push
- Distinctive: line 114
If the user selects an option to address issues:
- Distinctive: line 116
Create a todo list of all issues to fix based on their selection
- Very specific: line 118
After all fixes are complete, run make check to verify the changes
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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
prereview
Review unpushed commits before pushing, using the same comprehensive analysis as PR reviews.
You are performing a pre-push code review. The user has commits ready to push but wants them reviewed first.
Step 0: Check for Uncommitted Changes
Before checking for unpushed commits, check if there are uncommitted changes that should be committed first:
# Check for staged or unstaged changes
git status --porcelainIf there are NO unpushed commits BUT there ARE uncommitted changes:
Use the AskUserQuestion tool to ask:
Question: "No unpushed commits found, but you have uncommitted changes. Would you like to commit them first?"
Options:
- Commit all changes - Stage all changes and create a commit (will prompt for message)
- Commit staged only - Commit just what's currently staged
- Cancel - Exit without reviewing
If the user chooses to commit:
- For "Commit all changes": Run
git add -Afirst - Use the Skill tool to invoke
commit-commands:committo create a proper conventional commit - After the commit succeeds, continue to Step 1
If there are NO unpushed commits AND NO uncommitted changes:
- Inform the user: "Nothing to review - no unpushed commits and no uncommitted changes."
- Exit the skill
Step 1: Identify Unpushed Changes
First, determine what needs to be reviewed:
# Get the current branch
git branch --show-current
# Check if there's an upstream tracking branch
git rev-parse --abbrev-ref @{upstream} 2>/dev/null || echo "NO_UPSTREAM"
# Show unpushed commits (if upstream exists)
git log @{upstream}..HEAD --oneline 2>/dev/null || git log origin/main..HEAD --oneline 2>/dev/null || git log origin/master..HEAD --oneline 2>/dev/nullStep 2: Get the Full Diff
Get the complete diff of all unpushed changes:
# Diff against upstream, falling back to origin/main or origin/master
git diff @{upstream}..HEAD 2>/dev/null || git diff origin/main..HEAD 2>/dev/null || git diff origin/master..HEAD 2>/dev/nullStep 3: Run Comprehensive Review
Using the diff output, launch the pr-review-toolkit agents to analyze the changes. Run these agents in parallel where possible:
- code-reviewer (
pr-review-toolkit:code-reviewer): Review for bugs, logic errors, security vulnerabilities, and adherence to project conventions in CLAUDE.md - silent-failure-hunter (
pr-review-toolkit:silent-failure-hunter): Identify silent failures, inadequate error handling, and inappropriate fallback behavior - code-simplifier (
pr-review-toolkit:code-simplifier): Check if code can be simplified while preserving functionality - comment-analyzer (
pr-review-toolkit:comment-analyzer): If comments were added/modified, verify they are accurate and helpful - pr-test-analyzer (
pr-review-toolkit:pr-test-analyzer): Analyze test coverage for the changes - type-design-analyzer (
pr-review-toolkit:type-design-analyzer): If new types were introduced, review their design
When launching agents, provide them with:
- The git diff output showing all changes
- The list of files modified
- Context that this is a pre-push review (not a PR review)
Step 4: Summarize Findings
After all agents complete, provide a consolidated summary:
- Critical Issues (must fix before pushing)
- Warnings (should consider fixing)
- Suggestions (nice to have improvements)
- Positive Observations (things done well)
End with a clear recommendation: ✅ Ready to push, ⚠️ Consider addressing issues, or 🛑 Fix critical issues first.
Step 5: Prompt for Action
After presenting the summary, use the AskUserQuestion tool to ask what the user wants to do next:
Question: "How would you like to proceed with these findings?"
Options:
- Address all - Fix all critical issues, warnings, and suggestions now
- Address critical + warnings - Fix critical and warning issues, skip minor suggestions
- Push as-is - No changes needed, ready to push
- Custom - Let me choose which specific issues to address
If the user selects an option to address issues:
- Create a todo list of all issues to fix based on their selection
- Work through each issue systematically, making the necessary code changes
- After all fixes are complete, run
make checkto verify the changes - Amend the existing commit(s) with the fixes (use
git commit --amendfor single commit, or interactive fixup for multiple) - Present the updated diff for final review before pushing
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.

