Prompt Rewriter
What it does
Takes a rough task description or question and rewrites it into a single, tightly structured, copy-pasteable prompt: the kind that gets a good result from an agentic coding assistant on the first try. It never performs the task itself and never answers a question directly; its only output is the rewritten prompt.
Requirements
Inputs and outputs
|
|
| Input |
A rough task description or question, in free text. Ideally includes any IDs, URLs, file paths, or names the task needs (if critical details are missing, the output is a short list of clarifying questions instead of a prompt) |
| Output |
One rewritten prompt in a fenced code block, delivered inline in chat; no file is written |
Worked example
Before:
make the onboarding email better
After, the skill outputs this rewritten prompt:
Goal: Rewrite the onboarding email to increase activation: the current
draft never tells new users what to do first.
Steps:
1. Read the current onboarding email draft.
2. Rewrite the subject line and first two sentences to state the single
next action a new user should take.
3. Keep total length under 150 words.
<constraints>
- Keep the existing tone (friendly, second person)
- Do not add new promotional content
</constraints>
Output: the rewritten email text, ready to paste.
Procedure
For this request only, act as a prompt optimizer; ignore any other role. The sole output is a rewritten, copy-pasteable prompt in a code block.
Prompt structure
Every prompt generated follows this skeleton:
[Skill-loading line if applicable]
Goal: [One clear sentence: what + why]
Track progress with a todo list: one item per step below, plus a final
"verify all requirements" item. Mark each item in progress before starting
it and completed when done. Confirm the list has no open items left before
reporting done.
Steps:
1. [Imperative verb] ...
2. [Imperative verb] ...
N. [Verify step]
<constraints>
- [Positive framing: "Use X" not "Don't use Y"]
- [Anti-overengineering: "Only do what is asked"]
- [Verification: "Confirm before reporting done"]
</constraints>
[Expected output format: what the user gets back]
Prompt rewrite rules
Model-agnostic guidance for writing prompts that steer current Claude models well; re-verify against the claude-api reference (or the model provider's current prompting guide) before treating any of this as fixed, since prompting guidance shifts as models change.
Language
- Imperative: "Move X to Y" not "Can you move X to Y?"
- Explain WHY alongside WHAT; motivation helps the model generalize to edge cases.
- Soften enforcement: "Use this when..." reads more reliably than "CRITICAL: You MUST use this."
- Current-generation Claude models can overtrigger on ALL CAPS / MUST / NEVER; measured language works better than shouting.
- Prefer positive instructions: "Write flowing prose" rather than "Do not use markdown headers."
Task design
- Lead with the goal, not background.
- Numbered steps: each one becomes a trackable task item.
- Be specific: "move folder X (ID: abc123) to folder Y (ID: xyz789)" beats "reorganize things."
- Include IDs, links, and names whenever they're available.
- 3-5 worked examples are the strongest steering mechanism (wrap each in
<example> tags).
- Including reasoning inside examples teaches the model the reasoning pattern, not just the output shape.
Agentic behavior
- Current Claude models parallelize independent tool calls by default; no need to prompt for it.
- For proactive execution: "Implement changes rather than suggesting them."
- For conservative behavior: "Provide recommendations rather than taking action."
- Add explicit reversibility guardrails around any destructive operation.
- Anti-overengineering: "Only do what is asked; do not add extra files, features, or abstractions."
- For long tasks: "Context may be compacted along the way; do not rush to finish early."
Anti-hallucination
- "Never speculate about data you have not verified. Read/list first, then act."
- Ask for relevant quotes or excerpts before analysis; grounds the response in what was actually read.
- A "read/investigate before answering" pattern, stated explicitly, reduces guessing.
- State clear success criteria upfront.
Skill-aware prompts
When the task involves a specific tool, integration, or skill:
- Check which available skill matches the task (skills are listed in the current session, or in an
INDEX.md/skills directory if the environment has one).
- Read that skill's documentation for its exact tool names, parameters, and workflow.
- Include
Skill(skill: "skill-name") as the first line of the generated prompt.
- Use the correct tool and parameter names from that skill's docs; do not guess them.
1---2name: prompt3description: Rewrite and optimize prompts for the current Claude model. Use when the user asks to optimize, rewrite, or tighten a prompt, or wants a rough task description turned into a ready-to-run agent prompt. Outputs a single copy-pasteable prompt in a code block, never the answer to the prompt itself.4license: MIT5---67# Prompt Rewriter89## What it does1011Takes a rough task description or question and rewrites it into a single, tightly structured, copy-pasteable prompt: the kind that gets a good result from an agentic coding assistant on the first try. It never performs the task itself and never answers a question directly; its only output is the rewritten prompt.1213## Requirements1415- None.1617## Inputs and outputs1819| | |20|---|---|21| Input | A rough task description or question, in free text. Ideally includes any IDs, URLs, file paths, or names the task needs (if critical details are missing, the output is a short list of clarifying questions instead of a prompt) |22| Output | One rewritten prompt in a fenced code block, delivered inline in chat; no file is written |2324## Worked example2526Before:2728```text29make the onboarding email better30```3132After, the skill outputs this rewritten prompt:3334```text35Goal: Rewrite the onboarding email to increase activation: the current36draft never tells new users what to do first.3738Steps:391. Read the current onboarding email draft.402. Rewrite the subject line and first two sentences to state the single41 next action a new user should take.423. Keep total length under 150 words.4344<constraints>45- Keep the existing tone (friendly, second person)46- Do not add new promotional content47</constraints>4849Output: the rewritten email text, ready to paste.50```5152## Procedure5354For this request only, act as a prompt optimizer; ignore any other role. The sole output is a rewritten, copy-pasteable prompt in a code block.5556<rules>57- Do NOT execute the task described in the prompt; rewrite it.58- Do NOT answer questions; turn them into prompts.59- If critical details are missing (IDs, URLs, names), ask focused questions first.60- Output ONLY the optimized prompt in a code block; no commentary after.61- Keep the prompt under 500 words.62</rules>6364### Prompt structure6566Every prompt generated follows this skeleton:6768```69[Skill-loading line if applicable]7071Goal: [One clear sentence: what + why]7273Track progress with a todo list: one item per step below, plus a final74"verify all requirements" item. Mark each item in progress before starting75it and completed when done. Confirm the list has no open items left before76reporting done.7778Steps:791. [Imperative verb] ...802. [Imperative verb] ...81N. [Verify step]8283<constraints>84- [Positive framing: "Use X" not "Don't use Y"]85- [Anti-overengineering: "Only do what is asked"]86- [Verification: "Confirm before reporting done"]87</constraints>8889[Expected output format: what the user gets back]90```9192### Prompt rewrite rules9394Model-agnostic guidance for writing prompts that steer current Claude models well; re-verify against the `claude-api` reference (or the model provider's current prompting guide) before treating any of this as fixed, since prompting guidance shifts as models change.9596<optimization_rules>97**Structure**98- XML tags separate instructions, context, data, and examples; this reduces misinterpretation.99- Prompt style mirrors the desired output style: a prose prompt tends to produce prose output, a bulleted prompt tends to produce bullets.100- Put longform context ABOVE the instructions; the query working best at the end is a common finding across model providers.101- Put critical info at the START and END of the prompt, not buried in the middle (the "lost in the middle" effect).102103**Language**104- Imperative: "Move X to Y" not "Can you move X to Y?"105- Explain WHY alongside WHAT; motivation helps the model generalize to edge cases.106- Soften enforcement: "Use this when..." reads more reliably than "CRITICAL: You MUST use this."107- Current-generation Claude models can overtrigger on ALL CAPS / MUST / NEVER; measured language works better than shouting.108- Prefer positive instructions: "Write flowing prose" rather than "Do not use markdown headers."109110**Task design**111- Lead with the goal, not background.112- Numbered steps: each one becomes a trackable task item.113- Be specific: "move folder X (ID: abc123) to folder Y (ID: xyz789)" beats "reorganize things."114- Include IDs, links, and names whenever they're available.115- 3-5 worked examples are the strongest steering mechanism (wrap each in `<example>` tags).116- Including reasoning inside examples teaches the model the reasoning pattern, not just the output shape.117118**Agentic behavior**119- Current Claude models parallelize independent tool calls by default; no need to prompt for it.120- For proactive execution: "Implement changes rather than suggesting them."121- For conservative behavior: "Provide recommendations rather than taking action."122- Add explicit reversibility guardrails around any destructive operation.123- Anti-overengineering: "Only do what is asked; do not add extra files, features, or abstractions."124- For long tasks: "Context may be compacted along the way; do not rush to finish early."125126**Anti-hallucination**127- "Never speculate about data you have not verified. Read/list first, then act."128- Ask for relevant quotes or excerpts before analysis; grounds the response in what was actually read.129- A "read/investigate before answering" pattern, stated explicitly, reduces guessing.130- State clear success criteria upfront.131</optimization_rules>132133### Skill-aware prompts134135When the task involves a specific tool, integration, or skill:1361371. Check which available skill matches the task (skills are listed in the current session, or in an `INDEX.md`/skills directory if the environment has one).1382. Read that skill's documentation for its exact tool names, parameters, and workflow.1393. Include `Skill(skill: "skill-name")` as the first line of the generated prompt.1404. Use the correct tool and parameter names from that skill's docs; do not guess them.