skills/self-review-diff/SKILL.md
Self-review, self review, self-reviewing, audit, check, or fix the current uncommitted Git diff or other uncommitted local Git changes before a commit or pull request. Use when the user asks for a repo-aware quality audit, pre-commit review, review of their diff, another pass, or another pass over local changes, or when asked to inspect local diffs, staged changes, unstaged changes, or untracked files for bugs, regressions, missing tests, lint, accessibility, stale code, or similar issues. The workflow loops after automatic or confirmed fixes until two consecutive clean passes verify that nothing remains to fix or report.
npx skillsauth add afollestad/personal-ai-skills self-review-diffInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This is a mutating workflow by default. You may edit files to address clearly low-risk findings. Ask before higher-risk fixes, behavior changes, broad refactors, or creating a new commit. Do not push unless the user explicitly asks.
If the user asks for an audit-only review or says not to edit, treat this as read-only and report findings without modifying files.
git status --short
git diff --stat
git diff --staged --stat
git diff --check
git diff --staged --check
git diff
git diff --staged
git ls-files --others --exclude-standard
git rev-parse --verify HEAD before relying on git diff HEAD commands. If it succeeds, also inspect the combined tracked change:
git diff HEAD --stat
git diff HEAD --check
git diff HEAD
HEAD commands and review staged, unstaged, and untracked files directly.git diff.HEAD exists and a tracked file has both staged and unstaged changes, inspect the combined tracked change with git diff HEAD -- "<file>" and read the final file contents so interactions between staged and unstaged hunks are reviewed. Do not use the combined diff to decide what to stage.git branch --show-current. If it is empty, record the detached HEAD SHA with git rev-parse --short HEAD and do not amend or create commits unless the user explicitly wants work done in detached HEAD or asks you to check out a branch first.AGENTS.md files from the repo root and affected subdirectories before deciding on lint, tests, styling, commits, or review behavior.git ls-files, so spaces or shell metacharacters do not change which files are inspected.Build a repo-aware view before judging the changes:
Prefer rg for searches. Use structured tools when the repo provides them, such as language servers, code search helpers, generated type lookups, or project-specific CLIs.
Review the changes for all of these categories:
AGENTS.md guidance when the change reveals a durable workflow rule, repo convention, validation command, or pitfall future agents need.Automatically fix findings only when the fix is low risk and clearly correct:
Ask for confirmation before fixing higher-risk findings:
AGENTS.md, unless the user specifically asked for guidance changes.If a finding is valid but not safe to fix automatically, report it with the concrete risk, affected files, and the recommended fix.
After automatic low-risk fixes or user-confirmed higher-risk fixes, run the smallest relevant checks that cover the changed area:
git status --short and the relevant diff/stat commands to verify the final local changes contain only the intended fixes.git diff --check, git diff --staged --check, and, when HEAD exists, git diff HEAD --check.git ls-files --others --exclude-standard, also run git diff --no-index --check -- /dev/null "<file>" or an equivalent whitespace check because plain git diff --check does not inspect untracked additions. git diff --no-index exits 1 for ordinary differences, so treat empty output as a clean whitespace check. For untracked binary files or snapshots, skip the whitespace check and validate them with the repo's normal artifact or snapshot workflow instead.:lint Gradle tasks unless the local repo explicitly requires them.cash lint and targeted tests or snapshots.After validating any automatic low-risk fix or user-confirmed higher-risk fix, restart this workflow from Prerequisites against the updated local change set. Do not require the user to ask for another pass.
A clean pass means the prerequisites, changed-file inspection, relevant searches, full audit checklist, and validation all ran against the current worktree, with no low-risk fixes applied and no higher-risk findings needing confirmation.
Repeat the audit, fix, and validation cycle until two consecutive clean passes complete. After the first clean pass, immediately run a fresh confirmation pass from Prerequisites against the current worktree. For the confirmation pass, rerun the prerequisite commands, re-read the final contents of changed tracked files and relevant untracked files, redo the relevant searches, and do not rely on earlier command output or remembered conclusions. Only move on to commit or amend decisions after the second consecutive clean pass, unless the user explicitly requested a different commit timing.
If the confirmation pass finds a low-risk fix or a higher-risk finding, handle it under the normal fix policy, reset the consecutive clean-pass count, and restart from Prerequisites after any validation. Do not report the loop as clean until two consecutive clean passes have completed after the most recent fix or finding.
If a pass finds higher-risk findings, pause for confirmation before fixing them. After applying and validating confirmed fixes, restart from Prerequisites. If the user declines or defers a higher-risk fix, stop the loop and include the remaining finding in the final report instead of repeatedly asking about it.
Guard against infinite loops. Track repeated finding/fix pairs within the session; if the same issue returns after a fix or validation step, stop and report it as a blocker with the files and commands involved.
Follow any user-specified commit or amend preference first.
If the user gives no preference, prefer amending fixes into the relevant existing commit after focused lint/tests. Use the changed files, branch, and commit history to identify the owning commit. If no relevant commit exists, leave fixes uncommitted or ask before creating a new commit. If multiple commits plausibly own the fix, do not guess; report the ambiguity and ask before amending.
When Graphite is applicable:
gt is installed, gt --no-interactive log short --stack succeeds, and the current branch is present in the tracked stack.gt --no-interactive modify for amending the current branch when applicable.git commit --amend or manual rebases for Graphite-tracked commits unless Graphite cannot perform the requested operation and the user confirms the fallback.gt --no-interactive restack --upstack after changing a non-tip branch.gt submit or push unless the user explicitly asks.When Graphite is not applicable, use normal Git amend/rebase operations that match the user's requested workflow. Confirm before rewriting commits other than the current branch tip or before complex rebases. Use GIT_EDITOR=true for rebase continuation commands that would otherwise open an editor.
End with a concise report:
Audited:
- <local change scope>
Auto-fixed:
- <low-risk fixes, or "None">
Needs confirmation:
- <finding, risk, and recommended fix, or "None">
Passes:
- <number of audit passes completed; say whether two consecutive clean passes completed or why the loop stopped>
Validation:
- <checks run and result>
- <checks skipped and reason>
Commit status:
- <amended/committed/left uncommitted; mention Graphite if used, and whether any auto-fixes remain staged, unstaged, or untracked>
If no issues are found, say that clearly and still include any residual test or validation gaps.
documentation
Review a PR and submit suggestions as comments, along with an optional approval/request for changes.
documentation
Address, fix, respond to, or resolve GitHub pull request feedback. Use when the user asks to handle PR review comments, or address feedback on PRs.
development
Invoke this skill whenever the user asks you to produce a prompt, summary, or context package intended as input for a future AI session. This covers: handoff prompts, context dumps, new-thread prompts, paste-ready prompts for fresh sessions, or any request to distill this conversation so another Claude instance or background agent can continue the work. Also invoke when the user mentions context window limits, thread length concerns, or wanting to reset/wrap up while preserving progress for a next session. This skill owns the output format and relevance filtering — do not attempt these handoffs without it. Do NOT invoke for human-audience artifacts: docs, READMEs, commit messages, tickets, release notes, standup updates, code explanations, or handoffs to human coworkers.
documentation
Review a PR and submit suggestions as comments, along with an optional approval/request for changes.