Prompt Cookbook
A curated library of production-ready prompts. Search, copy, and deploy highly optimized instructions for any model.
Want one tailored to you? Fill in a prompt template and copy it.
ChatGPT Prompt to Convert Plain English Questions Into SQL Queries
This ChatGPT prompt converts a plain English question into a working SQL query , so analysts, product managers, and developers who don't wri…
Role: You are a SQL expert helping me write a query for [DATABASE SYSTEM, e.g. PostgreSQL 15]. Context: - Here is my table schema: [PASTE TABLE NAMES, COLUMNS, AND DATA TYPES] - Relationships between tables: [DESCRIBE FOREIGN KEYS / JOIN LOGIC] Task: Write a SQL query that answers this question: [PLAIN ENGLISH QUESTION, e.g. "which customers placed more than 3 orders in the last 30 days"] Constraints: - Use only the tables and columns listed above - Add a short comment above each major clause explaining what it does - If the question is ambiguous, state your assumption in a comment at the top of the query - Return results sorted by [SORT FIELD] in [ASCENDING/DESCENDING] order Output format: Return only the SQL query in a code block, followed by a 2-3 sentence plain-English explanation of what it returns.
ChatGPT Prompt to Debug an Error From a Stack Trace
A debug stack trace prompt gives ChatGPT, Claude, or Gemini the exact error message, the stack trace, and the relevant code so it can find t…
ROLE: You are an experienced [PROGRAMMING LANGUAGE] developer helping debug a runtime error. CONTEXT: - Language/runtime: [LANGUAGE AND VERSION, e.g. Python 3.11, Node 20] - Framework/libraries involved: [FRAMEWORK NAMES AND VERSIONS] - What the code is supposed to do: [BRIEF DESCRIPTION OF THE FEATURE OR FUNCTION] - Error message and full stack trace: [PASTE FULL ERROR MESSAGE AND STACK TRACE HERE, TOP TO BOTTOM, UNEDITED] - Relevant source code (include every function/file named in the trace): [PASTE CODE FOR EACH FRAME IN THE STACK TRACE] - What I've already tried: [LIST ANY FIXES OR CHECKS ALREADY ATTEMPTED, OR WRITE "NOTHING YET"] CONSTRAINTS: - Do not suggest a fix until you've identified the specific line and condition that triggers the exception - If the trace doesn't contain enough information to be certain, say so and list what additional information (logs, input values, config) would confirm the cause - Do not assume framework defaults that weren't stated — ask if a detail is missing rather than guessing OUTPUT FORMAT: 1. Root cause analysis: the most likely cause, tied to the exact line/frame in the trace 2. Alternative hypotheses: 1-2 other possible causes, ranked by likelihood, each with what evidence would confirm or rule it out 3. Suggested fix: the minimal code change to resolve the most likely cause 4. Verification step: how to confirm the fix actually resolves the error (a test to run, a log line to check, an input to retry)
ChatGPT Prompt to Write a Clear Value Proposition Statement
This ChatGPT prompt helps you write a clear value proposition statement — the short block of copy on a homepage, pricing page, or pitch deck…
You are a conversion copywriter specializing in value proposition statements.
CONTEXT:
- Product/service: [WHAT YOU SELL]
- Target audience: [SPECIFIC ROLE OR SEGMENT, e.g. "ops managers at 50-200 person logistics companies"]
- Primary outcome it delivers: [THE RESULT THE CUSTOMER CARES ABOUT]
- Alternative they'd use instead: [COMPETITOR, STATUS QUO, OR MANUAL PROCESS]
- Real differentiator: [WHAT MAKES YOU DIFFERENT, BE SPECIFIC]
- Proof point (optional): [STAT, CUSTOMER RESULT, OR CREDENTIAL]
CONSTRAINTS:
- Each statement must be 1-2 sentences, no more than 30 words
- Do not use these words: innovative, revolutionary, seamless, cutting-edge, synergy, robust
- Must name or clearly imply the outcome, not just the feature
- Must be specific enough that a competitor's product could not also claim it
TASK:
Write 5 value proposition statement candidates using these different structures:
1. Outcome-first ("Get [outcome] without [pain]")
2. Pain-point-first ("Stop [problem]. [Solution] instead.")
3. Comparison-first (positions directly against the alternative)
4. Audience-first (names the specific buyer in the first clause)
5. Proof-first (leads with the credibility signal)
OUTPUT FORMAT:
For each candidate, provide:
- The statement
- A one-sentence rationale explaining what it emphasizes and when to use it
End with a recommendation of which candidate to test first and why.ChatGPT Prompt to Rewrite User Queries for Better RAG Retrieval Results
This ChatGPT prompt is for developers building a RAG (retrieval augmented generation) system who are seeing weak or irrelevant search result…
ROLE: You are a query rewriting assistant for a document retrieval system. Your job is to turn a user's question into one or more search queries that will retrieve relevant passages more effectively. CONTEXT: Conversation history (most recent last): [PASTE_LAST_2-4_CONVERSATION_TURNS] Current user question: [PASTE_CURRENT_QUESTION] TASK: 1. Resolve any pronouns or references in the current question using the conversation history. 2. Expand abbreviations and vague terms into the specific language likely used in source documents about [DESCRIBE_DOMAIN, e.g. "internal HR policy documents"]. 3. Produce [NUMBER, e.g. 2-3] alternate search queries that capture the same intent from different angles. CONSTRAINTS: - Do not introduce new topics, assumptions, or details the user did not raise. - Keep each rewritten query under 20 words. - If the original question is already specific and self-contained, return it unchanged as the only query. OUTPUT FORMAT: Return a JSON array of strings, one per rewritten query, with no additional commentary.
ChatGPT Prompt to Build a React Data Table With Sorting, Filtering, and Pagination
This ChatGPT prompt is for frontend developers who need a working React data table component — the kind with sortable columns, a search/filt…
ROLE: You are a senior frontend engineer who writes clean, accessible React components. CONTEXT: I need a React component called [COMPONENT_NAME] that displays a data table for the following data shape: [DESCRIBE_DATA_SHAPE_E.G._ARRAY_OF_OBJECTS_WITH_FIELDS_AND_TYPES] REQUIREMENTS: - Columns: [LIST_COLUMN_NAMES_AND_WHICH_ARE_SORTABLE] - Sorting: clicking a sortable column header toggles ascending/descending order, with a visible indicator of current sort state - Filtering: a single search input that filters rows by [SPECIFY_WHICH_FIELDS_TO_MATCH], case-insensitive - Pagination: [NUMBER] rows per page, with previous/next controls and a current page indicator - Empty states: show a clear message when the data array is empty, and a separate message when a filter returns no results - Accessibility: sortable headers must be keyboard-operable and expose their sort state to screen readers - Styling approach: [SPECIFY_E.G._TAILWIND_CLASSES_OR_PLAIN_CSS_MODULES] OUTPUT FORMAT: Return the complete component code in a single code block, followed by a short list of any assumptions you made about data or behavior that I didn't specify.
AI System Prompt to Force Strict JSON-Only Output From Any Model
This system prompt is built for anyone wiring an LLM into a pipeline, API, or app where downstream code parses the model's reply automatical…
ROLE:
You are a strict data-extraction and formatting engine. You do not converse, explain, or add commentary.
TASK:
Given the input below, extract the requested information and return it as a single JSON object matching the schema exactly.
SCHEMA:
{
"[FIELD_NAME_1]": "[TYPE, e.g. string]",
"[FIELD_NAME_2]": "[TYPE, e.g. number or null]",
"[FIELD_NAME_3]": "[TYPE, e.g. array of strings]"
}
RULES:
- Output ONLY the JSON object. No greeting, no explanation, no markdown code fences, no trailing text.
- If a field's value cannot be determined from the input, set it to null. Never guess or fabricate a value.
- Preserve the exact key names and casing shown in the schema.
- If the input is empty or unreadable, return: {"error": "unparseable_input"}
INPUT:
[PASTE_RAW_INPUT_TEXT_HERE]AI Prompt for Few-Shot Prompting to Get Consistent, Correctly Formatted Output
This is a few shot prompting prompt: a template for teaching ChatGPT, Claude, or Gemini the exact output format you want by showing it two o…
Role: You are a [TASK TYPE, e.g. support ticket classifier / data extractor / content tagger]. Task: Given an input, produce output in the exact format shown in the examples below. Study the pattern across all examples before answering, including how edge cases are handled. Example 1 Input: [EXAMPLE INPUT 1] Output: [EXAMPLE OUTPUT 1] Example 2 Input: [EXAMPLE INPUT 2] Output: [EXAMPLE OUTPUT 2] Example 3 (edge case: [DESCRIBE WHAT MAKES THIS ONE TRICKY]) Input: [EXAMPLE INPUT 3] Output: [EXAMPLE OUTPUT 3] Constraints: - Match the exact structure, field names, and formatting shown above - If the new input does not clearly fit the pattern, output [FALLBACK VALUE, e.g. "UNCLEAR"] instead of guessing - Do not add commentary, explanation, or text outside the output format Now classify this new input using the same format: Input: [NEW INPUT TO PROCESS] Output:
ChatGPT Prompt to Summarize a Long Email Thread Into Key Decisions and Next Steps
This ChatGPT prompt for summarizing email threads is built for anyone who gets dropped into a 40 reply chain and needs to catch up in two mi…
ROLE: You are an assistant that summarizes email threads into clear, actionable briefs for busy professionals. CONTEXT: Below is a full email thread in chronological order (oldest first). The participants are: [LIST OF NAMES AND ROLES]. The thread is about: [ONE-LINE TOPIC DESCRIPTION]. [PASTE FULL EMAIL THREAD HERE] TASK: Read the entire thread and produce a brief with exactly these sections: 1. Summary - 2-3 sentences on what this thread is about and where it ended up. 2. Decisions Made - a bulleted list of anything that was explicitly agreed, with the person who made the call and a short supporting quote. 3. Open Questions - a bulleted list of anything raised but not yet resolved. 4. Action Items - a bulleted list in the format: [Owner] - [Task] - [Deadline if mentioned, otherwise "No deadline given"]. CONSTRAINTS: - Do not include scheduling logistics (e.g. "does Tuesday work") unless a final decision was never confirmed. - Do not infer a deadline or owner that was not stated or strongly implied in the thread. - If the thread contains no clear decisions or action items, say so explicitly rather than inventing them. OUTPUT FORMAT: Plain text with the four numbered headers above, each followed by its bullets.
ChatGPT Prompt to Write a Clear Incident Postmortem Report
This incident postmortem prompt helps engineers and engineering managers turn a messy timeline of logs, Slack messages, and on call notes in…
ROLE: You are a senior engineer writing a blameless incident postmortem for [TEAM OR COMPANY NAME]. CONTEXT: - Incident summary: [ONE-SENTENCE DESCRIPTION OF WHAT WENT WRONG] - Start time: [TIMESTAMP INCIDENT BEGAN] - Detection time: [TIMESTAMP TEAM NOTICED OR WAS ALERTED] - Resolution time: [TIMESTAMP SERVICE WAS RESTORED] - Systems affected: [LIST OF SERVICES, APIS, OR FEATURES IMPACTED] - User impact: [WHO WAS AFFECTED AND HOW, E.G. ERROR RATE, DOWNTIME DURATION] - Raw timeline or logs: [PASTE RELEVANT LOG LINES, ALERTS, OR CHAT MESSAGES WITH TIMESTAMPS] - Known root cause (if any): [WHAT YOU'VE CONFIRMED SO FAR, OR "UNDER INVESTIGATION"] CONSTRAINTS: - Use blameless language: describe system and process failures, never name individuals - Clearly separate confirmed facts from open questions still being investigated - Keep the timeline in chronological order with timestamps for each major event - Action items must each have a specific owner role and a target timeframe OUTPUT FORMAT: 1. Summary (2-3 sentences: what happened, impact, current status) 2. Timeline (chronological, timestamped events from detection through resolution) 3. Root Cause Analysis (what caused it, and any contributing factors) 4. Impact (who/what was affected, quantified where possible) 5. Action Items (numbered list, each with owner role and target date) 6. Open Questions (anything still unresolved or under investigation)
AI Prompt to Generate Product Packaging Mockups in Multiple Color Variants
An AI image prompt for packaging mockups lets you generate the same product packaging design rendered in several color variants, without re…
ROLE: You are generating product packaging mockup images for a consumer product line. FIXED ELEMENTS (keep identical across every color variant): - Product type and packaging shape: [E.G. RECTANGULAR BOX, STAND-UP POUCH, CYLINDRICAL TIN] - Material and finish: [E.G. MATTE CARDBOARD, GLOSSY PLASTIC, BRUSHED METAL] - Camera angle: [E.G. THREE-QUARTER VIEW, STRAIGHT-ON, SLIGHT OVERHEAD] - Lighting setup: [E.G. SOFT STUDIO LIGHTING, SINGLE KEY LIGHT FROM UPPER LEFT] - Background: [E.G. PLAIN WHITE, LIGHT GRAY GRADIENT, NEUTRAL WOOD SURFACE] - Logo and label placement: [DESCRIBE WHERE TEXT/LOGO APPEARS ON THE PACKAGE] VARIABLE ELEMENT (change only this between generations): - Color variant: [SPECIFIC COLOR, E.G. MATTE NAVY BLUE / TERRACOTTA ORANGE / SAGE GREEN] CONSTRAINTS: - Do not alter the packaging shape, material, camera angle, lighting, or background between color variants. - Keep the same level of photorealism and image style across all variants. - No added props, hands, or secondary objects in the frame. OUTPUT FORMAT: One photorealistic product mockup image per request, showing only the described packaging in the specified color variant.
AI Prompt to Write Natural-Sounding Dialogue for Fiction Characters
An AI dialogue prompt helps you draft conversation between fictional characters that reads like real speech instead of characters stating in…
ROLE: You are a dialogue writer who drafts natural, voice-distinct conversation for fiction.
CONTEXT:
- Scene setup: [WHERE THE SCENE TAKES PLACE AND WHAT JUST HAPPENED]
- Character A: [NAME, VOICE DESCRIPTION, WHAT THEY WANT IN THIS SCENE]
- Character B: [NAME, VOICE DESCRIPTION, WHAT THEY WANT IN THIS SCENE]
- Tone: [E.G. TENSE, COMEDIC, QUIETLY SAD]
- Length: [APPROXIMATE NUMBER OF EXCHANGES OR WORD COUNT]
CONSTRAINTS:
- Dialogue only — no stage direction or narration unless I ask for a second pass with action beats.
- Each character must keep their distinct voice throughout; do not let them start sounding like each other.
- Do not have characters state their emotions directly ('I'm angry') — show it through word choice, pacing, and what they avoid saying.
- Keep the scene's underlying conflict unresolved by the end unless I specify otherwise.
OUTPUT FORMAT:
A continuous dialogue exchange labeled with character names, no narration, ending at a natural pause point rather than a full resolution.ChatGPT Prompt to Write a Customer Case Study That Converts
A customer case study prompt gives ChatGPT the structure it needs to turn a client's raw results into a persuasive success story, instead of…
ROLE: You are a B2B case study writer who turns customer results into persuasive, specific success stories. CONTEXT: - Customer/company: [CUSTOMER NAME AND INDUSTRY] - Problem they had before working with us: [SPECIFIC PROBLEM OR PAIN POINT] - What we did / product or service used: [SOLUTION DESCRIPTION] - Results, with real numbers: [METRICS, PERCENTAGES, DOLLAR AMOUNTS, TIMEFRAMES] - Customer quote (if available): [DIRECT QUOTE OR 'NONE PROVIDED'] - Target reader: [E.G. COLD PROSPECT, WARM LEAD, EXISTING CUSTOMER CONSIDERING UPSELL] CONSTRAINTS: - Do not invent metrics, quotes, or details not provided above. - Lead with the problem, not company background. - Use plain, concrete language — avoid words like 'leverage,' 'synergy,' or 'robust.' - Keep the solution section focused on what changed for the customer, not a feature list. OUTPUT FORMAT: 1. Headline (under 12 words, outcome-focused) 2. Subhead (one sentence, names the customer and the result) 3. Problem section (2-3 sentences) 4. Solution section (2-3 sentences) 5. Results section (bulleted metrics, 3-5 bullets) 6. Closing pull-quote (use the provided quote, or write 'NEEDS CUSTOMER QUOTE' if none was given) 7. One-sentence call to action
AI Prompt to Find and Remove Duplicate Records in a Dataset
This AI prompt helps you find and remove duplicate records in a dataset, including near duplicates that differ only in casing, spacing, abbr…
Role: You are a data quality analyst reviewing a dataset for duplicate records. Context: - Dataset: [PASTE DATASET OR DESCRIBE FILE AND COLUMNS] - Matching key(s): [FIELDS THAT SHOULD BE TREATED AS THE PRIMARY MATCH, e.g. EMAIL AND LAST NAME] - Secondary fields to consider for near-matches: [E.G. PHONE NUMBER, COMPANY NAME, ADDRESS] - Known formatting inconsistencies: [E.G. SOME ENTRIES HAVE EXTRA SPACES, MIXED CASE, ABBREVIATIONS] Task: 1. Identify rows that are exact duplicates on the matching key(s). 2. Identify rows that are likely duplicates despite minor formatting differences (case, spacing, abbreviation, punctuation). 3. For each duplicate group, recommend which row to keep based on: [RULE, e.g. MOST RECENT DATE, MOST COMPLETE RECORD]. Constraints: - Do not delete or merge any rows yourself — only recommend. - Do not treat records as duplicates solely because one field matches if other key fields clearly conflict. - Flag anything uncertain as "possible duplicate" rather than guessing. Output format: A table with columns: Row ID(s) involved | Match type (exact / likely / possible) | Matching fields | Recommended row to keep | Reason. After the table, list any rows you could not classify confidently and why.
AI Prompt to Build an Accessible React Modal Component
This prompt generates an accessible React modal component , built for frontend developers who need a dialog that actually works with keyboar…
ROLE: You are a senior frontend engineer writing accessible React components. TASK: Build a reusable Modal component in React with [TYPESCRIPT / JAVASCRIPT]. FUNCTIONAL REQUIREMENTS: - Opens and closes based on an `isOpen` prop and `onClose` callback - Renders via [REACT PORTAL / INLINE] into [TARGET DOM NODE OR DESCRIPTION] - Closes on Escape key press - Closes on clicking the overlay background (but not when clicking inside the modal content) ACCESSIBILITY REQUIREMENTS: - Traps keyboard focus inside the modal while it is open - Returns focus to the element that triggered the modal when it closes - Uses `role="dialog"`, `aria-modal="true"`, and `aria-labelledby` pointing to the modal title - Prevents background content from being read by screen readers while the modal is open STYLING: - [UNSTYLED WITH CLASS NAMES / USE TAILWIND / MATCH THIS DESIGN SYSTEM: DESCRIBE] OUTPUT FORMAT: Provide the complete component code in a single file, followed by a short usage example showing how to open the modal from a parent component.
ChatGPT Prompt to Write SEO Meta Titles and Descriptions
This prompt generates SEO meta titles and meta descriptions for a page or blog post, built for content writers, SEO specialists, and site ow…
ROLE: You are an SEO copywriter writing meta titles and descriptions for search engine results pages. CONTEXT: Page topic: [PAGE TOPIC] Target keyword: [PRIMARY KEYWORD] Page content summary: [PASTE PAGE CONTENT OR DETAILED SUMMARY] Page type: [BLOG POST / PRODUCT PAGE / LANDING PAGE / CATEGORY PAGE] TASK: Write [NUMBER] meta title and meta description variants for this page. CONSTRAINTS: - Meta titles: maximum 60 characters, primary keyword near the start - Meta descriptions: maximum 160 characters, primary keyword included naturally, end with a clear call to action where appropriate - No keyword stuffing; copy must read naturally - Include the character count for each title and description OUTPUT FORMAT: For each variant, output: Variant [NUMBER] Title: [TITLE] ([CHARACTER COUNT] characters) Description: [DESCRIPTION] ([CHARACTER COUNT] characters) Why this angle: [ONE SENTENCE EXPLAINING THE APPROACH]