$npx -y skills add Jeffallan/claude-skills --skill prompt-engineerWrites, refactors, and evaluates prompts for LLMs — generating optimized prompt templates, structured output schemas, evaluation rubrics, and test suites. Use when designing prompts for new LLM applications, refactoring existing prompts for better accuracy or token efficiency, im
| 1 | # Prompt Engineer |
| 2 | |
| 3 | Expert prompt engineer specializing in designing, optimizing, and evaluating prompts that maximize LLM performance across diverse use cases. |
| 4 | |
| 5 | ## When to Use This Skill |
| 6 | |
| 7 | - Designing prompts for new LLM applications |
| 8 | - Optimizing existing prompts for better accuracy or efficiency |
| 9 | - Implementing chain-of-thought or few-shot learning |
| 10 | - Creating system prompts with personas and guardrails |
| 11 | - Building structured output schemas (JSON mode, function calling) |
| 12 | - Developing prompt evaluation and testing frameworks |
| 13 | - Debugging inconsistent or poor-quality LLM outputs |
| 14 | - Migrating prompts between different models or providers |
| 15 | |
| 16 | ## Core Workflow |
| 17 | |
| 18 | 1. **Understand requirements** — Define task, success criteria, constraints, and edge cases |
| 19 | 2. **Design initial prompt** — Choose pattern (zero-shot, few-shot, CoT), write clear instructions |
| 20 | 3. **Test and evaluate** — Run diverse test cases, measure quality metrics |
| 21 | - **Validation checkpoint:** If accuracy < 80% on the test set, identify failure patterns before iterating (e.g., ambiguous instructions, missing examples, edge case gaps) |
| 22 | 4. **Iterate and optimize** — Make one change at a time; refine based on failures, reduce tokens, improve reliability |
| 23 | 5. **Document and deploy** — Version prompts, document behavior, monitor production |
| 24 | |
| 25 | ## Reference Guide |
| 26 | |
| 27 | Load detailed guidance based on context: |
| 28 | |
| 29 | | Topic | Reference | Load When | |
| 30 | |-------|-----------|-----------| |
| 31 | | Prompt Patterns | `references/prompt-patterns.md` | Zero-shot, few-shot, chain-of-thought, ReAct | |
| 32 | | Optimization | `references/prompt-optimization.md` | Iterative refinement, A/B testing, token reduction | |
| 33 | | Evaluation | `references/evaluation-frameworks.md` | Metrics, test suites, automated evaluation | |
| 34 | | Structured Outputs | `references/structured-outputs.md` | JSON mode, function calling, schema design | |
| 35 | | System Prompts | `references/system-prompts.md` | Persona design, guardrails, injection defense | |
| 36 | | Context Management | `references/context-management.md` | Attention budget, degradation patterns, context optimization | |
| 37 | |
| 38 | ## Prompt Examples |
| 39 | |
| 40 | ### Zero-shot vs. Few-shot |
| 41 | |
| 42 | **Zero-shot (baseline):** |
| 43 | ``` |
| 44 | Classify the sentiment of the following review as Positive, Negative, or Neutral. |
| 45 | |
| 46 | Review: {{review}} |
| 47 | Sentiment: |
| 48 | ``` |
| 49 | |
| 50 | **Few-shot (improved reliability):** |
| 51 | ``` |
| 52 | Classify the sentiment of the following review as Positive, Negative, or Neutral. |
| 53 | |
| 54 | Review: "The battery life is incredible, lasts all day." |
| 55 | Sentiment: Positive |
| 56 | |
| 57 | Review: "Stopped working after two weeks. Very disappointed." |
| 58 | Sentiment: Negative |
| 59 | |
| 60 | Review: "It arrived on time and matches the description." |
| 61 | Sentiment: Neutral |
| 62 | |
| 63 | Review: {{review}} |
| 64 | Sentiment: |
| 65 | ``` |
| 66 | |
| 67 | ### Before/After Optimization |
| 68 | |
| 69 | **Before (vague, inconsistent outputs):** |
| 70 | ``` |
| 71 | Summarize this document. |
| 72 | |
| 73 | {{document}} |
| 74 | ``` |
| 75 | |
| 76 | **After (structured, token-efficient):** |
| 77 | ``` |
| 78 | Summarize the document below in exactly 3 bullet points. Each bullet must be one sentence and start with an action verb. Do not include opinions or information not present in the document. |
| 79 | |
| 80 | Document: |
| 81 | {{document}} |
| 82 | |
| 83 | Summary: |
| 84 | ``` |
| 85 | |
| 86 | ## Constraints |
| 87 | |
| 88 | ### MUST DO |
| 89 | - Test prompts with diverse, realistic inputs including edge cases |
| 90 | - Measure performance with quantitative metrics (accuracy, consistency) |
| 91 | - Version prompts and track changes systematically |
| 92 | - Document expected behavior and known limitations |
| 93 | - Use few-shot examples that match target distribution |
| 94 | - Validate structured outputs against schemas |
| 95 | - Consider token costs and latency in design |
| 96 | - Test across model versions before production deployment |
| 97 | |
| 98 | ### MUST NOT DO |
| 99 | - Deploy prompts without systematic evaluation on test cases |
| 100 | - Use few-shot examples that contradict instructions |
| 101 | - Ignore model-specific capabilities and limitations |
| 102 | - Skip edge case testing (empty inputs, unusual formats) |
| 103 | - Make multiple changes simultaneously when debugging |
| 104 | - Hardcode sensitive data in prompts or examples |
| 105 | - Assume prompts transfer perfectly between models |
| 106 | - Neglect monitor |