anthropic-prompt-engineer — Claude Code skill: how to install
Builds new prompts from scratch and refines existing templates for Claude models using official Anthropic prompt engineering guidelines.
MIT 233 installs ★ 236 updated 2026-01-14
npx skills add jamesrochabrun/skills --skill anthropic-prompt-engineer -a claude-codeWhat anthropic-prompt-engineer does
This skill guides coding agents through Anthropic's proven prompt design methods. It applies semantic XML tags like <instructions> or <context>, chain-of-thought instructions for complex reasoning, few-shot examples, and response prefilling to steer formatting directly into clean JSON or specific code blocks.
The skill relies on files in its references/ directory, covering core techniques, recurring pitfalls, and Claude 4.x recommendations. Poorly framed prompts waste tokens and trigger hallucinations; this skill ensures your agent injects explicit role assignments, constraints, and edge-case handling before sending prompts to production.
What it helps with
- build structured data extraction prompts returning strict JSON
- convert vague one-line prompts into detailed XML-tagged specifications
- prevent hallucinations and token waste across Claude models
- add reliable few-shot examples and prefilled response prefixes
Example prompts for the agent
- Using the anthropic-prompt-engineer skill, create a prompt that extracts contact details from emails into JSON
- Using the anthropic-prompt-engineer skill, improve this prompt: 'Analyze this code and tell me if there are bugs'
- Apply prompt engineering principles from anthropic-prompt-engineer to structure a multi-step workflow
How to install anthropic-prompt-engineer
1Skills CLI (Vercel)
npx skills add jamesrochabrun/skills --skill anthropic-prompt-engineer -a claude-code2Manually: put the files in place
~/.claude/skills/anthropic-prompt-engineer/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/anthropic-prompt-engineer/
1Skills CLI (Vercel)
npx skills add jamesrochabrun/skills --skill anthropic-prompt-engineer -a codex2Manually: put the files in place
.agents/skills/anthropic-prompt-engineer/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add jamesrochabrun/skills --skill anthropic-prompt-engineer -a cursor2Manually: put the files in place
.cursor/skills/anthropic-prompt-engineer/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install jamesrochabrun/skills skills/anthropic-prompt-engineer2Manually: put the files in place
.github/skills/anthropic-prompt-engineer/SKILL.md1Skills CLI (Vercel)
npx skills add jamesrochabrun/skills --skill anthropic-prompt-engineer -a gemini-cli2Platform CLI
gemini skills install https://github.com/jamesrochabrun/skills --path skills/anthropic-prompt-engineerManually: put the files in place
.devin/skills/anthropic-prompt-engineer/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add jamesrochabrun/skills --skill anthropic-prompt-engineer -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about anthropic-prompt-engineer
How to install anthropic-prompt-engineer in Claude Code?
Run npx skills add jamesrochabrun/skills --skill anthropic-prompt-engineer -a claude-code in your terminal.
What does anthropic-prompt-engineer do?
It equips your coding assistant with Anthropic prompt engineering rules to design, evaluate, and fix prompts for Claude models.
What reference docs does this skill provide?
Its references/ folder includes guides for core and advanced techniques, common pitfalls, Claude 4.x best practices, and reusable templates.
Source text
SKILL.md · MIT
--- name: anthropic-prompt-engineer description: Master Anthropic's prompt engineering techniques to generate new prompts or improve existing ones using best practices for Claude AI models. --- # Anthropic Prompt Engineer Master the art and science of prompt engineering with Anthropic's proven techniques. Generate new prompts from scratch or improve existing ones using best practices for Claude AI models (Claude 4.x, Sonnet, Opus, Haiku). ## What This Skill Does Helps you create and optimize prompts for Claude AI using Anthropic's official techniques: - **Generate new prompts** - Build effective prompts from requirements - **Improve existing prompts** - Optimize prompts for better results - **Apply best practices** - Use proven techniques from Anthropic - **Avoid common mistakes** - Prevent hallucinations and unclear outputs - **Optimize for Claude 4.x** - Leverage latest model capabilities - **Structure complex prompts** - Build multi-step, production-ready prompts ## Why Prompt Engineering Matters **Without proper prompting:** - Inconsistent or incorrect outputs - Hallucinations and made-up information - Unclear or verbose responses - Wasted tokens and API calls - Poor performance on complex tasks - Difficulty reproducing results **With engineered prompts:** - Precise, reliable outputs - Factual, grounded responses - Clear, formatted results - Efficient token usage - Excellent complex task performance - Reproducible, production-ready results ## Quick Start ### Generate a New Prompt ``` Using the anthropic-prompt-engineer skill, create a prompt that: - Extracts structured data from customer emails - Returns JSON format - Handles missing information gracefully - Includes 2 examples ``` ### Improve an Existing Prompt ``` Using the anthropic-prompt-engineer skill, improve this prompt: "Analyze this code and tell me if there are bugs" Make it more effective using Anthropic's best practices. ``` ## Core Techniques Summary ### 1. Be Clear and Direct Provide explicit, unambiguous instructions. Claude 4.x excels with precise direction. ### 2. Use XML Tags for Structure Organize prompts with semantic tags like `<instructions>`, `<example>`, `<context>`. ### 3. Chain of Thought (CoT) Ask Claude to think step-by-step for complex reasoning. ### 4. Prefilling Start Claude's response to guide format and style. ### 5. Few-Shot Examples Provide 2-5 diverse examples showing the pattern you want. ### 6. Role Assignment Give Claude a specific role or persona for appropriate context. ## Reference Materials All techniques, examples, and templates are available in the `references/` directory: - **core_techniques.md** - Essential techniques with examples - **advanced_techniques.md** - Advanced methods and optimization - **common_mistakes.md** - Pitfalls to avoid - **claude_4_best_practices.md** - Claude 4.x specific guidance - **prompt_templates.md** - Ready-to-use templates ## Usage Examples ### Example 1: Generate a Data Extraction Prompt Create a prompt that extracts names, emails, and phone numbers from business cards. ### Example 2: Improve a Vague Prompt Transform "Write about machine learning" into a structured, effective prompt. ### Example 3: Debug a Failing Prompt Fix inconsistent outputs by adding structure, examples, and format specification. ## Best Practices Checklist - [ ] Instructions are clear and specific - [ ] Output format is explicitly defined - [ ] Examples align with desired behavior - [ ] XML tags separate different sections - [ ] Context is minimal but sufficient - [ ] Edge cases are addressed - [ ] Tested on diverse inputs - [ ] Token usage is optimized ## Key Principles 1. **Empirical Approach** - Test, measure, iterate 2. **Context as Resource** - Every token counts 3. **Clarity Over Cleverness** - Explicit instructions work best 4. **Examples Teach Best** - Show, don't just tell 5. **Structure Helps** - Organization reduces confusion 6. **Iteration Improves** - Refine based on results ## Summary Master prompt engineering to create: - Reliable and consistent outputs - Production-ready prompts - Token-efficient solutions - Easy to maintain systems Apply Anthropic's proven techniques for best results. --- **Remember:** Good prompts are engineered, not guessed.
© jamesrochabrun · MIT · jamesrochabrun/skills