Prompt Engineering
Comprehensive prompt engineering knowledge base. Provides actionable patterns, checklists, and guides for designing, securing, evaluating, and optimizing LLM prompts and agent systems.
When to Use
- Designing or reviewing prompt templates (system, developer, user prompts)
- Building tool calling schemas and structured output contracts
- Evaluating prompt quality — accuracy, safety, cost, latency
- Auditing LLM security against OWASP LLM Top 10
- Designing multi-agent orchestration and handoff protocols
- Optimizing prompt cost and latency
- Creating or reviewing Codex AI assets (rules, workflows, skills — all are prompts)
- Setting up prompt versioning and observability
When NOT to Use
- Implementing backend/frontend code (use
software-engineerrole + stack-specific role) - Infrastructure and deployment (use
devops-engineerrole) - Writing code tests (use
qa-engineerrole +test-strategyskill) - Content writing (use
content-writerrole) - Context pipeline design, memory engineering, agent harness, RAG architecture, multi-agent orchestration, production AI checklists → use
context-engineeringskill
Key Concepts
Prompt as System
A prompt is not a string — it is a system composed of:
- Instruction hierarchy: System prompt > Developer prompt > User prompt > Retrieved content
- Context assembly: What enters the context window, in what order, with what priority
- Output contract: Schema, format, constraints, error handling, fallback behavior
- Tool interface: Available tools, their schemas, permissions, composition patterns
- Guard rails: Safety filters, refusal policies, output validators
- Versioning: Immutable versions, deployment tags, audit trail
Core Principles
- Eval-first: Define how to measure before changing anything
- Simplest technique: Zero-shot → few-shot → CoT → chaining. Escalate only when simpler fails
- Explicit over implicit: Spell out constraints, output format, edge cases. Never assume the model "knows"
- Separation of concerns: Instructions vs data vs examples — always delimited
- Grounding: Prefer citations and verifiable data over unanchored claims
- Least privilege: Minimal tool permissions per agent. HITL for high-impact actions
- Cost awareness: Every token costs money and time. Compress, cache, route
Resource Files
| File | Contents |
|---|---|
technique-guide.md |
Technique selector overview and reading map |
technique-guide-core.md |
Zero-shot, few-shot, CoT, self-consistency, constrained generation |
technique-guide-agentic.md |
ToT, ReAct, chaining, reflection, RAG, meta-prompting, provider guidance |
prompt-template-patterns.md |
Prompt structure overview and pattern index |
prompt-template-foundations.md |
Delimiters, system prompt architecture, few-shot formatting, CoT formatting |
prompt-template-contracts.md |
Output schemas, tool schemas, prompt registry, provider-specific adaptations |
security-checklist.md |
OWASP LLM Top 10 mapped to prompt-level mitigations with checklist |
eval-and-testing-guide.md |
Eval workflow overview and decision map |
eval-datasets-and-graders.md |
Dataset curation, grader types, grader selection |
eval-deployment-and-monitoring.md |
Regression gates, A/B testing, deployment rollout, monitoring |
Integration
- Follows rules:
prompt-engineerrole (prompt system architecture, security, eval-first quality) - Used by workflows:
ai-skillsskill (all assets are prompts),feature-devskill (AI features),code-reviewskill (prompt quality review) - Companion skills:
context-engineeringskill (context pipeline design, memory engineering, agent harness, RAG architecture, multi-agent orchestration, production checklists),asset-validationskill (AI asset format validation),code-reviewskill (review checklists) - Collaborates with roles:
software-engineerrole (prompt integration),qa-engineerrole (prompt regression tests),product-managerrole (success metrics)