prompt-refiner
Skill0 starsChanged 5 months agoMITView on GitHub
Use when the user asks to refine, improve, restructure, or clarify a prompt for Claude Code. Also activates on /refine. Guides through a conversational loop: understands intent, researches the codebase, asks grounded clarifying questions, then transforms ramblings into clean structured prompts with execute/edit/copy options.
9 other projects use a version of this.
Adopted by
Most recently taken up by
- Data-Wise/crafttheir own version, first seen Oct 31, 2026
- 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
- 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
- Data-Wise/craft★ 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
- 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 repository34 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- architectureSkill
- code-reviewSkill
- debugSkill
- dep-auditSkill
- deploy-checklistSkill
- documentationSkill
- end-agent-sessionSkill
- incident-responseSkill
- likec4-dslSkill
- load-agentSkill
- manual-testSkill
- market-scanSkill
- new-agentSkill
- new-goal-loopSkill
- nexus-microSkill
- nexusSkill
- nexus-sprintSkill
- orchestration-cost-policySkill
- persona-forgeSkill
- project-onboardSkill
- public-readinessSkill
- release-prepSkill
- render-mermaidSkill
- secrets-syncSkill
- standupSkill
- system-designSkill
- tech-debtSkill
- testing-strategySkill
- tmux-session-captureSkill
- tsdocSkill
- web-ui-automation-componentsSkill
- web-ui-automation-surveySkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. 0 are common, 12 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
12
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 29
Read the raw prompt. Categorize:
- Very specific: line 42
If unclear: Ask 1-2 high-level questions about task type and actual goal.
- Distinctive: line 46
After categorization, check: does the prompt contain 3+ distinct concerns, reference multiple projects, or mix definite decisions with …
- Distinctive: line 62
Run the task-scoped research checklist (bug fix, feature, refactor, etc.)
- Distinctive: line 73
Document findings internally using this format (not shown to user):
- Very specific: line 91
Use AskUserQuestion with multiple choice where possible
- Distinctive: line 92
Every option must reference specific findings (file paths, function names, patterns)
- Distinctive: line 108
After each clarification round, assess:
- Distinctive: line 125
Wait for user response:
- Distinctive: line 153
When transforming a compound prompt, use this alternative structure:
- Distinctive: line 187
When the raw prompt contains phrases like "let's brainstorm," "let's plan," "generate a plan," or references a specific workflow, recognize …
- Distinctive: line 191
No skill reference -> Execute runs the refined prompt directly in conversation
- Distinctive: line 201
No framework labels (CO-STAR, RISEN, etc.) -- just clean, direct instructions
- Distinctive: line 202
Only include sections that add information -- skip empty ones
“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
Transform vague or rambling prompts into clean, structured Claude Code instructions through a conversational loop with deep research. Invoked via /refine <prompt> or /refine (then ask what to refine).
Escape Hatches
Recognize these at any point in the flow:
- "Just do it" or "good enough": Transform immediately with current understanding, skip remaining questions
- "Start over": Reset to Phase 1
- User directly edits the understanding summary: Accept edits as corrections
Phase 1: Understand Intent
Read the raw prompt. Categorize:
| Category | Signals |
| Bug fix | "broken", "error", "fix", "crash", "failing", stack traces |
| Feature | "add", "create", "implement", "new", "build" |
| Refactor | "clean up", "reorganize", "split", "extract", "simplify" |
| Exploration | "how does", "understand", "explain", "what is" |
| Config/Infra | "deploy", "config", "environment", "CI", "docker" |
| Docs | "document", "README", "explain for others", "write docs" |
If category is obvious from the prompt: Skip to Phase 2.
If unclear: Ask 1-2 high-level questions about task type and actual goal. Use AskUserQuestion with multiple choice.
Compound Detection
After categorization, check: does the prompt contain 3+ distinct concerns, reference multiple projects, or mix definite decisions with exploratory ideas? If so, treat it as a compound prompt:
- Identify each concern cluster and its certainty level (decided, exploring, just an example)
- Note which projects/repos are referenced
- Proceed to Phase 2 with cross-cutting research rather than a single-category checklist
- In Phase 3, prioritize decomposition questions before diving into any single cluster
Track loop count. Maximum 3 research-clarify loops total across Phases 2-3.
Phase 2: Deep Research
Load references/research-strategies.md for task-scoped checklists.
Execute research scoped by the category from Phase 1:
- Check conversation history first -- recent messages, error output, file views
- Run the task-scoped research checklist (bug fix, feature, refactor, etc.)
- Budget: 5-8 files/commands per round
Available research tools:
Glob-- find files by patternGrep-- search file contentsRead-- read specific filesBash-- git log, git blame, directory listingsAgentwithsubagent_type=Explore-- broad codebase explorationWebSearch/WebFetch-- external docs, best practices
Document findings internally using this format (not shown to user):
Findings:
- [File/source]: [What was found]
- [File/source]: [What was found]
Patterns: [Existing patterns relevant to the task]
Gaps: [What's still unclear -- drives questions in Phase 3]Phase 3: Grounded Clarification
Load references/question-patterns.md for templates.
Generate 1-3 questions per round. Every question must cite specific research findings.
Question Rules
- Use
AskUserQuestionwith multiple choice where possible - Every option must reference specific findings (file paths, function names, patterns)
- 1 decision point per question
- 2-4 options per question
- Include trade-offs in option descriptions
- User can always provide freeform input
Adaptive Thoroughness
| Complexity | Rounds | Signals |
| Simple | 1 | Target is clear, one obvious approach |
| Moderate | 2 | Multiple valid approaches, ambiguous scope |
| Complex | 3 | Touches auth/data/infra, multiple interconnected decisions |
Loop Control
After each clarification round, assess:
- Sufficient understanding? Proceed to Phase 4
- Research revealed more complexity? Loop back to Phase 2 (respect max 3 loops)
- User said "just do it"? Proceed to Phase 4 with current understanding
Phase 4: Transform
Load references/transformation-examples.md for before/after models.
Step 1: Show Understanding
Present a plain-language summary:
Here's what I understood:
[2-4 sentences describing the task, target, approach, and any constraints -- in conversational tone]
Wait for user response:
- Confirms: Proceed to Step 2
- Corrects: Incorporate corrections, loop back to Phase 3 if needed
- Edits directly: Accept edits as the new understanding
Step 2: Present Structured Prompt
Transform into this format (include sections only when relevant):
## Goal
[1-2 sentences: what to accomplish]
## Context
[Files involved, current state, constraints from research]
## Requirements
- [Specific requirements extracted from the rambling + clarification]
## Approach
[If preference expressed or research suggests one]
## Boundaries
[What NOT to do -- only if constraints exist or task is risky]Compound Output Format
When transforming a compound prompt, use this alternative structure:
## Goal
[Overarching objective -- 1-2 sentences]
## Work Streams
### 1. [Stream name]
**Goal**: [What this stream accomplishes]
**Context**: [Relevant findings]
**Requirements**: [Specifics]
**Open questions**: [Things still uncertain]
### 2. [Stream name]
...
## Sequencing
[Which streams depend on others, suggested order]
## Boundaries
[Cross-cutting constraints]Step 3: User Choice
Present three options:
- Execute -- Run the refined prompt directly in this conversation (do NOT re-invoke prompt-refiner)
- Edit -- User modifies the prompt, then execute
- Copy -- Place the prompt on clipboard, done
Skill Chaining
When the raw prompt contains phrases like "let's brainstorm," "let's plan," "generate a plan," or references a specific workflow, recognize these as implicit skill invocations. Adjust the Execute option:
- "Let's brainstorm" -> Execute feeds the refined prompt into the brainstorming skill
- "Generate a plan" -> Execute feeds into writing-plans
- No skill reference -> Execute runs the refined prompt directly in conversation
Note the target skill in the Execute option so the user knows what will happen.
Transformation Principles
- Distill, don't decorate -- shorter and clearer beats longer
- Preserve intent, not wording
- Surface implicit assumptions the user didn't state
- Research findings become baked-in context (file paths, function names, error messages)
- No framework labels (CO-STAR, RISEN, etc.) -- just clean, direct instructions
- Only include sections that add information -- skip empty ones
Progressive Disclosure
These references load on-demand during specific phases:
- Research strategies:
references/research-strategies.md-- task-scoped checklists (Phase 2) - Question patterns:
references/question-patterns.md-- grounded question templates (Phase 3) - Transformation examples:
references/transformation-examples.md-- before/after models (Phase 4)
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.

