Cheat Sheet
Quick reference for common patterns and prompts.
Prompt Starters
| Goal | Prompt Start |
|---|---|
| New feature | "Create a [feature] that..." |
| Bug fix | "This code has a bug where [behavior]. The error is [error]. Fix it." |
| Refactor | "Refactor this code to [goal]. Keep the same behavior." |
| Explain | "Explain what this code does, line by line." |
| Review | "Review this code for [bugs/security/performance]." |
| Test | "Write tests for this function covering [cases]." |
| Document | "Add JSDoc comments to these functions." |
Context Phrases
| To Add | Say |
|---|---|
| Constraints | "Without using...", "Only using...", "In under X lines..." |
| Style | "Following the pattern in [file]...", "Matching the style of..." |
| Scope | "Just the [specific part]...", "Don't change [other thing]..." |
| Output | "Return [format]...", "Export as [type]..." |
Recovery Phrases
| Problem | Say |
|---|---|
| Wrong approach | "Let's try a different approach. What if we..." |
| Too complex | "Simplify this. Give me the minimal version." |
| Missing context | "Here's more context: [paste relevant code]" |
| Going in circles | "Let's step back. What's the core problem we're solving?" |
The Context Sandwich
[What exists] + [What you want] + [Constraints]Example:
"We have a Next.js app with Prisma [exists].
Add email/password auth using NextAuth.js [want].
Use the existing User model. No OAuth for now [constraints]."Quick Commands
# Cursor shortcuts
Cmd+K # Inline edit
Cmd+Shift+I # Open Composer
@filename # Reference file
Tab # Accept suggestion
Esc # Reject/stopAI Strengths vs Your Job
AI handles: Boilerplate, types, tests, refactoring, docs, errors, regex, SQL, CSS, integrations
You handle: Architecture, security, business logic, performance, UX, code review, deployment
Red Flags to Watch
| If AI does this... | You should... |
|---|---|
| Adds unnecessary dependencies | Ask: "Can this be done without a library?" |
| Creates god-functions | Ask: "Split into smaller functions" |
| Uses raw SQL | Check for injection vulnerabilities |
| Ignores error handling | Ask: "Add error handling for..." |
| Puts files at root | Specify exact path in prompt |
The Golden Rules
- Read every line of AI-generated code
- Test before committing — Build must pass
- Never commit secrets — Check
git diff --staged - Start fresh when context gets polluted
- You decide architecture and security
"The best code is the code you don't have to write."