Loading...
Loading...
Expert prompt optimization for LLMs and AI systems. Use PROACTIVELY when building AI features, improving agent performance, or crafting system prompts. Masters prompt patterns and techniques.
npx skill4agent add erichowens/some_claude_skills prompt-engineerUser: "My chatbot gives inconsistent answers about our refund policy"
Prompt Engineer:
1. Analyze current prompt structure
2. Identify ambiguity and edge cases
3. Apply constraint engineering
4. Add few-shot examples
5. Test with adversarial inputs
6. Measure improvement| Technique | When to Use | Expected Improvement |
|---|---|---|
| Chain-of-Thought | Complex reasoning | 20-40% accuracy |
| Few-Shot Examples | Format consistency | 30-50% reliability |
| Constraint Engineering | Edge case handling | 50%+ consistency |
| Role Prompting | Domain expertise | 15-25% quality |
| Self-Consistency | Critical decisions | 10-20% accuracy |
C - Context: What background does the model need?
L - Limits: What constraints apply?
E - Examples: What does good output look like?
A - Action: What specific task to perform?
R - Review: How to verify correctness?You are [ROLE] with expertise in [DOMAIN].
## Your Task
[CLEAR, SPECIFIC INSTRUCTION]
## Constraints
- [CONSTRAINT 1]
- [CONSTRAINT 2]
## Output Format
[EXACT FORMAT SPECIFICATION]
## Examples
Input: [EXAMPLE INPUT]
Output: [EXAMPLE OUTPUT]Think through this step-by-step:
1. First, identify [ASPECT 1]
2. Then, analyze [ASPECT 2]
3. Consider [EDGE CASES]
4. Finally, synthesize into [OUTPUT]
Show your reasoning before the final answer.| Phase | Activities | Tools |
|---|---|---|
| Analyze | Review current prompts, identify issues | Read, pattern analysis |
| Hypothesize | Form improvement hypotheses | Sequential thinking |
| Implement | Apply prompt engineering techniques | Write, Edit |
| Test | Validate with diverse inputs | Manual testing |
| Measure | Quantify improvement | A/B comparison |
| Iterate | Refine based on results | Repeat cycle |
Problem: Model fabricates information
Fix: Add "Only use information provided. Say 'I don't know' if uncertain."Problem: Model produces too much text
Fix: Add "Be concise. Maximum 3 sentences." + format constraintsProblem: Output doesn't match required format
Fix: Add explicit examples + "Follow this exact format:"Problem: Model loses track in long conversations
Fix: Add periodic context summaries + clear role reminders| Metric | How to Measure | Target |
|---|---|---|
| Consistency | Same input, same output quality | >90% |
| Accuracy | Correct information | >95% |
| Format Compliance | Follows specified format | >98% |
| Latency | Time to first token | <2s |
| Token Efficiency | Output tokens per task | -20% waste |