agentleFS
erraggyerraggy/oastools/.claude/skills/prereview/SKILL.md

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.

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
  1. Distinctive:

    Before checking for unpushed commits, check if there are uncommitted changes that should be committed first:

    line 14
  2. Distinctive:

    Use the AskUserQuestion tool to ask:

    line 23
  3. Distinctive:

    Commit staged only: - Commit just what's currently staged

    line 30
  4. Distinctive:

    If the user chooses to commit:

    line 33
  5. Very specific:

    Use the Skill tool to invoke commit-commands:commit to create a proper conventional commit

    line 36
  6. Distinctive:

    After the commit succeeds, continue to Step 1

    line 37
  7. Distinctive:

    When launching agents, provide them with:

    line 84
  8. Distinctive:

    After all agents complete, provide a consolidated summary:

    line 92
  9. Distinctive:

    After presenting the summary, use the AskUserQuestion tool to ask what the user wants to do next:

    line 103
  10. Distinctive:

    Push as-is: - No changes needed, ready to push

    line 111
  11. Distinctive:

    If the user selects an option to address issues:

    line 114
  12. Distinctive:

    Create a todo list of all issues to fix based on their selection

    line 116
  13. Very specific:

    After all fixes are complete, run make check to verify the changes

    line 118

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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 --porcelain

If 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:

  1. Commit all changes - Stage all changes and create a commit (will prompt for message)
  2. Commit staged only - Commit just what's currently staged
  3. Cancel - Exit without reviewing

If the user chooses to commit:

  • For "Commit all changes": Run git add -A first
  • Use the Skill tool to invoke commit-commands:commit to 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/null

Step 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/null

Step 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:

  1. code-reviewer (pr-review-toolkit:code-reviewer): Review for bugs, logic errors, security vulnerabilities, and adherence to project conventions in CLAUDE.md
  2. silent-failure-hunter (pr-review-toolkit:silent-failure-hunter): Identify silent failures, inadequate error handling, and inappropriate fallback behavior
  3. code-simplifier (pr-review-toolkit:code-simplifier): Check if code can be simplified while preserving functionality
  4. comment-analyzer (pr-review-toolkit:comment-analyzer): If comments were added/modified, verify they are accurate and helpful
  5. pr-test-analyzer (pr-review-toolkit:pr-test-analyzer): Analyze test coverage for the changes
  6. 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:

  1. Critical Issues (must fix before pushing)
  2. Warnings (should consider fixing)
  3. Suggestions (nice to have improvements)
  4. 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:

  1. Address all - Fix all critical issues, warnings, and suggestions now
  2. Address critical + warnings - Fix critical and warning issues, skip minor suggestions
  3. Push as-is - No changes needed, ready to push
  4. 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 check to verify the changes
  • Amend the existing commit(s) with the fixes (use git commit --amend for single commit, or interactive fixup for multiple)
  • Present the updated diff for final review before pushing

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.