100% free no uploads no sign-up

💻 ai prompts for coding

Debug errors, understand unfamiliar code, write tests and learn new languages faster. Prompts for beginners and working devs.

13 original prompts · tap “fill in the blanks” to personalise, then copy · updated November 2026

Fix this error

I'm using [language/framework + version]. This code: [paste code] throws this error: [paste error] I expected it to [expected behaviour]. Explain the cause in plain words, then show the minimal fix.

fill in the blanks (4)
ChatGPTGeminiClaudeMeta AICopilot

Explain this code line by line

Explain what this [language] code does, line by line, for someone who knows basic programming. Then summarise its purpose in 2 sentences and point out any bugs or risky parts. [paste code]

fill in the blanks (2)
ChatGPTGeminiClaudeMeta AICopilot

Write unit tests

Write unit tests for this function using [test framework]. Cover normal cases, edge cases (empty input, very large values, invalid types) and errors. [paste function]

fill in the blanks (2)
ChatGPTGeminiClaudeMeta AICopilot

Refactor for readability

Refactor this code for readability without changing its behaviour. Use clear names, smaller functions and remove duplication. Explain each change briefly. [paste code]

fill in the blanks (1)
ChatGPTGeminiClaudeMeta AICopilot

Build and explain a regex

Write a regular expression in [language] that matches [describe pattern] but not [counter-examples]. Explain each part and give 5 test strings with expected results.

fill in the blanks (3)
ChatGPTGeminiClaudeMeta AICopilot

Write an SQL query

Using [database, e.g. PostgreSQL], write a query that [what you need]. Tables: [paste table schemas]. Use parameterised placeholders for any user input, and explain the query.

fill in the blanks (3)
ChatGPTGeminiClaudeMeta AICopilot

Learn a new language fast

I know [language I know] well. Teach me [new language] by comparing it to what I know: syntax, types, error handling, common libraries and gotchas. End with 3 small exercises.

fill in the blanks (2)
ChatGPTGeminiClaudeMeta AICopilot

Code review like a senior dev

Review this code like a senior developer. Comment on correctness, security, performance, readability and edge cases, ordered by importance. Suggest concrete fixes. [paste code]

fill in the blanks (1)
ChatGPTGeminiClaudeMeta AICopilot

Convert code to another language

Convert this [source language] code to idiomatic [target language], using standard libraries where possible. Point out any behaviour that differs between the two. [paste code]

fill in the blanks (3)
ChatGPTGeminiClaudeMeta AICopilot

Plan a project from an idea

I want to build [app idea] using [tech stack]. Break it into milestones, list the main components and data model, and suggest the order to build them in so I have something working after the first day.

fill in the blanks (2)
ChatGPTGeminiClaudeMeta AICopilot

Git: get me out of trouble

I'm stuck in git: [describe the situation and paste `git status` output]. Explain what's going on and give me the safest commands to fix it, warning me before anything that could lose work.

fill in the blanks (1)
ChatGPTGeminiClaudeMeta AICopilot

Write docs and comments

Write clear documentation for this function: a one-line summary, parameters, return value, errors and a usage example, in [docstring style]. [paste function]

fill in the blanks (2)
ChatGPTGeminiClaudeMeta AICopilot

DSA interview practice

Give me a [easy/medium/hard] coding interview problem on [topic, e.g. arrays, graphs]. Wait for my solution in [language], then review its correctness and time/space complexity, and show an optimal approach.

fill in the blanks (3)
ChatGPTGeminiClaudeMeta AICopilot

How to use these prompts

AI coding assistants are most useful when you give them precise context: the language and version, the exact error message, the relevant code and what you expected to happen. The prompts below are structured to make you include that context, which is the single biggest factor in getting a useful answer.

Always read and test what the AI gives you. Generated code can use functions that don't exist, outdated APIs or insecure patterns — especially around authentication, SQL queries and file handling. Run it, write a test and ask the AI to explain any line you don't understand before it goes anywhere near production.

Never paste secrets — API keys, passwords, tokens, customer data — into an AI chat. Replace them with placeholders like YOUR_API_KEY. If you're working on your employer's code, check their policy on AI tools first.

Tips for better results

Use responsibly: Use these prompts responsibly: only edit photos of yourself or people who've agreed, label AI-generated images when you share them, don't use AI to impersonate anyone or create fake documents, and check important facts — AI can be wrong.

Frequently asked questions

Can AI write a whole app for me?

It can scaffold a lot, but you'll still need to understand, test and fix the code. Build in small steps and test each one.

Is AI-generated code safe to use?

Treat it like code from a stranger on the internet: review it, test it, and check security-sensitive parts carefully.

Which AI is best for coding?

Most leading assistants handle these prompts well; dedicated coding tools add features like reading your whole project.

More prompt collections