agentleFS
Baba01hacker666Baba01hacker666/dummyskills/skills/diff-reviewer/SKILL.md

diff-reviewer

Skill0 starsChanged 2 months agoMITView on GitHub

Reviews a git diff for concrete bugs, regressions, security risks, and style breaches with line citations.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 7 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when:

    line 14
  2. Very specific:

    Do not use to review pure infrastructure configuration files.

    line 20
  3. Very specific:

    Do not use to apply code fixes.

    line 21
  4. Very specific:

    If git_diff is empty: report "Diff is empty.

    line 28
  5. Very specific:

    If diff is missing line numbers: calculate relative to chunk headers (@@ -L,S +L,S @@).

    line 29
  6. Distinctive:

    Never invent defects if the diff is clean.

    line 30
  7. Distinctive:

    Follow these numbered actions:

    line 33
  8. Distinctive:

    Check for hardcoded credentials, unescaped SQL queries, command injections, and exposed debug logs.

    line 35
  9. Distinctive:

    Check null/undefined handling, off-by-one errors, unhandled promise rejections, and missing error branches.

    line 37
  10. Distinctive:

    Verify that existing public signatures or data contracts are not broken.

    line 39
  11. Very specific:

    If any secret or API key is found in diff: immediately classify as BLOCKER and recommend immediate credential rotation.

    line 48
  12. Very specific:

    If there are zero blockers or warnings: mark verdict as APPROVED.

    line 49
  13. Distinctive:

    Stop and ask the user when:

    line 83

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

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

Diff Reviewer

Conducts a rigorous, objective code review on a git diff. Flags logic errors, security vulnerabilities, leaked secrets, and broken conventions with exact line references.

1. Purpose

Identify defects in pull requests or staged commits before merging. Prioritizes correctness and security over stylistic opinions.

2. When to Use

Use this skill when:

  • Reviewing a branch diff before merging (git diff main...feature).
  • Inspecting staged changes prior to commit.
  • User requests: "Review this diff" or "Check my changes".

3. When Not to Use

  • Do not use to review pure infrastructure configuration files; use config-risk-reviewer.
  • Do not use to apply code fixes; use minimal-bug-fix.

4. Required Inputs

  • git_diff: Unified diff output (string).
  • context_summary: Optional description of the goal of the diff.

5. Missing-Input Behavior

  1. If git_diff is empty: report "Diff is empty; no changes to review."
  2. If diff is missing line numbers: calculate relative to chunk headers (@@ -L,S +L,S @@).
  3. Never invent defects if the diff is clean.

6. Procedure

Follow these numbered actions:

  1. Action 1: Scan for Security Vulnerabilities and Leaks
    • Check for hardcoded credentials, unescaped SQL queries, command injections, and exposed debug logs.
  2. Action 2: Check Logic Correctness and Edge Cases
    • Check null/undefined handling, off-by-one errors, unhandled promise rejections, and missing error branches.
  3. Action 3: Check Backward Compatibility & Regressions
    • Verify that existing public signatures or data contracts are not broken.
  4. Action 4: Classify Findings by Severity
    • BLOCKER: Security flaw, crash bug, or data corruption.
    • WARNING: Edge case bug, performance pitfall, or missing test.
    • NIT: Style, typo, or minor naming consistency.
  5. Action 5: Emit Review Report
    • Format using Section 8.

7. Decision Rules

  • If any secret or API key is found in diff: immediately classify as BLOCKER and recommend immediate credential rotation.
  • If there are zero blockers or warnings: mark verdict as APPROVED. Otherwise mark CHANGES REQUESTED.

8. Output Format

Emit the review using this template:

### Code Review: [PR or Branch Title]

- **Verdict**: [APPROVED | CHANGES REQUESTED]
- **Files Changed**: [Count]
- **Blockers**: [Count] | **Warnings**: [Count] | **Nits**: [Count]

#### Findings Table
| File | Line | Severity | Category | Description & Fix Recommendation |
| :--- | :--- | :--- | :--- | :--- |
| `[file]` | `[line]` | **BLOCKER** | Security | [Exact issue and replacement code] |
| `[file]` | `[line]` | **WARNING** | Logic | [Edge case explanation] |

#### Positive Observations
- [Clean patterns or good test coverage observed in the diff]

9. Verification Checklist

  • Every finding references exact file and line number.
  • Findings are categorized by severity.
  • No stylistic bike-shedding promoted to Blocker.
  • Verdict accurately reflects presence of blockers.

10. Common Failures and Recovery

Failure SymptomCauseRecovery Action
Vague feedbackSaying "Check error handling"Cite specific line and write the exact missing catch block.
Hallucinating issuesMisunderstanding frameworkVerify against framework standard before labeling Blocker.

11. Stop or Escalation Conditions

Stop and ask the user when:

  • Diff is too large (> 3,000 lines) to review accurately in one turn.

12. Examples

Example 1: Successful Execution

Input:

--- a/src/db.js
+++ b/src/db.js
@@ -10,3 +10,3 @@ function getUser(id) {
-  return db.query('SELECT * FROM users WHERE id = $1', [id]);
+  return db.query(`SELECT * FROM users WHERE id = '${id}'`);
 }

Output:

### Code Review: SQL Query Refactoring

- **Verdict**: CHANGES REQUESTED
- **Files Changed**: 1
- **Blockers**: 1 | **Warnings**: 0 | **Nits**: 0

#### Findings Table
| File | Line | Severity | Category | Description & Fix Recommendation |
| :--- | :--- | :--- | :--- | :--- |
| `src/db.js` | 11 | **BLOCKER** | Security | Critical SQL injection vulnerability. String interpolation allows arbitrary query execution. Revert to parameterized query: `db.query('SELECT * FROM users WHERE id = $1', [id])`. |

#### Positive Observations
- Query simplified, but security must take precedence.

Example 2: Ambiguous or Missing Input

Input:

Review this: (Empty diff)

Output:

### Code Review: Empty Diff

- **Verdict**: APPROVED (No Changes)
- **Files Changed**: 0
- **Blockers**: 0 | **Warnings**: 0 | **Nits**: 0

The provided diff contains no additions, modifications, or deletions.

Example 3: Expected Final Output

Output:

### Code Review: Add User Avatar Upload

- **Verdict**: APPROVED
- **Files Changed**: 2
- **Blockers**: 0 | **Warnings**: 0 | **Nits**: 1

#### Findings Table
| File | Line | Severity | Category | Description & Fix Recommendation |
| :--- | :--- | :--- | :--- | :--- |
| `src/upload.ts` | 42 | **NIT** | Style | Typo in comment: "avater" -> "avatar". |

#### Positive Observations
- MIME type and file size validation properly implemented before processing buffer.

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.