Coding prompts
Write the commit message for this change. Diff: """ [PASTE THE STAGED DIFF] """ Why I made this change: [THE REASON, THE TICKET, THE BUG REPORT, or "you infer it"] Convention: [Conventional Commits / this repo's existing style, pasted below / plain] Recent commits from this repo, to match style: """ [PASTE 5-10 RECENT COMMIT SUBJECT LIN
Commit Message
Write a commit message that explains why the change was made, in Conventional Commits format, split into separate commits when needed.
Help me recover from a git mistake without making it worse. What I was trying to do: [THE GOAL] What I ran: [THE EXACT COMMANDS, IN ORDER] What happened instead: [THE OUTPUT OR THE STATE NOW] Has this been pushed or shared: [YES/NO, and to which branch and whether anyone else has pulled] Uncommitted work I cannot lose: [WHAT AND WHERE, o
Undo a Git Mistake
Recover from a bad commit, force push, wrong branch, or lost work with a reversible plan and the exact commands, explained before you run them.
Handler code, routes, and models: """ [PASTE THE ROUTE DEFINITIONS, HANDLERS, REQUEST AND RESPONSE TYPES, VALIDATION SCHEMAS, AND MIDDLEWARE] """ Generate an OpenAPI 3.1 specification from the code above. API name, version, and base URL: [DETAILS] Auth scheme: [BEARER JWT / API KEY / OAUTH / SESSION COOKIE, and where it is enforced] Con
OpenAPI Spec From Code
Generate an accurate OpenAPI 3.1 spec from handler code, including error responses and auth, with gaps flagged instead of invented.
Infrastructure code to review: """ [PASTE THE TERRAFORM, CLOUDFORMATION, PULUMI, OR KUBERNETES MANIFESTS. INCLUDE THE PLAN OUTPUT IF YOU HAVE IT.] """ Review the infrastructure code above as the person who will be paged when it breaks. Environment: [PROD / STAGING / DEV] and what runs on it: [WORKLOAD] What this change is meant to do: [
Infrastructure as Code Review
Review Terraform, CloudFormation, or Kubernetes manifests for blast radius, security defaults, state risk, and what the plan will really do.
Write a technical design document. What we are building and why now: [THE PROBLEM AND THE TRIGGER] Who is affected: [USERS, TEAMS, SYSTEMS] Requirements: [FUNCTIONAL, PLUS ANY SCALE, LATENCY, AVAILABILITY, OR COMPLIANCE NUMBERS] Existing system: [WHAT IS THERE NOW, THE STACK, AND WHAT WE MUST NOT BREAK] Constraints: [TEAM SIZE, DEADLINE,
Technical Design Doc
Write the design doc that gets approved: problem, constraints, the chosen approach against real alternatives, and the risks stated up front.
Threat model this system. What it does and who uses it: [SYSTEM + USER TYPES INCLUDING ANONYMOUS ONES] Architecture, data flows, and dependencies: """ [PASTE THE DESIGN, THE RELEVANT CODE, OR A DESCRIPTION OF COMPONENTS AND HOW DATA MOVES BETWEEN THEM] """ Data handled: [WHAT KINDS, INCLUDING PERSONAL, PAYMENT, HEALTH, OR CREDENTIALS] Au
Threat Model
Threat model a feature or system with STRIDE: trust boundaries, ranked threats with attack paths, and mitigations mapped to real controls.
Design the retry and idempotency behavior for this operation. The operation and what it does: [e.g. "charge a card and create an order", "process an inbound webhook", "run a nightly sync job"] Where it runs and what calls it: [SERVICE, QUEUE, CRON, CLIENT] External systems it touches: [APIS, DATABASES, QUEUES, and whether each is idempot
Idempotency and Retry Design
Design safe retries for payments, webhooks, and jobs: idempotency keys, exactly-once boundaries, backoff, and the failure cases to test.
Plan an upgrade from [PACKAGE] [CURRENT VERSION] to [TARGET VERSION]. Why we are upgrading: [SECURITY FIX / FEATURE WE NEED / END OF SUPPORT / STAYING CURRENT] How the package is used in our codebase: """ [PASTE THE IMPORT SITES, THE CONFIG, AND ANY WRAPPER OR ADAPTER CODE. A GREP FOR THE PACKAGE NAME IS A GOOD START.] """ Migration guid
Major Dependency Upgrade
Plan a major framework or library upgrade: breaking changes that hit your code, a staged order, and a verification step per stage.
Write a data backfill script. What needs to change: [THE TRANSFORMATION, IN PLAIN TERMS] Schema and table sizes: [PASTE THE RELEVANT SCHEMA + ROW COUNTS] Database and version: [e.g. Postgres 16, MySQL 8, MongoDB] Language and access pattern: [e.g. "Python with SQLAlchemy", "a psql script", "a Rails task"] Is the system live during the ba
Safe Data Backfill
Write a backfill or one-off data migration that is batched, resumable, verifiable, and reversible, with a dry run before anything writes.
Help me fix this flaky test. The test and any helpers it uses: """ [PASTE THE TEST, ITS SETUP AND TEARDOWN, AND THE CODE UNDER TEST] """ Failure output from a failing run: """ [PASTE THE ERROR AND STACK TRACE] """ Failure rate: [e.g. "1 in 20 runs", "only in CI", "only when the full suite runs"] When it started: [AFTER WHAT CHANGE, or
Flaky Test Triage
Diagnose intermittent test failures by cause class, get the experiment that confirms each, and fix the root rather than adding retries.
Write end-to-end tests for this application. Framework: [PLAYWRIGHT / CYPRESS / SELENIUM] and language: [TS / PYTHON / OTHER] The app and its critical user journeys: [THE 3-7 FLOWS THAT LOSING WOULD ACTUALLY HURT] Relevant markup or components: """ [PASTE THE PAGES, COMPONENTS, OR SELECTORS INVOLVED] """ Auth: [HOW USERS LOG IN, AND WHET
End-to-End Test Suite
Write stable end-to-end tests for the flows that matter: resilient selectors, real waits, isolated data, and no test that tests everything.
Help me fix this type error. The full error, unabridged: """ [PASTE THE ENTIRE ERROR INCLUDING EVERY "Types of property X are incompatible" LINE. THE NESTED PART IS USUALLY THE REAL ERROR.] """ The code: """ [PASTE THE FAILING CODE PLUS THE TYPE AND INTERFACE DEFINITIONS INVOLVED] """ TypeScript version and relevant tsconfig settings:
Fix TypeScript Type Errors
Resolve stubborn type errors by reading what the compiler is really saying, with fixes ranked so escape hatches are the last resort.
Logs, traces, or metric output: """ [PASTE THE RAW LOGS, TRACE SPANS, OR METRIC SERIES. INCLUDE THE PERIOD BEFORE THE PROBLEM STARTED, NOT ONLY THE FAILING WINDOW.] """ Analyze the material above. What users reported and when: [SYMPTOM + TIME, WITH TIMEZONE] System shape: [SERVICES INVOLVED AND WHAT CALLS WHAT] What changed recently: [D
Log and Trace Analysis
Turn a pile of logs, traces, or metrics into a timeline, a ranked set of hypotheses, and the one query that would confirm the top one.
[Attach the screenshot or design image, then use this prompt:] Build this UI as [FRAMEWORK: React + TypeScript / Vue / Svelte / plain HTML] using [STYLING: Tailwind / CSS modules / styled-components / our design system, described below]. Our existing conventions and tokens: """ [PASTE A SIMILAR COMPONENT FROM OUR CODEBASE, PLUS OUR SPAC
Build UI From a Screenshot
Turn a design screenshot into accessible, responsive component code that matches your existing stack instead of inventing a new one.
Review the code changes below as a senior engineer who will be paged if this breaks in production. For each finding, report: - **Severity**: blocker / major / minor - **Claim**: one sentence stating the defect - **Failure scenario**: the concrete input or state that triggers it and what goes wrong - **Fix**: the smallest change that reso
Code Review
Review a diff like a senior engineer: verified, severity-ranked findings with concrete failure scenarios, no style nitpicks.
Help me debug this issue. Work as a diagnostician, not a guesser. **Symptom**: [WHAT HAPPENS, INCLUDING EXACT ERROR TEXT] **Expected**: [WHAT SHOULD HAPPEN] **Started when**: [RECENT CHANGES, OR "unknown"] **Environment**: [RUNTIME, VERSIONS, OS] **What I've tried**: [ATTEMPTS SO FAR] Relevant code/logs: """ [PASTE] """ Do this: 1. Res
Systematic Debugging
Debug any failure methodically: reproduce, form ranked hypotheses, and identify the single cheapest test that discriminates between them.
I want to implement this feature: [DESCRIBE THE FEATURE: the user-visible outcome, not the implementation] Constraints: [e.g. "no new dependencies", "must work with our existing auth", "ship behind a feature flag"] Work in two phases. Do NOT write or edit any code in phase 1. **Phase 1: Explore and plan:** 1. Read the relevant parts of
Plan-First Feature Implementation
Make an AI coding agent explore and plan before touching code: file-level plan, risks, and edge cases; implementation gated on your approval.
Refactor the code below. The hard constraint: observable behavior must not change, same outputs, same side effects, same error behavior, same performance characteristics within reason. What hurts about the current code: [THE PAIN, e.g. "600-line function", "logic duplicated in 4 places", "impossible to test"] Test coverage: [WHAT TESTS E
Behavior-Preserving Refactor
Refactor messy code without changing behavior: named invariants, small reviewable steps that each pass tests, and a strict scope fence.
Write tests for the code below. Test framework + conventions: [e.g. "vitest, tests in __tests__/, describe/it style", or paste an existing test file to match] What this code is used for: [THE REAL-WORLD JOB, so tests reflect actual usage] Code under test: """ [PASTE FUNCTION/MODULE] """ Work in this order: 1. **Contract**: state what t
Edge-Case Test Generation
Generate tests from a behavior contract and boundary analysis (happy paths, edges, and error paths) instead of coverage theater.
Help me make an architecture decision. The decision: [WHAT YOU'RE DECIDING, e.g. "how to handle background jobs", "monolith vs services for the new module"] System today: [STACK, SCALE, TEAM SIZE, DEPLOYMENT SETUP] Requirements that matter: [FUNCTIONAL + NUMBERS WHERE THEY EXIST: requests/sec, data volume, latency budget, team's operatio
Architecture Decision
Get 2-3 genuinely different architecture options with a trade-off table, a recommendation, and an ADR you can commit to the repo.
Plan (do not yet execute) this migration: [FROM → TO, e.g. "Express 4 → 5", "moment → date-fns", "REST client X → Y", "Python 3.9 → 3.12"] Codebase context: [SIZE, STACK, TEST COVERAGE HONESTLY STATED] Why now: [THE FORCING FUNCTION: EOL, security, blocked feature] Relevant code (or run against the repo if you're an agent): """ [PASTE RE
Legacy Migration Plan
Plan a framework upgrade or API migration the safe way: full usage inventory, old-to-new mapping rules, and compilable checkpoints.
Write a README for this project. Audience: [WHO LANDS HERE: e.g. "developers evaluating whether to use this library" / "new team members" / "users installing the CLI"] Project code (or explore the repo if you're an agent): """ [PASTE package.json/pyproject.toml, entry points, main modules, CLI/arg definitions] """ Rules before structure
README From Your Code
Generate a README grounded in what the code actually does: verified commands, honest feature list, and no hallucinated flags.
Write the PR description and commit message(s) for the changes below. The task these changes came from: [ONE LINE: the ticket/goal, e.g. "rate-limit the public API"] Anything the diff doesn't show: [CONTEXT: e.g. "follows up #123", "the weird part is a workaround for X"] Diff: """ [PASTE git diff OUTPUT] """ Produce: 1. **PR title**:
PR Description and Commits From a Diff
Turn a diff into a reviewable PR: what changed and why, a guide telling reviewers where to look, and conventional commit messages.
Optimize this slow query. Work from evidence, not pattern-matching. Do not propose any change until you've read the actual plan. The query: """ [PASTE THE SQL] """ Execution plan, run and paste: EXPLAIN (ANALYZE, BUFFERS) for Postgres, EXPLAIN ANALYZE for MySQL: """ [PASTE THE FULL PLAN OUTPUT] """ Schema context: table definitions + e
SQL Query Optimization
Fix a slow query the disciplined way: read the real execution plan, change one thing, re-measure, no index guessing without evidence.
Write SQL to answer my question. My schema (tables, columns, types, plus 2-3 sample rows per table if available; samples resolve ambiguity better than descriptions): """ [PASTE CREATE TABLE STATEMENTS OR SCHEMA DUMP] """ Dialect: [POSTGRES / MYSQL / SQLITE / BIGQUERY / SNOWFLAKE] The question, in plain English: [WHAT YOU WANT TO KNOW, e
Text to SQL
Turn a plain-English question into correct SQL: schema-grounded, dialect-aware, edge cases handled, and the query explained back.
Security-audit the code below. You are looking for exploitable vulnerabilities, not style issues: every finding needs an attack story. Code (routes/handlers, auth logic, DB access, file handling: the attack surface): """ [PASTE CODE, or point an agent at the repo and name the entry points] """ Context: [STACK + WHERE THIS RUNS, e.g. "Ex
OWASP Top 10 Security Audit
Audit code for the OWASP Top 10 with exploitability-ranked findings: concrete attack scenario, affected lines, and the minimal fix.
Write a regex for me. What it should match: [DESCRIBE THE PATTERN + PASTE 3-5 REAL STRINGS THAT MUST MATCH] What it must NOT match: [PASTE 3-5 STRINGS THAT LOOK SIMILAR BUT MUST BE REJECTED: this is where most regexes fail] Where it runs: [JAVASCRIPT / PYTHON / GO(RE2) / PCRE / grep: flavors differ on lookbehind, named groups, unicode] T
Regex Builder
Get a regex with match/reject test cases, a piece-by-piece explanation, ReDoS check, and a straight answer when regex is the wrong tool.
Write a production-ready Dockerfile for my app. Stack: [LANGUAGE + VERSION + FRAMEWORK, e.g. "Node 22 / Next.js", "Python 3.12 / FastAPI", "Go 1.23"] How it builds and starts: [BUILD COMMAND + START COMMAND + PORT] Package manager + lockfile: [e.g. "pnpm with pnpm-lock.yaml", "uv with uv.lock"] Runtime needs: [NATIVE DEPS, ENV VARS EXPEC
Production Dockerfile
Write a production Dockerfile with multi-stage builds, layer-cache ordering, non-root user, health check, and no secrets in layers.
Give me a guided tour of this codebase. I'm [NEW TO THE TEAM / EVALUATING THIS PROJECT / INHERITING THIS CODE], and my first real task will be: [THE TASK, e.g. "add a field to the billing flow", or "unknown, general orientation"]. [IF AGENT: explore the repo yourself, start with the manifest, entry points, and folder structure. IF CHAT:
Codebase Onboarding Tour
Turn an unfamiliar repo into a guided tour: architecture map, the money path traced end to end, conventions inferred, and safe first tasks.
Write a blameless postmortem from my raw incident material. Raw material (Slack threads, alerts, PR links, notes: messy is fine): """ [PASTE EVERYTHING: when things fired, who did what, what was tried, what worked] """ Impact facts: [DURATION / USERS OR CUSTOMERS AFFECTED / REVENUE OR SLA IMPACT / DATA LOSS Y/N: what's known] The system:
Blameless Postmortem
Turn incident notes into a blameless postmortem: timestamped timeline, systemic contributing factors, and action items with owners.
Write a GitHub Actions workflow for my project. What it should do: [e.g. "typecheck + test + lint on every PR, build and deploy on merge to main"] Stack: [LANGUAGE/RUNTIME + VERSION, PACKAGE MANAGER, TEST/BUILD COMMANDS] Deploy target, if any: [WHERE + AUTH METHOD: OIDC preferred over long-lived secrets] Repo facts: [MONOREPO? / TYPICAL
GitHub Actions Workflow
Generate a CI workflow with the practices AI usually skips: SHA-pinned actions, least-privilege permissions, caching, timeouts, and concurrency.
[DESIGN a new API / REVIEW my existing API] for [THE DOMAIN, e.g. "order management for our storefront"]. The resources and operations needed: [WHAT CLIENTS MUST BE ABLE TO DO: plain language list] Consumers: [INTERNAL SERVICES / THIRD-PARTY DEVELOPERS / MOBILE APPS: third parties raise the stakes on consistency and versioning] Existing
REST API Design
Design or review an API against the conventions that matter: resource naming, cursor pagination, RFC 9457 errors, idempotency, and OpenAPI 3.1.
Design the database schema for [THE FEATURE/SYSTEM, e.g. "orders, payments, and refunds for our marketplace"]. The entities and how they relate, in plain language: [DESCRIBE THE DOMAIN: what exists, what belongs to what, what changes often] Database: [POSTGRES (assumed) / MYSQL / OTHER + VERSION] Scale expectations, honestly: [ROWS/GROWT
Database Schema Design
Design a schema with the decisions that age well: right PK strategy, indexed FKs, timestamptz everywhere, and migrations that don't lock tables.
Explain this error and find the real cause. The full error + stack trace (paste everything: truncated traces hide the answer): """ [PASTE THE COMPLETE ERROR OUTPUT] """ Language/runtime + framework: [e.g. "Python 3.12 / Django" / "Node 22 / Next.js"] What I was doing when it happened: [THE ACTION/REQUEST/COMMAND] What changed recently: [
Explain This Error
Decode any error or stack trace: read it in the right direction, separate your code from framework noise, and fix the cause, not the symptom.
Help me make this faster, with discipline. Rule zero: no optimization gets proposed until we've seen a measurement that implicates it. What's slow: [THE SYMPTOM + NUMBERS: "the /reports endpoint takes 8s p95" / "this script takes 40 min on 1M rows"] The target: [WHAT FAST ENOUGH MEANS: "p95 under 1s" / "under 5 min", no target, no finish
Performance Optimization
A measure-first optimization loop: profile under real load, rank by Amdahl math, change one thing, re-measure, no speculative micro-tuning.
Port this code from [SOURCE LANGUAGE] to [TARGET LANGUAGE]. The code: """ [PASTE THE MODULE/FUNCTIONS, or point an agent at the files] """ What it does in production: [THE REAL JOB + what depends on it] Existing tests: [PASTE THEM / "none", if none, step 1 is mandatory, not optional] Target conventions: [THE FRAMEWORK/STYLE THE PORT MUST
Port Code Between Languages
Translate code the safe way: characterization tests first, idiomatic (not literal) translation, and a checklist of the semantic drift traps.
Audit this code for accessibility (WCAG 2.2 AA). Start with the failures that dominate real-world audits, and be honest about what a code review can't verify. The code (components/templates/pages): """ [PASTE THE MARKUP/COMPONENTS, or point an agent at the views/components directories] """ What this UI does: [THE FLOWS: forms, navigation
Accessibility Audit
Audit code against WCAG 2.2 AA starting with the six violations that dominate the web: semantic HTML over ARIA, keyboard paths, honest coverage limits.
Give me a shell command for this task: [TASK, e.g. "find every file over 100MB modified in the last week, excluding node_modules"] My environment: [macOS / Linux / Windows (WSL or Git Bash)], shell: [zsh / bash / don't know] Format the answer as: 1. THE COMMAND: one pasteable line (or two clear commands if that's more readable than one
Plain English to Shell Command
Turn a plain-English task into a shell command with a flag-by-flag explanation, a blast-radius warning, and a dry-run first for anything destructive.
Turn my app idea into a spec for an AI app builder ([v0 / Lovable / Bolt / Replit]). Vague ideas produce demo-ware: plausible screens wrapped around a core loop that doesn't work. This spec's whole job is to prevent that. The idea: [2-3 SENTENCES] Who it's for: [THE USER, and the moment they'd reach for it] The one thing that must work:
PRD for AI App Builders
Turn an app idea into a build spec (pages, data model, edge states, scope cuts) then compress it into one paste-ready prompt for builders like v0, Lovable, and Bolt.