Prompt Mastery
БесплатноБез исполняемых скриптовНе проверенAdvanced LLM prompt engineering expertise for crafting highly effective prompts, system messages, and tool descriptions with Claude-specific techniques
от majiayu000★ 31 звезда на GitHubОб этом скилле
Prompt Mastery: Advanced LLM Prompt Engineering Skill
Purpose: This skill provides comprehensive prompt engineering expertise, distilling cutting-edge research, best practices, and battle-tested techniques for crafting highly effective prompts for Large Language Models, with special emphasis on Claude.
When to invoke: Use this skill when creating system prompts, tool descriptions, agent instructions, or any situation requiring sophisticated prompt design. Invoke before writing any significant prompts to leverage advanced techniques.
🎯 Core Principles
The Fundamentals (Never Violate These)
- Clarity Over Cleverness: Clear, explicit instructions consistently outperform clever wordplay
- Specificity Beats Vagueness: Precise requirements produce better results than general requests
- Context is Currency: Provide enough background for the model to understand the task deeply
- Structure Reduces Ambiguity: Well-structured prompts eliminate confusion
- Iteration is Essential: First prompts rarely achieve perfection—treat prompting as iterative
The 2025 Paradigm Shift
Modern prompt engineering isn't about asking questions—it's about designing the question space that guides models toward accurate, relevant, and actionable outputs. Context engineering enables you to shape not just what you ask, but how the model interprets and responds.
🔷 Claude-Specific Techniques
Official Anthropic Best Practices (2025)
1. Be Clear and Explicit
Claude 4 models (Sonnet 4.5, Sonnet 4, Haiku 4.5, Opus 4.1, Opus 4) respond best to clear, explicit instructions. If you want "above and beyond" behavior, explicitly request it—don't assume the model will infer it.
<!-- GOOD: Explicit and clear -->
<instruction>
Analyze this code for security vulnerabilities. Provide:
1. A severity rating (Critical/High/Medium/Low)
2. Specific line numbers where issues occur
3. Concrete remediation steps with code examples
4. Explanation of the attack vector
</instruction>
<!-- BAD: Vague and implicit -->
<instruction>
Look at this code and tell me if there are any problems.
</instruction>
2. Provide Context and Motivation
Explaining why a behavior is important helps Claude understand your goals and deliver more targeted responses.
<context>
We're building a medical diagnosis system where accuracy is critical.
False positives can cause unnecessary anxiety, while false negatives
could delay treatment. We need responses that:
- Cite specific medical literature when making claims
- Express uncertainty appropriately
- Never provide definitive diagnoses (legal requirement)
</context>
3. Use XML Tags for Structure
Claude was trained with XML tags, so they provide exceptional control over output structure and interpretation.
<task>
Analyze the following customer feedback and extract insights.
</task>
<feedback>
[Customer feedback text here]
</feedback>
<output_format>
- sentiment: positive/negative/neutral
- key_themes: list of main topics
- action_items: specific recommendations
- urgency: high/medium/low
</output_format>
<guidelines>
- Focus on actionable insights
- Distinguish between individual complaints and systemic issues
- Flag any mentions of competitors
</guidelines>
4. Leverage Thinking Capabilities
Claude 4 offers thinking capabilities for reflection after tool use or complex multi-step reasoning. Guide initial or interleaved thinking for better results.
<thinking_instructions>
Before answering:
1. Identify what type of problem this is (optimization, debugging, architecture)
2. Consider edge cases that might break the obvious solution
3. Evaluate tradeoffs between performance, maintainability, and complexity
4. Only then propose your approach
</thinking_instructions>
5. Instruction Placement Matters
Claude follows instructions in human messages (user prompts) better than those in the system message. Place critical requirements in the user message.
# BETTER: Critical instructions in user message
messages = [
{"role": "system", "content": "You are a helpful coding assistant."},
{"role": "user", "content": """
Write a Python function to calculate Fibonacci numbers.
CRITICAL REQUIREMENTS:
- Use memoization for efficiency
- Include type hints
- Add comprehensive docstrings
- Handle edge cases (n=0, n=1, negative n)
"""}
]
# WORSE: Critical instructions only in system message
messages = [
{"role": "system", "content": """
You are a helpful coding assistant.
Always use memoization, type hints, docstrings, and handle edge cases.
"""},
{"role": "user", "content": "Write a Python function to calculate Fibonacci numbers."}
]
6. Prefill Claude's Response (Powerful Technique!)
Guide Claude by starting the Assistant message with desired initial text. This skips preambles, enforces formats, and increase
Установить Prompt Mastery в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл Prompt Mastery?
Advanced LLM prompt engineering expertise for crafting highly effective prompts, system messages, and tool descriptions with Claude-specific techniques
Как установить скилл Prompt Mastery?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Prompt Mastery запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic