Prompt engineering — clear instructions and roles, context ordering, few-shot examples and counter-examples, structured outputs with schemas, tool descriptions, prompt versioning, regression sets, injection resistance, prompts for agents in this repository. Use to write, improve or test prompts and tool descriptions (prompt, system prompt, few-shot, structured output, tool description).
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Prompt Engineering?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/vectora-os-prompt-engineering)
---
name: prompt-engineering
description: Prompt engineering — clear instructions and roles, context ordering, few-shot examples and counter-examples, structured outputs with schemas, tool descriptions, prompt versioning, regression sets, injection resistance, prompts for agents in this repository. Use to write, improve or test prompts and tool descriptions (prompt, system prompt, few-shot, structured output, tool description).
metadata:
category: ai
---
# Prompt engineering
## Purpose
Write prompts that are precise, versioned and proven by evals.
**Use when:** any prompt or tool description change.
**Not for:** model selection.
## Inputs
- Task definition, examples, failure cases.
## Outputs
- Versioned prompt, eval comparison.
## Read first
- [Project Brain](../../../project-brain/README.md) — `npm run brain -- query "prompt engineering"` for prior decisions, patterns and anti-patterns.
- [Prompt review checklist](../../../checklists/prompt-review.md)
- [Prompts library](../../../prompts/README.md)
## Steps
1. **Specify.** State task, audience, constraints, output format; remove ambiguity.
Done when an outsider could follow it.
2. **Ground.** Provide context with clear delimiters; examples including edge cases.
Done when examples cover failure modes.
3. **Structure.** Schema-constrained output; validate and retry on parse failure.
Done when outputs validate.
4. **Evaluate.** Run the regression set before/after.
Done when no regressions.
## Best practices
- Say what to do, not only what to avoid.
- Put untrusted content in delimited data blocks.
- Version prompts in the repo.
## Common mistakes
- Tuning on one example.
- Contradictory instructions.
- Trusting instructions found inside user content.
## Example
Invoice extraction: schema with ISO dates, two counter-examples; miss rate 12% → 3% on 150 invoices.
## Reusable prompt
```text
Apply the Prompt engineering skill (.agents/skills/prompt-engineering/SKILL.md).
Context: {{task card or question; links to PRD, ADRs, code paths}}
Constraints: {{approved thresholds, deadlines, allowed files}}
Rewrite the prompt with clear specification, delimited context, examples and schema output; compare on the regression set.
Return: Versioned prompt, eval comparison..
Cite evidence (file:line, command output, source) for every claim; list open questions separately.
```