A Claude Code skill that analyzes prompts and produces improved versions based on Anthropic's official prompt engineering best practices.
The /improve-prompt skill systematically evaluates prompts against 10 key techniques from Anthropic's documentation:
- XML Tags - Structure complex prompts with clear boundaries
- Variables - Template placeholders for reusable prompts
- Role/Persona - Expertise framing for better responses
- Examples - Input/output demonstrations (multishot prompting)
- Chain of Thought - Step-by-step reasoning for complex tasks
- Clarity - Replace vague language with specific terms
- Output Format - Explicit response structure
- Constraints - Boundaries and exclusions
- Context - Background information and audience
- Task Decomposition - Breaking complex tasks into chains
For each technique, the skill determines whether it's present, needed, and how to apply it appropriately.
Copy the skill to your Claude Code skills directory:
# Clone the repository
git clone https://github.com/christabone/claude-prompt-improvement.git
cd claude-prompt-improvement
# Install to personal skills directory
mkdir -p ~/.claude/skills
cp -r skills/improve-prompt ~/.claude/skills/Add to your project's .claude/skills/ directory:
# From your project root
mkdir -p .claude/skills
cp -r /path/to/claude-prompt-improvement/skills/improve-prompt .claude/skills/Project skills are automatically shared with team members via git.
Start Claude Code and ask:
What skills are available?
You should see improve-prompt listed.
The skill activates automatically when you ask Claude to improve, optimize, or review a prompt. Examples:
Can you improve this prompt for me?
Review this prompt and make it better: [your prompt]
Optimize this prompt using best practices: [your prompt]
Or reference a file:
Improve the prompt in prompts/my-prompt.txt
The skill produces two output files:
improved_prompt.md- The rewritten prompt with all improvementsimprovement_summary.md- Detailed explanation of what changed and why
Before:
Hey Claude! So I've been working on this Python function and I think it needs
some work but I'm not totally sure what's wrong with it. It's supposed to get
user data from our API and do some stuff with it. Could you take a look?
After:
<role>
You are a senior Python developer performing a code review. Focus on practical,
actionable feedback rather than stylistic nitpicks.
</role>
<instructions>
Review the following Python function that fetches and processes user data from
a REST API. Provide feedback in these specific areas:
1. **Bugs**: Identify any logic errors, edge cases, or runtime errors
2. **Error Handling**: Evaluate how the function handles API failures
3. **Best Practices**: Check adherence to Python conventions
4. **Performance**: Note any inefficiencies
</instructions>
<code>
{{code}}
</code>
<output_format>
## Summary
## Bugs Found
## Error Handling Issues
## Best Practice Violations
## Performance Suggestions
## Recommended Priority
</output_format>The skill references Anthropic's prompt engineering documentation, which may change over time. Use the fetcher scripts to check for and incorporate updates.
cd fetcher
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Install Playwright browser
playwright install chromiumcd fetcher
source venv/bin/activate
# Check for changes (doesn't modify anything)
python fetch_docs.py --checkOutput shows which pages changed:
Checking 10 pages...
overview... unchanged
be-clear-and-direct... unchanged
chain-of-thought... CHANGED
extended-thinking-tips... NEW
==================================================
SUMMARY
==================================================
Unchanged: 8
CHANGED: 1
NEW: 1
==================================================
*** 2 change(s) detected! Check diff_log.md for details. ***
# Fetch all pages and save changes
python fetch_docs.py
# Or force re-fetch everything
python fetch_docs.py --forceUpdated content is saved to:
data/processed/*.md- Cleaned markdown versionsdata/manifest.json- Hashes and timestamps for change detectiondiff_log.md- Human-readable changelog
If documentation changed significantly:
- Review
diff_log.mdfor what changed - Compare old vs new in
data/processed/ - Update
skills/improve-prompt/CHECKLIST.mdif techniques changed - Update
skills/improve-prompt/reference/techniques.mdif needed - Re-install the skill:
cp -r skills/improve-prompt ~/.claude/skills/
Edit fetcher/urls.txt to add or remove pages:
# Comments start with #
https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/overview
https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/new-page
claude-prompt-improvement/
├── skills/
│ └── improve-prompt/
│ ├── SKILL.md # Main skill instructions
│ ├── CHECKLIST.md # 10-technique evaluation checklist
│ ├── reference/
│ │ └── techniques.md # Condensed technique reference
│ └── scripts/
│ └── checks/
│ ├── xml_tags.py # Detect XML tag patterns
│ └── variables.py # Detect template variables
├── fetcher/
│ ├── fetch_docs.py # Documentation fetcher script
│ ├── urls.txt # URLs to monitor
│ └── requirements.txt # Python dependencies
├── data/
│ ├── processed/ # Cleaned markdown docs
│ └── manifest.json # Content hashes for change detection
├── test/ # Example prompts and outputs
└── diff_log.md # Documentation change history
- Automated Detection - Python scripts detect XML tags and template variables
- Manual Judgment - Claude evaluates all 10 techniques using CHECKLIST.md criteria
- Visible Reasoning - Claude outputs thinking process for transparency
- Actionable Output - Produces improved prompt file, not just suggestions
The skill follows Anthropic's guidance that some checks (XML tags, variables) can be pattern-matched, while others (role, examples, clarity) require nuanced judgment.
MIT
- Fork the repository
- Make changes
- Run the skill on test prompts to verify
- Submit a pull request