Send git diff to Cursor for code review
Sends git diff to Cursor for AI-powered code review and analysis.
/plugin marketplace add glekner/cursor-opinion-marketplace/plugin install cursor-opinion@cursor-opinion-marketplaceThe user wants Cursor to review current git changes.
Cursor will analyze the diff but will NOT make any changes to files. This is a SLOW operation - expect 2-5 minutes.
When calling Bash, you MUST set a long timeout:
timeout: 600000 (10 minutes) for the Bash tool callCheck for Git Repository: Verify we're in a git repository:
git rev-parse --git-dir 2>&1
If this fails, inform the user they're not in a git repository.
Gather Git Changes: Get both staged and unstaged changes:
git diff HEAD
If that returns empty (no commits yet or no changes), try:
git diff
Or for only staged changes:
git diff --cached
Validate Changes Exist: If no changes are found in any of the above, inform the user there are no uncommitted changes to review.
Send to Cursor for Review: Pipe the diff to the review script.
CRITICAL: Set timeout to 600000ms (10 minutes) because Cursor uses a slow model:
# timeout: 600000
git diff HEAD | "${CLAUDE_PLUGIN_ROOT}/scripts/review-cursor.sh"
Present the Review: Share Cursor's code review feedback with the user clearly.
Synthesize (Optional): If you have additional observations about the code changes, add them to complement Cursor's review. Highlight points of agreement or offer different perspectives.
agent command is not found, they need to install the Cursor CLI