Where AI speeds you up
An AI assistant is great at the slow, repetitive parts of coding. Hand those over and you get more time for the interesting decisions.
Here’s a quick guide to what to share and what to keep.
- Boilerplate and scaffolding
- Tests, especially the edge cases you’d skip
- Refactors and renames inside a file
- Explaining code you didn’t write
- Regex, date maths and one-off scripts
- First drafts of docs and comments
- Architecture and trade-offs
- Deciding what to build, and what not to
- Security and privacy decisions
- The final review: you own what ships
The Acceleration Loop
Speed comes from short cycles, not long prompts. Run these four steps in minutes, then run them again. Select a step to see how it works.
Ask for the approach before the code
A quick plan catches misunderstandings early, before they turn into code.
Before writing any code, outline how you'd add pagination to fetchUsers(). List the changes, the edge cases, and anything you need from me.
One small, focused piece at a time
Small changes are easy to review and easy to undo, so you can move fast with confidence.
Implement step 1 only: add page and pageSize parameters to fetchUsers(). Keep the existing return shape.
Run it, test it, read it
Give it the same friendly review you’d give a teammate’s pull request. Tests turn “looks right” into “is right”.
Write Vitest tests for fetchUsers() covering page 1, the last page, an empty result, and a pageSize above the limit.
Share the details
Show what you see: the error message, the failing test, the actual output. The more facts you share, the faster the fix.
This test fails: expected 20 items, got 21 (output below). Find the off-by-one and explain the fix before changing any code.
Anatomy of a coding prompt
A strong prompt has five parts. Select one to isolate it.
Weak vs strong
Same bug, same model. Switch between the two prompts.
Weak prompt
fix this
function total(items) {
return items.reduce((sum, i) => sum + i.price)
}
The model has to guess what’s wrong. It might rewrite the function in a new style or change things that were fine, and you still won’t know what the bug was.
Strong prompt
total() returns "[object Object]10" instead of a number.
function total(items) {
return items.reduce((sum, i) => sum + i.price)
}
Input: [{ price: 5 }, { price: 10 }]
Expected: 15
Explain the cause in one sentence, then give the smallest fix.
Don't rename the function or change its signature.
The cause: with no starting value, reduce begins with the first object, so the first addition joins an object and a number into a string. Then the one-line fix:
return items.reduce((sum, i) => sum + i.price, 0)
Five things to watch for
Keep these in mind and you’ll stay fast.
- Double-check unfamiliar APIs. Now and then a model suggests a function or option that doesn’t exist. A quick look at the docs settles it.
- Mention your versions. Say which runtime and library versions you use, so the code matches your setup.
- Keep changes small. Smaller changes are easier to review, so ask for one step at a time.
- Keep secrets out of prompts. Use placeholders like
YOUR_API_KEYinstead of real keys, tokens or customer data. - Let tests do the checking. A few quick tests catch problems early, while they’re still easy to fix.
- Plan first, code second.
- Ask for one small change per prompt.
- Give real context: the code, the error, your versions.
- Verify everything: run it, test it, read it.
- Share the details: errors, failing tests, actual output.
- Review before you ship. It’s your code, and now it’s faster to write.