self-review
Skill1 starsChanged 3 months agoMITView on GitHub
Automated self-review loop for code changes. Accepts a PR URL, a local git repo path, or defaults to the current directory. Spawns a fresh review agent (with no prior context) to find bugs, design issues, and code quality problems, then triages findings, fixes valid issues, and iterates until the review is clean. Use this skill when the user wants to self-review their PR or branch, do an automated code review cycle, have Claude review and fix its own code, or iterate on code quality before requesting human review. Invoke with /self-review [pr-url-or-repo-path] [--max-rounds <N>]
25 other projects use a version of this.
Adopted by
Most recently taken up by
- ThinkFlowLab/system1-agentstheir own version, first seen Oct 4, 2026
- crbnos/carbontheir own version, first seen Oct 4, 2026
- shortcuts/dotfilestheir own version, first seen Oct 2, 2026
- tykisgod/quick-questiontheir own version, first seen Sep 19, 2026
- eai-org/agent-toolkittheir own version, first seen Sep 13, 2026
- huggingface/diffuserstheir own version, first seen Sep 9, 2026
Used with
Projects with it also use latex-formatting, novelty-assessment and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
lingzhi227Skilllatex-formatting
Handle LaTeX formatting, templates, and styling for academic papers. Set up conference templates (ICML, ICLR, NeurIPS, AAAI, ACL), fix formatting issues, manage packages, and ensure venue-specific compliance. Use when the user needs to set up a paper template, fix LaTeX formatting, or prepare for submission.
Also in 3 projects that use this
lingzhi227Skillnovelty-assessment
Assess research idea novelty through systematic literature search. Multi-round search-evaluate loops with harsh critic persona. Binary novel/not-novel decision with justification. Use before committing to a research direction.
Also in 3 projects that use this
michaelboedingSkillslide-generation
Use this skill to create presentation slides from structured content. Triggers: "create slides", "generate presentation", "make powerpoint", "create pptx", "build slides", "presentation from content", "slide deck", "slides for" Outputs: PPTX files, Markdown slides, or HTML presentations. Used by: pitch-deck-agent, market-researcher-agent, and other agents needing slides.
Also in 3 projects that use this
BlockSkillgithub-research
Search GitHub issues, PRs, and code using the gh CLI.
Also in 3 projects that use this
juanlurgSkillpaper-to-code
Reads a research paper and generates an implementation notebook with equations, code, and a toy example. Use when the user wants to implement a paper, convert a paper to code, or reproduce a paper's algorithm.
Also in 3 projects that use this
ZanderRussSkillliterature-review
Conduct comprehensive, systematic literature reviews using multiple academic databases (PubMed, arXiv, bioRxiv, Semantic Scholar, etc.). This skill should be used when conducting systematic literature reviews, meta-analyses, research synthesis, or comprehensive literature searches across biomedical, scientific, and technical domains. Creates professionally formatted markdown documents and PDFs with verified citations in multiple citation styles (APA, Nature, Vancouver, etc.).
Also in 3 projects that use this
- +4 more from lingzhi227
Other versions25 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 25
- huggingface/diffusers★ 35ksame name
- crbnos/carbon★ 2.7ksame name
- K9i-0/ccpocket★ 1.1ksame name
- lingzhi227/agent-research-skills★ 376same name
- ThinkFlowLab/system1-agents★ 114same name
- eai-org/agent-toolkit★ 55same name
- oribarilan/97★ 24same name
- wrg32786/aigent-os★ 19same name
- K9i-0/flutter_claude_sandbox★ 18same name
- shortcuts/dotfiles★ 18same name
15 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- bug-reportSkill
- code-coverage-policySkill
- coding-agents-setupSkill
- repo-agents-setupSkill
- review-designSkill
- review-prSkill
- sync-skillsSkill
- threat-modelSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
24 rules. 0 are common, 15 are distinctive, and 9 are very specific to this project.
0
Common
Most of the 22 edited versions we read keep these.
15
Distinctive
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 32
If the arg starts with http:// or https:// — treat it as a PR URL.
- Very specific: line 33
If the arg is a filesystem path (absolute or relative) that exists as a directory — treat it as a local git repo path.
- Distinctive: line 34
If no arg is provided — use the current working directory.
- Very specific: line 46
Check if a local clone already exists: Look at the current working directory (or any parent): does git remote -v match the PR's repository?
- Very specific: line 58
Verify it is a git repository: git -C <path> rev-parse --is-inside-work-tree.
- Very specific: line 67
If multiple candidates exist, or if the detected base seems wrong, use AskUserQuestion to confirm: "I detected origin/main as the base …
- Very specific: line 73
Verify the diff is non-empty: git diff <merge-base>...HEAD --stat.
- Distinctive: line 93
Log all decisions: Every triage verdict must include the reasoning.
- Very specific: line 148
When uncertain, ask the user: Use AskUserQuestion to present the finding and let the user decide:
- Distinctive: line 168
If there are findings marked Fix, launch a general-purpose Agent to apply them.
- Distinctive: line 198
After the fix agent completes, the coordinator re-runs the test suite independently via Bash.
- Very specific: line 204
If tests fail, spawn the fix agent again with the failure output and ask it to fix them.
- Distinctive: line 214
All findings in this round were triaged as won't-fix, invalid, or nit-level
- Distinctive: line 216
No fixes were applied in this round (all findings were triaged as acceptable)
- Distinctive: line 218
If exiting, proceed to Phase 3.
- Distinctive: line 224
After the loop completes (tests already verified in Step 4 of each round):
- Distinctive: line 226
Check if any files were modified: git status
- Very specific: line 229
Use AskUserQuestion to ask what to do:
- Distinctive: line 232
"Leave uncommitted": Leave changes in the working tree for manual review
- Distinctive: line 233
If no changes were made, inform the user that the review found no actionable issues.
- Distinctive: line 282
Be conservative with fixes: Only mark something as "Fix" if you are confident it is a genuine improvement.
- Distinctive: line 284
Respect prior decisions: If this conversation involved making deliberate design choices (e.g., using string interpolation instead of a …
- Distinctive: line 285
Log everything: Every finding and every verdict should be traceable.
- Distinctive: line 291
If the same finding keeps coming back across rounds despite being won't-fixed, consider whether the code could be restructured to make the …
“Common” is measured: kept by at least 6 in 10 of the 22 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Self-Review Skill
You are the coordinator of an automated self-review loop. You orchestrate two specialized agents, triage findings, interact with the user, and manage the iteration lifecycle.
Agent Architecture
| Agent | Type | Role | Can modify files? |
| Coordinator (you) | main | Orchestrate loop, triage findings, interact with user, gate exits, commit | No (only via fix agent) |
| Review agent | Explore | Analyze diff, report findings | No (read-only) |
| Fix agent | general-purpose | Apply code fixes, run tests | Yes |
The key insight is that the review agent has zero context about prior decisions — it reviews the diff cold, just like a human reviewer seeing the code for the first time. This surfaces issues that the author (you, with full context) might overlook due to familiarity bias.
All reviews happen locally. Whether the input is a PR URL or a local branch, the review always runs against a local git diff. If the input is a PR URL, the PR changes are checked out locally first.
Input Parsing
Parse arguments from $ARGUMENTS:
- First positional arg (optional): A PR URL, or a local folder path to a git repository. If omitted, use the current working directory.
--max-rounds <N>: Maximum review-fix iterations (default: 10). The loop may exit earlier if the review is clean.
Detecting input type
- If the arg starts with
http://orhttps://— treat it as a PR URL. - If the arg is a filesystem path (absolute or relative) that exists as a directory — treat it as a local git repo path.
cdinto it. - If no arg is provided — use the current working directory.
Phase 1: Set Up Local Working Copy
The goal of this phase is to ensure we have a local git repo with the changes to review checked out as the current branch.
Path A: PR URL provided
- Parse the PR URL to extract repository and PR identifiers:
- GitHub:
https://github.com/{owner}/{repo}/pull/{number}— extract owner, repo, number - Azure DevOps:
https://dev.azure.com/{org}/{project}/_git/{repo}/pullrequest/{id}— extract org, project, repo, id
- GitHub:
- Check if a local clone already exists. Look at the current working directory (or any parent): does
git remote -vmatch the PR's repository? If yes, use it. If not, useAskUserQuestionto ask:- "Provide path to existing local clone"
- "Clone the repository" — shallow clone (
--depth 1) the source branch into a temp directory
- Check out the PR's source branch. Fetch and check out the branch so the local diff matches the PR:
- GitHub:
gh pr checkout <number>(ifghis available) or fetch the source branch manually - Azure DevOps:
git fetch origin <source-branch> && git checkout <source-branch>
- GitHub:
- Identify the target branch from the PR metadata (the branch the PR merges into). This becomes the base branch for diffing.
Path B: Local path or CWD
- Verify it is a git repository:
git -C <path> rev-parse --is-inside-work-tree. If not, inform the user and stop. - Detect the base branch by checking which of these remote branches exist (use
git rev-parse --verify), in order of priority:origin/mainorigin/masterorigin/developorigin/workingorigin/release
- If multiple candidates exist, or if the detected base seems wrong, use
AskUserQuestionto confirm: "I detectedorigin/mainas the base branch. Is this correct?"
Common: Compute merge base and validate
- Get the current branch name:
git branch --show-current - Compute the merge base:
git merge-base <base-branch> HEAD - Verify the diff is non-empty:
git diff <merge-base>...HEAD --stat. If empty, inform the user there are no changes to review and stop.
Log the detected configuration
Repository: <path>
Branch: <current-branch>
Base branch: origin/main
Merge base: abc1234
Changed files: NPhase 2: Review-Fix Loop
Maintain two lists across iterations:
- Won't-fix list: Findings triaged as acceptable (by-design, pre-existing, out-of-scope, or too minor). Passed to subsequent review rounds so the reviewer doesn't re-raise them.
- Fixed list: Findings that were addressed. Confirms fixes worked if they don't reappear.
Log all decisions. Every triage verdict must include the reasoning. This log is shown to the user at each round and in the final summary.
For each round (up to max-rounds):
Step 1: Spawn the review agent
Launch a read-only review agent using Agent with subagent_type: Explore. The Explore agent can only read files, search code, and run read-only shell commands — it cannot edit files, write files, or post comments. This enforces a clean separation: the review agent observes and reports; the main agent decides and acts.
Prompt for the review agent:
You are a fresh code reviewer with no prior context about this code.
Your role is READ-ONLY: analyze the code and report findings. Do NOT
modify any files or post comments anywhere.
Review the diff of branch <current-branch> against <merge-base> in the
git repository at <repo-path>.
Run: git diff <merge-base>...HEAD
First, read the review checklist at:
<this-skill-directory>/references/review-checklist.md
Apply its categories, severity levels, and verification discipline to
every changed file.
Focus ONLY on files changed in this branch. Read the full source of each
changed file (not just diff hunks) to understand context.
The following issues have already been reviewed and accepted as won't-fix:
<won't-fix list — numbered, with file/line and brief reason>
Return any NEW findings not covered above. If you find no new issues,
say "No new issues found."
For each finding, provide:
- File path and line number
- Severity: bug, security, design, process, nit
- Description of the issue
- Suggested fix if applicableStep 2: Triage findings (coordinator)
The coordinator (you) triages each finding. This is your job — not the review agent's or the fix agent's — because triage requires conversation context, knowledge of prior design decisions, and user interaction.
For each finding, classify it into one of:
| Verdict | Criteria | Action |
| Fix | Valid bug, design issue, or meaningful improvement | Apply the fix |
| Won't fix | By-design, pre-existing, out-of-scope, or too minor | Add to won't-fix list with reason |
| Already fixed | Reviewer flagged something already addressed | Ignore |
| Invalid | Reviewer misunderstood the code | Add to won't-fix list with explanation |
| Uncertain | Not sure whether this is valid or worth fixing | Ask the user |
When uncertain, ask the user. Use AskUserQuestion to present the finding and let the user decide:
- "Fix it" — apply the fix
- "Won't fix" — add to won't-fix list
- "Skip for now" — don't fix, don't add to won't-fix (may come back next round)
Present the triage to the user as a summary table:
## Round N Review Summary
| # | Severity | File:Line | Description | Verdict | Reason |
|---|----------|-----------|-------------|---------|--------|
| 1 | bug | Foo.cs:42 | Null ref... | Fix | Valid — missing null check |
| 2 | design | Bar.cs:15 | Missing... | Won't fix | Pre-existing behavior |
| 3 | nit | Baz.cs:99 | Naming... | Won't fix | Too minor for this PR |
| 4 | design | Qux.cs:7 | Perf concern | Uncertain | Asked user |Step 3: Spawn the fix agent
If there are findings marked Fix, launch a general-purpose Agent to apply them. The fix agent has full read-write access. Give it the specific list of fixes to apply — nothing more.
Prompt for the fix agent:
You are a code fix agent. Apply the following fixes to the git repository
at <repo-path>. For each fix, read the relevant file to understand context,
then apply the change.
Fixes to apply:
<numbered list of findings marked Fix, each with file, line, description,
and suggested fix>
After applying all fixes, run the test suite:
<test-command, e.g. dotnet test, npm test, pytest, etc.>
If tests fail, investigate and fix the failures.
Report back:
- Which fixes were applied successfully
- Test results (pass/fail, with failure details if any)
- Any test failures and how they were resolved
- Any fixes you could not apply (with reason)
Do NOT make changes beyond the listed fixes and test-failure fixes.
Do NOT refactor or improve surrounding code.Step 4: Verify tests independently (coordinator)
After the fix agent completes, the coordinator re-runs the test suite independently via Bash. This is an independent verification — do not trust the fix agent's self-reported test results alone.
<test-command>If tests fail, spawn the fix agent again with the failure output and ask it to fix them. Re-run tests after. Repeat until tests pass or escalate to the user via AskUserQuestion.
Log the test results for each round.
Log the fix agent's results: what was changed, which file/line, and why.
Step 5: Check exit conditions
Exit the loop if ANY of these conditions are met:
- The review agent returned "No new issues found"
- All findings in this round were triaged as won't-fix, invalid, or nit-level
- Maximum rounds reached (default: 10)
- No fixes were applied in this round (all findings were triaged as acceptable)
If exiting, proceed to Phase 3. Otherwise, loop back to Step 1.
Phase 3: Commit
After the loop completes (tests already verified in Step 4 of each round):
- Check if any files were modified:
git status - If changes exist:
- Show the user a summary of all fixes applied across all rounds, with file paths and descriptions
- Use
AskUserQuestionto ask what to do:- "Commit and push": Stage changed files, commit with a descriptive message, and push
- "Commit only": Stage and commit without pushing
- "Leave uncommitted": Leave changes in the working tree for manual review
- If no changes were made, inform the user that the review found no actionable issues.
Commit message format
Address self-review findings
- <brief description of fix 1>
- <brief description of fix 2>
...
Co-Authored-By: Claude <noreply@anthropic.com>Phase 4: Final Summary
Present a complete decision log and summary:
## Self-Review Complete
**Rounds**: N
**Total findings across all rounds**: X
**Fixed**: Y
**Won't fix**: Z
**User decisions**: W
### Fixes Applied
1. [File:Line] Description of fix — Reason
2. ...
### Won't Fix (with reasons)
1. [File:Line] Description — Reason (by-design / pre-existing / out-of-scope / ...)
2. ...
### User Decisions
1. [File:Line] Description — User chose: fix/won't fix/skip
**Review status**: Clean / Minor items remainingList any remaining won't-fix items so the user can decide if any need attention from a human reviewer.
Decision-Making Guidelines
- Be conservative with fixes. Only mark something as "Fix" if you are confident it is a genuine improvement. When in doubt, mark it "Uncertain" and ask the user.
- Don't over-fix. The goal is to catch real issues, not to gold-plate the code. Nits and style preferences should generally be won't-fixed unless the user has expressed a preference.
- Respect prior decisions. If this conversation involved making deliberate design choices (e.g., using string interpolation instead of a serializer), those are by-design won't-fixes.
- Log everything. Every finding and every verdict should be traceable. The user should be able to look at the final summary and understand exactly what was found, what was done about it, and why.
Tips for Effective Self-Review
- The review agent intentionally has no context about design decisions — this is a feature, not a bug. It catches things that look wrong to fresh eyes.
- Won't-fix items often reveal places where a code comment would help future readers understand the rationale.
- If the same finding keeps coming back across rounds despite being won't-fixed, consider whether the code could be restructured to make the intent clearer.
- The skill works best when tests exist — it can verify fixes don't break anything.
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.

