AI Coding Mistakes Quick Reference
Last reviewed: June 2026
Mistakes at a Glance
| Mistake | Symptom | Fix |
|---|---|---|
| Hallucinated API | Method not in docs | Grep source / official docs |
| Phantom import | Module not found | Run build; fix paths |
| Wrong package | npm install fails | Check npm registry name |
| Outdated syntax | Deprecated API warnings | State stack version in rules |
| Invented env var | Runtime undefined | Audit process.env in diff |
| Over-refactor | Huge unrelated diff | Reject; narrow file scope |
| Missing errors | Crashes on bad input | Require error handling in prompt |
| Fake tests | Green but useless | Read assertion bodies |
| SQL injection | String concat in queries | Parameterized queries |
| Hardcoded secret | Key in source | Env vars + secret scan |
| Prompt injection | User overrides bot | Separate system/user content |
| Refactor loop | Fix breaks other tests | Revert; smaller scope |
Quick Verification Commands
git diff # scope check
npm run lint # style and imports
npm run build # types and compile
npm test # behavior
grep -r "sk-" src/ # leaked keys (example)
When to Stop and Re-Prompt
- Same error after 2 fix attempts
- Model adds a library for a one-line change
- Diff touches files you did not name
- Security-sensitive code (auth, payments)