Coding & Debugging prompts

Practical coding & debugging prompts tested with useful AI apps.

Code

Find the slow thing before optimising

This is slow: {{describe symptom, e.g. endpoint takes 4s at p95}}. Here's the code and what I know: {{paste code, query plans, timings, data volumes}}. Don't optimise yet. First: …

By Max 267 copies · 23 likes Added Jul 24, 2026
Code

Design review before you write the service

Review this design before I build it: {{paste design or describe: what it does, data model, endpoints, dependencies, expected scale}}. Attack it in this order: 1. FAILURE MODES — …

By Max 132 copies · 26 likes Added Jul 7, 2026
Code

Review your own code before anyone else sees it

Here's the change I'm about to push: {{paste the diff}}. Context: {{what it's meant to do, what the codebase conventions are}}. Review it as three different people, separately: 1.…

By Max 76 copies · 16 likes Added Aug 21, 2026
Code

Review this PR like the reviewer everyone respects

Review the diff below as a senior engineer on this codebase would. Order your review by what actually matters: 1. CORRECTNESS — logic errors, off-by-one, unhandled nulls, wrong er…

By Max 80 copies · 19 likes Added Jul 16, 2026
Code

Write the docs the next engineer needs

Write documentation for the code below, for an engineer who joins in six months. Structure: 1. WHAT AND WHY — what this does and the problem it exists to solve. Include the constr…

By Max 103 copies · 20 likes Added Jul 13, 2026
Code

Write the SQL, then explain what it will cost

Write the query for this question: {{describe what you need to know}}. Schema: {{paste DDL or table and column list with row counts}} Database: {{engine and version}} Requirement…

By Max 87 copies · 17 likes Added Jul 4, 2026
Code

Turn a vague ticket into an implementation plan

Here's the ticket: {{paste}}. Here's the relevant code: {{paste}}. Produce an implementation plan: 1. Restate the requirement precisely, and list every ambiguity you had to resolv…

By Max 60 copies · 22 likes Added Jul 20, 2026
Code

Understand an unfamiliar codebase fast

I've just been dropped into this codebase and need to ship a change to {{area}} this week. Given the files below, produce an orientation doc: 1. What this system does, in two sent…

By Max 91 copies · 15 likes Added Jul 9, 2026
Code

Refactor without changing behaviour

Refactor the code below. The behaviour must not change, including its bugs, unless I approve the change. Process: 1. First, describe the current behaviour precisely, including edg…

By Max 60 copies · 17 likes Added Jul 8, 2026
Code

Convert a script into something maintainable

This script works but it's about to become important: {{paste script}}. Harden it without over-engineering: 1. Name the failure modes it currently has — what happens on a network …

By Max 99 copies · 13 likes Added Jul 13, 2026
Code

Turn a customer bug report into a reproducible test

Here's what the customer wrote: {{paste it verbatim, including the vague bits}}. Here's the relevant code: {{paste}}. Here's our test setup: {{framework, how fixtures work}}. Do t…

By Max 81 copies · 10 likes Added Aug 21, 2026
Code

Unblock a dependency upgrade that broke the build

A dependency upgrade broke my build. Upgrade: {{package, from version, to version}}. Errors: {{paste the first and last 30 lines of the failure}}. Lockfile or manifest: {{paste rel…

By Max 81 copies · 17 likes Added Aug 3, 2026
Code

Add logging to code you did not write

Here's a module I inherited and now have to support: {{paste the code}}. It currently logs {{nothing / everything at debug}}. Propose targeted logging, not a rewrite. For each sug…

By Max 89 copies · 11 likes Added Aug 21, 2026
Code

Security pass on code that touches user data

Security-review the code below. It handles {{describe data and who can reach it}}. Check specifically: 1. AUTHZ — is every object access scoped to the caller's tenant and role, or…

By Max 85 copies · 13 likes Added Jul 19, 2026
Code

Triage a test suite that fails at random

My CI is red often enough that people rerun jobs instead of reading them. Failure data: {{paste test names, failure counts, and recent failure output}}. Stack and test runner: {{e.…

By Max 70 copies · 16 likes Added Aug 7, 2026
Code

Plan a schema migration that runs under live traffic

I need to change a database schema while the app keeps serving traffic. Current shape: {{tables, columns, types, indexes, row counts}}. Target shape: {{what it should become}}. Sta…

By Max 62 copies · 15 likes Added Aug 3, 2026
Text

Estimate work you have never done before

I've been asked how long this will take: {{describe the work}}. What I know: {{stack, team size, what already exists}}. What I've never done before: {{the unfamiliar part}}. Break…

By Max 65 copies · 13 likes Added Aug 21, 2026
Code

Decide the error handling for a new API endpoint

I'm adding an endpoint: {{method, path, what it does}}. It touches {{database / third-party API / queue}}. Callers are {{our own frontend / third-party integrators / both}}. Give …

By Max 75 copies · 8 likes Added Aug 21, 2026
Text

Draft the postmortem from a raw incident timeline

Write a blameless postmortem from the raw material below. Incident channel or timeline: {{paste messages, alerts, and deploy events with timestamps}}. User impact as measured: {{wh…

By Max 74 copies · 13 likes Added Aug 7, 2026
Code

Debug the thing that only fails in production

This works locally and fails in production. Symptoms: {{describe, including frequency and pattern}}. Environment differences I know of: {{list}}. Logs: {{paste}}. Work the problem…

By Max 76 copies · 12 likes Added Jul 9, 2026
Code

Explain this error like a senior engineer would

Here's an error and the relevant code. Diagnose it properly. 1. Translate the error into plain language: what the runtime was trying to do when it gave up. 2. Name the actual caus…

By Max 97 copies · 10 likes Added Jul 29, 2026
Code

Write the tests that would have caught the bug

Here's a bug that reached production, and the code around it. 1. Write the failing test that reproduces it at the smallest useful level (unit if the logic is pure, integration if …

By Max 84 copies · 8 likes Added Jul 10, 2026
Text

Write the on-call runbook for the service you own

You are a staff engineer writing an on-call runbook for someone who has never touched this service. The service: {{what it does, who depends on it, what it talks to}}. Paste the co…

By Max 52 copies · 11 likes Added Aug 20, 2026
Text

Decide whether to roll back or fix forward at 2am

You are the calm senior engineer on an incident bridge. Symptoms and blast radius: {{errors, affected users, when it started}}. What shipped recently: {{commits, migrations, config…

By Max 39 copies · 8 likes Added Aug 18, 2026
Code

Work out why your service is slow for one customer only

You are a senior engineer debugging a latency complaint that only one customer sees. Below are their symptoms, our timings and the relevant code or queries. Work the problem. 1. S…

By Max 23 copies · 7 likes Added Sep 16, 2026
Code

Decide what to do about a bug you cannot reproduce

You are a senior engineer on call. A bug is reported but does not reproduce locally. Report: {{paste the ticket or user description}}. Relevant code: {{paste}}. What we have from p…

By Max 53 copies · 4 likes Added Aug 14, 2026
Text

Review a dependency before you add it to the codebase

You are a staff engineer who has been burned by abandoned libraries. I am about to add a dependency. Judge it in five sections, no preamble. 1. WHAT IT ACTUALLY DOES - two sentenc…

By Max 30 copies · 3 likes Added Aug 31, 2026
Text

Cut your cloud bill without breaking the service

You are a pragmatic infrastructure engineer. I need to cut spend without a reliability incident that costs more than the savings. Cost breakdown by service or line item, last full…

By Max 23 copies · 3 likes Added Sep 4, 2026
Code

Decide whether to rewrite a module or keep patching it

You are a staff engineer who has seen rewrites fail. Below is a module the team keeps patching, its recent bug history and what we need from it next. Tell me whether to rewrite it,…

By Max 12 copies · 3 likes Added Sep 27, 2026
Code

Clean up the bad data a bug wrote into production

You are the engineer who has done this before and knows a rushed backfill causes the second incident. A bug wrote incorrect rows to production. Below are the schema, the bug, and t…

By Max 15 copies · 1 like Added Sep 6, 2026
Code

Contain an API key someone just committed to the repo

You are a security-minded senior engineer. A credential was committed to our repository. Below is what leaked, where, and for how long. Walk me through containing it in the right o…

By Max 13 copies · 1 like Added Sep 30, 2026