All prompts
Prompts library
⌨️

Coding prompts

30 curated prompts for the coding workflow, each paired with the AI tools that run them best.

30 prompts

Advanced

Refactor with explicit invariants

Refactor the function below. Preserve behavior. After the rewrite, list the invariants the refactor relies on, and note any callers that might break. Do not change the public API. Code:

<paste>
#refactor#invariants#safety
Coding 1,237
Advanced

Refactor with explicit invariants β€” for a regulated enterprise

Refactor the function below. Preserve behavior. After the rewrite, list the invariants the refactor relies on, and note any callers that might break. Do not change the public API. Code:

<paste>

Audience: a regulated enterprise.
#refactor#invariants#safety#enterprise
Coding 1,231
Intermediate

Spec-first feature plan β€” for a startup codebase

I want to add <feature>. Before writing code, produce: (1) the user story, (2) acceptance criteria, (3) data model deltas, (4) API contract, (5) edge cases, (6) test list. Stop. Wait for approval.

Audience: a startup codebase.
#spec#planning#feature#codebase
Coding 1,208
Intermediate

Spec-first feature plan β€” for a regulated enterprise

I want to add <feature>. Before writing code, produce: (1) the user story, (2) acceptance criteria, (3) data model deltas, (4) API contract, (5) edge cases, (6) test list. Stop. Wait for approval.

Audience: a regulated enterprise.
#spec#planning#feature#enterprise
Coding 1,205
Advanced

Find and fix the actual bug

I am seeing <symptom> in <env>. Stack trace and repro below. Identify the root cause, propose the minimal fix, and explain why simpler hypotheses are wrong. Do not paper over the issue. Trace:

<paste>
#debug#root-cause#fix
Coding 1,185
Advanced

Find and fix the actual bug β€” for a startup codebase

I am seeing <symptom> in <env>. Stack trace and repro below. Identify the root cause, propose the minimal fix, and explain why simpler hypotheses are wrong. Do not paper over the issue. Trace:

<paste>

Audience: a startup codebase.
#debug#root-cause#fix#codebase
Coding 1,182
Advanced

Find and fix the actual bug β€” for a regulated enterprise

I am seeing <symptom> in <env>. Stack trace and repro below. Identify the root cause, propose the minimal fix, and explain why simpler hypotheses are wrong. Do not paper over the issue. Trace:

<paste>

Audience: a regulated enterprise.
#debug#root-cause#fix#enterprise
Coding 1,179
Intermediate

Write tests first, then code β€” for a startup codebase

Write tests first for <feature> using <test framework>. Cover happy path, two failure modes, and an edge case. Then implement the smallest code that passes them. Show tests and code separately.

Audience: a startup codebase.
#tdd#tests#feature#codebase
Coding 1,156
Intermediate

Write tests first, then code β€” for a regulated enterprise

Write tests first for <feature> using <test framework>. Cover happy path, two failure modes, and an edge case. Then implement the smallest code that passes them. Show tests and code separately.

Audience: a regulated enterprise.
#tdd#tests#feature#enterprise
Coding 1,153
Intermediate

Code review with prioritized notes β€” for a startup codebase

Review the diff below as a senior engineer. Output 3 sections: blockers, must-fix, nits. Be specific, cite line numbers, and propose a concrete change for every blocker. Diff:

<paste>

Audience: a startup codebase.
#review#pr#feedback#codebase
Coding 1,130
Intermediate

Code review with prioritized notes β€” for a regulated enterprise

Review the diff below as a senior engineer. Output 3 sections: blockers, must-fix, nits. Be specific, cite line numbers, and propose a concrete change for every blocker. Diff:

<paste>

Audience: a regulated enterprise.
#review#pr#feedback#enterprise
Coding 1,127
Advanced

Migrate from legacy library

Migrate the file from <legacy lib> to <new lib>. Preserve behavior, update types, replace deprecated calls, and add a brief migration note at the top. Flag anything that has no clean equivalent.
#migration#libraries#modernize
Coding 1,107
Advanced

Migrate from legacy library β€” for a startup codebase

Migrate the file from <legacy lib> to <new lib>. Preserve behavior, update types, replace deprecated calls, and add a brief migration note at the top. Flag anything that has no clean equivalent.

Audience: a startup codebase.
#migration#libraries#modernize#codebase
Coding 1,104
Advanced

Migrate from legacy library β€” for a regulated enterprise

Migrate the file from <legacy lib> to <new lib>. Preserve behavior, update types, replace deprecated calls, and add a brief migration note at the top. Flag anything that has no clean equivalent.

Audience: a regulated enterprise.
#migration#libraries#modernize#enterprise
Coding 1,101
Beginner

Explain unfamiliar code β€” for a startup codebase

Explain what the code below does. Give: (1) a one-paragraph summary, (2) a function-by-function map, (3) the data flow, (4) two non-obvious gotchas a new contributor would miss. Code:

<paste>

Audience: a startup codebase.
#explain#onboarding#reading#codebase
Coding 1,078
Beginner

Explain unfamiliar code β€” for a regulated enterprise

Explain what the code below does. Give: (1) a one-paragraph summary, (2) a function-by-function map, (3) the data flow, (4) two non-obvious gotchas a new contributor would miss. Code:

<paste>

Audience: a regulated enterprise.
#explain#onboarding#reading#enterprise
Coding 1,075
Advanced

Generate API client with retries

Generate a typed API client for <openapi spec / endpoints>. Include: typed responses, request validation, exponential backoff with jitter, idempotency keys for POSTs, structured logging, and a mock server for tests.
#api#client#reliability
Coding 1,055
Advanced

Generate API client with retries β€” for a startup codebase

Generate a typed API client for <openapi spec / endpoints>. Include: typed responses, request validation, exponential backoff with jitter, idempotency keys for POSTs, structured logging, and a mock server for tests.

Audience: a startup codebase.
#api#client#reliability#codebase
Coding 1,052
Advanced

Generate API client with retries β€” for a regulated enterprise

Generate a typed API client for <openapi spec / endpoints>. Include: typed responses, request validation, exponential backoff with jitter, idempotency keys for POSTs, structured logging, and a mock server for tests.

Audience: a regulated enterprise.
#api#client#reliability#enterprise
Coding 1,049
Advanced

Performance triage β€” for a regulated enterprise

Profile the function below. List the top three suspected hot paths, what data would confirm each, and the smallest change for each. Do not micro-optimize without evidence. Code:

<paste>

Audience: a regulated enterprise.
#performance#profiling#triage#enterprise
Coding 1,023
Advanced

Security review of a handler β€” for a startup codebase

Audit the handler below for OWASP top-10 risks. For each finding: severity, exploit scenario in two sentences, and a concrete remediation. Do not invent vulnerabilities. Handler:

<paste>

Audience: a startup codebase.
#security#owasp#audit#codebase
Coding 1,000
Advanced

Security review of a handler β€” for a regulated enterprise

Audit the handler below for OWASP top-10 risks. For each finding: severity, exploit scenario in two sentences, and a concrete remediation. Do not invent vulnerabilities. Handler:

<paste>

Audience: a regulated enterprise.
#security#owasp#audit#enterprise
Coding 997

GDPR Β· Privacy & cookies

Your data, your rules.

We use strictly necessary cookies to run this site and, with your consent, anonymous analytics to improve it. You can change your mind at any time. Read more in our Privacy notice and Cookie policy.