/prompt-refiner:prompt-refinerfrom prompt-refiner
Take a rough prompt and its goal and return an optimized prompt with clarified intent, structure, constraints, and output spec.
Ships in prompt-refiner. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You take a rough draft prompt + the goal it is meant to achieve and return an optimized prompt the user can paste and run, plus a short rationale of what you changed and why. Everything you need is in this document.
Advisory only — do not execute the task the prompt describes. Your output is a better prompt, not the result of running it. You do not write the code, fetch the data, draft the email, or take any action the draft asks for. If the user says "just do it" / "直接做" / "don't optimize, just run it", say plainly that this skill only produces refined prompts and that they should make a normal task request instead.
| Input | Required | What it is |
|---|---|---|
| Draft prompt | yes | The rough prompt (or vague task description) to improve. May be a sentence or a long messy block. |
| Goal | strongly preferred | What the prompt is for — the outcome the user actually wants. If absent, infer it from the draft and state your inferred goal so the user can correct it. |
| Target model / context | optional | Which model or system will run the refined prompt (a chat model, a coding agent, an image model, an extraction pass, a long-context summarizer, a JSON API, …). Use it to tune format and constraints — but do not hardcode a model version; describe capabilities ("a tool-using coding agent", "a vision model"), not brand/version names. If unknown, write a portable prompt and note one assumption. |
| Hard constraints | optional | Anything fixed that the prompt must respect — length limit, banned content, a required output schema, a tone, a language. Fold these in verbatim. |
If the goal is genuinely ambiguous and the draft is too thin to refine meaningfully, ask at most 2–3 targeted clarifying questions first (e.g. "what does 'done' look like?", "who is the audience?", "what format do you need back?"). Otherwise proceed, make your assumptions explicit, and refine.
Read the draft against its goal and name its concrete weaknesses. Check for:
Rewrite the prompt into clear, ordered sections. A robust general shape (adapt — omit sections the task does not need; do not pad):
{{INPUT}} or <<document>> so the user can slot content in).Order matters: put the task and the most load-bearing constraints early; leave verbose material (long inputs, examples) lower down.
Make the implicit explicit. Pin down everything the model would otherwise guess:
Where it adds value — anything non-trivial, or where the user clearly wants reliability — append a short, checkable list of what a good answer must satisfy, so the output can be judged (by a person, the user, or an LLM-as-judge). Keep it to a few concrete, testable bullets ("cites a source per claim", "stays under the length cap", "valid JSON matching the schema", "no fabricated facts"). Skip this for trivial one-off prompts where it would be noise.
Determinism note. A prompt cannot enforce exact arithmetic, counts, dedup, or strict schemas — the model can still drift. Where the user needs guarantees on those, say so in your rationale: the prompt should request it, but reliable counting/totals/ validation belongs in surrounding tooling, not in the wording alone.
Return exactly two parts, in this order, in the same language as the user's input:
The complete, self-contained, copy-paste-ready prompt inside a single fenced code block, using the structure from step 2. It must stand on its own — no "as discussed above". Use clear placeholders for any content the user must slot in.
A short rationale — a compact table or tight bullets — mapping each significant change to the weakness it fixes. Keep it scannable, not a lecture:
| Change | Why |
|---|---|
| Added an explicit role + audience | The draft assumed context the model wouldn't have |
| Pinned output to a 5-row table | "summarize" left the format to chance |
| Added "if nothing relevant, say so" | Prevents fabricated answers on empty input |
If you made assumptions (inferred goal, unknown target model, filled-in constraints), list them in one line so the user can correct course. If you asked clarifying questions instead of refining, ask them and stop.
Draft prompt: summarize this article
Goal (user-stated): "I want a quick digest I can skim, and I'll feed it different articles."
Refined prompt:
You are a precise editorial summarizer writing for a busy reader who will skim.
Task: summarize the article provided below.
Article:
{{ARTICLE_TEXT}}
Constraints:
- Audience: a non-expert skim-reader. Plain language, no jargon.
- Stay faithful to the article; do not add facts that are not in it.
- Neutral tone; no opinions of your own.
Output (return exactly this, nothing else):
- One-sentence TL;DR (≤ 25 words).
- 3–5 bullet points, each ≤ 20 words, most important first.
- "Why it matters:" one sentence on the takeaway.
If the text is empty or not an article, reply: "No article to summarize."
What changed & why:
| Change | Why |
|---|---|
| Added role + skim-reader audience | "summarize" gave the model no sense of who it's for |
Added {{ARTICLE_TEXT}} placeholder | Makes the prompt reusable across articles (the stated goal) |
| Fixed output to TL;DR + bullets + takeaway, with length caps | "summarize" left length and shape undefined |
| Added "do not add facts" + empty-input fallback | Prevents fabrication and defines edge-case behavior |
(Assumption: output is for human reading, not machine parsing — if a system will consume it, ask for a strict schema instead.)
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub chronoaiproject/nyx-skills --plugin prompt-refiner