Collection · 76 prompts

AI coding prompts you can copy and paste

These prompts cover the everyday work of writing software with AI: debugging from a stack trace, reviewing a pull request, writing tests before the code, planning a feature, building small tools, learning a new framework and writing docs. The chat prompts work in Claude, ChatGPT and Gemini. The agent prompts are written for Claude Code and Cursor, which can read your project, run commands and edit files.

Two habits make every prompt here work better: paste the real code, error or diff instead of describing it, and say what "done" looks like. Remove passwords, API keys and customer data before you paste anything, and always run and read the code the AI gives you.

Last updated

Download 76 prompts as a free PDF245 KB · no sign-up · all prompt packs

Free agent rules generatorCLAUDE.md, AGENTS.md or Cursor rules in the right format, plus a spec and a build plan · no sign-up

All 76 prompts

Example result: Write a CLAUDE.md file for your project Text & chat2 blanks to fillWrite a CLAUDE.md file for your projectClaude Code · Cursor Example result: Give an AI coding agent a clear task brief Text & chat2 blanks to fillGive an AI coding agent a clear task briefClaude Code · Cursor Example result: Find the root cause from a stack trace Text & chat4 blanks to fillFind the root cause from a stack traceClaude · ChatGPT · Gemini Example result: Review a pull request diff before you merge Text & chat2 blanks to fillReview a pull request diff before you mergeClaude · ChatGPT · Claude Code Example result: Plan a feature before writing any code Text & chat2 blanks to fillPlan a feature before writing any codeClaude · ChatGPT · Claude Code Example result: Review code written by an AI before you trust it Text & chat2 blanks to fillReview code written by an AI before you trust itClaude · ChatGPT · Claude Code Example result: Fix a bug that works locally but fails in production Text & chat3 blanks to fillFix a bug that works locally but fails in productionClaude · ChatGPT · Gemini Example result: Fix a flaky test that passes and fails at random Text & chat4 blanks to fillFix a flaky test that passes and fails at randomClaude · ChatGPT · Gemini Example result: Speed up a slow API endpoint or function Text & chat5 blanks to fillSpeed up a slow API endpoint or functionClaude · ChatGPT · Gemini Example result: Track down a memory leak Text & chat3 blanks to fillTrack down a memory leakClaude · ChatGPT · Gemini Example result: Resolve a Git merge conflict safely Text & chat1 blank to fillResolve a Git merge conflict safelyClaude · ChatGPT · Claude Code Example result: Fix a CORS error between frontend and API Text & chat3 blanks to fillFix a CORS error between frontend and APIClaude · ChatGPT · Gemini Example result: Check a UI component for accessibility Text & chat2 blanks to fillCheck a UI component for accessibilityClaude · ChatGPT · Gemini Example result: Review a database schema before it goes live Text & chat3 blanks to fillReview a database schema before it goes liveClaude · ChatGPT · Gemini Example result: Find dead code and safe things to delete Text & chat1 blank to fillFind dead code and safe things to deleteClaude · ChatGPT · Claude Code Example result: Improve error handling in your code Text & chat3 blanks to fillImprove error handling in your codeClaude · ChatGPT · Gemini Example result: Make confusing code easy to read Text & chat1 blank to fillMake confusing code easy to readClaude · ChatGPT · Gemini Example result: Write the tests first for a new feature Text & chat2 blanks to fillWrite the tests first for a new featureClaude · ChatGPT · Claude Code Example result: List the edge cases your code might miss Text & chat1 blank to fillList the edge cases your code might missClaude · ChatGPT · Gemini Example result: Write an end-to-end test for a user journey Text & chat3 blanks to fillWrite an end-to-end test for a user journeyClaude · ChatGPT · Claude Code Example result: Mock an external API in your tests Text & chat2 blanks to fillMock an external API in your testsClaude · ChatGPT · Gemini Example result: Turn a fixed bug into a regression test Text & chat2 blanks to fillTurn a fixed bug into a regression testClaude · ChatGPT · Claude Code Example result: Build a REST API endpoint with validation Text & chat3 blanks to fillBuild a REST API endpoint with validationClaude · ChatGPT · Gemini Example result: Build a React component from a description Text & chat3 blanks to fillBuild a React component from a descriptionClaude · ChatGPT · Gemini Example result: Build a small command-line tool Text & chat2 blanks to fillBuild a small command-line toolClaude · ChatGPT · Gemini Example result: Build a landing page in plain HTML and CSS Text & chat1 blank to fillBuild a landing page in plain HTML and CSSClaude · ChatGPT · Gemini Example result: Build a simple Chrome extension Text & chat1 blank to fillBuild a simple Chrome extensionClaude · ChatGPT · Gemini Example result: Clean a messy spreadsheet with Python Text & chat1 blank to fillClean a messy spreadsheet with PythonClaude · ChatGPT · Gemini Example result: Automate Google Sheets with Apps Script Text & chat1 blank to fillAutomate Google Sheets with Apps ScriptClaude · ChatGPT · Gemini Example result: Build a simple Telegram or Discord bot Text & chat3 blanks to fillBuild a simple Telegram or Discord botClaude · ChatGPT · Gemini Example result: Turn a user story into working code Text & chat5 blanks to fillTurn a user story into working codeClaude · ChatGPT · Claude Code Example result: Add secure login to a web app Text & chatReady to copyAdd secure login to a web appClaude · ChatGPT · Gemini Example result: Understand a new codebase fast Text & chat3 blanks to fillUnderstand a new codebase fastClaude · ChatGPT · Claude Code Example result: Learn a programming concept with analogies Text & chatReady to copyLearn a programming concept with analogiesClaude · ChatGPT · Gemini Example result: Practise coding interview problems with hints Text & chat2 blanks to fillPractise coding interview problems with hintsClaude · ChatGPT · Gemini Example result: Learn a new framework using one you know Text & chat2 blanks to fillLearn a new framework using one you knowClaude · ChatGPT · Gemini Example result: Understand a long SQL query step by step Text & chat2 blanks to fillUnderstand a long SQL query step by stepClaude · ChatGPT · Gemini Example result: Choose a tech stack for your project Text & chat1 blank to fillChoose a tech stack for your projectClaude · ChatGPT · Gemini Example result: Break a project into small tickets Text & chat1 blank to fillBreak a project into small ticketsClaude · ChatGPT · Gemini Example result: Write a pull request description reviewers love Text & chat3 blanks to fillWrite a pull request description reviewers loveClaude · ChatGPT · Claude Code Example result: Write an architecture decision record Text & chat3 blanks to fillWrite an architecture decision recordClaude · ChatGPT · Gemini Example result: Write Cursor project rules for your codebase Text & chatReady to copyWrite Cursor project rules for your codebaseClaude Code · Cursor Example result: Let an AI agent fix failing tests properly Text & chat1 blank to fillLet an AI agent fix failing tests properlyClaude Code · Cursor Example result: Do a large refactor in small safe steps Text & chat2 blanks to fillDo a large refactor in small safe stepsClaude Code · Cursor Example result: Fix a layout bug from a screenshot Text & chat1 blank to fillFix a layout bug from a screenshotClaude · ChatGPT · Claude Code Example result: Write a Dockerfile for your app Text & chat1 blank to fillWrite a Dockerfile for your appClaude · ChatGPT · Claude Code Example result: Check your code for leaked API keys and secrets Text & chat1 blank to fillCheck your code for leaked API keys and secretsClaude · ChatGPT · Gemini Example result: Add logging that helps you debug later Text & chat1 blank to fillAdd logging that helps you debug laterClaude · ChatGPT · Gemini Example result: Create TypeScript types from a JSON response Text & chat2 blanks to fillCreate TypeScript types from a JSON responseClaude · ChatGPT · Gemini Example result: Upgrade a library to a new major version Text & chat3 blanks to fillUpgrade a library to a new major versionClaude · ChatGPT · Claude Code Example result: Add an AI feature to your app with an LLM API Text & chatReady to copyAdd an AI feature to your app with an LLM APIClaude · ChatGPT · Gemini Example result: Debug an error message step by step Text & chat4 blanks to fillDebug an error message step by stepChatGPT · Gemini · Claude Example result: Get a code review like a senior engineer Text & chat3 blanks to fillGet a code review like a senior engineerChatGPT · Gemini · Claude Example result: Write unit tests for your code Text & chat2 blanks to fillWrite unit tests for your codeClaude · ChatGPT · Gemini Example result: Explain code line by line Text & chat3 blanks to fillExplain code line by lineChatGPT · Gemini · Claude Example result: Refactor messy code safely Text & chat2 blanks to fillRefactor messy code safelyChatGPT · Gemini · Claude Example result: Security review checklist for your code Text & chat2 blanks to fillSecurity review checklist for your codeChatGPT · Gemini · Claude Example result: Write an SQL query from plain English Text & chat2 blanks to fillWrite an SQL query from plain EnglishClaude · ChatGPT · Gemini Example result: Speed up a slow SQL query Text & chat4 blanks to fillSpeed up a slow SQL queryChatGPT · Gemini · Claude Example result: Design a REST API for your app Text & chat2 blanks to fillDesign a REST API for your appChatGPT · Gemini · Claude Example result: Design a database schema Text & chat5 blanks to fillDesign a database schemaChatGPT · Gemini · Claude Example result: Write a GitHub Actions workflow Text & chat5 blanks to fillWrite a GitHub Actions workflowChatGPT · Gemini · Claude Example result: Plan how to find a performance bottleneck Text & chat5 blanks to fillPlan how to find a performance bottleneckChatGPT · Gemini · Claude Example result: Plan a safe technology migration Text & chat5 blanks to fillPlan a safe technology migrationChatGPT · Gemini · Claude Example result: Write a technical spec Text & chat4 blanks to fillWrite a technical specChatGPT · Gemini · Claude Example result: Write clear git commit messages Text & chat2 blanks to fillWrite clear git commit messagesChatGPT · Gemini · Claude Example result: Write a README for your project Text & chat5 blanks to fillWrite a README for your projectChatGPT · Gemini · Claude Example result: Write friendly release notes Text & chat5 blanks to fillWrite friendly release notesChatGPT · Gemini · Claude Example result: Write API documentation from code Text & chat1 blank to fillWrite API documentation from codeChatGPT · Gemini · Claude Example result: Add helpful comments and docstrings to code Text & chat1 blank to fillAdd helpful comments and docstrings to codeChatGPT · Gemini · Claude Example result: Write a regex from a plain description Text & chat3 blanks to fillWrite a regex from a plain descriptionChatGPT · Gemini · Claude Example result: Convert code from one language to another Text & chat3 blanks to fillConvert code from one language to anotherChatGPT · Gemini · Claude Example result: Python script to automate a task Text & chat4 blanks to fillPython script to automate a taskChatGPT · Gemini · Claude Example result: Get a beginner roadmap for learning to code Text & chat3 blanks to fillGet a beginner roadmap for learning to codeChatGPT · Gemini · Claude Example result: Practise a system design interview Text & chat1 blank to fillPractise a system design interviewChatGPT · Gemini · Claude
1 more prompt without a picture yet

How to get working code from an AI, not just code that looks right

AI coding help fails in a predictable way: the answer is fluent, confident and slightly wrong, because the model guessed at something you did not show it. The prompts on this page are built to remove that guessing. The debugging prompts ask for the full error, the stack trace and what you already tried. The review prompts ask for the diff, not a summary of it. The planning prompts ask for the goal, the constraints and what done looks like before any code is written.

There are two ways to use them. In a chat assistant you paste code in and copy answers out, which suits one file, one error or one question. A coding agent works inside your project instead: it can read files, run commands and edit code. For an agent the most useful prompts here are the task brief, the plan-before-coding prompt and the rules file prompts, because an agent with a clear brief and clear rules wanders much less.

How to use these prompts

  1. 1

    Pick the prompt for the job you are doing right now: fixing, reviewing, testing, building, learning or documenting.

  2. 2

    Paste the real material: the exact error text, the failing test, the diff or the file. Remove keys, passwords and customer data first.

  3. 3

    Say what done means, such as “this test passes” or “the endpoint returns in under 200 ms locally”, so the answer has a clear target.

  4. 4

    Run what you get, read every changed line, and paste any new error back into the same conversation rather than starting again.

Get better results

  • Ask for a plan first. For anything bigger than a small fix, ask for the steps and the files it will touch before any code. Plans are cheap to correct.
  • Keep changes small. Ask for one change at a time with a test. Large rewrites are hard to review and hide new bugs.
  • Write down your rules. A short rules file with your commands, style and do-not-touch areas saves you repeating them in every prompt.
  • Make it explain its fix. Ask why the bug happened, not only how to fix it. If the reason does not match what you see, the fix is probably wrong.
  • Check libraries and versions. Models sometimes suggest functions that do not exist or belong to another version. Look them up in the official docs before you rely on them.

If the answer is not right

  • The fix does not work. Paste the new error and the code as it is now. Say what you ran and what happened, so it stops reasoning from an old version.
  • It rewrote far more than asked. Ask for the smallest possible change, as a diff, and tell it which files and functions must not change.
  • The answer uses a made-up function. Name your language, framework and version, and ask it to use only what is in that version’s documentation.
  • Tests pass but the bug is still there. Ask for a test that reproduces the bug first and fails, then for the fix that makes it pass.

Follow your employer’s rules on AI tools and on sharing code. Never paste secrets or personal data, and treat AI-written code like code from a new colleague: review it, test it and understand it before it ships.

Guides

Guides for ai coding

All guides →
FAQ

Questions, answered

Which AI is best for coding?

Claude, ChatGPT and Gemini all handle everyday coding help well, and the chat prompts here work in all three. For changes across a whole project, an agent such as Claude Code or Cursor is faster because it can read your files and run your tests.

What is a CLAUDE.md file?

It is a short Markdown file in your project that Claude Code reads at the start of every session. It lists your commands, code style and rules, so the agent works the way your team does. The CLAUDE.md prompt helps you write one.

Is it safe to paste my code into an AI?

Follow your company rules first. Never paste passwords, API keys or customer data, and check whether your plan lets the provider train on your inputs. Many teams use business plans that do not.

Need something that isn’t here?

Describe it in one line and get a AI coding prompt built for you.

Build my prompt

Explore more prompts