prompt-engineer
Create, improve, or optimize prompts using best practices.
What this skill does
# Prompt Engineering Skill
This skill provides comprehensive guidance for creating effective prompts for language models using proven 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 outputs 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:**
1. **Clarity**: Be explicit and specific
2. **Structure**: Use XML tags to organize
3. **Examples**: Provide 3-5 concrete examples for complex formats
4. **Context**: Give relevant background
5. **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:**
1. Identify failure points
2. Review relevant reference material
3. Apply appropriate techniques
4. Test and measure improvement
5. 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 tone | Add role to system prompt | core_prompting.md |
| Misunderstands task | Add clarity, provide context | core_prompting.md |
| Complex reasoning fails | Add chain of thought | advanced_patterns.md |
## Important Principles
**Progressive Disclosure**
Start with core techniques and add advanced patterns only when needed. Don't over-engineer simple prompts.
**Documentation**
When delivering prompts, explain which techniques were used and why. This helps users understand and maintain them.
**Validation**
Always validate critical outputs, especially for high-stakes applications. No prompting technique eliminates all errors.
**Experimentation**
Prompt engineering is iterative. Small changes can have significant impacts. Test variations and measure results.
## Quick Reference Guide
### Technique Selection Matrix
| User Need | Primary Technique | Reference File |
| ----------------------------- | ----------------------- | ---------------------- |
| Better clarity | Be clear and direct | core_prompting.md |
| Domain expertise | System prompts | core_prompting.md |
| Organized structure | XML tags | core_prompting.md |
| Complex reasoning | Chain of thought | advanced_patterns.md |
| Format consistency | Multishot prompting | advanced_patterns.md |
| Multi-step process | Prompt chaining | advanced_patterns.md |
| Long documents (100K+ tokens) | Long context tips | advanced_patterns.md |
| Deep analysis | Extended thinking | advanced_patterns.md |
| Reduce false information | Hallucination reduction | quality_improvement.md |
| Consistent outputs | Consistency techniques | quality_improvement.md |
| Security/safety | Jailbreak mitigation | quality_improvement.md |
### When to Combine Techniques
- **Structured analysis**: XML tags + Chain of thought
- **Consistent formatting**: Multishot + Response prefilling
- **Complex workflows**: Prompt chaining + XML tags
- **Factual reports**: Quote grounding + Citation verification
- **Production systems**: System prompts + Input validation + Consistency techniques
## Resources
This skill includes three comprehensive reference files:
### references/core_prompting.md
Essential techniques for all prompts:
- Being clear and direct
- System prompts and role assignment
- Using XML tags effectively
### references/advanced_patterns.md
Sophisticated techniques for complex tasks:
- Chain of thought prompting
- Multishot prompting
- Prompt chaining
- Long context handling
- Extended thinking
### reRelated 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.