AI Prompt Library
830+ ready-to-use prompt templates — just replace the bracketed parts with your own needs to get more out of ChatGPT, Claude, Midjourney, and more.
All categories Learning & ResearchVideo & YouTubeDesign & CreativeWriting & ContentCreative & StorytellingMarketing & SocialWork & BusinessEmail & CommunicationProductivity & WorkProgrammingLearning & EducationJob & CareerSEO & BloggingAI Image GenerationE-commerce & SellersData & AnalysisLife & FinanceCustomer SupportPresentations & PitchesTravel & PlanningParenting & KidsHealth & FitnessInterview PrepSocial Media Managers
Programming
Paste an error message so AI locates the bug and gives a fix
You are a senior engineer. I hit an error — find the cause and give a fix. Answer in this order: 1. [What the error is saying] Explain the error message's meaning in plain language. 2. [Most likely causes] List two to three most likely causes, from most to least likely. 3. [How to fix] For the most likely cause, give me directly-applicable fix code, explaining what you changed and why. 4. [How to prevent] How to write it next time so I don't hit this again. My dev environment: (language / framework / version) What I'm doing: (briefly what this code is trying to achieve) Full error message: (paste the error log) Relevant code: (paste the code near the error) If there's not enough info to judge, first tell me what more you need — don't guess.Suggested tool →
Explain this code
Explain in plain language what the code below does, walking through the logic section by section, and point out any potential bugs or areas to improve. Code: "___"
Write tests for me
Write unit tests for the function below, covering normal cases and edge conditions (null, extreme values, bad input), and explain what each test verifies. Function: "___"
Help me debug
My code is supposed to "___" but actually "___". Find the likely cause, how to verify it, and the fix. Code: "___" Error message: "___"
Help me refactor
The code below runs but feels messy. Refactor it into a clearer, more maintainable version, explain what you changed and why, and keep the original behavior unchanged. Code: "___"
Ask AI to explain this code
Explain in a way even a beginner understands what the code below does and why it's written this way, and point out where it can be improved: (paste the code)
Plan an MVP development plan for an indie mini-game
I want to make a (game genre, e.g., 2D platformer / idle management / puzzle) mini-game; the core idea is (describe the gameplay in one sentence); my skills are (can't code at all / know a little JavaScript / familiar with a certain engine); I can invest (hours) per week. Please: 1) narrow the idea into a one-sentence core gameplay; 2) define the 3-5 features the minimum playable version (MVP) must have, and list a "cut from v1 first" list; 3) recommend an engine and tool combo based on my skill level; 4) lay out week-by-week development milestones. Be pragmatic — the goal is finishing within two months.Suggested tool →
Help me debug
I hit this error: (paste the full error message) Relevant code: (paste the code) The behavior I expect is (describe). Guess the likely cause and give a fix, and explain why it went wrong.
Write tests for me
Write unit tests for the function below, covering normal and edge cases, and explain what each test verifies: (paste the function)
Understand a confusing error message and troubleshoot step by step
I hit an error running code and can't quite understand it — as a senior engineer, walk me through figuring it out and fixing it step by step. What I'm doing: (e.g., running a Python script / starting a project) Language or framework and version: (if known) Full error message: (paste the whole thing, including the traceback) Relevant code snippet: (paste the part that might be failing) What I've tried: (if any) Please: 1. Explain in plain language what this error is actually saying and the most likely cause 2. List 2-3 most likely problem spots, ranked by likelihood 3. Give me concrete fix steps and the corrected code 4. Teach me how to read this kind of error myself next time and how to narrow it down Constraint: confirm the cause before giving a fix, don't just hack at it; state uncertain parts clearly.Suggested tool →
Add plain-language comments and refactoring suggestions to confusing legacy code
You are a software engineer with ten years' experience, skilled at maintaining others' legacy code. I'll paste some code. Please: Programming language: (e.g., Python / JavaScript / PHP) Code: (paste here) Output: 1. "Plain-language explanation of the whole thing": in three sentences, make clear what it does, assuming the reader is a new engineer. 2. "Block-by-block comments": add Traditional Chinese inline comments to key blocks (keep the original code, explaining the purpose alongside). 3. "Potential issues": list possible bugs, performance, or security concerns. 4. "Refactoring suggestions": propose two or three concrete rewrite directions and explain the benefit of each. Constraint: don't rewrite the whole thing outright — focus first on explanation and suggestions; state uncertain parts as "needs confirmation."Suggested tool →
Write a regular expression
I want to use a regular expression (regex) to achieve: (describe the need, e.g., "match Taiwanese mobile numbers"). Give me a working regex with a section-by-section explanation and a few test examples.
Check code for security issues
Review the code below, point out possible security risks (like injection, permissions, secret leakage), and give fix suggestions: (paste the code)
Plan an automation workflow
I want to automate this repetitive work: (describe the steps). Break it into automatable steps, suggest a tool or method for each, and mark which need human confirmation.
Add clear comments and naming suggestions to hard-to-read code
I inherited some code with no comments and careless variable naming, and want to make it understandable to future people (including myself). Programming language: () Roughly what this code does (my current guess): () Code: (paste it) Please: 1. Summarize in one plain-language paragraph what this code actually does 2. Without changing the logic, add Traditional Chinese comments at the key spots (only comment what's confusing, not every line) 3. List unclear variable/function names and give more expressive naming suggestions, as a comparison table 4. Point out anything that looks like it might hide a bug or be hard to maintain later, each with a one-line note.Suggested tool →
Plan a feature's implementation steps (for an AI editor to execute)
I'm building a (project type, e.g., Astro site / Node API); the stack is (language/framework). I want to add a feature: (describe the feature and expected behavior concretely). Please: 1) break this requirement into clear implementation steps (which files to change and what to do at each step); 2) mark possible edge cases and tests to write; 3) point out easy pitfalls. Output as a task list I can paste into an AI editor agent like Cursor to execute step by step, with fine-enough granularity that I can review each part.Suggested tool →
Plan an automation workflow
I want to automate: (describe the need, e.g., "send a personalized thank-you email when a form comes in"). Break it into "trigger → steps → result," and point out which steps can connect to AI.
Plan a customer-service knowledge-base bot with Dify
You are a Dify adoption consultant. Our company wants to build AI customer service; existing data: (describe, e.g., a 50-page product-manual PDF, 30 FAQ items, a returns/exchange rules document). Produce a build spec: 1) document organization and chunking suggestions for the knowledge base; 2) Chatflow node design (with a draft system prompt that must include an "admit it if not found" rule); 3) a 10-question test-question list before going live; 4) the conditions under which a human should take over.Suggested tool →
Have AI list the impact scope before changing code
I want to change this code: (paste the code, or the file path and requirement). Before you touch anything, do just one thing — list the impact scope: 1) which files and functions this change touches; 2) what places call it that might break after the change; 3) whether tests cover this logic, and if not which cases to add; 4) whether there's a smaller, lower-risk alternative approach. **Don't write any code yet** — wait until I confirm the scope. If you need to see certain files to judge, just tell me which — don't guess. Answer in Traditional Chinese with Taiwan usage.Suggested tool →
Prompt-injection self-check checklist before an AI app goes live
You are a consultant specializing in AI application security. I'm about to launch an LLM app — help me do a pre-launch security self-check. App purpose: (e.g., an external customer-service bot connected to the company product knowledge base) Model used: (e.g., Claude / GPT) What data it can read: (e.g., product FAQ, an order-lookup API) What actions it can perform: (e.g., look up orders, submit return requests) Who the users are: (e.g., general consumers, no login needed) Output: 1. Based on the above, draw the risk boundary and list three worst-case attack paths 2. A Traditional Chinese jailbreak test bank, 10 questions in each of four categories (extract the system prompt / bypass the role settings / cross-user data leakage / indirect injection) 3. The defenses for each category, split into "prompt layer," "application layer," "infrastructure layer" 4. What content the output side should filter, and the specific criteria for filtering 5. Which fields to log to the audit log so problems can be traced afterward Give an executable list directly — don't explain the theory.
Explain what this code does (for beginners)
Explain this code in plain language even a beginner understands: 1) what it does overall (with a real-life analogy); 2) key logic section by section; 3) where it's error-prone or needs attention; 4) if there's a clearer way to write it, suggest it. Use Taiwan's common technical terms. Code: ``` paste the code ```Suggested tool →
Find the bug and explain the cause
My code isn't working as expected. Please: 1) find the most likely problem; 2) explain why it happens (spell out the principle); 3) give the corrected code; 4) remind me how to avoid this kind of error in future. If info is insufficient, first ask what I need to add. Expected behavior: "describe" Actual behavior: "describe" Code: ``` paste the code ```Suggested tool →
Turn a requirement into clean, commented code
Write code per my requirement. Requirements: clear naming, clean structure, Traditional Chinese comments at key spots, and basic error handling and edge cases. After writing, explain your design tradeoffs in a few sentences and what could be optimized further. Requirement: "describe what you want to do, in what language/framework"Suggested tool →
Write tests covering this code
Write tests for the code below. Requirements: cover normal, edge, and error cases; name each test clearly to state what it tests; use the language's common test framework; and point out what other cases are worth adding. Code: ``` paste the code ```Suggested tool →
Refactor this code to be more readable
Refactor the code below to be more readable and maintainable: 1) improve naming; 2) break up overly long functions; 3) remove duplication; 4) keep behavior unchanged. After, explain what you changed and why, and include the full refactored code. Code: ``` paste the code ```Suggested tool →
Do a code security check
Review the code below from a security standpoint: 1) check for common vulnerabilities (injection, XSS, privilege escalation, secret leakage, insecure dependency usage); 2) list issues ranked by severity; 3) attach fixed code for each; 4) explain how to verify the fix. Code: ``` paste the code ```Suggested tool →
Write a database query (SQL)
Write SQL: 1) a query per my described need; 2) a section-by-section explanation of what it does; 3) point out possible performance issues (missing indexes, full table scans) and fixes; 4) remind me of edge cases (NULL, duplicates, time zones). Table schema: "describe tables and columns" What I want to query: "describe the need"Suggested tool →
Write a regular expression (Regex)
Write a regular expression: 1) give the regex per the need; 2) break it down explaining what each part matches; 3) give 5 matching and 5 non-matching examples; 4) point out common mismatch traps and a more robust way to write it. What I want to match: "describe the rule, e.g., Taiwanese mobile numbers" Language used: "e.g., JavaScript"Suggested tool →
Code review: aim for coverage, don't filter for me
Review the code below. This round's goal is **coverage**, not brevity. [Code] (paste the code you want reviewed) [Background] - Language and framework: (e.g., TypeScript + React) - What this code is for: - Runtime environment and scale: (e.g., handles 100,000 requests a day) - The part I'm most worried about: (may leave blank) [Review requirements] Report **every** issue you find, including ones you're unsure about or think are low severity. Don't filter by importance at this stage — I'll rank them myself later. Better to report one extra that I later dismiss than to miss a real bug. Use this format for each finding: - **Location**: line number or function name - **Issue**: concretely what will go wrong - **Trigger scenario**: what input or state causes it - **Severity**: high/medium/low - **Confidence**: high/medium/low - **Suggested fix**: concrete enough to apply directly [Specially check these categories] 1. Edge conditions (null, zero, huge values, empty arrays) 2. Concurrency and race conditions 3. Error handling and exception paths 4. Resource leaks (connections, files, memory) 5. Security (injection, permissions, sensitive data leakage) Finally give me a summary table sorted by "severity x confidence." Use Traditional Chinese with Taiwan usage.
Turn a natural-language requirement into a runnable SQL query
You are a senior data engineer. My table schema is as follows: (paste the CREATE TABLE or column descriptions) The question I want to answer is: (describe in plain language, e.g., "last month's deal-amount ranking per salesperson") Please: 1. Produce standard SQL (state the applicable database, e.g., PostgreSQL/MySQL). 2. Explain the query logic line by line with comments. 3. Point out possible performance traps (missing indexes, full table scans) and optimization suggestions. 4. If my question is semantically ambiguous, ask me first before producing the SQL.
Do a rigorous code review for a Pull Request
You are a quality-focused Tech Lead. Below is my diff: (paste the code changes) Review on the principle of "precise, few false positives," listing issues by severity: 1. 🔴 Correctness/security (things that will break or have vulnerabilities) 2. 🟡 Maintainability (naming, duplication, edge conditions) 3. 🟢 Suggestions (optional optimizations) For each, note the file and line number, explain why it's a problem, and give a fix example. Don't force-find issues in parts that are fine.Suggested tool →
Line-by-line code review to catch bugs
You are a senior software engineer specializing in code review. Review the (programming language) code below, pointing out item by item: potential bugs, edge-case vulnerabilities, performance bottlenecks, naming and readability issues, and security risks. For each issue, note the line number and severity, and give a corrected code snippet with the reason. Code: (paste the code)Suggested tool →
Refactor legacy code
You are a refactoring expert. Refactor the (programming language) code below to be cleaner and more maintainable, following SOLID principles and the language's conventions. Keep the original functionality unchanged, and use comments to explain the reason for each change. If functions can be split or common logic extracted, do that too. Output the full refactored code plus a summary of key changes. Code: (paste the code)Suggested tool →
Plain-language explanation of confusing code
You are a patient coding teacher. In plain Chinese, explain section by section what the (programming language) code below does — first a one-sentence summary of the overall purpose, then break down each key block's logic and data flow, and finally point out what beginners most easily misunderstand. The audience is (level, e.g., learning to code for half a year). Code: (paste the code)Suggested tool →
Error-message debugging help
You are a debugging ace. I hit the following error running (programming language/framework) — judge the most likely root cause and list 3 troubleshooting directions and concrete fix steps, ordered by likelihood. If you need more info, tell me clearly what to provide. Error message: (paste the full error message). Relevant code: (paste the code)Suggested tool →
Generate code from a requirement
You are a senior (programming language) developer. Write complete, runnable code per the requirement below, following the language's best practices, adding necessary error handling and Traditional Chinese comments, and ending with a brief usage example. Requirement: (describe the feature you want). Constraints: (e.g., no third-party packages, must be compatible with a certain version).Suggested tool →
Write unit tests
You are a test engineer specializing in TDD. Write complete unit tests for the (programming language) function below using (test framework, e.g., Jest/PyTest). Be sure to cover normal cases, boundary values, and exceptions and bad input. Add a one-line comment to each test case explaining what it verifies. Function: (paste the code)Suggested tool →
SQL query writing and optimization
You are a database engineer. Write a correct SQL query per the requirement below, explain the purpose of each JOIN and condition, and finally give performance-optimization suggestions (indexes, avoiding full table scans, etc.). Database: (e.g., MySQL/PostgreSQL). Table schema: (paste the schema). What I want to query: (describe the need).Suggested tool →
Write a regular expression
You are a regex expert. Write a regex for the purpose of (describe what to match), compatible with (programming language/tool). Provide the expression itself, break down the meaning of each symbol section by section, and attach 3 matching and 2 non-matching test strings for me to verify. Example text to handle: (paste the example)Suggested tool →
Write API integration code
You are a backend engineer. In (programming language), write code integrating the API below, including the correct request method, headers, parameters, response parsing, and an error-retry mechanism, with Traditional Chinese comments. If there's an API key, handle it via environment variables. API doc highlights: (paste endpoints, parameters, auth method). My goal: (describe).Suggested tool →
Generate technical docs and a README
You are a technical writer. Produce a clear README for the project below, including: project intro, features, installation steps, usage examples, environment requirements, and FAQ. Professional but understandable tone, code blocks marked in Markdown. Project info: (describe the project's purpose and tech stack). Main code or config: (paste the key content)Suggested tool →
Cross-language code conversion
You are an engineer fluent in multiple languages. Convert the (source language) code below to (target language), keeping the same logic and behavior, using the target language's idioms and standard library rather than a word-for-word translation. After converting, note the syntax or ecosystem differences to watch for between the two. Original code: (paste the code)Suggested tool →
Design a system architecture
You are a systems architect. I'm building (product/feature description), estimated scale (e.g., daily active users). Propose a suitable technical architecture including front-end/back-end tech choices, database, cache, and deployment, and describe in text the components' relationships and data flow. List this design's pros, cons, possible bottlenecks, and directions for scaling.Suggested tool →
Optimize code performance
You are a performance-optimization expert. The (programming language) code below runs too slowly — analyze its time and space complexity, find the bottleneck, propose concrete optimizations, and attach the rewritten code. Explain the complexity difference before and after. If it involves algorithm or data-structure changes, explain the principle. Code: (paste the code)Suggested tool →
Write Git commands and workflow
You are a Git version-control expert. My current situation is (describe your situation, e.g., wanting to undo the last commit, resolve a conflict, merge branches). Tell me step by step which Git commands to run, explain each command's effect and risk, and warn me of any irreversible actions. If there's a safer alternative, explain that too.Suggested tool →
Code security-vulnerability check
You are a security engineer familiar with the OWASP Top 10. Check whether the (programming language) code below has security vulnerabilities, such as SQL injection, XSS, CSRF, sensitive-info leakage, missing authentication/authorization, etc. For each, note the risk level, how it could be attacked, and provide the patched, secure way to write it. Code: (paste the code)Suggested tool →
Plan a development work breakdown
You are a technical project manager. I'm building (feature/product description); the tech stack is (fill in). Break it into an executable development task list, ordered logically, marking each task's dependencies and estimated difficulty, and point out the technical risks or unknowns to clarify first. Output as a bulleted list I can paste directly onto a kanban board.Suggested tool →
FAQ
What is an AI prompt?
A prompt is the instruction or question you give an AI. The clearer it is, the more context and the more specific the role and output format, the better the AI's answer.
How do I write a good AI prompt?
Master four elements: give the AI a role, state the goal and background clearly, specify the output format and tone, and provide examples or constraints. The templates here are all designed this way and can be used directly.
Which AI can these prompts be used with?
Text prompts work with ChatGPT, Claude, Gemini, and more; image prompts work with Midjourney, Stable Diffusion, and others. Just replace the bracketed parts with your own needs.