MODULE 12
Speed, Tools & Cheat Sheet
12.1: Token Efficiency
Every token costs time and money. Be concise in your prompts.
Good:
"Add email validation to the signup form in src/components/SignupForm.tsx"Bad:
"Hey! So I was thinking about the signup form and I realized we
should probably add some email validation. The form is in the
components folder I think, called SignupForm. Can you take a look
and add validation? Thanks so much!"Tips for efficiency:
- Use file references (
@file) instead of pasting code - Don't repeat context AI already has
- Stop AI mid-generation if you have enough (press Esc)
- One clear ask per message works better than multiple asks
12.2: The Scaffold-Then-Fill Pattern
Don't ask for everything at once. Create the skeleton, then fill in details:
Step 1: "Create the file structure for the new payments feature"
-> AI generates skeleton files
Step 2: "Fill in src/services/PaymentService.ts with Stripe integration"
-> You direct the specific details12.3: Batch Similar Tasks
Instead of one-by-one:
Slow:
"Add validation to form A"
"Add validation to form B"
"Add validation to form C"
Fast:
"Add Zod validation to all forms in src/components/forms/.
Use the schema pattern from UserForm.tsx."12.4: Tool-Specific Tips
Cursor
| Action | Shortcut |
|---|---|
| Inline edit | Cmd+K |
| Open Composer | Cmd+Shift+I |
| Reference file | @filename |
| Accept suggestion | Tab |
| Reject/stop | Esc |
Best practices:
- Use
@to reference files -- gives AI direct context Cmd+Kfor inline edits -- faster for small changes- Composer for multi-file changes -- better for features
- Use
.cursorrules-- project conventions AI follows
Claude (Direct)
Best for: complex reasoning, architecture planning, code review, long explanations.
- Use artifacts for standalone code blocks
- Ask for explanations before implementation
- Upload files and screenshots for direct context
GitHub Copilot
Best for: quick completions, continuations, filling in boilerplate.
- Write the function signature, let Copilot fill the body
- Use comments as prompts:
// function that validates email - Accept incrementally with Tab
12.5: Quick Reference: Prompt Starters
| Goal | Prompt Start |
|---|---|
| New feature | "Create a [feature] that..." |
| Bug fix | "This has a bug where [behavior]. Error: [error]. Fix it." |
| Refactor | "Refactor this 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]." |
12.6: Quick Reference: 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 here?" |
| AI adds junk | "No new dependencies. No abstractions. Keep it simple." |
12.7: Quick Reference: Red Flags
| 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 [cases]" |
| Puts files at root | Specify the exact path in your prompt |
| Generates 200 lines | Ask: "Under 50 lines, simplest approach" |
12.8: 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
- Plan before building -- 2 hours planning saves 20 hours debugging
- Error logs are gold -- always paste the full error
- Constraints prevent mistakes -- tell AI what NOT to do
- Small steps beat big prompts -- incremental is faster
- Research first -- 10 min of docs saves 2 hours of guessing
Module Checkpoint
Test your understanding -- try to answer from memory before looking
What is the scaffold-then-fill pattern?
Why is batching similar tasks faster?
Which Cursor shortcut opens the Composer for multi-file changes?
What is the #1 golden rule of vibecoding?