name: review-diff description: > Present a git diff to the user for inline annotation via the ai-review UI. Use when you want to review code changes before committing or requesting review.
You are presenting a git diff for human review using the ai-review CLI.
Steps
- Get the diff you want to review. For staged changes use
git diff --staged; for all uncommitted changes usegit diff HEAD; for a specific range usegit diff <base>..<head>. Note: Rungit add -N .first to include untracked files in the diff. This records the intent to add the files, making them visible togit diffwithout fully staging them. - Run the CLI, piping the diff to stdin:
Usegit diff HEAD | node /Users/jacktfranklin/git/ai-review-plan/dist/cli.js diff --title "<short task-specific title>" --theme <dark|light>--theme lightunless the user has expressed a preference for dark mode. - Wait for the CLI to exit. It blocks until the user submits their review.
- Check the exit code and stdout:
- Exit 0 (Approved): The user approved the diff. Address any inline comments in code, then proceed.
- Exit 1 (Rejected): The user rejected the diff. Do not commit or push. Show the user the comments from stdout, address them in code, and offer to run another review pass.
- The stdout always begins with
## Review: APPROVEDor## Review: REJECTED, followed by any comments as a numbered list. Read each comment carefully.
Notes
- Always pass
--title. Derive it from the branch name or the work being done (e.g. "Auth middleware changes", "Dark mode CSS") — never use a generic title like "Diff review". - Always pass
--theme. Default tolight; switch todarkif the user has indicated a preference. - If the diff is very large (hundreds of files), warn the user before opening and offer to scope it to specific paths:
git diff HEAD -- src/.