12. Speed, Tools & Cheat Sheet
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 details

12.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

ActionShortcut
Inline editCmd+K
Open ComposerCmd+Shift+I
Reference file@filename
Accept suggestionTab
Reject/stopEsc

Best practices:

  • Use @ to reference files -- gives AI direct context
  • Cmd+K for 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

GoalPrompt 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

ProblemSay
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 dependenciesAsk: "Can this be done without a library?"
Creates god-functionsAsk: "Split into smaller functions"
Uses raw SQLCheck for injection vulnerabilities
Ignores error handlingAsk: "Add error handling for [cases]"
Puts files at rootSpecify the exact path in your prompt
Generates 200 linesAsk: "Under 50 lines, simplest approach"

12.8: The Golden Rules

  1. Read every line of AI-generated code
  2. Test before committing -- build must pass
  3. Never commit secrets -- check git diff --staged
  4. Start fresh when context gets polluted
  5. You decide architecture and security
  6. Plan before building -- 2 hours planning saves 20 hours debugging
  7. Error logs are gold -- always paste the full error
  8. Constraints prevent mistakes -- tell AI what NOT to do
  9. Small steps beat big prompts -- incremental is faster
  10. 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?