| name | prompt-engineer |
| description | Optimize system prompts for Claude Code agents using proven prompt engineering patterns. Use when users request prompt improvement, optimization, or refinement for agent workflows, tool instructions, or system behaviors. |
| license | MIT |
| metadata | null |
| version | 1.0.0 |
| model | claude-sonnet-4-5 |
Prompt Optimizer
Optimizes system prompts by applying research-backed prompt engineering patterns. Human-in-the-loop phases: understand, plan, propose changes, receive approval, then integrate.
Purpose and Success Criteria
A well-optimized prompt achieves:
- Behavioral clarity: Agent knows exactly what to do in common cases and edge cases
- Appropriate scope: Complex tasks get decomposition; simple tasks don't trigger overthinking
- Grounded changes: Every modification traces to a specific pattern with documented impact
Optimization is complete when:
- Every change has explicit pattern attribution from the reference document
- No section contradicts another section
- The prompt matches its operating context (tool-use vs. conversational, token constraints)
- Human has approved both section-level changes and full integration
When to Use This Skill
Use when the user provides a prompt and wants it improved, refined, or reviewed for best practices.
Do NOT use for:
- Writing prompts from scratch (different skill)
- Prompts that are already working well and user just wants validation
- Non-prompt content (documentation, code, etc.)
Required Resources
Before ANY analysis, read the appropriate pattern reference(s):
Single-Turn Reference (Always Read)
Read references/prompt-engineering-single-turn.md
Contains: Technique Selection Guide table, Quick Reference principles, domain-organized techniques with citations, Anti-Patterns section.
Multi-Turn Reference (Conditional)
Read references/prompt-engineering-multi-turn.md
Read ONLY when the prompt involves:
- Multi-turn flows (iterative refinement, conversation chains)
- Multi-agent / sub-agent orchestration
Skip for:
- Static system prompts executed in a single LLM call
- Tool instructions or one-shot prompts
Workflow Reference
Read references/workflow.md
Contains: Detailed Phase 0-4 workflows, visual card template, completion checkpoint.
Quick Process
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 1. READ THE REFERENCE(S) โ
โ - Always: references/prompt-engineering-single-turn.md โ
โ - If multi-turn/multi-agent: also read multi-turn reference โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ 2. UNDERSTAND THE PROMPT (Phase 1) โ
โ - Operating context (single-shot? tool-use? constraints?) โ
โ - Current state (working? unclear? missing?) โ
โ - Document specific problems with quoted prompt text โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ 3. PLAN WITH VISUAL CARDS (Phase 2) โ
โ - Present each change as a visual card with: โ
โ SCOPE โ PROBLEM โ TECHNIQUE โ BEFORE/AFTER โ
โ - Quote trigger conditions from reference โ
โ - โ ๏ธ WAIT FOR USER APPROVAL before proceeding โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ 4. EXECUTE APPROVED CHANGES (Phase 3) โ
โ - Apply the BEFORE โ AFTER transformations โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ 5. INTEGRATE AND VERIFY QUALITY (Phase 4) โ
โ - Check cross-section coherence โ
โ - Final anti-pattern check โ
โ - Present complete optimized prompt โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Triage (Phase 0)
Simple prompts (use lightweight process):
- Under 20 lines
- Single clear purpose
- No conditional logic
Complex prompts (use full process):
- Multiple sections serving different functions
- Conditional behaviors or rule hierarchies
- Tool orchestration or multi-step workflows
Core Quality Principles
- Quote before deciding: Every technique selection must quote the reference's trigger condition.
- Open verification questions: Ask "What behavior will this produce?" not "Is this correct?"
- Approval happens once, upfront: The visual card format in Phase 2 shows full impact.
- Preserve what works: Optimization means improving problems, not rewriting everything.
Completion Checkpoint
Before presenting the final prompt, verify:
References