Prompt Engineer
Design, refactor, and evaluate LLM prompts.
When to use
New LLM-app prompts; refactoring prompts for accuracy or token efficiency; chain-of-thought / few-shot; system prompts with personas + guardrails; JSON / function-calling schemas; prompt evaluation frameworks.
Core workflow
- Clarify task — define the exact output, success criteria, and failure modes.
- Draft prompt — role/persona, task, constraints, output format; place key instructions to avoid lost-in-the-middle.
- Add structure — few-shot examples, CoT when reasoning helps, JSON schema for structured output.
- Guardrails — refusal/scope limits, input handling, injection resistance.
- Evaluate — test suite + rubric; measure accuracy/consistency; iterate on failures.
Key practices
- Be explicit and specific; state format and constraints; show 1-3 high-quality few-shot examples.
- Chain-of-thought only where reasoning improves results; structured output for machine consumption.
- Put critical instructions at the start and end (context degrades in the middle of long prompts).
- Manage context/attention budget: trim irrelevant context, summarize long history.
- Define an eval set with rubric scoring before tuning; track regressions.
- Defend against prompt injection: delimit user content, never let it override system rules.
Constraints
MUST: define success criteria + an eval set first; explicit output format; place key instructions at edges of long context; guardrails for scope + injection; measure before/after when optimizing.
MUST NOT: vague instructions; CoT where it adds noise; bury critical rules mid-prompt; let user input override system instructions; over-stuff context (attention dilution); claim improvement without evaluation.
Output
- Optimized prompt template (system + user). 2. Output schema (JSON/function-calling) if structured. 3. Few-shot examples. 4. Eval rubric + test cases. 5. Brief note on design + token trade-offs.
Knowledge
Prompt engineering, system prompts, personas/guardrails, chain-of-thought, few-shot learning, structured outputs (JSON/function calling), lost-in-the-middle, context/attention budget, prompt injection defense, eval rubrics, token optimization.
1---2name: prompt-engineer3description: "Use when writing, refactoring, or evaluating LLM prompts — prompt templates, structured output schemas, evaluation rubrics, test suites, chain-of-thought, few-shot, system prompts with personas/guardrails, JSON/function-calling schemas. Triggers: prompt engineering, prompt optimization, chain-of-thought, few-shot learning, prompt testing, LLM prompts, prompt evaluation, system prompts, structured outputs, token optimization."4version: 1.0.05license: MIT6tags: [prompt-engineering, llm, chain-of-thought, few-shot, structured-output, evaluation, system-prompts, token-optimization]7source: https://github.com/jeffallan/claude-skills/tree/main/skills/prompt-engineer8derived_from: awesomeclaude9metadata:10 source: https://skillmd.com/skills/aashutosh396/prompt-engineer11---1213# Prompt Engineer1415Design, refactor, and evaluate LLM prompts.1617## When to use1819New LLM-app prompts; refactoring prompts for accuracy or token efficiency; chain-of-thought / few-shot; system prompts with personas + guardrails; JSON / function-calling schemas; prompt evaluation frameworks.2021## Core workflow22231. **Clarify task** — define the exact output, success criteria, and failure modes.242. **Draft prompt** — role/persona, task, constraints, output format; place key instructions to avoid lost-in-the-middle.253. **Add structure** — few-shot examples, CoT when reasoning helps, JSON schema for structured output.264. **Guardrails** — refusal/scope limits, input handling, injection resistance.275. **Evaluate** — test suite + rubric; measure accuracy/consistency; iterate on failures.2829## Key practices3031- Be explicit and specific; state format and constraints; show 1-3 high-quality few-shot examples.32- Chain-of-thought only where reasoning improves results; structured output for machine consumption.33- Put critical instructions at the start and end (context degrades in the middle of long prompts).34- Manage context/attention budget: trim irrelevant context, summarize long history.35- Define an eval set with rubric scoring before tuning; track regressions.36- Defend against prompt injection: delimit user content, never let it override system rules.3738## Constraints3940MUST: define success criteria + an eval set first; explicit output format; place key instructions at edges of long context; guardrails for scope + injection; measure before/after when optimizing.41MUST NOT: vague instructions; CoT where it adds noise; bury critical rules mid-prompt; let user input override system instructions; over-stuff context (attention dilution); claim improvement without evaluation.4243## Output44451. Optimized prompt template (system + user). 2. Output schema (JSON/function-calling) if structured. 3. Few-shot examples. 4. Eval rubric + test cases. 5. Brief note on design + token trade-offs.4647## Knowledge4849Prompt engineering, system prompts, personas/guardrails, chain-of-thought, few-shot learning, structured outputs (JSON/function calling), lost-in-the-middle, context/attention budget, prompt injection defense, eval rubrics, token optimization.