Prompt library
AI prompts for coding
Debugging, reviewing, explaining, and refactoring code.
What these prompts are for
Ask a model what is wrong with your code and it will always answer. The expensive part is not a wrong answer, it is a plausible one: you spend forty minutes proving it wrong, and for all forty you are not looking anywhere else.
These prompts are shaped against that. Ranked hypotheses with the cheapest discriminating check attached to each, review aimed at what production does rather than at what the diff says, and test cases for the input that returns the wrong answer without raising an error.
4 prompts for coding
- Debug a stack traceTurns an error and its stack trace into an ordered list of what could cause it, each with the specific check that would rule it in or out.
- Write a spreadsheet formula and understand itBuilds the Excel or Sheets formula you described, explains each part, and supplies the data that makes it return the wrong answer without erroring.
- Write and test a regex or SQL queryWrites the pattern or query you asked for, explains it piece by piece, and then supplies the inputs that make it silently return the wrong thing.
- Review a diff for production risksReviews a change for the failures that only appear under real traffic and real data, and separately lists which of the new behaviour has no test.