Skill detail

prompt-engineer

Writes, refactors, and evaluates LLM prompts, covering prompt patterns, optimization for token efficiency, evaluation frameworks, structured outputs, system prompts, and context management.

Why we recommend it: Explicitly covers prompt optimization, token efficiency, and context management — core token optimization work.

MatchDirectRecommended for Token Optimization
Sourcejeffallan/​claude-skillsExternal source
Reported installs5,250Popularity signal only

Inspect before use

Read the source instructions and check the requirements before you install this skill.

Saved source preview

SKILL.md

The saved excerpt is a snapshot from when this skill was listed. The external source remains the complete and most current version.

---
name: prompt-engineer
description: Writes, 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, implementing chain-of-thought or few-shot learning, creating system prompts with personas and guardrails, building JSON/function-calling schemas, or developing prompt evaluation frameworks to measure and improve model performance.
license: MIT
metadata:
  author: https://github.com/Jeffallan
  company: https://synergetic.solutions
  version: "1.2.0"
  domain: data-ml
  triggers: prompt engineering, prompt optimization, chain-of-thought, few-shot learning, prompt testing, LLM prompts, prompt evaluation, system prompts, structured outputs, prompt design, context management, lost-in-the-middle, context degradation, token optimization, attention budget
  role: expert
  scope: design
  output-format: document
  related-skills: test-master, rag-architect, debugging-wizard
---

# Prompt Engineer

Expert prompt engineer specializing in designing, optimizing, and evaluating prompts that maximize LLM performance across diverse use cases.

## When to Use This Skill

- Designing prompts for new LLM applications
- Optimizing existing prompts for better accuracy or efficiency
- Implementing chain-of-thought or few-shot learning
- Creating system prompts with personas and guardrails
- Building structured output schemas (JSON mode, function calling)
- Developing prompt evaluation and testing frameworks
- Debugging inconsistent or poor-quality LLM outputs
- Migrating prompts between different models or providers

## Core Workflow

1. **Understand requirements** — Define task, success criteria, constraints, and edge cases
2. **Design initial prompt** — Choose pattern (zero-shot, few-shot, CoT), write clear instructions
3. **Test and evaluate** — Run diverse test cases, measure quality metrics
   - **Validation checkpoint:** If accuracy < 80% on the test set, identify failure patterns before iterating (e.g., ambiguous instructions, missing examples, edge case gaps)
4. **Iterate and optimize** — Make one change at a time; refine based on failures, reduce tokens, improve reliability
5. **Document and deploy** — Version prompts, document behavior, monitor production

## Reference Guide

Load detailed guidance based on context:

| Topic | Reference | Load When |
|-------|-----------|-----------|
| Prompt Patterns | `references/prompt-patterns.md` | Zero-shot, few-shot, chain-of-thought, ReAct |
| Optimization | `references/prompt-optimization.md` | Iterative refinement, A/B testing, token reduction |
| Evaluation | `references/evaluation-frameworks.md` | Metrics, test suites, automated evaluation |
| Structured Outputs | `references/structured-outputs.md` | JSON mode, function calling, schema design |
| System Prompts | `references/system-prompts.md` | Persona design, guardrails, injection defense |
| Context Management | `references/context-management.md` | Attention budget, degradation patterns, context optimization |

## Prompt Examples

### Zero-shot vs. Few-shot

**Zero-shot (baseline):**
```
Classify the sentiment of the following review as Positive, Negative, or Neutral.

Review: {{review}}
Sentiment:
```

**Few-shot (improved reliability):**
```
Classify the sentiment of the following review as Positive, Negative, or Neutral.

Review: "The battery life is incredible, lasts all day."
Sentiment: Positive

Review: "Stopped working after two weeks. Very disappointed."
Sentiment: Negative

Review: "It arrived on time and matches the description."
Sentiment: Neutral

Review: {{review}}
Sentiment:
```

### Before/After Optimization

**Before (vague, inconsistent outputs):**
```
Summarize this document.

{{document}}
```

**After (structured, token-efficient):**
```
Summarize the document below in exactly 3 bullet points. Each bullet must
Read the full source on GitHub (opens external page)
Context

Related work