prompt-craft — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited prompt-craft (Agent Skill) and scored it 96/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 1 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 1 flagged
The text {match} tells the agent to skip the normal "ask the user first" gate. Used adversarially it removes the human-in-the-loop check before destructive or sensitive actions, turning a normally-gated agent into a fire-and-forget executor.
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
A prompt is an executable instruction contract: stable rules and examples define the function, variable user content supplies arguments, and evals decide whether revisions improved behavior.
This skill covers portable prompt design for LLM-backed tasks and agents:
A prompt is a specification, not a wish list. The goal is not the shortest possible wording or the most elaborate incantation; the goal is the smallest inspectable instruction contract that reliably produces the required behavior on realistic inputs.
Prompt craft is also not a substitute for system design. A model cannot reliably follow context it never received, validate JSON the runtime never checks, refuse tool calls the application allows, or prove quality on examples that were never run. Good prompt work names those boundaries. It tells the model what to do, tells the runtime what must be validated, and tells the maintainer what evidence would justify keeping a revision.
The largest failure mode is prompt-and-pray: write a prompt, run one plausible example, and ship. Prompt engineering becomes engineering only when a stable eval set, format checker, or trace review can show whether the change improved the target metric without causing regressions.
A non-trivial prompt usually has these layers. The order is a starting point, not a universal law; provider docs and eval results should decide the final shape.
| Layer | Purpose | Guidance |
|---|---|---|
| Authority frame | Put stable rules, product policy, and business logic above variable user input | Use the highest-authority message or instructions surface your provider supports; keep user-controlled data out of that layer. |
| Identity or role | Set expertise, tone, or operating stance when it changes behavior | Keep it short. A precise task instruction usually beats a broad persona. |
| Task statement | Name the exact deliverable | One sentence should answer: what should the model produce? |
| Context | Provide definitions, source text, business rules, retrieved snippets, or constraints the model cannot infer | Include only relevant context; route larger context design to context-engineering. |
| Procedure | Give ordered steps when sequence or completeness matters | Use numbered steps for workflows; avoid hidden requirements buried in prose. |
| Examples | Demonstrate desired input/output shape and edge decisions | Use diverse boundary examples; avoid production or private examples unless scrubbed and authorized. |
| Variable input | Present the user data, document, trace, or item being processed | Delimit it and state that it is data to analyze, not instructions to obey. |
| Output contract | Define response shape, enum, schema, length, tone, or citation requirements | Prefer provider structured-output features for complex JSON; validate after generation. |
| Failure path | Tell the model what to do when information is missing, unsafe, ambiguous, or outside scope | Use explicit fallback labels, clarification rules, or refusal criteria. |
| Verification hook | State what will be checked or how success is measured | Tie prompt revisions to evals, tests, schema validation, or human review. |
Place instructions where the runtime's authority model expects them. OpenAI's prompt-engineering docs describe developer messages as the system's rules and business logic, while user messages carry inputs and configuration. Anthropic docs similarly emphasize clear, direct instructions, examples, XML-style structure, and model-specific prompt tuning. Gemini docs emphasize direct structure, constraints, response format, context, and prompt iteration.
Use these defaults unless provider guidance or eval evidence says otherwise:
Use prompt-craft for the wording and structure of instructions. Use context-engineering when the problem is the information environment around the prompt.
| Symptom | Prompt-craft owns | Context-engineering owns |
|---|---|---|
| The model ignores the required output shape | Output contract, example, final cue, retry instruction | Runtime parser, schema validation, downstream repair loop |
| The model lacks domain facts | Instruction that says how to use supplied evidence | Retrieval, source selection, chunking, memory, context budget |
| The model follows malicious text inside an input | Data/instruction separation wording | Sanitization, tool permissions, content isolation, guardrails |
| The model is verbose or under-specific | Tone, length, and specificity instructions | Product-level response policy and reusable context packs |
| The agent misses steps | Task procedure and stop criteria | Workflow state, TODO tracking, orchestration, tool traces |
If changing the prompt cannot plausibly fix the observed behavior without changing retrieved data, tool authority, memory, schema validation, or runtime state, switch skills.
For structured output, the prompt should describe the contract and the runtime should enforce it. Do not treat model obedience as validation.
Use a layered approach:
Example pattern:
Return one JSON object with this shape: { "label": "SPAM" | "HAM" | "UNDETERMINED", "confidence": 0.0-1.0 }
Output no prose outside the JSON object.
If the input cannot be classified from the supplied evidence, use "UNDETERMINED".
Avoid exact reliability claims such as a fixed breakage percentage unless you have measurements for the model, prompt, sampling settings, and input distribution in front of you.
Negative instructions are sometimes necessary, especially for safety, privacy, authorization, and output exclusions. But a prohibition alone often leaves the model without a target behavior. Pair negative boundaries with positive replacements.
| Weak | Stronger |
|---|---|
| Do not be vague. | State the verdict in the first sentence, then give two evidence bullets. |
| Do not output private data. | Output only the label and confidence; do not copy any input text into the response. |
| Do not use Markdown. | Output plain text sentences only; no headings, bullets, tables, or formatting characters. |
| Do not hallucinate. | Use only facts in the Source section. If the source is insufficient, answer INSUFFICIENT_SOURCE. |
| Do not call dangerous tools. | Before any side-effecting tool call, state the intended action and require explicit approval. |
The principle is salience plus target: reduce unnecessary mention of forbidden content, and give the model an allowed behavior it can execute instead.
Few-shot examples teach pattern and boundaries. They are not a storage place for every rule.
Choose examples that:
Use zero-shot for simple, well-defined tasks. Use one example to establish shape. Use three to five examples for nuanced classification or style. More examples can help exemplar-driven tasks, but if the prompt needs many examples to work, consider whether the task should be decomposed, retrieved examples should be selected dynamically, or the behavior belongs in a fine-tuned model, rules engine, or eval-guided workflow.
Do not ask the model to reveal hidden chain-of-thought. Ask for the visible artifact you need: a concise rationale, assumptions, cited evidence, decision table, calculation trace, or verification checklist. For models with explicit reasoning controls, tune the provider's effort or thinking budget instead of trying to coerce hidden reasoning through prose.
Use visible reasoning when it improves auditability:
Suppress visible reasoning when it harms the product:
Any prompt that processes user-controlled or retrieved content is exposed to prompt injection. OWASP describes the core problem as natural-language instructions and data being processed together without clear separation, with impacts such as safety bypass, data exfiltration, prompt leakage, and unauthorized tool use.
Prompt-level defenses:
Runtime defenses that prompt-craft must not pretend to solve alone:
When user input can cause tool calls, financial actions, data access, credential exposure, or customer-impacting changes, verify with guardrails.
Prompt changes need evidence. Use this loop for any prompt that matters:
A prompt that has not been measured may be a good draft. It is not yet an engineered prompt.
Before finalizing a prompt, verify the provider/runtime details that affect behavior:
| Surface | Check |
|---|---|
| Role semantics | Which instruction levels exist, and which wins on conflict? |
| Structured output | Is JSON schema or constrained decoding available, or is the prompt only advisory? |
| Tool use | How are tools described, selected, authorized, and validated? |
| Reasoning controls | Is there an effort, thinking, or budget parameter that should be used instead of prompt wording? |
| Context window | How much context can be supplied, and where should reusable versus variable content sit? |
| Sampling | Are temperature, top-p, stop sequences, max output, and retries pinned for reproducibility? |
| Persistence | Are prompt versions, eval links, and rollback paths available? |
Provider docs can conflict in emphasis because models differ. Treat provider guidance as a hypothesis to test against your own eval set, not as a permanent universal rule.
After applying this skill, verify:
| Use instead | When |
|---|---|
| context-engineering | Designing retrieval payloads, context windows, memory, compaction, source selection, or the broader information environment around the prompt. |
| eval-driven-development | Creating eval datasets, graders, hard negatives, thresholds, or a benchmark harness for future prompt or agent evaluation. |
| evaluation | Scoring a completed prompt change or deliverable against evidence and deciding whether it is done. |
| guardrails | Designing runtime controls for prompt injection, tool permissions, side effects, data exfiltration, or policy enforcement. |
| code-review | Reviewing AI-generated code or a pull request for correctness, security, maintainability, and regressions. |
| skill-scaffold | Authoring or restructuring a SKILL.md file and its metadata contract. |
| skill-router | Selecting which skill or agent should activate for a user query. |
| debugging | Investigating root cause for a deployed prompt or agent failure after bad outputs, traces, or incidents already exist. |
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.