prompt-engineer-toolkit
Production prompt engineering frameworks for building, testing, versioning, and evaluating prompts. Covers chain-of-thought, few-shot design, system prompt architecture, prompt regression testing, and evaluation rubrics. Use when designing prompts for production systems, running A/B tests on prompts, building prompt libraries, or debugging prompt quality degradation.
What this skill does
# Prompt Engineer Toolkit - Production Prompt Engineering
**Tier:** POWERFUL
**Category:** Engineering
**Tags:** prompt engineering, chain-of-thought, few-shot, evaluation, testing, prompt versioning
## Overview
Prompt Engineer Toolkit provides the complete lifecycle for production prompts: design patterns that work, testing frameworks that catch regressions, versioning systems that track changes, and evaluation rubrics that replace subjective "looks good" with measurable quality. This is not about clever tricks -- it is about treating prompts as production code with the same rigor.
## Core Prompt Patterns
### 1. System Prompt Architecture
Every production prompt has a layered structure. Order matters.
```
┌──────────────────────────────────────┐
│ Layer 1: Identity & Role │ Who the model is
│ "You are a senior code reviewer..." │
├──────────────────────────────────────┤
│ Layer 2: Capabilities & Constraints │ What it can and cannot do
│ "You can read files, run tests..." │
├──────────────────────────────────────┤
│ Layer 3: Output Format │ How to structure responses
│ "Always respond with JSON..." │
├──────────────────────────────────────┤
│ Layer 4: Quality Standards │ What good output looks like
│ "Include edge cases, cite sources" │
├──────────────────────────────────────┤
│ Layer 5: Anti-Patterns │ What to avoid
│ "Never fabricate citations..." │
├──────────────────────────────────────┤
│ Layer 6: Examples │ Calibration via demonstration
│ "Here is an example..." │
└──────────────────────────────────────┘
```
#### Layer Design Principles
| Layer | Principle | Common Mistake |
|-------|-----------|----------------|
| Identity | Be specific about expertise level | "You are an AI assistant" (too generic) |
| Capabilities | Enumerate, don't imply | Assuming model knows available tools |
| Output Format | Show exact schema | Describing format in prose instead of schema |
| Quality Standards | Quantify when possible | "Be thorough" (unquantifiable) |
| Anti-Patterns | State the actual failure mode | "Don't be wrong" (useless) |
| Examples | Show edge cases, not just happy path | Only showing trivial examples |
### 2. Chain-of-Thought (CoT) Patterns
#### Standard CoT
```
Think through this step by step:
1. First, identify [what needs to be analyzed]
2. Then, evaluate [specific criteria]
3. Finally, synthesize [the conclusion]
Show your reasoning for each step.
```
**When to use:** Complex reasoning, math, multi-step logic
**When NOT to use:** Simple classification, formatting tasks, creative writing
#### Structured CoT with Scratchpad
```
Use the following reasoning process:
<scratchpad>
- List relevant facts
- Identify applicable rules
- Work through the logic
- Check for edge cases
</scratchpad>
Then provide your final answer outside the scratchpad tags.
```
**Advantage:** Model can reason messy, output is clean.
#### Self-Consistency CoT
```
Solve this problem three different ways, then compare your answers.
If all three agree, that's your answer.
If they disagree, identify which approach is most reliable and explain why.
```
**When to use:** High-stakes decisions where correctness matters more than speed.
**Cost:** 3x token usage. Use selectively.
### 3. Few-Shot Design
#### Shot Selection Criteria
| Criterion | Good Example | Bad Example |
|-----------|-------------|-------------|
| Representative | Covers typical input pattern | Only edge cases |
| Diverse | Different input types/lengths | All same structure |
| Edge-covering | Includes tricky cases | Only happy path |
| Output-calibrating | Shows desired detail level | Overly verbose or terse |
| Ordered | Simple → complex progression | Random order |
#### Few-Shot Template
```
Here are examples of the expected input and output:
Example 1 (simple case):
Input: [simple input]
Output: [simple output with annotation]
Example 2 (typical case):
Input: [typical input]
Output: [typical output with annotation]
Example 3 (edge case):
Input: [tricky input]
Output: [correct handling with annotation]
Now process this:
Input: {user_input}
Output:
```
#### Dynamic Few-Shot Selection
For production systems with thousands of examples:
```
1. Embed all examples
2. Embed the current input
3. Find K nearest examples by embedding similarity
4. Include those K examples as shots
5. Typical K: 3-5 (diminishing returns after 5)
```
### 4. Output Structuring Patterns
#### JSON Mode with Schema
```
Respond with a JSON object matching this exact schema:
{
"analysis": {
"summary": "string - one sentence summary",
"severity": "string - one of: critical, high, medium, low",
"findings": [
{
"issue": "string - description of the issue",
"location": "string - file:line",
"fix": "string - recommended fix",
"confidence": "number - 0.0 to 1.0"
}
],
"overall_score": "number - 0 to 100"
}
}
Rules:
- findings array must have at least one entry
- confidence must reflect actual certainty, not optimism
- overall_score: 90-100 (excellent), 70-89 (good), 50-69 (needs work), <50 (poor)
```
#### Structured Reasoning with Sections
```
Structure your response with these exact sections:
## Assessment
[1-2 sentence bottom line]
## Evidence
[Specific observations supporting the assessment]
## Risks
[What could go wrong, with likelihood estimates]
## Recommendation
[Specific actionable next steps with owners]
```
### 5. Prompt Decomposition
Complex prompts that try to do everything fail. Decompose them.
#### Single Responsibility Prompts
| Bad (monolithic) | Good (decomposed) |
|-----------------|-------------------|
| "Review this code for bugs, style, performance, security, and suggest improvements" | Prompt 1: "Identify bugs" / Prompt 2: "Check style" / Prompt 3: "Find performance issues" / Prompt 4: "Security audit" / Prompt 5: "Synthesize findings" |
#### Pipeline Pattern
```
Prompt 1 (Extract): Input → structured data
Prompt 2 (Analyze): Structured data → findings
Prompt 3 (Synthesize): Findings → recommendation
Prompt 4 (Format): Recommendation → user-facing output
```
Each prompt is testable independently. A failure in Prompt 2 doesn't require re-running Prompt 1.
### 6. Calibration Techniques
#### Temperature Guidelines
| Task Type | Temperature | Rationale |
|-----------|-------------|-----------|
| Code generation | 0.0-0.2 | Correctness > creativity |
| Classification | 0.0 | Deterministic expected |
| Analysis/reasoning | 0.2-0.5 | Some flexibility in framing |
| Creative writing | 0.7-1.0 | Diversity of expression |
| Brainstorming | 0.8-1.2 | Maximum variety |
#### Confidence Calibration
```
For each finding, rate your confidence:
Confidence levels:
- VERIFIED: I can point to specific evidence in the provided context
- LIKELY: Strong inference from available information
- UNCERTAIN: Reasonable guess, but limited evidence
- SPECULATIVE: Possible but I'm reaching
Never state SPECULATIVE findings as VERIFIED.
```
## Prompt Testing Framework
### Test Case Design
Every production prompt needs a test suite.
#### Test Case Structure
```json
{
"test_id": "classify-urgent-001",
"input": "Server is down, customers can't access the product",
"expected": {
"contains": ["critical", "immediate"],
"not_contains": ["low priority", "can wait"],
"format_regex": "^\\{.*\\}$",
"max_tokens": 500,
"required_fields": ["severity", "category"]
},
"tags": ["classification", "urgency", "happy-path"]
}
```
#### Test Suite Composition
| Category | % of Suite | Purpose |
|----------|-----------|---------|
| Happy path | 40% | Confirm basic functionality works |
| Edge cases | 30% | Boundary conditions, unusual inputs |
| Adversarial | 15% | Inputs designed to break the prompt |
| Regression | 15% | Cases that previously failed |
### Evaluation Rubric
#### Automated Scoring
| DimensRelated in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.