Prompt templates

Starting points for common LLM tasks. Each template states the output format and constraints it expects; adapt it to your data and test it on your own examples before relying on it.

Intent Classification with Confidence

Routes a user message to one of N categories with a confidence score. Returns "unclear" rather than guessing when uncertain. classification

Classify the user message into exactly one category from this list:
{{categories}}

Return JSON:
{
  "category": one of the listed categories OR "unclear",
  "confidence": 0.0-1.0,
  "reasoning": one sentence
}

Use "unclear" if confidence would be below 0.6. Do not invent categories not in the list.

User message: {{message}}

Code Review — Specific, Severity-Graded

Reviews code with concrete fixes per finding, grouped by severity. Avoids generic "consider adding tests" suggestions. coding

You are a senior code reviewer.

For the code below, identify issues in these categories, in this priority order:

1. Correctness — bugs, race conditions, off-by-one errors, null/undefined handling
2. Security — injection, auth bypass, secret leakage, unsafe deserialization, XSS
3. Performance — N+1 queries, O(n²) loops, missing indexes, blocking I/O
4. Maintainability — unclear naming, missing types, tight coupling

For each finding:
- Cite the specific line or function
- Explain the concrete impact (not "this could be a problem")
- Provide a specific code fix, not a general principle

Group findings by severity: blocking, major, minor.

Skip nit-picks a formatter would catch. If the code is genuinely good, say so plainly without padding the review.

Code to review:
{{code}}

Debug a Production Error

Walks through a stack trace systematically: what failed, why, and the smallest change to fix it without introducing risk. coding

I'm seeing this error in production:

{{error_or_stack_trace}}

Walk me through:

1. What is actually failing — the immediate cause, not just the symptom.
2. Why it's happening — the root cause, with the specific code path or condition that triggers it.
3. The smallest change that fixes it without introducing other risks. Show the actual code change, not just a description.
4. What I should add to make this kind of error easier to debug next time (logging, assertions, types).
5. Whether this is a one-time fix or a class of bugs likely to surface elsewhere.

If you need information you don't have (relevant source code, the input that triggered it, framework version), say what you need before guessing.

Explain a SQL Query

Translates a complex SQL query into plain English step by step. Notes performance characteristics and missing indexes. coding

Explain this SQL query in plain English. Structure your response as:

1. **What it does** — one sentence of intent.
2. **How it works, step by step** — broken into the operations (filter, join, aggregate, sort, limit) in execution order, not query order.
3. **Performance notes** — full table scans likely, missing indexes worth adding, expensive joins. Be specific about which clauses are likely slow.
4. **Edge cases** — what the query does for NULL values, duplicates, empty tables.

Query:
{{query}}

Optional context: schema / table sizes / current indexes:
{{schema}}

Write Unit Tests — Cover Edge Cases

Generates unit tests in {{framework}} that cover the happy path, edge cases, and error conditions. Tests are runnable, not pseudocode. coding

Write unit tests for this function using {{test_framework}} (e.g., Jest, Vitest, pytest).

Cover these cases explicitly:

1. Happy path: typical valid input, expected output.
2. Edge cases: empty input, single element, very large input, boundary values.
3. Error cases: invalid input, null/undefined, wrong types — what the function should do (throw, return null, etc.).
4. Off-by-one risks: anything involving array indices, ranges, dates.

Each test must be runnable as-is. No "// TODO" placeholders. No mocking the function under test. Mock only external dependencies (network, time, randomness).

Code to test:
{{code}}

Structured Data Extraction to JSON

Extracts specific fields from unstructured text into a strict JSON schema. Reliable across providers when JSON mode is on. extraction

Extract the following fields from the text. Return JSON exactly matching this schema:

{
  "person_name": string | null,
  "company": string | null,
  "role": string | null,
  "email": string | null,
  "phone": string | null,
  "meeting_date_iso": string | null,
  "topics": [string]
}

Rules:
- Use null for any field not present in the text. Do not guess.
- ISO date format for meeting_date_iso (YYYY-MM-DD), null if no date or only relative ("next Tuesday").
- Topics: 1-5 short noun phrases (max 3 words each).
- Return only the JSON object, no preamble, no markdown fences.

Text:
{{text}}

RAG Answer — Citations Required

Answers a question from provided context with inline citations. Refuses when the context doesn't support an answer. rag

You are answering questions strictly from the provided context. Follow these rules:

1. Cite the source for every factual claim. Use [1], [2], etc. matching the numbered chunks below.
2. If the context does not contain enough information to answer, say "I don't have enough information to answer this from the provided sources" and stop. Do not guess.
3. Quote directly from the source when the claim is non-obvious; paraphrase when it is.
4. If two sources conflict, note the conflict and which source you trust more, with reasoning.
5. Do not introduce information from outside the context, even if you are confident it is true.

Context:
{{numbered_chunks}}

Question: {{question}}

Meeting Notes — Decisions and Action Items

Summarizes meeting transcript into decisions, action items (with owners), and unresolved questions. Skips small talk. writing

Summarize this meeting transcript into three sections:

## Decisions
Bullet list. Each decision in one sentence with the people who decided. Skip discussions that didn't reach a decision.

## Action items
Bullet list in the format: **[Owner]** — what they'll do — by when (if mentioned). One per line. Skip vague intent without a name attached.

## Open questions
Bullet list. Anything raised but not resolved, with who needs to follow up if mentioned.

Skip small talk, recaps of previous meetings, and discussion that didn't produce a decision or action.

Transcript:
{{transcript}}

Rewrite for Clarity, Keep Meaning

Rewrites a paragraph to be clearer and tighter without changing the underlying claims. Preserves voice. writing

Rewrite the following text to be clearer and tighter. Rules:

- Preserve every factual claim. Do not add new claims or remove existing ones.
- Preserve the voice and register (formal stays formal; casual stays casual).
- Cut filler: "in order to", "in conclusion", "it is important to note that", "needless to say".
- Replace passive voice with active where it doesn't change meaning.
- Replace jargon with plain language unless the jargon is precise and the audience is technical.
- If the text is already tight, return it unchanged and say so.

Return only the rewritten text. No commentary on what you changed unless I ask.

Text:
{{text}}

Technical Translation — Preserve Code and Terms

Translates technical content while preserving code blocks, API names, version numbers, and untranslatable terms. writing

Translate the following content from {{source_lang}} to {{target_lang}}.

Rules:
- Do not translate code blocks, command-line snippets, file paths, API names, function names, or version numbers.
- Preserve the original formatting (Markdown, headings, lists).
- Keep proper nouns (product names, company names) in their original form.
- For technical terms that have no common translation in {{target_lang}}, keep the English term and add the translation in parentheses on first occurrence.
- Match the original tone (formal documentation stays formal; casual blog stays casual).

Content:
{{content}}

Have a template worth sharing? Send it to us with the model you used and an example input.