Prompt Engineering Skill

A skill for writing and fixing prompts: diagnose the model and task first, strip anti-patterns, and finish with a way to measure the result.

---
name: prompt-engineering
description: Write, review, or fix a prompt. Use when the user asks for a prompt, wants better output from a model, says the model is ignoring instructions, or is building a system prompt for an app or agent.
---

# Prompt Engineering

There is no perfect prompt, only a perfect process. The highest-leverage move is never a wording trick; it is having a way to tell whether a change helped.

## Diagnose before writing

Establish three things, asking if they are not stated:

1. **Model class.** A reasoning model or a standard one. This flips several rules.
2. **Task type.** Math or symbolic, extraction or classification, creative, agentic, or long-context analysis. Step-by-step reasoning instructions pay off substantially on math and symbolic work and close to nothing elsewhere, so the task type decides whether to include them at all.
3. **Surface.** Chat or API. The API offers structured outputs, role separation, prefilling, and effort controls, and every one of those beats a wording change.

## Build only the components the task needs

In roughly this order, including a component only when it earns its place:

1. **Instruction**: lead with a direct verb and say exactly what you want. Specificity is the most reliable win available.
2. **Context**: why this matters and who the output is for. A reasoned rule outperforms a bare prohibition.
3. **Constraints**: scope, length, audience, exclusions. Prefer telling the model what to do over what to avoid.
4. **Persona**: only for tone and audience framing. Never as an accuracy lever; it does not improve correctness.
5. **Examples**: the strongest addition for format and pattern tasks. Start with one, add more only if outputs stay inconsistent, keep labels balanced, and make every example match the stated rules exactly, because examples override instructions when they disagree.
6. **Output format**: state it explicitly. On an API, use structured outputs rather than describing the format in prose.
7. **Uncertainty permission**: "if the information is insufficient, say so rather than speculating". Cheap, and it reduces fabrication on factual work.
8. **Placement**: put long pasted material at the start or the end, never in the middle, and split a multi-objective prompt into a chain.
9. **Hierarchy**: durable rules in the system prompt, per-request content in the user turn. Never let retrieved documents or tool output sit at instruction-level trust.

On a reasoning model: drop manual step-by-step instructions and worked reasoning examples, keep the prompt direct, remove contradictions aggressively, and control depth with the effort setting rather than with wording. On a standard model doing math or logic: add the step-by-step instruction, and expect a real gain there specifically.

## Strip the anti-patterns

Scan every prompt, yours or theirs, and name each one found with the fix in one line:
- Contradictory or vague instructions, which are the most damaging flaw on current models
- Manual chain-of-thought on a reasoning model
- Expert personas used to improve accuracy
- Politeness, threats, or emotional appeals used as performance levers
- Technique stacking. Longer is not better; the best prompt is the minimum structure that hits the goal reliably
- Critical material buried in the middle of a long input
- Examples whose style or labels contradict the instructions
- Assuming a prompt tuned on one model transfers to another

## Close with the measurement

Never deliver a prompt without it, scaled to the stakes:
1. Define success and gather 5 to 20 test inputs before trusting it.
2. Change one variable at a time, and test two or three phrasings, because a single result is noise.
3. Re-test on every model upgrade.
4. With a metric and roughly fifty labeled examples, move to automatic optimization for the prompts that matter most.

When reviewing someone's prompt, output: the verdict in one line, the numbered issues each tagged with its anti-pattern and fix, the rewritten prompt, and the testing plan.

How to use

Save as .claude/skills/prompt-engineering/SKILL.md. The diagnosis step is what stops the most common failure, which is applying a technique that helps on one model class to another where it does nothing or hurts. The closing measurement section is not filler: the difference between a prompt that works and one that seems to work is a handful of test inputs, and prompts are unusually sensitive to changes that look meaning-preserving.

Originated fromStan SedberryUpdated
Authoringadvanced

More skill prompts

---
name: writing-documentation
description: Write or update documentation from the code. Use when the user asks for a README, API reference, guide, docstrings, or says the docs are out of date.
---

# Writing Documentation

Documentation is a claim about behavior. Every claim must be checked against the code before it ships, because a wr
SKILL.md

Documentation Skill

A skill that documents what the code does rather than what it should do: read first, examples from tests, unverifiable claims marked.

Skillintermediate
---
name: security-review
description: Review code for security defects. Use before merging changes that touch authentication, authorization, user input, file handling, secrets, or external requests, or when the user asks for a security review.
---

# Security Review

Find defects an attacker could actually use. A finding without an attac
SKILL.md

Security Review Skill

A skill that reviews changes for exploitable defects, follows untrusted input to where it lands, and reports only findings with an attack path.

Skilladvanced
---
name: accessibility-review
description: Audit UI code for accessibility defects against WCAG. Use when building or changing components, forms, modals, or navigation, or when the user asks about accessibility, a11y, screen readers, or keyboard support.
---

# Accessibility Review

Judge the interface by whether a person can complete th
SKILL.md

Accessibility Skill

A skill that audits UI against WCAG by keyboard, semantics, and state, reporting who is blocked rather than listing rule numbers.

Skillintermediate

Search prompts

Find a prompt by title, description, tag, or category.