agent-instructions
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what does not, structure, and…
Use when writing or improving prompts for a language model. Covers instruction structure, examples, reasoning elicitation, output formatting, and systematically diagnosing why a prompt fails.
$ npx -y skills add nimadorostkar/Claude-Skills-collection --skill prompt-engineering --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/prompt-engineeringContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when writing or improving prompts for a language model. Covers instruction structure, examples, reasoning elicitation, output formatting, and systematically diagnosing why a prompt fails.
name: prompt-engineering description: Use when writing or improving prompts for a language model. Covers instruction structure, examples, reasoning elicitation, output formatting, and systematically diagnosing why a prompt fails. metadata: category: ai version: 1.0.0 tags: [prompting, llm, few-shot, chain-of-thought, evaluation]
Write prompts that produce the right output reliably, and diagnose the ones that do not. Prompt engineering is an empirical discipline: the model's actual behavior, measured, beats any theory about what should work.
1. **Define correct before writing the prompt** — Twenty real inputs and their correct outputs. Without this, "improving" a prompt is a matter of opinion and you will optimize for the last example you looked at. 2. **State the task, the constraints, and the output shape** — Be specific about what to do, what not to do, and exactly what format the answer takes. 3. **Add examples that teach the boundary** — Two or three examples covering the ambiguous cases, not the obvious ones. An example of the hard case is worth ten of the easy one. 4. **Elicit reasoning only where it helps** — For multi-step reasoning, ask the model to work through it before answering. For classification and extraction, it adds latency and cost without improving accuracy. 5. **Measure, change one thing, measure again** — On the evaluation set. A change that improves one example and silently breaks three others is a regression that feels like progress. 6. **Handle the failure mode** — Decide what happens when the model returns something unparseable, refuses, or hallucinates a field. That path will be taken.
**A prompt with an explicit contract and a boundary example:**
You classify customer support messages for routing.
Categories (choose exactly one):
- billing — charges, invoices, refunds, payment methods
- technical — errors, outages, broken functionality, integration problems
- account — login, permissions, plan changes, cancellation
- other — anything not clearly covered above
Rules:
- If a message spans two categories, choose the one the customer needs
resolved first to be unblocked.
- If the message is too vague to classify with confidence, return "other"
with confidence below 0.5. Do not guess.
Respond with JSON only, matching this schema:
{"category": "billing|technical|account|other", "confidence": 0.0-1.0, "reason": "<one sentence>"}
Examples:
Message: "I was charged twice for March and I can't log in to check."
{"category": "account", "confidence": 0.8, "reason": "The double charge matters, but they cannot access the account to act on it, so access is the blocker."}
Message: "hey"
{"category": "other", "confidence": 0.2, "reason": "No classifiable content."}The first example is the one that earns its place: it teaches the tie-break rule in a way the prose alone does not.
**Diagnosing a failing prompt systematically:**
Symptom: the classifier returns "billing" for technical messages ~15% of the time.
Hypotheses, tested one at a time against the 40-case evaluation set:
H1: The category definitions overlap.
Test: read them. "billing" says "payment methods"; several technical
messages are about a broken payment *integration*.
Result: CONFIRMED. Baseline 85% -> 94% after clarifying that integration
failures are technical regardless of subject matter.
H2: Reasoning would help.
Test: add "Think step by step before answering."
Result: no accuracy change, +340ms latency, +180 tokens. REVERTED.
H3: More examples would help.
Test: 6 examples instead of 2.
Result: 94% -> 96%. Kept. Diminishing returns past 6 (tested 10: 96%).
Final: 96%, at lower cost than the baseline.A curated library of 137 production-grade skills for Claude and other AI coding agents. Every skill follows one structure, speaks with one voice, and earns its place by changing what the agent does.
Repo: nimadorostkar/Claude-Skills-collection
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what does not, structure, and…
Use when an agent needs state that survives a session or a context compaction. Covers what to persist, file-based memory, structuring notes for retrieval, and…
Use when automating agent behavior with lifecycle hooks. Covers hook events, deterministic enforcement of rules the model should not be trusted to remember,…
Use when packaging skills, commands, hooks, and MCP servers into a distributable plugin. Covers manifest structure, bundling, versioning, testing, and…
Use when writing a new skill for an AI agent. Covers scoping, description writing for reliable triggering, progressive disclosure, and the difference between a…
Use when reviewing or improving an existing agent skill. Covers triggering accuracy, content quality, redundancy with the base model, and measuring whether the…