Coding Prompts

AI prompts for code review, debugging, refactors and architecture across any stack.

54+
prompts
6
use cases
4
AI models
Coding prompts
54
AI models supported
4
Use cases
6
Total library
564+

Search within Coding only — titles, summaries, use cases, models and tags.

View all 54 prompts

Browse by AI Model

AI models that pair well with Coding

Open the model hub to see how each one handles this kind of work.

All Prompts

Browse all 54 coding prompts

Filter by use case, model or difficulty — every prompt in this category, on one page.

Showing 112 of 54 prompts

Architecture
ChatGPT

ChatGPT Architecture Brainstorm Prompt

Generates a wide list of angles or variants to pick from.

View prompt →
Architecture
ChatGPT

ChatGPT Architecture Quickstart Prompt

A short, opinionated prompt that gets a great first draft.

View prompt →
Code Review
ChatGPT

ChatGPT Code Review Brainstorm Prompt

Generates a wide list of angles or variants to pick from.

View prompt →
Code Review
ChatGPT

ChatGPT Code Review Quickstart Prompt

A short, opinionated prompt that gets a great first draft.

View prompt →
Database
ChatGPT

ChatGPT Database Brainstorm Prompt

Generates a wide list of angles or variants to pick from.

View prompt →
Database
ChatGPT

ChatGPT Database Quickstart Prompt

A short, opinionated prompt that gets a great first draft.

View prompt →
Debugging
ChatGPT

ChatGPT Debugging Brainstorm Prompt

Generates a wide list of angles or variants to pick from.

View prompt →
Debugging
ChatGPT

ChatGPT Debugging Quickstart Prompt

A short, opinionated prompt that gets a great first draft.

View prompt →
DevOps
ChatGPT

ChatGPT DevOps Brainstorm Prompt

Generates a wide list of angles or variants to pick from.

View prompt →
DevOps
ChatGPT

ChatGPT DevOps Quickstart Prompt

A short, opinionated prompt that gets a great first draft.

View prompt →
Code Review
ChatGPT

ChatGPT Dockerfile Generator Prompt

Production-ready Dockerfile for any stack.

View prompt →
Refactoring
ChatGPT

ChatGPT Refactoring Brainstorm Prompt

Generates a wide list of angles or variants to pick from.

View prompt →
Page 1 of 5

⭐ Editor's Choice

The featured prompt on this page

One prompt we'd ship today. Read why it works, see a preview, and copy it in a click.

Editor's Choice · Tuned for Claude

Claude Senior Code Review

Why it works · It defines the runtime, behaviour and edge cases, then asks for tests — turning the AI from a code generator into a reliable engineering pair.

Best use case

Best for coding workflows where staff-engineer review of any diff with risks and nits.

Expected output

Working code in the runtime you specified, with edge cases handled and a small test you can run immediately.

Open full prompt

Staff-engineer review of any diff with risks and nits.

Coding prompts turn an AI into the senior engineer on your team — the one who catches the bug, names the abstraction, and writes the missing test.

Each prompt assigns a role, scopes the task, and asks for structured output you can act on. They work especially well with Claude and ChatGPT.

Use them in your IDE, your code review tool, or pasted into a chat. They're designed to be model-agnostic.

Editorial

The coding prompt library, explained

Welcome to the Coding hub. You'll find 54 coding prompts organised by use case, ranked by quality and tagged with the AI models that handle each task best. The collection is curated, not generated — every prompt has been written by humans, tested against real workflows and refined based on what actually ships.

These prompts are built for software engineers, ML engineers and indie devs who want code, tests and architecture suggestions they can ship. They work across the major AI models — ChatGPT, Claude, Gemini and the leading image and video generators — and they hold up whether you're prompting in a chat window, an editor extension or a workflow tool. Pull these in during scoping, scaffolding, refactors and code reviews — anywhere a teammate would help.

Why these prompts work: each one starts with a clear role, names the audience or scene, defines the output format and adds 2–3 hard constraints. That structure is what separates a vague AI answer from a usable one. The library is curated so you don't have to test 30 versions of the same prompt to find the one that actually performs — that work is already done.

Expect production-style code, types, edge-case handling and at least a smoke test — written in the style you specify. You'll occasionally want to regenerate or refine, especially the first time you use a prompt with your own context. Treat each prompt as a starting structure: the variables and constraints stay, the topic and tone become yours.

Read each prompt before you copy it. Swap the placeholders for your real audience, product and constraints, and add one or two engineering-specific details from your own brief. The prompts here are designed to be edited — the more context you bring, the stronger the output.

If you're new to AI prompting in coding, start with the featured prompts at the top of this page — they're the highest-leverage, lowest-friction picks. From there, drop into the use-case hubs below to find the exact workflow you need.

Prompt Writing Guide

How to write better Coding prompts

Six habits that consistently produce stronger AI output. Apply them to any prompt on this page.

  1. 1

    State the runtime and stack

    Language, version, framework, target platform. "Node 20 on Cloudflare Workers" produces very different code than "any JavaScript".

  2. 2

    Write the requirements first

    Functional behaviour, inputs, outputs, error handling. The AI is excellent at following a spec and mediocre at guessing intent.

  3. 3

    List the edge cases

    Empty arrays, null, network failures, race conditions, oversize payloads. Naming them up front prevents the "happy path only" trap.

  4. 4

    Ask for tests

    Request a small test suite alongside the implementation. Tests force the model to reason about boundaries — and you get verification for free.

  5. 5

    Pin code style

    TypeScript strict, no `any`, named exports, early returns. Pin style and you'll spend zero time on lint cleanup.

  6. 6

    Demand explanations on tricky parts

    Ask the model to comment any non-obvious step. Comments expose flawed reasoning before you ship the code.

Best Practices

Coding best practices

Apply these in every prompt on this page. Small habits, outsized improvements in output quality.

Pin the runtime and version

Language + framework + version. Skip and you'll get half-deprecated APIs.

Write the spec first

Inputs, outputs, errors, edge cases. The AI is a great spec follower.

Ask for tests alongside code

Tests catch flawed reasoning before you ship.

Forbid `any` in TypeScript

One rule removes 80% of weak AI-generated TS code.

Avoid These

Common Coding prompt mistakes

The same handful of mistakes are responsible for most weak AI output. Catch them before you hit send.

  • Missing the runtime

    Different runtimes have different APIs. Without it, the AI guesses — usually wrongly.

  • Glossing over edge cases

    If the prompt only describes the happy path, the code will only handle the happy path.

  • Asking for "clean code"

    "Clean" is subjective. Specify naming, style and lint rules instead.

  • Skipping tests

    Without tests you have no way to verify the AI's reasoning. Always ask for at least a smoke test.

  • Pasting too much code

    Dump only the relevant functions and types. Long context dilutes attention.

Pro Tips

Advanced prompt patterns

Side-by-side rewrites that show what separates a weak prompt from a great one.

Instead of

Write a function to debounce.

Use

Write a TypeScript `debounce<T>` higher-order function targeting Node 20. Cancel in-flight calls, return a `.cancel()` method, preserve `this`, type the return as `(...args: Parameters<T>) => void`. Include 4 Vitest tests covering rapid calls, cancel, late call, and `this` binding.

Why it works: Stack, behaviour, types and tests are all defined.

Instead of

Make this API.

Use

Implement a REST endpoint POST /api/invoices in Hono on Cloudflare Workers. Validate body with Zod. Return 400 on invalid input, 409 on duplicate, 201 with the new invoice on success. Include a small handler test and a sample curl.

Why it works: Framework, runtime, errors and verification are pinned.

Instead of

Fix this bug.

Use

Here's the error: `TypeError: cannot read 'map' of undefined`. The function receives `items` from the API. Add a guard, log a warning when it's missing, and update the test to cover the empty case. Don't change the public API.

Why it works: Symptom, expected fix and scope are explicit.

Instead of

Optimise this query.

Use

This Postgres query takes 1.4s on a 12M-row `events` table. The filter is `user_id = ? AND created_at > ?`. Propose 2 index strategies, explain the trade-offs, and rewrite the query if helpful.

Why it works: Volume, filter and trade-off framing produce useful answers.

Instead of

Refactor this code.

Use

Refactor this React component to extract the data fetching into a TanStack Query hook. Keep the rendering identical. Add types, no `any`, and update tests if they reference the old API.

Why it works: Boundary and constraints prevent over-refactoring.

FAQ

Coding prompts, answered

Common questions about using this category of prompts.

Related searches

People also search for coding prompts

Popular searches related to this page. Each one links to the closest matching prompt library.

Explore Coding Prompts

Browse dozens of curated prompts optimized for modern AI models.

View All Coding Prompts