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: …
Practical coding & debugging prompts tested with useful AI apps.
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: …
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 — …
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.…
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…
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…
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…
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…
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…
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…
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 …
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…
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…
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…
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…
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.…
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…
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…
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 …
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…
This works locally and fails in production. Symptoms: {{describe, including frequency and pattern}}. Environment differences I know of: {{list}}. Logs: {{paste}}. Work the problem…
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…
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 …
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…
Here's my diff: {{paste git diff or the file list plus key hunks}}. The ticket said: {{paste it}}. Write the pull request description with these sections: 1. WHAT CHANGED — two se…
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…
You are a staff engineer doing a deletion pass. Candidate dead code: {{paste file list, functions, feature flags, endpoints, and any usage or analytics data you have}}. How we dete…
You are a senior engineer breaking an oversized change into a review-friendly series. Below is the diff summary (or file list plus description) and the constraints. Produce: 1. PR…
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…
You are a build engineer looking at a CI pipeline that has crept up to {{current wall-clock time}}. Config: {{paste CI config / Dockerfile / build script}}. Timing breakdown per st…
You are a staff engineer doing a flag cleanup on a codebase where every flag was supposed to be temporary. Flag list with creation dates, current rollout state, and owner if known…
You are a staff engineer triaging a stale pull request. It is too big, the branch has drifted, and nobody wants to be the one to review it. The PR description and diff summary (fi…
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…
You are a staff engineer reviewing a failure path. Below is the code that calls a third-party API, plus what the user is doing when it runs and what the vendor's failure modes look…
You are the engineer who owns an API endpoint that has to go. Below are the endpoint and its replacement, request volume by client or API key over the last month, and why we are re…
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…
You are a performance engineer. Below is my endpoint list with real traffic shape and the infrastructure behind it. Design the load test. 1. THE PROFILE WORTH TESTING - table: End…
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…
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,…
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…
You are a senior engineer who finds regressions by narrowing, not by reading every diff. A feature worked in the previous release and is broken now. Help me find the commit. Return…
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…
You are a senior engineer on a team where tests pass in staging and break in production. Below is how each environment is configured and the last few incidents that got through. Pr…
You are a senior engineer who has chased memory leaks in production. My service's memory climbs until it restarts. Using the evidence below, help me find the cause in five sections…