prompt-improver
Skill509 starsChanged 3 months agoMITView on GitHub
Rewrite a vague prompt into a rich, structured one, with automatic fallback. Use when the user says 'improve this prompt', 'make this prompt better', or hands over a thin instruction. Not for creating a reusable skill; use `create-skill`.
- Reads credentials
12 other projects use a version of this.
Adopted by
Most recently taken up by
- ji-hun-git/how-to-use-aitheir own version, first seen Nov 15, 2026
- KalastajaM/Cluidetheir own version, first seen Nov 8, 2026
- zedarvates/frugal-skillstheir own version, first seen Nov 8, 2026
- No1Hoo/prompt-improver-skilltheir own version, first seen Sep 14, 2026
- Amery2010/skillstheir own version, first seen Sep 9, 2026
- d3v0psdan/claude-skillstheir own version, first seen Jun 19, 2026
Other versions12 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 12
- severity1/claude-code-prompt-improver★ 1.9ksame name
- happycapy-ai/Happycapy-skills★ 137same name
- ndpvt-web/prompt-improver★ 86same name
- dazuck/operator-skills★ 17same name
- Amery2010/skills★ 4same name
- KalastajaM/Cluide★ 2same name
- dazuck/claude-code-skills★ 1same name
- zedarvates/frugal-skills★ 1same name
- d3v0psdan/claude-skills★ 0same name
- ji-hun-git/how-to-use-ai★ 0same name
2 more not listed
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 repository153 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .claude/plugins/compound-engineering/CLAUDE.mdCLAUDE.md
- .cursor/rules/search-routing.mdcCursor rule
- anthropic-algorithmic-artSkill
- anthropic-brand-guidelinesSkill
- anthropic-doc-coauthoringSkill
- anthropic-docxSkill
- anthropic-frontend-designSkill
- anthropic-internal-commsSkill
- anthropic-mcp-builderSkill
- anthropic-pptxSkill
- anthropic-slack-gif-creatorSkill
- anthropic-theme-factorySkill
- anthropic-webapp-testingSkill
- anthropic-web-artifacts-builderSkill
- anthropic-xlsxSkill
- atlassian-setupSkill
- backup-nowSkill
- backup-restoreSkill
- backup-setupSkill
- calendar-setupSkill
- commitmentsSkill
- create-mcpSkill
- daily-planSkill
- daily-reviewSkill
- decision-logSkill
- delegate-checkSkill
- dex-backlogSkill
- dex-doctorSkill
- dex-improveSkill
- dex-obsidian-setupSkill
- dex-rollbackSkill
- dex-updateSkill
- dex-whats-newSkill
- diff-profileSkill
- enable-semantic-searchSkill
- getting-startedSkill
- goal-backlogSkill
- google-workspace-setupSkill
- granola-setupSkill
- identity-snapshotSkill
- industry-truthsSkill
- initiative-kickoffSkill
- integrate-mcpSkill
- journalSkill
- manage-capabilitiesSkill
- meeting-closeoutSkill
- meeting-prepSkill
- ms-teams-setupSkill
- pipedrive-setupSkill
- pipeline-syncSkill
- process-meetingsSkill
- product-briefSkill
- project-healthSkill
- relationship-radarSkill
- reviewSkill
- save-insightSkill
- scrapeSkill
- skill-scoreSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
12 rules. 0 are common, 7 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 10 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 31
Check if $PROMPT starts with a flag:
- Very specific: line 47
Check if $PROMPT starts with a flag (-p, -v) and extract:
- Very specific: line 56
Script available?: Check if .scripts/improve-prompt.cjs exists
- Distinctive: line 57
If yes → Use script (calls Anthropic API directly)
- Distinctive: line 58
If no → Check for API key
- Very specific: line 60
API key available?: Check if ANTHROPIC_API_KEY is set in environment
- Distinctive: line 61
If yes → Use Anthropic Messages API inline
- Distinctive: line 62
If no → Fall back to current LLM
- Distinctive: line 88
Use the current session's LLM to improve the prompt inline:
- Distinctive: line 98
Stop. Do NOT execute.
- Very specific: line 209
Create .env file in vault root (if not exists)
- Very specific: line 235
Call track_event with event_name prompt_improved and properties:
“Common” is measured: kept by at least 6 in 10 of the 10 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
<!-- Generated from `.claude/skills/prompt-improver/SKILL.md` by `scripts/generate-agents-skills.py`. Do not edit. -->Purpose
Transform vague, ambiguous prompts into rich, well-structured prompts. Uses Anthropic's prompt improvement capabilities when available, with graceful fallback to the current LLM.
How it works:
- User provides a vague prompt (e.g., "critique this doc")
- Skill improves the prompt using best available method
- Executes the improved prompt and returns results
- User sees the answer without seeing the improved prompt (unless flags are set)
Arguments
$PROMPT - The prompt to improve (required) $FEEDBACK - Optional feedback on what to improve (e.g., "Make it more detailed", "Add examples", "Focus on clarity") $TARGET_MODEL - Optional target model for the improved prompt (defaults to current model) $SYSTEM - Optional system prompt to improve alongside the user prompt
Qualifiers
Check if $PROMPT starts with a flag:
| Flag | Behavior |
-p | Prompt only - Show the improved prompt, don't execute |
-v | Verbose - Show the improved prompt, then execute |
| (none) | Quick - Execute immediately without showing full prompt |
Strip the flag from $PROMPT before processing.
Process
Step 1: Parse Flags and Extract Prompt
Check if $PROMPT starts with a flag (-p, -v) and extract:
- mode:
prompt-only,verbose, orquick(default) - original_prompt: The actual prompt text (flag removed)
- feedback: Optional improvement guidance from $FEEDBACK
Step 2: Determine Improvement Method
Check in this order:
- Script available? Check if
.scripts/improve-prompt.cjsexists- If yes → Use script (calls Anthropic API directly)
- If no → Check for API key
- API key available? Check if
ANTHROPIC_API_KEYis set in environment- If yes → Use Anthropic Messages API inline
- If no → Fall back to current LLM
The fallback cascade:
Script (.scripts/improve-prompt.cjs)
↓ (if not available)
Anthropic Messages API (direct call)
↓ (if no API key)
Current LLM (Opus 4.5, Sonnet, etc.)Step 3: Improve the Prompt
Method A: Script (preferred)
node .scripts/improve-prompt.cjs "$PROMPT" "$FEEDBACK" "$TARGET_MODEL" "$SYSTEM"Method B: Anthropic Messages API (direct) Make API call with:
- Model:
claude-sonnet-4-5-20250929(optimized for prompt engineering) - System Prompt: Prompt engineering expert persona (see below)
- User Message: The original vague prompt
- Temperature: 0.3
Method C: Current LLM Fallback Use the current session's LLM to improve the prompt inline:
- Notify user:
"💡 Using inline improvement (no API key configured). For best results, add ANTHROPIC_API_KEY to .env" - Apply the same prompt engineering system prompt
- Continue with the improved result
Step 4: Handle Based on Mode
Mode: prompt-only (flag: -p):
- Show:
> **Original:** [original_prompt] - Show the enhanced_prompt in a code block
- Stop. Do NOT execute.
Mode: verbose (flag: -v):
- Show:
> **Original:** [original_prompt] - Show the enhanced_prompt in a collapsible block:
<details> <summary>📝 Improved Prompt (click to expand)</summary> [enhanced_prompt] </details> - Add
---separator - Execute the enhanced_prompt and return results
Mode: quick (no flag - DEFAULT):
- Silently execute the enhanced_prompt
- Return results directly to user
- Do NOT show the improved prompt - user just sees the answer
Prompt Engineering System Prompt
Used for both API and fallback methods:
You are an expert prompt engineer trained in Anthropic's best practices. Your job is to transform vague, ambiguous prompts into clear, structured, effective prompts.
Analyze the user's prompt and improve it using these techniques:
1. **Structure**: Add clear sections with XML tags or markdown headers
2. **Clarity**: Be specific about format, length, and success criteria
3. **Context**: Include necessary background and define ambiguous terms
4. **Examples**: Add few-shot examples when helpful
5. **Chain of Thought**: For complex tasks, request step-by-step reasoning
6. **Constraints**: Make implicit constraints explicit
Return ONLY the improved prompt. Do not explain your changes or add meta-commentary.
{if $FEEDBACK exists: "Focus on: {$FEEDBACK}"}Examples
/prompt-improver -p critique this strategy doc
→ Shows improved prompt only, doesn't execute
/prompt-improver -v critique this strategy doc
→ Shows improved prompt, then executes it
/prompt-improver critique this strategy doc
→ Just executes the improved prompt
/prompt-improver -v "review this code" "Focus on security issues"
→ Shows improved prompt focused on security, then executesImprovement Template Reference
The improved prompt typically follows this structure:
# Task
[Clear statement of what to do]
# Context
[Background information needed]
# Instructions
1. [Step 1]
2. [Step 2]
3. [Step 3]
# Constraints
- [Constraint 1]
- [Constraint 2]
# Output Format
[Expected format and structure]
# Examples (if helpful)
[Input/output examples]Error Handling
| Situation | Behavior |
| Script not found | Fall back to API |
| No API key | Fall back to current LLM with notification |
| API rate limit | Retry with exponential backoff, then fall back |
| API error | Fall back to current LLM |
| Network issues | Fall back to current LLM |
Key principle: The skill should NEVER fail completely. It always has the current LLM as ultimate fallback.
Setup (Optional)
For best results, add your Anthropic API key:
- Create
.envfile in vault root (if not exists) - Add:
ANTHROPIC_API_KEY=your-key-here - Make the file owner-only:
chmod 600 .env(API keys should never be readable by other users of the machine)
Without the API key, the skill still works using the current LLM session.
Philosophy
Meta-prompting: This skill uses Claude to improve prompts for Claude. It's prompt engineering as a service.
Invisible by default: The best tools disappear. Users ask naturally, get expert results, never see the complexity.
Progressive disclosure: Flags (-v, -p) let power users inspect and learn from the improvements.
Graceful degradation: Works everywhere - with full API access, partial access, or no external access at all.
Track Usage (Silent)
Call the mark_feature_used tool on the dex-analytics MCP server with prompt-improver. This ticks the feature's box in System/usage_log.md, which is what /dex-level-up reads to recommend features that have not been tried. It writes locally and sends nothing, so it runs whether or not analytics is enabled.
Analytics (Silent):
Call track_event with event_name prompt_improved and properties:
- (no properties)
This only fires if the user has opted into analytics. No action needed if it returns "analytics_disabled".
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.

