← Prompt library

Prompts for coding help that goes beyond "here's some code"

AI writes plausible code by default — not correct, reviewed or maintainable code. Constraints about context, style and failure cases close that gap.

Debugging

What most people type

why doesnt my code work

The prompt that works

Debug the code below. Context: [language/framework, what it should do, the exact error or wrong behavior, what I already tried]. Work systematically: 1) state your hypothesis for the root cause, 2) point to the exact lines that support it, 3) give the minimal fix, not a rewrite, 4) explain how to verify the fix, 5) mention one similar bug this pattern tends to hide. If information is missing, ask before guessing.

Code review

What most people type

review my code

The prompt that works

Review the code below as a senior engineer who will co-own this codebase. Separate your findings by severity: bugs and correctness first, then security, then performance, then readability. For each: the line, why it matters, and a concrete fix. Note what is done well in one line. Skip style nitpicks a formatter would catch. End with the one change you would insist on before merging.

Refactoring

What most people type

clean up this function

The prompt that works

Refactor the function below without changing its behavior. Priorities in order: make the logic obvious on first read, reduce nesting, name things by intent, extract only where it genuinely helps. Keep the same language idioms as the surrounding code style I pasted. Show the refactored version, then list each change with a one-line justification, and flag anything that needs a test before this refactor is safe.

Explaining unfamiliar code

What most people type

what does this code do

The prompt that works

Explain the code below to a developer who knows programming but not this codebase or framework. Structure: one-sentence purpose, the flow step by step referencing actual line numbers, any non-obvious tricks or gotchas, what would break if I changed the two most fragile parts, and one question I should ask the original author. Do not explain basic syntax.

Writing tests

What most people type

write tests for my function

The prompt that works

Write tests for the function below using [test framework]. Cover: the happy path, each boundary condition, invalid inputs, and the one failure mode most likely in production. Name each test to describe the behavior it proves, not the method it calls. Keep each test independent. After the tests, list any behavior that is untestable as written and what small change would fix that.

Prompt Pro writes these for you

Type the lazy version, click ✨ Improve Prompt, get the expert version — right inside ChatGPT, Claude & Gemini. 3 free enhancements a day.

Chrome Add to Chrome — It's Free

Get the complete pack

All 50 prompts from every category in one searchable collection — free, sent to your inbox.

Check your inbox 📬

The complete pack is on its way to .

No spam — one email with the pack, that's it.

More prompt collections