💻 Category

Coding

Power-user developer prompts — code review, debugging, SQL, docs, and refactoring with senior-engineer rigor.

The developers getting real leverage from AI treat it like a sharp junior engineer: brilliant with clear instructions, dangerous with vague ones. These prompts are written to that standard — they assign a role, demand a format, and force the model to show its reasoning. A code review that flags the race condition instead of praising your variable names. A debug session that forms hypotheses instead of shotgunning fixes.

How developers actually use these

Not to write whole features — to compress the slow parts of the job. Explaining a regex you'll otherwise burn twenty minutes decoding. Turning plain-English questions into SQL you can verify line by line. Writing the API docs nobody wants to write. Planning a refactor of legacy code before touching a single line, so the scary change becomes a sequence of safe ones.

Rules that make code prompts work

  • Context is the prompt. Language, framework, version, and the constraint that matters ("must run on Postgres 14", "no new dependencies") change the answer more than any clever phrasing.
  • Ask for the reasoning, then the code. A model that explains its approach first produces better code — and lets you catch a wrong assumption before it compiles.
  • Demand tests or examples. "Include three example inputs with expected outputs" is the fastest way to expose a subtly wrong regex or query.
  • Verify anything you'd ship. Run it, read it, test it. AI code is a draft from a fast colleague, not a merged PR.

Pair these with the planning prompts for project-shaped work, or the productivity collection for the non-code half of a developer's day.

Which prompt for which moment

Staring at a wall of red error text: Debug Detective, with the smallest reproduction you can build. Reviewing a pull request — yours or someone else's: the Senior Code Reviewer, before the human pass. Writing a query against a schema you half-remember: SQL from plain English, then read every line of the output before running it. Facing a regex in the wild: the explainer first, generator second. Shipping an API: the docs writer while the behavior is fresh in your head. Touching legacy code: the refactor plan before a single edit. And when the feature finally merges, the commit message generator writes the message your future self will thank you for.

7 coding prompts

Senior Code Reviewer

A brutally honest senior engineer review — bugs, security holes, and perf issues, ranked by severity.

#code-review#best-practices#refactoring#senior
View →

Debug Detective

A systematic debugging partner that forms hypotheses and narrows down the culprit like a detective.

#debugging#troubleshooting#errors#systematic
View →

API Documentation Writer

Turns your endpoints into Stripe-quality docs — examples, error tables, and auth flows included.

#api#documentation#rest#developer-experience
View →

Frequently asked questions

Which AI is best for coding prompts?

Claude and ChatGPT trade the lead depending on the task — Claude is often stronger on long-file reasoning and refactors, ChatGPT on quick explanations and broad library knowledge. Gemini is competitive on SQL and data questions. All the prompts here are written to work on any of them.

How much code should I paste into a prompt?

The smallest complete unit that shows the problem: the function, its direct dependencies, and the error or input that breaks it. Pasting an entire repo adds noise and burns context; pasting a single line removes the context the model needs to help.

Is it safe to paste my company's code into AI tools?

Only within your employer's policy. Many companies prohibit proprietary code in consumer AI tools and provide an approved enterprise tier instead. For personal projects and open-source code there's no issue — and when in doubt, anonymize names and strip secrets, keys, and connection strings before pasting anything.

Can AI replace code review?

No — and these prompts don't try to. They catch the mechanical layer fast (null risks, N+1 queries, missing error handling, unclear naming) so your human review time goes to architecture and intent. Think of it as a tireless first pass, not the final word.

Why does AI code sometimes look right but fail?

Models predict plausible code, not verified code — an invented method name or an off-by-one in a regex can look perfect. That's why the prompts here demand examples, edge cases, and explanations: they force the failure into the open before you run anything.

Official resources

Go deeper with the official docs and tools behind these prompts.

  • ChatGPT — Conversational AI for code help
  • Claude — Anthropic's AI assistant, strong at code