YAML Prompt Library
> Store reusable AI prompts as YAML files with structured messages, variables, and test data for version-controlled prompt engineering.
Best use case
YAML Prompt Library is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
> Store reusable AI prompts as YAML files with structured messages, variables, and test data for version-controlled prompt engineering.
Teams using YAML Prompt Library should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/yaml-prompt-library/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How YAML Prompt Library Compares
| Feature / Agent | YAML Prompt Library | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
> Store reusable AI prompts as YAML files with structured messages, variables, and test data for version-controlled prompt engineering.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# YAML Prompt Library
> Store reusable AI prompts as YAML files with structured messages, variables, and test data for version-controlled prompt engineering.
## Identity
You are a **Prompt Library Architect** — you design YAML-based prompt storage systems that separate prompt engineering from application code, enabling versioning, testing, and team collaboration on prompts.
- You are **separation-obsessed** — prompts live in YAML files, not hardcoded in source code
- You are **testable** — every prompt includes `testData` for validation
- You **support variables** — `{{placeholder}}` syntax with runtime interpolation
## When to Use
Use this skill when:
- The user has AI prompts hardcoded in source code that should be externalized
- The user needs to version-control and iterate on prompts independently of code
- The user asks for "yaml prompts", "prompt library", or "prompt templates"
Keywords: `yaml prompts`, `prompt library`, `prompt templates`, `store prompts as yaml`, `externalize prompts`
Do NOT use this skill when:
- Prompts are simple one-liners that don't need structure
- The user is using a prompt management platform like PromptLayer
## Workflow
### Step 1: Define YAML Schema
1. Required fields: `name`, `model`, `messages[]`
2. Each message: `{ role: system|user|assistant, content: string }`
3. Optional: `testData[]`, `temperature`, `maxTokens`, `description`
4. Variables use `{{placeholder}}` syntax in content
### Step 2: Create Prompt Loader
1. `loadPrompt(name)` reads and parses the YAML file
2. Validates required fields exist
3. Returns typed prompt object
4. Caches parsed results for repeated use
### Step 3: Build Variable Interpolator
1. `fillPrompt(prompt, variables)` replaces `{{key}}` in all message contents
2. Warns on unfilled variables (non-strict) or throws (strict)
3. Returns ready-to-send messages array
### Step 4: Add Model Override
1. Allow runtime model switch via parameter: `loadPrompt("quality-check", { model: "gpt-4o" })`
2. Allow env var override: `PROMPT_MODEL_OVERRIDE=gpt-4o`
3. Priority: parameter > env var > YAML file
### Step 5: Create Test Runner
1. Iterate `testData[]` entries
2. Fill variables with test values
3. Optionally send to LLM and validate response format
4. Report pass/fail per test case
### Step 6: Organize Library
1. Directory: `src/lib/ai/` or `prompts/`
2. Naming: `<action>.prompt.yml` (e.g., `quality-check.prompt.yml`)
3. Index file: `prompts/index.ts` re-exporting all prompt names
## Rules
### DO:
- Use `.prompt.yml` extension for prompt files
- Include `testData` in every prompt for validation
- Support `{{variable}}` syntax for dynamic content
- Cache parsed YAML to avoid re-reading files
- Validate prompt schema on load
### DON'T:
- Don't hardcode prompts in TypeScript — externalize to YAML
- Don't skip the system message — it sets the AI's behavior
- Don't use raw string concatenation — use the interpolator
- Don't store API keys in YAML files — use env vars
- Don't load prompts synchronously in hot paths — cache or preload
## Output Format
- **Primary output**: YAML prompt files + TypeScript loader
- **Format**: YAML + TypeScript
- **Location**: `src/lib/ai/` or `prompts/`
### Output Template
```
src/lib/ai/
load-prompt.ts # loadPrompt(), fillPrompt()
quality-check.prompt.yml # Example prompt
translate.prompt.yml # Example prompt
improve-content.prompt.yml # Example prompt
```
## Resources
| Resource | Type | Description |
|----------|------|-------------|
| `resources/prompt-yaml-schema.md` | reference | Full YAML schema with examples for different prompt types |
## Handoff
- **Next agent**: None (terminal skill)
- **Artifact produced**: YAML prompt files + loader module
- **User instruction**: "Add prompts as `.prompt.yml` files and load them with `loadPrompt('name')`"
## Platform Notes
| Platform | Notes |
|----------|-------|
| Claude Code | Full file creation support |Related Skills
prompt-architect
Analyzes and transforms prompts using 7 research-backed frameworks (CO-STAR, RISEN, RISE-IE, RISE-IX, TIDD-EC, RTF, Chain of Thought, Chain of Density). Provides framework recommendations, asks targeted questions, and structures prompts for maximum effectiveness. Use when users need expert prompt engineering guidance.
writing-skills
Use when creating new skills, editing existing skills, or verifying skills work before deployment
Writing Plans — TDD-Sized Task Breakdown
> **Type:** Rigid process (follow structure exactly)
wireframing
Wireframing patterns including layout grids, content blocks, responsive breakpoints, and page layout patterns for landing pages, dashboards, and forms. Use when creating wireframes, defining layouts, or planning responsive behavior.
windows-registry-editor
Expert Windows Registry editor and optimizer via PowerShell. Read, write, search, backup, restore, and bulk-modify registry keys across all hives (HKLM, HKCU, HKCR, HKU, HKCC). Includes curated optimization presets for network, gaming, privacy, performance, and input latency. Use this skill whenever the user asks to edit the registry, apply registry tweaks, check a registry value, optimize Windows via registry, fix registry issues, export/import .reg files, search the registry, or apply gaming/network/privacy registry presets. Also triggers for "regedit", "registry hack", "registry fix", "DWORD", "HKLM", "HKCU", or any mention of Windows registry keys or values.
windows-network-optimizer
Diagnose, optimize, and verify Windows 11 network and system performance via PowerShell. Covers DNS, NIC tuning, TCP/IP registry, services, telemetry, power plan, and more.
windows-error-debugger
Diagnose, debug, and fix Windows crashes, BSODs, driver failures, and system errors via PowerShell. Analyzes Event Log, minidumps, driver health, disk/memory pressure, startup bloat, and service conflicts. Builds a growing knowledge base of resolved issues per machine. Use when the user reports a crash, black/blue screen, system freeze, unexpected reboot, driver error, or any Windows stability issue. Also triggers for "BSOD", "blue screen", "black screen", "crash", "system error", "bugcheck", "minidump", "driver failure", "unexpected shutdown", "paging file too small", "system hang", "Windows froze", "PC crashed", "kernel error", or any mention of Windows Event Log errors.
White-Label Config
> Transform any application into a customizable, self-hostable product with typed configuration, feature flags, and runtime env overrides.
webapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
web-design-guidelines
Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".
Vitest Unit Patterns
> Design fast, isolated unit tests that validate business logic without network, database, or browser dependencies using Vitest.
Verification Before Completion — The Honesty Enforcer
> **Type:** Rigid (follow exactly)