11 curated prompts

Programming

Refactors, debugging, code review, and architecture prompts.

Get a staff-engineer-grade review of a diff.

You are a staff engineer reviewing a {language} pull request.
Context: {context}

Diff:
```
{diff}
```

Review in this order and stop at the first blocker:
1. Correctness bugs (with a concrete failing input if possible)
2. Security issues
3. Design issues (cou…
reviewquality

Plan a safe refactor before touching code.

I want to refactor {file_or_module}. Current pain: {current_pain}. Constraints: {constraints}.

Produce a refactor plan:
1. Current shape (a 5-bullet summary — do not paste code back)
2. Target shape and why it's better
3. Step-by-step migration in commits tha…
refactorarchitecture

Structured debugging when you're stuck.

I'm debugging a {language} error:

Error:
{error}

What I tried:
{what_i_tried}

Relevant code:
```
{relevant_code}
```

Do this:
1. List the top 3 hypotheses ranked by likelihood, with the specific evidence for each
2. For hypothesis #1, give me the smallest …
debugbugs

Enumerate cases before writing tests.

Design a test plan for this function.

Signature: {function_signature}
Behavior: {behavior}
Language: {language}, Framework: {framework}

Return a table:
| Case | Input | Expected | Category |

Categories: happy path, boundary, invalid input, error path, concu…
testingquality

Understand a regex you didn't write.

Explain this regex step by step: {regex}

Then:
1. Show what it matches and doesn't match, using {example_inputs}
2. Identify any performance risk (catastrophic backtracking, greedy vs lazy)
3. Propose a cleaner rewrite (readable named groups, comments if the …
regex

Speed up a query with reasoning.

Optimize this {dialect} query. Current runtime: {current_runtime}.

Schema:
{schema}

Query:
```sql
{query}
```

Do this:
1. Read the query plan implied by the query and call out the likely bottleneck
2. Propose index changes (with CREATE INDEX statements) and…
sqlperformance

Design an HTTP endpoint with edge cases covered.

Design an HTTP endpoint for {action} on {resource}. Auth: {auth_model}.

Return:
- Method + path
- Request headers, query params, body schema (with types and required flags)
- Response body schema for 2xx
- All non-2xx cases with status codes and body shape
- …
apidesign

Write a commit message from a diff.

Given this diff:

```
{diff}
```

Write a Conventional Commits message:
- Type (feat/fix/refactor/perf/docs/test/chore/build/ci)
- Optional scope
- Subject in imperative mood, ≤72 chars, no period
- Blank line
- Body explaining "why" in ≤3 short paragraphs
- F…
gitcommit

Document a technical decision.

Write an ADR titled "{decision_title}".

Context: {context}
Options considered: {options}

Sections:
1. Status (proposed / accepted / superseded)
2. Context — what problem, what constraints
3. Options — each with pros, cons, cost
4. Decision — chosen option, i…
architectureadr

Audit a Dockerfile for best practices.

Review this Dockerfile:

```
{dockerfile}
```

Check for:
- Multi-stage build opportunity
- Base image size and vulnerabilities
- Layer caching order (deps before source)
- Non-root user
- HEALTHCHECK
- Signal handling / init process
- Secrets accidentally bak…
dockerdevops

Structured walkthrough of a design problem.

Walk through the system design for: {problem_statement}. Target scale: {scale}.

Follow this outline:
1. Clarifying questions (list, don't guess answers)
2. Functional and non-functional requirements
3. Back-of-envelope estimates (QPS, storage, bandwidth)
4. H…
system-designinterview