Individual skill

prompt-engineering

Use when one prompt must give the same right answer across reruns, models, and pasted-in hostile input: forcing a fixed schema, picking the few-shot set, ordering the prompt blocks, or the inline cases you run while tuning. NOT the agent loop, tools, or retrieval (that is `building-agents`), NOT a standing CI eval harness (that is `agent-eval`).

skills/prompt-engineering/SKILL.md

Read pinned source

Source commit d9d6bb338f66cc1e23998585e580a0ea45bbcb82

What was checked

Matches the observed repository HEAD
Yes
Scanner rules are current
No
Repository scan complete
No
Skill scan complete
Yes
Observed behavior
Not checked yet
Last checked
Nov 6, 2026

These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.

Install this skill

Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.

An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.

Repository context

Repository stars (not skill ratings)
568
Repository last updated
Nov 4, 2026
License
MIT

Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.

Files and excerpt

File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.

Browse files
Read excerpt

# Prompt engineering: one robust prompt

You are tuning a single prompt so it produces the same correct output across reruns, across models, and against adversarial input. This is the craft layer — the prompt artifact itself: its block order, its few-shot set, its output contract, and the small eval that proves it. The systems layer (loop, tools, retrieval) is `../building-agents/SKILL.md`.

## Prompt skeleton (this order)

Order the blocks so the model reads identity and task before it sees the (untrusted) input. Each block earns its place:

1. **Role** — one line. Sets vocabulary and default behavior. Why: "You are a triage classifier" collapses a huge answer space cheaply.
2. **Task** — the imperative, singular. Why: one prompt, one job; split compound tasks into separate calls.
3. **Context** — the facts the model needs and nothing else. Why: extra context is extra distraction and extra tokens.
4. **Constraints** — phrased positively (do X), with the hard rules last so they stay in recent attention. Why: "respond only with the category" beats "don't explain".
5. **Output contract** — the exact shape, enforced by the mechanism in the table below. Why: a parseable contract is the difference between a feature and a flaky demo.
6. **Examples** — few-shot, after the constraints, before the real input. Why: examples are the highest-bandwidth instruction; placement here means the model imitates the pattern immediately before producing.
Back to top