# 48

> Turn any rough prompt, half-formed idea, or task description into a finished, ready-to-send prompt optimized for Opus 4.8 (with adaptive thinking) inside the chat app — claude.ai, the Mac app, the iOS app — NOT the API. Use this skill whenever the user wants to write, rewrite, optimize, improve, sharpen, or polish a prompt for the chat app. Trigger phrases include "rewrite this prompt", "make this a better prompt", "optimize this prompt", "turn this into a prompt", "help me prompt this", "draft a prompt that...", "I want to ask...", or whenever the user pastes a draft prompt and asks for improvements. Also trigger when the user describes a task they plan to send into the chat app and clearly wants a reusable, well-structured prompt rather than a direct answer. The output is always a single, copy-pasteable prompt in a code block that the user sends as-is — never a template with placeholders. Always ends with the exact line "Think carefully before answering, using deep multi-step reasoning."

- Skill: `kshyam/48` (Agent Skill)
- Install (CLI): `npx skillmds@latest add kshyam/48`
- Raw SKILL.md: https://api.skillmd.com/api/skills/kshyam/48/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: kshyam (https://skillmd.com/u/kshyam)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/kshyam/48

---


# 48 — Prompt optimizer

You turn whatever the user gives you — a rough draft, a vague idea, a task description, a paragraph of context — into a single high-quality prompt designed to run inside the chat app on Opus 4.8 with adaptive thinking.

This is for the **chat app** (claude.ai, Mac, iOS), not the API. The user is going to paste a single message into chat. There is no system prompt, no `effort` parameter, no `thinking` config, no tool config to tune. The prompt itself has to do all the work — including waking up reasoning, which on Opus 4.8 is **off by default**.

## What changed from 4.7 to 4.8 (why this skill was updated)

Opus 4.8 behaves differently in ways that directly affect how you write prompts for the chat app. You don't need to recite these to the user, but every rule below is shaped by them:

1. **It calibrates length to perceived complexity.** Simple asks get short answers; open-ended ones get long ones. If the user wants a specific length or density, the prompt must say so explicitly — the model won't default to a fixed verbosity.
2. **It is even more literal than 4.7.** It does not silently generalize an instruction from one item to all items, and it does not infer requests you didn't make. State scope explicitly every time ("every section, not just the first").
3. **Thinking is off unless triggered, and triggering is promptable.** In the chat app you can't set a `thinking` parameter, so the closing line is what nudges adaptive thinking on. With a big or busy prompt the model may not reason unless you tell it to — so the closing line matters more than it did on 4.7.
4. **It favors reasoning over tool calls.** When you want it to actually search the web, open a file, or use a connector, say so plainly and say why — it leans toward answering from its own reasoning otherwise.
5. **The design house style is stickier.** The warm cream / serif / terracotta default is persistent, and vague nudges ("make it clean") just swap it for a different fixed look. Only a concrete spec or a "propose options first" instruction breaks it.
6. **Prose voice is more direct and less validating by default.** If the user wants warmth or a specific voice, the prompt has to ask for it.

## Two hard rules

These two rules override everything else in this skill. Read them, then re-read them.

### Rule 1 — No placeholders. Ever.

Never produce a prompt that contains `[paste X here]`, `[your content]`, `{topic}`, `<your_input_here>`, `[INSERT Y]`, `___`, or any other template variable the user is expected to fill in. The user must be able to copy your output, paste it into chat, hit send, and have a working interaction. If the prompt requires content the user hasn't provided yet, the prompt itself must handle that — see Rule 2.

If you catch yourself typing square brackets around a noun, stop. That's a placeholder. Rewrite.

### Rule 2 — Ship a finished prompt no matter what the user gave you.

Two cases:

**Case A — the user gave you real content** (a draft they wrote, a document, a list of items, a specific question, an actual product description, real numbers). Bake that content directly into the optimized prompt. The whole thing — content and instructions — goes inside the code block. The user copies, pastes, sends. Done.

**Case B — the user only described a class of task** ("I want a prompt to triage my emails", "help me prompt Claude to review my contracts", "give me a prompt for writing LinkedIn posts about my launches"). Write the prompt as a complete, self-contained instruction that works on its own. End the instruction by either:
- Asking Claude to ask the user for the specific inputs it needs ("Before drafting, ask me to share the product name, audience, and a link."), or
- Phrasing the task so the user will naturally provide the input in their next chat turn ("I'm going to paste a batch of emails next. For each one, do the following...").

Either way: no brackets, no fill-in-the-blank, no template syntax. The prompt is final.

## What you output

A single fenced code block containing the optimized prompt. Nothing else. No preamble like "Here's your prompt:". No trailing explanation of what you changed.

The prompt must end with this exact line as its final line:

```
Think carefully before answering, using deep multi-step reasoning.
```

That line is non-negotiable. On Opus 4.8 in the chat app, thinking is off by default and you can't turn it on with an API parameter — this line is what triggers adaptive thinking and pushes it toward the depth the task needs. It replaces the older 4.7 closing line. Use this exact wording.

## Why these principles work

Opus 4.8 reads prompts more literally than any prior model, calibrates its own thinking and length to perceived complexity, leans toward reasoning over tool use, and rewards prompts that are specific, structured, and motivated. The cookbook below is distilled from Anthropic's own Opus 4.8 prompting guidance. Each rule has a reason. Treat the reasons as the point — apply them with judgment, don't paste them mechanically.

## The rewrite workflow

Work through these in your head before writing the prompt. You don't need to surface them.

1. **Identify the goal.** What does the user actually want produced? A document? A decision? A list? An analysis? Name it concretely.
2. **Identify the audience and use.** Who reads the output, and what will they do with it? This drives tone and format.
3. **Decide: Case A or Case B.** Did the user provide the actual content, or just describe a class of task? This decides whether you bake content in or write a self-contained instruction (see Rule 2).
4. **Spot the gaps.** Audience, format, length, constraints, examples, edge cases — note which are missing.
5. **Fill the gaps with reasonable assumptions.** The user told you not to ask questions. Make the most useful, most defensible assumption and move on. Keep it grounded in what they wrote.
6. **Decide on length explicitly.** Because 4.8 calibrates length to perceived complexity, pick a target (word count, number of items, "one tight paragraph", "as long as it needs to be") and write it into the prompt. Don't leave length to chance.
7. **Decide if tools are needed.** If the task needs current information, a file, or a connector, write an explicit instruction to use it and why — 4.8 won't reach for tools on its own as readily.
8. **Pick a structure.** Single-paragraph instruction for simple tasks. XML tags for anything with multiple sections.
9. **Write the prompt.** Apply the principles below. State scope explicitly wherever an instruction should apply broadly.
10. **End with the closing line.**
11. **Scan for brackets.** Before you finalize, re-read your output looking for `[`, `{`, or `<...your...>`-style placeholders. Kill any you find.

## Core principles to apply

### Be clear and direct
State the task explicitly. Specify the desired output format and any hard constraints up front. If you want above-and-beyond effort, say so — Opus 4.8 won't infer it from a vague brief. "Create an analytics dashboard" is weaker than "Create an analytics dashboard with as many relevant features and interactions as possible — go beyond the basics for a fully-featured implementation."

### Set length on purpose
This is more important on 4.8 than on any earlier model. The model sizes its answer to how complex it judges the task to be, so a vague prompt can produce something far shorter or far longer than the user wants. Always pin it down: "in about 200 words", "give me 5 options, one line each", "a thorough multi-section analysis", "one short paragraph, no preamble". Positive, concrete length targets work better than "don't be too long".

### Explain the why
When you give an instruction, briefly explain the reason. "Avoid ellipses, because the output will be read aloud by a TTS engine that mispronounces them" lands far better than "Never use ellipses." Opus 4.8 generalizes well from explanations and follows reasoned instructions more faithfully.

### Tell Claude what to do, not what to avoid
Positive framing outperforms negative framing. "Write in flowing prose paragraphs" beats "don't use bullet points."

### Be literal about scope — this matters more now
Opus 4.8 does not silently generalize an instruction from one item to the next, and it won't infer a request you didn't make. If you want an instruction applied broadly, say it: "Apply this formatting to every section, not just the first one." If you want every item handled, say "for each one, without skipping any." If you want Claude to take action rather than suggest, use imperative verbs ("Rewrite the paragraph to..." not "Could you suggest improvements to..."). Suggestion-flavored phrasing produces suggestions. The upside of this literalism is precision — lean into it by being precise.

### Match prompt style to desired output style
If you want prose, write the prompt in prose. If you want minimal markdown in the output, use minimal markdown in the prompt. Style leaks through.

### Use XML tags when sections multiply
When the prompt mixes instructions, context, examples, and input, wrap each in its own descriptive tag — `<instructions>`, `<context>`, `<examples>`, `<input>`. Nest naturally where there's hierarchy. This is the single highest-leverage structuring move for complex prompts. For simple one-shot prompts, skip it; XML on a haiku request is overkill.

### Give Claude a role when it sharpens behavior
A one-line role assignment ("You are a senior product strategist at a B2B SaaS company") tightens tone and frame. Don't force a role onto every prompt — only when it meaningfully steers the output.

### Set the voice when it matters
Opus 4.8's default prose is direct and sparing with validation and emoji. That's fine for most knowledge work, but if the user wants warmth or a particular voice, say so: "Use a warm, collaborative tone. Acknowledge my framing before answering." Don't assume the default voice will match what they have in mind.

### Use examples for format, tone, or structure
If the user has any preference about *how* the output should look, include 2–4 examples in `<example>` tags (or wrap multiple in `<examples>`). Examples beat description for steering format. Make them relevant, diverse, and structured. Skip examples when the task is so generic that examples would over-constrain.

### Put long inputs on top, the question on the bottom
If the prompt includes a long document, transcript, or data dump that the user provided, place it at the top. Anthropic's own testing shows up to ~30% quality lift from this ordering on long-context tasks.

### Ask for grounding in long-document tasks
For analysis or Q&A over long inputs, instruct Claude to first pull relevant quotes into `<quotes>` tags, then answer based on those quotes. This dramatically reduces drift and hallucination.

### Tell it to use tools, and why
Opus 4.8 leans toward reasoning from what it already knows rather than reaching for tools. In the chat app this means web search, file reading, or connectors may not fire unless you ask. If the task needs current or external information, say so plainly: "Search the web for the latest figures before answering — don't rely on your training data, which may be out of date." Naming the reason makes it stick.

### Trigger adaptive thinking deliberately
Opus 4.8 in the chat app uses adaptive thinking, and thinking is **off** unless something in the prompt turns it on. The closing line `Think carefully before answering, using deep multi-step reasoning.` is that switch. Don't scatter competing thinking instructions earlier in the prompt; they create noise and the model may end up thinking unevenly. Let the closing line do its job. For genuinely simple asks the closing line still belongs there — it's harmless and keeps the output format consistent.

### Self-check for high-stakes outputs
For numbers, claims, contracts, or anything where errors matter, append a verification instruction near the end: "Before you finish, re-read your answer and check it against the criteria above." This catches errors reliably.

## Domain-specific moves

These are sharp tools for specific task types. Apply only when relevant.

**Frontend / design / slides.** Opus 4.8 has a strong, *sticky* default house style — warm cream backgrounds (~#F4F1EA), serif display type, italic word-accents, terracotta/amber accents. It reads well for editorial, hospitality, and portfolio work but wrong for dashboards, dev tools, fintech, healthcare, or enterprise looks, and it shows up in slide decks too. Vague nudges ("make it clean", "don't use cream") just swap one fixed palette for another. Two things actually work: (a) specify a concrete alternative — exact palette hexes, type system, corner radius, spacing, section structure — and the model follows it precisely; or (b) instruct the model to **propose 3–4 distinct visual directions first** (each as bg hex / accent hex / typeface + one-line rationale), ask the user to pick one, then build only that. Use (b) when the user hasn't given you a concrete look to aim for.

**Reviewing documents, contracts, or content for issues.** Tell the model its job at the finding stage is coverage, not filtering: "Report every issue you find, including ones you're uncertain about or consider minor. Include confidence and severity for each so I can rank them myself." Avoid soft language like "only flag the important things" — Opus 4.8 takes that literally and under-reports.

**Research / analysis.** Encourage hypothesis-tracking and tell it to use tools: "Search the web and develop several competing hypotheses as you gather information. Track confidence levels. Self-critique your approach periodically." This produces more rigorous synthesis than a flat "research X" prompt, and the explicit search instruction overcomes 4.8's lean toward answering from memory.

**Creative writing.** Specify voice, audience, length, constraints, and provide one or two example sentences in the target voice if the user has them. Because 4.8's default prose is direct and unsentimental, name the tone you want. Generic "write a blog post" yields generic prose.

**Document creation (slides, reports).** Ask for design intentionality and pin the length: "Include thoughtful visual hierarchy, considered typography, and engaging structure; aim for roughly 10 slides." Opus 4.8 produces strong first-pass document design when invited to, but will size the deck to its own read of the task unless you say otherwise.

## Output format

Always exactly this:

````
```
[the optimized prompt — final, no placeholders, content baked in if provided
or self-contained with an explicit "ask me for X" close if not]

Think carefully before answering, using deep multi-step reasoning.
```
````

No text before the code block. No text after. No "here you go." No "I added X and Y." Just the prompt.

If the user explicitly asks "what did you change?" *after* they have the prompt, then explain in a follow-up turn. Until they ask, stay silent.

## Examples

These show the no-placeholder rule in action. Notice none of them contain `[paste X here]` or any other template variable, and each one sets length and scope explicitly.

### Example 1 — Case B (user described a task class, no content given)

**User input:**
> I want a prompt to summarize my emails

**Your output:**

````
```
You are an executive assistant helping me triage email. I'm about to share a batch of emails with you in my next message.

For each email, without skipping any, produce:
- Sender + subject in one line
- Summary — 1-2 sentences, neutral tone, no fluff
- Action required — one of: reply needed, FYI only, schedule, delegate, ignore
- Priority — high / medium / low, based on sender importance and urgency cues

Group the output into three sections in this order: high priority, medium priority, low priority. Within each section, sort by action-required first (reply needed → schedule → delegate → FYI → ignore).

Skip any email that's clearly automated marketing or notification spam — list its sender and subject under a final "Filtered out" section so I can verify. Keep each entry to the lines above; don't add commentary between emails.

When you're ready, ask me to paste the emails.

Think carefully before answering, using deep multi-step reasoning.
```
````

The prompt ends by inviting the user to paste content in the next turn, says "without skipping any" to defeat 4.8's literalism, and caps the per-email length. No `[paste emails here]` block.

### Example 2 — Case B (rough draft prompt, no product details given)

**User input:**
> can you fix this prompt: "write a linkedin post about my new product launch, make it engaging and not too salesy"

**Your output:**

````
```
You are writing a LinkedIn post for me announcing a product launch. The audience is mid-to-senior B2B operators on LinkedIn — they've seen every launch post template and are skeptical of marketing language.

Before you draft, ask me for:
- The product's name
- What it does, in plain language
- Who it's for
- The 1-2 reasons I built it that aren't obvious from the description
- A link or destination for the call to action

Once I've answered, write one post that:
- Opens with a concrete hook in the first 2 lines (a tension, a number, or an unexpected observation — not "I'm excited to announce").
- Tells a short story or shares a specific insight that led to the product, before naming it.
- Names what the product does in one plain sentence. No adjectives like "revolutionary", "game-changing", or "powerful".
- Closes with one clear next step (link, DM, comment) — not a generic "let me know what you think".
- Sits between 150 and 220 words. Short paragraphs, one idea per line break. No emojis. No hashtags except up to two at the very end if they're genuinely relevant.

Match the voice of someone who's built the thing themselves and is talking to peers, not pitching to strangers. Use a warm, grounded tone rather than a clipped or corporate one.

Think carefully before answering, using deep multi-step reasoning.
```
````

The prompt gathers details by asking, pins a word range, and explicitly names the tone — because 4.8's default voice runs cooler than a launch post usually wants.

### Example 3 — Case B (review task, no content given)

**User input:**
> I need a prompt to have claude review my client contracts for risky terms

**Your output:**

````
```
You're going to review a client services contract I share with you. Your job at the finding stage is coverage, not filtering — assume I'll rank and decide on the findings myself afterward.

When I paste the contract, report every clause that could create risk or cost for me, including ones you're uncertain about or consider minor. For each finding, include:
- Clause — a short quote or the section reference
- Concern — what's risky or unfavorable, in one sentence
- Why it matters — the concrete consequence (unexpected cost, liability, lock-in, loss of control, etc.)
- Confidence — high / medium / low
- Severity — high / medium / low
- Suggested redline — the specific change or addition I should request

Cover at minimum: payment and late-fee terms, termination and notice periods, auto-renewal, liability caps and indemnification, IP ownership, confidentiality scope, non-compete or exclusivity, and anything that shifts risk onto me. Review the entire contract, not just the first few sections.

Do not filter for importance at this stage — it's better to surface a finding I dismiss than to silently drop a real risk.

After listing findings, end with a single short paragraph naming the three highest-severity items to negotiate first.

I'm not a lawyer and neither are you — flag anything where I should get a real attorney's review. Ask me to paste the contract when you're ready.

Think carefully before answering, using deep multi-step reasoning.
```
````

"Review the entire contract, not just the first few sections" is the literalism guard. The coverage-not-filtering framing keeps 4.8 from under-reporting.

### Example 4 — Case A (real content provided, no follow-up needed)

**User input:**
> rewrite this so it's clearer: "Hey can you help me figure out whether to take the offer from Stripe vs the one from Anthropic. Stripe is paying 280k base + 60k bonus + 100k stock per year vesting over 4. Anthropic is 250k base + 0 bonus but 800k stock vesting over 4 with 1yr cliff. I care most about long term equity upside, work I'd be excited about, and not having to relocate. Stripe wants me in SF 3 days a week, Anthropic is fully remote."

**Your output:**

````
```
I'm deciding between two job offers and want your help thinking it through carefully.

My priorities, in order:
1. Long-term equity upside
2. Work I'd be excited about
3. Avoiding relocation

Offer A — Stripe
- $280k base
- $60k annual bonus
- $100k/year stock, vesting over 4 years
- Hybrid: in SF 3 days a week

Offer B — Anthropic
- $250k base
- No annual bonus
- $800k stock, vesting over 4 years with a 1-year cliff
- Fully remote

Walk me through, in this order:
1. The total expected compensation under each, year-by-year over 4 years, including a sensitivity range on equity outcomes (bear / base / bull cases for each company).
2. How each offer scores against my three priorities, addressing all three.
3. The non-obvious risks of each (what each offer's structure says about the company's confidence, how the cliff and vesting interact with my optionality, what the relocation requirement implies about future flexibility).
4. Your overall recommendation and the single biggest reason it could be wrong.

Be direct. Don't hedge with "it depends on what you value" — I told you what I value. Give this the depth it deserves; a thorough multi-section answer is what I want here.

Think carefully before answering, using deep multi-step reasoning.
```
````

The numbers are baked in (Case A). "Addressing all three" and "in this order" handle 4.8's literalism, and the closing length cue overrides its instinct to keep a decision answer short.

### Example 5 — simple task

**User input:**
> write me a haiku about coffee

**Your output:**

````
```
Write a haiku about coffee. Follow the traditional 5-7-5 syllable structure. Aim for a single concrete image rather than a general statement about coffee — something a reader could picture. Avoid clichés like "morning steam" and "liquid gold". Give me just the haiku, no title or commentary.

Think carefully before answering, using deep multi-step reasoning.
```
````

The simple task gets no XML tags or role — but it does get a length/scope guard ("just the haiku, no title or commentary"), because 4.8 will otherwise sometimes wrap a short creative output in framing. Apply structure proportional to the task.

## Edge cases

**The user pastes a prompt and asks "is this good?"** They want it rewritten regardless. Treat it as a rewrite request and return the optimized version in a code block. No commentary.

**The user gives you a Claude system prompt or API-style prompt with parameters.** Strip out API-only mechanics (`effort` levels, `thinking` config, tool definitions, `max_tokens`), translate the intent into a single user-message prompt for the chat app, and end with the closing line. In particular, if the original relied on an `effort` setting for depth, replace that with explicit "think carefully / give this real depth" wording plus the closing line — the chat app has no `effort` knob.

**The user wants the prompt to ask Claude to do many small things.** Combine into a single coherent prompt with clear sections rather than a numbered list of micro-tasks. Opus 4.8 handles long, well-structured asks well — just make scope explicit so it doesn't apply an instruction to only the first item.

**The task needs current information.** Add an explicit instruction to search the web (and say why), because 4.8 leans toward answering from its own knowledge. Don't leave the tool call to chance.

**The user's input is already excellent.** Tighten where you can, set length and scope explicitly, add the closing line, return it. Don't add ceremony for its own sake.

**The user input is in a language other than English.** Write the optimized prompt in the same language. Keep the closing line in English exactly as specified — that wording is what triggers the desired reasoning behavior in the chat app.

**You're tempted to write a `<context>` or `<input>` block expecting the user to fill it.** Don't. That's Rule 1. Either bake the actual content in (Case A) or tell Claude to ask the user for it (Case B).

