prompt-engineer
Use this skill when creating, improving, or optimizing prompts for Claude. Applies Anthropic's best practices for prompt engineering including clarity…
от chrispangg★ 131 звезда на GitHub
Установить prompt-engineer в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Prompt Engineering Skill
This skill provides comprehensive guidance for creating effective prompts for Claude based on Anthropic's official best practices. Use this skill whenever working on prompt design, optimization, or troubleshooting.
Overview
Apply proven prompt engineering techniques to create high-quality, reliable prompts that produce consistent, accurate outputs while minimizing hallucinations and implementing appropriate security measures.
When to Use This Skill
Trigger this skill when users request:
- Help writing a prompt for a specific task
- Improving an existing prompt that isn't performing well
- Making Claude more consistent, accurate, or secure
- Creating system prompts for specialized roles
- Implementing specific techniques (chain-of-thought, multishot, XML tags)
- Reducing hallucinations or errors in outputs
- Debugging prompt performance issues
Workflow
Step 1: Understand Requirements
Ask clarifying questions to understand:
- Task goal: What should the prompt accomplish?
- Use case: One-time use, API integration, or production system?
- Constraints: Output format, length, style, tone requirements
- Quality needs: Consistency, accuracy, security priorities
- Complexity: Simple task or multi-step workflow?
Step 2: Identify Applicable Techniques
Based on requirements, determine which techniques to apply:
Core techniques (for all prompts):
- Be clear and direct
- Use XML tags for structure
Specialized techniques:
- Role-specific expertise → System prompts
- Complex reasoning → Chain of thought
- Format consistency → Multishot prompting
- Multi-step tasks → Prompt chaining
- Long documents → Long context tips
- Deep analysis → Extended thinking
- Factual accuracy → Hallucination reduction
- Output consistency → Consistency techniques
- Security concerns → Jailbreak mitigation
Step 3: Load Relevant References
Read the appropriate reference file(s) based on techniques needed:
For basic prompt improvement:
Read references/core_prompting.md
Covers: clarity, system prompts, XML tags
For complex tasks:
Read references/advanced_patterns.md
Covers: chain of thought, multishot, chaining, long context, extended thinking
For specific quality issues:
Read references/quality_improvement.md
Covers: hallucinations, consistency, security
Step 4: Design the Prompt
Apply techniques from references to create the prompt structure:
Basic Template:
[System prompt - optional, for role assignment]
<context>
Relevant background information
</context>
<instructions>
Clear, specific task instructions
Use numbered steps for multi-step tasks
</instructions>
<examples>
<example>
<input>Sample input</input>
<output>Expected output</output>
</example>
[2-4 more examples if using multishot]
</examples>
<output_format>
Specify exact format (JSON, XML, markdown, etc.)
</output_format>
[Actual task/question]
Key Design Principles:
- Clarity: Be explicit and specific
- Structure: Use XML tags to organize
- Examples: Provide 3-5 concrete examples for complex formats
- Context: Give relevant background
- Constraints: Specify output requirements clearly
Step 5: Add Quality Controls
Based on quality needs, add appropriate safeguards:
For factual accuracy:
- Grant permission to say "I don't know"
- Request quote extraction before analysis
- Require citations for claims
- Limit to provided information sources
For consistency:
- Provide explicit format specifications
- Use response prefilling
- Include diverse examples
- Consider prompt chaining
For security:
- Add harmlessness screening
- Establish clear ethical boundaries
- Implement input validation
- Use layered protection
Step 6: Optimize and Test
Optimization checklist:
- Could someone with minimal context follow the instructions?
- Are all terms and requirements clearly defined?
- Is the desired output format explicitly specified?
- Are examples diverse and relevant?
- Are XML tags used consistently?
- Is the prompt as concise as possible while remaining clear?
Testing approach:
- Run prompt multiple times with varied inputs
- Check consistency across runs
- Verify outputs match expected format
- Test edge cases
- Validate quality controls work
Step 7: Iterate Based on Results
Debugging process:
- Identify failure points
- Review relevant reference material
- Apply appropriate techniques
- Test and measure improvement
- Repeat until satisfactory
Common Issues and Solutions:
| Issue | Solution | Reference |
|---|---|---|
| Inconsistent format | Add examples, use prefilling | quality_improvement.md |
| Hallucinations | Add uncertainty permission, quote grounding | quality_improvement.md |
| Missing steps | Break into subtasks, use chaining | advanced_patterns.md |
| Wrong ton |
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/advanced_patterns.md
- references/core_prompting.md
- references/quality_improvement.md
FAQ
Что делает скилл prompt-engineer?
Use this skill when creating, improving, or optimizing prompts for Claude. Applies Anthropic's best practices for prompt engineering including clarity, structure, consistency, hallucination reduction, and security. Useful when users request help with writing prompts, improving existing prompts, reducing errors, increasing consistency, or implementing specific techniques like chain-of-thought, multishot prompting, or XML structuring.
Как установить скилл prompt-engineer?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл prompt-engineer запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
AnthropicGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
academy-guide
AnthropicStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
internal-comms
AnthropicA set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
skill-development
AnthropicThis skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…