Jason JunJason Jun

Custom Cursor prompts for Git workflows

27 July 2025

It's common practice to use linters and pre-commit hooks to catch issues early, but custom prompts can add another layer of safety for AI-assisted coding tools like Cursor.

These prompts help me code quickly without breaking things.

Quick sanity checking

This is probably my most-used prompt. It quickly reviews the current diff, flags potential issues, and suggests actionable fixes.

# Sanity Check
 
Review the current diff and provide a concise report highlighting only 'Issues'
and 'Quick Fixes', without additional commentary.
 
Focus:
 
- security, breaking changes
- logic errors, performance
- code quality, maintainability
- unrelated edits
 
Style: ultra-concise bullets, priority order, actionable only.
 
## Execute commands:
 
1. `git diff HEAD`
2. `git status --porcelain`
 
## Review format:
 
🚨 Issues
• brief description
 
💡 Quick Fixes
• actionable improvement
Running sanity-check
promptRunning sanity-check prompt
Example of sanity-check prompt
resultExample of sanity-check prompt result

Commit summary

I think commits are the smallest units of codebase documentation. Clear commit summaries, especially when viewed through tools like GitLens, save significant time by providing context without needing to search PRs or tickets. Other tools exist for generating commit messages, but custom prompts offer precise control over format, style, and length.

# Git Commit Summary
 
Review the current diff and generate a commit message with proper formatting.
 
## Execute commands:
 
1. `git diff HEAD`
2. `git status --porcelain`
 
## Generate commit:
 
**Summary** (≤50 chars): `type(scope): description`  
**Description** (optional): why and impact
 
Types:
 
- feat: new feature
- fix: bug fix
- docs: documentation
- style: formatting
- refactor: code change
- test: add/update tests
- chore: maintenance
 
## Action steps:
 
1. Display the summary and description
2. Ask Y/N for confirmation
3. If Y, then execute:
   - `git add .`
   - `git commit -m "summary" -m "description"`
Running commit-summary
promptRunning commit-summary prompt
Example of commit-summary prompt
resultExample of commit-summary prompt result

Branch review

Cursor helps catch overlooked issues in my code before I request feedback. For reviewing others' branches or PRs, Cursor-generated summaries reduce context switching by highlighting key areas. Because Cursor feedback tends to be verbose, I set clear guidelines for concise, actionable responses.

# Branch Review
 
Perform a comprehensive PR-style review of the current branch changes against the
main branch. Use only the four sections specified in the Review Format below:
Change Summary, Issues, Recommendations, and Verdict.
 
## Execute commands:
 
1. `git diff main...HEAD`
2. `git log main..HEAD --oneline`
3. `git status --porcelain`
 
## Review format:
 
📊 Change Summary
 
• Overview of files modified, commits, and scope of changes
• Brief description of what was implemented
 
🚨 Issues
 
• Critical problems and concerns requiring attention
• Include priority level (High/Medium/Low) and specific fixes
 
💡 Recommendations
 
• Improvements and optimizations
• Best practice suggestions and code quality enhancements
 
✅ Verdict
 
• Approve/Request Changes/Comment
• One-line key takeaway
Running branch-review
promptRunning branch-review prompt
Example of branch-review prompt
resultExample of branch-review prompt result

Custom prompts work better than global rules for cases requiring precise output formats or targeted, context-specific responses. Since prompts only consume context tokens when triggered, they're also more token-efficient. Global rules are better suited for general coding standards applied broadly.