prompt-engineering
Use this skill when creating, optimizing, or improving prompts for large language models. Applies when users need help designing effective prompts, selecting appropriate prompting techniques, or troubleshooting prompt performance. Provides expert guidance through conversational consulting to build prompts using research-backed best practices and proven patterns.
What this skill does
# Prompt Engineering
## Overview
This skill provides expert guidance for creating effective prompts for large language models. Act as a conversational consultant to understand the user's goal, analyze task requirements, recommend appropriate techniques, and collaboratively build optimized prompts.
The skill encodes research findings from academic papers and practical implementations into actionable workflows. Guide users through a structured process to create prompts that are clear, effective, and cost-efficient.
## When to Use This Skill
Invoke this skill when:
- User asks for help creating a prompt
- User wants to improve or optimize an existing prompt
- User needs guidance on prompting techniques or best practices
- User is troubleshooting poor LLM performance
- User asks questions like "how should I prompt for X?"
## Core Workflow
Follow this four-phase conversational workflow to build effective prompts:
### Phase 1: Intake - Understand the Goal
Begin by understanding what the user is trying to accomplish. Ask targeted questions to gather essential context:
**Key Questions**:
1. What is the desired outcome? (What should the LLM produce?)
2. What is the input format? (User queries, documents, data, etc.)
3. What constraints exist? (Length, format, style, tone)
4. What model will be used? (Affects capability assumptions)
5. What does success look like? (How to evaluate quality)
**Approach**:
- Ask 2-3 focused questions at a time (avoid overwhelming)
- Listen for implicit requirements the user may not state
- Clarify ambiguous terms or expectations
- Understand the user's technical level (adjust explanations accordingly)
**Output from Phase 1**: Clear statement of objective and constraints.
**Example**:
```
User: "I need a prompt for analyzing customer feedback"
Ask:
- What specific insights do you want extracted? (Sentiment, themes, issues, etc.)
- What format should the output be in?
- How much feedback will you provide at once? (Single review vs batch)
- Is there a specific classification or framework to follow?
```
---
### Phase 2: Analysis - Assess Task Complexity
Analyze the task to determine appropriate techniques. Consider:
**Complexity Dimensions**:
**Simple Tasks** (Zero-shot candidates):
- Well-defined, common operations (summarize, classify, extract)
- Model has strong base knowledge
- No special format requirements
- Examples: Basic summarization, simple classification, fact extraction
**Medium Complexity** (Few-shot or CoT candidates):
- Specific format or style needed
- Domain conventions to follow
- Multi-step reasoning required
- Examples: Structured extraction, styled writing, calculation problems
**High Complexity** (Advanced techniques):
- Multiple reasoning paths needed
- Strategic decision-making
- High accuracy requirements
- Exploration of alternatives
- Examples: Complex analysis, strategic planning, critical decisions
**Key Factors**:
1. **Reasoning depth**: Single step vs multi-step vs exploratory
2. **Format specificity**: Any format vs specific structure
3. **Domain knowledge**: General vs specialized
4. **Accuracy requirements**: Good enough vs must be perfect
5. **Consistency needs**: One-off vs repeatable process
**Output from Phase 2**: Classification of task complexity and candidate techniques.
---
### Phase 3: Recommendation - Select Techniques
Based on the analysis, recommend specific techniques with rationale. Explain the trade-offs.
**Use the Decision Framework**:
| If the task is... | Recommend... | Because... |
|-------------------|--------------|------------|
| Simple, well-defined | Zero-shot | Most efficient, model knows the pattern |
| Needs specific format | Few-shot (2-3 examples) | Examples demonstrate structure |
| Multi-step reasoning | Chain-of-thought | Makes reasoning explicit and debuggable |
| High-stakes accuracy | Self-consistency + CoT | Multiple paths reduce error rate |
| Strategic/exploratory | Tree-of-thought | Explores alternatives systematically |
| Complex multi-stage | Least-to-most | Breaks into manageable sub-problems |
| Needs improvement | Self-refine | Iterative refinement improves quality |
**Always consider**:
- **Cost**: Token usage implications
- **Latency**: Response time requirements
- **Consistency**: Repeatability needs
**Explain the recommendation**: Don't just name the technique, explain why it fits this specific use case.
**Output from Phase 3**: Recommended technique(s) with clear rationale.
**Example**:
```
"For customer feedback analysis with structured output, recommend few-shot prompting because:
1. You need consistent JSON format (examples demonstrate structure)
2. Domain-specific categories (examples show classification style)
3. Medium complexity doesn't require heavy CoT
4. Cost-efficient for production use
Would use 3 examples showing: typical feedback, edge case (missing info), and complex feedback with multiple issues."
```
---
### Phase 4: Construction - Build the Prompt
Collaboratively build the prompt, incorporating best practices. Walk through each component and explain the choices.
**Core Components to Address**:
1. **Role/Persona** (if beneficial):
- Specify expertise level and domain
- Set behavioral expectations
- Example: "You are a data analyst specializing in customer insights"
2. **Instructions**:
- Clear, concise task description
- Positive guidance (what to do, not what to avoid)
- Explicit edge case handling
3. **Structure**:
- Separate instructions from content with delimiters
- Use triple quotes, XML tags, or clear markdown sections
- Example: `Content: """[user input]"""`
4. **Examples** (if using few-shot):
- 2-3 representative examples
- Include edge cases
- Match actual use case format
5. **Output Format**:
- Specify if format matters
- Provide templates or schemas
- Example: "Respond in JSON: {sentiment: ..., themes: [...]}"
6. **Constraints**:
- Length limits
- Required inclusions
- Prohibited content
**Build Iteratively**:
- Start with core instruction
- Add structure and examples
- Refine based on requirements
- Explain each addition
**Show the prompt**: Present the complete prompt in a code block for easy copying.
**Output from Phase 4**: Complete, ready-to-use prompt with explanation of design choices.
---
## Reference Materials
This skill includes comprehensive reference documentation. Load these as needed based on the conversation:
### references/techniques-guide.md
Deep dive on 10+ prompting techniques with examples, decision criteria, and pitfalls.
**Load when**:
- User wants to understand a specific technique in depth
- Need detailed examples of technique implementation
- Troubleshooting technique selection
- User asks "what is chain-of-thought?" or similar
**Contains**:
- Zero-shot, few-shot, chain-of-thought, self-consistency, tree-of-thought
- Generated knowledge, least-to-most, self-refine, directional-stimulus
- Role/persona prompting
- Technique combination strategies
- Cost-benefit analysis
---
### references/best-practices.md
Structural and strategic best practices for prompt optimization.
**Load when**:
- User asks about prompt optimization
- Need to explain structural choices
- Troubleshooting prompt quality issues
- User wants to understand "why" behind recommendations
**Contains**:
- Core principles (clarity, positive guidance, separation, condensing)
- Role and system message design
- Context organization patterns
- The 6-step optimization process
- Common anti-patterns
- Quality checklist
---
### references/pattern-library.md
Ready-to-adapt templates for common scenarios.
**Load when**:
- User wants a quick-start template
- Looking for specific pattern examples
- Need concrete format examples
- Showing implementation of recommended technique
**Contains**:
- Zero-shot patterns (classification, extraction, transformation)
- Few-shot patterns (format learning, edge cases, conversational)
- Chain-of-thRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.