Coding AI prompt templates
Free AI coding prompt templates for code review, debugging, refactoring, and unit tests. Each includes clear constraints, variables, and a worked example.
Choose a prompt by the job it needs to do.
Good coding prompts make the expected evidence explicit: quote the risky line, explain the failure, propose a concrete patch, and name the test that proves it.
Include the smallest runnable snippet plus its real context. Language and framework matter, but the intended behavior and failure mode usually matter more.
- Review a diff by severity
- Explain an error from first principles
- Refactor without changing behavior
- Generate focused unit tests
4 free templates
Every page includes the full prompt, variable guidance, and a filled-in example.
Code review checklist
Run a focused, prioritised code review of a diff or snippet, covering correctness, edge cases, readability, and security without nitpicking style.
Explain this error
Decode a stack trace or error message into a plain-language root cause, the most likely fixes, and a quick way to confirm which one is right.
Refactor for readability
Refactor a piece of code to be clearer and easier to maintain while preserving its exact behaviour, with a short explanation of every change.
Write unit tests for a function
Generate a thorough unit test suite for a single function, covering the happy path, edge cases, and failure modes using your chosen test framework.