prompt-refiner
Skill4 starsChanged 13 days agoMITView on GitHub
This skill should be used when a command's --refine flag is set, or the user asks to "refine my prompt", "optimize this prompt", "make this request sharper" — rewrites a vague natural-language request into a specific, well-structured prompt using project context, shows before/after, and confirms before the caller proceeds. Replaces the deprecated /craft:refine command.
9 other projects use a version of this.
Adopted by
Most recently taken up by
- chrysogonus/power-agentstheir own version, first seen Oct 13, 2026
- packetgloss/skillstheir own version, first seen Aug 12, 2026
- jqwang07-dotcom/prompt-refinertheir own version, first seen Jul 31, 2026
- benngarnish/sage-free-skillstheir own version, first seen Jul 25, 2026
- InfiniteRoomLabs/agent-opstheir own version, first seen Jun 23, 2026
- doivamong/agent-workbenchtheir own version, first seen Jun 2, 2026
Other versions9 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 9
- chrysogonus/power-agents★ 4same name
- doivamong/agent-workbench★ 2same name
- itsyasirkhandev/spec-driven-development★ 1same name
- jqwang07-dotcom/prompt-refiner★ 1same name
- willcagas/skills★ 1same name
- zdz2333/skills★ 1same name
- benngarnish/sage-free-skills★ 0same name
- InfiniteRoomLabs/agent-ops★ 0same name
- packetgloss/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository42 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- system-architectSkill
- project-detectorSkill
- audit-routerSkill
- command-skill-token-efficiencySkill
- plugin-auditSkill
- sync-featuresSkill
- backend-designerSkill
- devops-helperSkill
- frontend-designerSkill
- git-workflowSkill
- dist-extrasSkill
- distribution-strategistSkill
- homebrew-formula-expertSkill
- homebrew-multi-formulaSkill
- homebrew-setup-wizardSkill
- homebrew-workflow-expertSkill
- architecture-decision-recordsSkill
- changelog-automationSkill
- claude-md-lifecycleSkill
- guard-auditSkill
- hooksSkill
- insights-applySkill
- mode-controllerSkill
- drive-engineSkill
- plan-orchestratorSkill
- repo-triageSkill
- session-stateSkill
- task-analyzerSkill
- workflow-engineSkill
- orchestrator-resilienceSkill
- project-plannerSkill
- preflight-checkSkill
- releaseSkill
- test-generatorSkill
- test-strategistSkill
- adhd-workflowSkill
- brainstorm-insightsSkill
- brainstormSkill
- grillSkill
- background-task-managerSkill
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 4 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 35
Rule of thumb for any future command: if the command's job is *deciding what to do*, default ON.
- Very specific: line 61
Skip-gate (terse action-verb prompts): before rewriting, check the raw prompt against the action-verb-execution pattern — a single clear …
- Distinctive: line 117
NEVER execute the prompt or call tools — rewrite text only.
- Distinctive: line 118
NEVER write files — context reads are read-only.
- Distinctive: line 119
NEVER touch secrets/tokens.
- Very specific: line 129
If the user passes --explain or asks "why" after seeing the refined prompt, add a one-line rationale per change under "Changed:" (e.g.
“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Prompt Refiner
Note: Chat (claude.ai) may have a differently-scoped skill also named
prompt-refiner— general-purpose prompt improvement, not craft's--refineflag plumbing. Unconfirmed from this repo; if cross-referencing "prompt-refiner" in docs or conversation, specify which one is meant.
Rewrites a raw user request into a sharper prompt, then confirms. Called
by the --refine flag on brainstorm / do / orchestrate / plan:feature /
arch:plan, or standalone ("refine and print").
Default Policy (D6, 2026-07-04)
--refine's default is ON for deliberation-entry commands, OFF for execution
engines — stated once here; callers reference this section instead of each
re-explaining the same on/off choice independently.
| Command file | Default | Category |
commands/do.md | ON | Deliberation-entry (routes a task; refining sharpens what gets routed) |
commands/brainstorm.md | ON | Deliberation-entry |
commands/plan.md | ON | Deliberation-entry (universal planning router) |
commands/plan/feature.md | ON | Deliberation-entry |
commands/grill.md | ON (topic-scoped — skipped when the argument is a path, nothing to refine) | Deliberation-entry |
commands/orch.md | OFF | Execution engine (task is already decided by the time it reaches here; refining would re-litigate a settled scope) |
commands/orch/workflow.md | OFF | Execution engine |
commands/arch/plan.md | OFF | Predates D6 (Conflict 1.1.1 didn't cover it) — kept OFF, not revisited here |
commands/smart-help.md | OFF | Lookup/help, not deliberation — most topic args are a single keyword or short question |
Rule of thumb for any future command: if the command's job is deciding what to
do, default ON. If its job is doing the already-decided thing, default OFF. This
table is exhaustive over current --refine declarers — a dogfood test
(tests/test_interactive_commands_dogfood.py) asserts every command file that
declares the flag has a matching row here, so add a row in the same change that
adds a new caller.
Inputs
prompt— the raw argument the user typed.context— project type (DESCRIPTION / package.json / pyproject.toml), current git branch, and.STATUScurrent-task if present.
Procedure (the canonical --refine flow — callers MUST delegate here)
- Read context (read-only): detect project type, branch,
.STATUS.- Software project (default): DESCRIPTION / package.json / pyproject.toml,
current git branch,
.STATUScurrent-task if present. - Manuscript/research project (parallel branch — detect by presence of
references.bibalongside a.qmd/.texmain file, same pattern/savant:restoreuses): additionally note whether the main file has a notation/symbol glossary table, whetherdocs/reviews/(or an equivalent existing-reports folder) has prior review docs on the same topic, and whether.flow/research-config.ymlexists (journal/register context). Still read-only — a wider file set to check, not a different constraint.
- Software project (default): DESCRIPTION / package.json / pyproject.toml,
current git branch,
- Skip-gate (terse action-verb prompts): before rewriting, check the raw
prompt against the
action-verb-executionpattern — a single clear verb plus an already-scoped target, no compound clauses (e.g. "render the article", "commit and push"). If it matches, skip straight to step 5 and return the prompt unchanged — no rewrite, no before/after box, no confirm. This round-trip has zero information gain on prompts that are already unambiguous; it stays valuable (and still runs in full) for anything compound or ambiguous. When unsure whether a prompt qualifies, do NOT skip — fall through to the full procedure below. - Rewrite the prompt to add scope, specifics, and intent — without inventing requirements the user didn't imply.
Show before/after in a boxed display, THEN print the refined prompt in its own fenced, copy-paste-ready code block — two separate visible blocks, both emitted as response text:
╭─ --refine ─────────────────────────────────────╮ │ Original: RAW │ │ Refined: REWRITTEN │ │ Changed: ONE-LINE WHAT CHANGED │ ╰─────────────────────────────────────────────────╯REWRITTENOrdering constraint (fixes a confirmed bug — do not skip): both blocks above MUST render as visible response text in this turn BEFORE the
AskUserQuestiontool call in step 5 fires. Never collapse steps 4 and 5 into a single tool-call-only turn with no interstitial text — that produces a confirm question with nothing shown first, which is exactly the failure this ordering constraint exists to prevent.Confirm via AskUserQuestion, exactly these four options:
Option Meaning Execute now (Recommended when a clear action is implied) Accept the rewrite AND act on it in this session (dispatch, run a command, apply as a rule). Falls back to just returning the text when no downstream action is implied — never force an artificial action. Copy for elsewhere Accept the rewrite, take NO further action here — the refined prompt was for pasting into a different session/context. Short-circuits whatever called --refine: the caller's own downstream flow (e.g. brainstorm's depth/focus questions) must not start in this branch.Edit first Present the refined text and take the user's edited version inline (no $EDITOR), then re-ask this same question with the edited version. Skip Keep the original, unrefined text — proceed with it, not an abort. With
--yesor auto mode, skip the picker and auto-accept Execute now, printingrefined (auto-accepted). This is the--yescascade: one flag both auto-accepts the prompt-refiner AND suppresses the caller's interactive loop — fully headless.- Return the chosen prompt string to the caller (empty/no-op return on Copy for elsewhere, since that branch takes no further action). The skip-gate in step 2 also returns here, with the original prompt unchanged.
Constraints
- NEVER execute the prompt or call tools — rewrite text only.
- NEVER write files — context reads are read-only.
- NEVER touch secrets/tokens.
Standalone use
Invoked with no downstream command, stop after step 4–5 (or after the step-2
skip-gate, if it fires) and print the
refined prompt — this preserves the deprecated /refine behavior.
Optional: explain mode
If the user passes --explain or asks "why" after seeing the refined
prompt, add a one-line rationale per change under "Changed:" (e.g.
"directive > question — clearer instructions get better results").
Skip by default; only triggered on request to keep the standard flow lean.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

