YMD/PMD format specification and authoring tools for structured, modular AI prompts
You can install this plugin from any of these themed marketplaces. Choose one, add it as a marketplace, then install the plugin.
Choose your preferred installation method below
A marketplace is a collection of plugins. Every plugin gets an auto-generated marketplace JSON for individual installation, plus inclusion in category and themed collections. Add a marketplace once (step 1), then install any plugin from it (step 2).
One-time setup for access to all plugins
When to use: If you plan to install multiple plugins now or later
Step 1: Add the marketplace (one-time)
/plugin marketplace add https://claudepluginhub.com/marketplaces/all.json
Run this once to access all plugins
Step 2: Install this plugin
/plugin install ymd-spec-2@all
Use this plugin's auto-generated marketplace JSON for individual installation
When to use: If you only want to try this specific plugin
Step 1: Add this plugin's marketplace
/plugin marketplace add https://claudepluginhub.com/marketplaces/plugins/ymd-spec-2.json
Step 2: Install the plugin
/plugin install ymd-spec-2@ymd-spec-2
Official specification and Claude Code plugin for YMD (YAML + Markdown + Jinja2) and PMD (Prompt Markdown + Jinja2) formats — enabling structured, modular, and reusable AI prompts.
YMD and PMD are file formats designed for prompt engineering that combine the best of YAML, Markdown, and Jinja2 templating.
This repository serves a triple purpose:
bash -c "$(curl -fsSL https://raw.githubusercontent.com/daviguides/ymd-spec/main/install.sh)"
The installer will:
ymd-spec/
to ~/.claude/ymd-spec/
~/.claude/CLAUDE.md
.ymd
files are complete prompt definitions with metadata and customizable sections.
Structure:
# Metadata (YAML)
meta:
id: pr_description_generator
kind: gh_pr
version: 0.1.0
title: Generate GitHub Pull Request Description
# Sections (Markdown + Jinja2)
system: |
You are a **senior maintainer** writing reviewer-friendly PR descriptions.
{% include "gh_pr/system_goals.pmd" %}
instructions: |
{% include "gh_pr/sections.pmd" %}
expected_output: |
{% include "gh_pr/example.pmd" %}
user: |
Context and diff:
```diff
{{ diff }}
**Key features**:
- **YAML metadata grouped under `meta:`**: `id`, `kind`, `version`, `title`
- **Customizable sections**: Standard (`system`, `instructions`, `user`) or custom (`context`, `constraints`)
- **Markdown content**: Rich formatting in block scalars (`|`)
- **Jinja2 templating**: Variables `{{ }}`, includes `{% %}`, control flow
- **PMD composition**: Include reusable components
### PMD: Prompt Components (Building Blocks)
`.pmd` files are **reusable Markdown blocks** for composition.
**Structure**:
```markdown
<!-- Pure Markdown + Jinja2 (no YAML) -->
You are a **{{ role_type }}** with expertise in:
- {{ primary_language }} development
- {{ domain }} best practices
{% include "../shared/code_principles.pmd" %}
Key features:
YMD files are orchestrators that compose PMD components:
GitHub PR YMD (orchestrator)
├─ system section
│ └─ includes roles/maintainer.pmd
│ └─ includes shared/principles.pmd
├─ instructions section
│ ├─ includes tasks/pr_analysis.pmd
│ └─ includes checklists/quality.pmd
└─ user section
└─ includes formats/diff_context.pmd
PMD files can include other PMDs:
<!-- roles/senior_dev.pmd (composite) -->
You are a senior software engineer.
{% include "../shared/code_principles.pmd" %}
{% include "../shared/communication_style.pmd" %}
Use YMD/PMD to structure your AI prompts:
Create reusable PMD components:
roles/expert.pmd
- Role definitionschecklists/security.pmd
- Verification listsformats/json_response.pmd
- Output formatsCompose YMD manifests:
code_review.ymd
- Includes expert role + security checklistapi_design.ymd
- Includes expert role + json_response formatBenefit from modularity:
expert.pmd
once → affects all YMDs that include itOnce installed, you can use YMD/PMD tools in three ways:
Load YMD/PMD context for your current session:
/load-ymd-context
Available Commands:
/load-ymd-context
- Load complete YMD/PMD format context/create-ymd-manifest
- Create new YMD file with scaffolding/create-pmd-partial
- Create new PMD component/validate-composition
- Validate YMD→PMD include chainsReference in your ~/.claude/CLAUDE.md
for automatic loading:
# YMD/PMD Format Support
@~/.claude/ymd-spec/context/format-guidelines.md
Reference in your project's CLAUDE.md
:
# Project Prompt Standards
## Format Specification
- **INHERITS FROM**: @./ymd-spec/context/format-guidelines.md
- **EXAMPLES**: @./ymd-spec/context/examples.md
The plugin includes specialized agents:
File extension: .ymd
or .yamd
Required metadata:
meta:
id: unique_identifier
kind: prompt_type
version: semver
title: Human-readable title
Standard sections (common patterns):
system
- Role/persona definitioninstructions
- Step-by-step tasksexpected_output
- Output format specificationdeveloper
- Implementation notesuser
- User input templateCustom sections:
section_name: |
Jinja2 features:
{{ variable_name }}
{% include "path.pmd" %}
{% if %}
, {% for %}
{# comment #}
File extension: .pmd
Structure:
Patterns:
Jinja2 features:
meta:
id: code_reviewer
kind: code_analysis
version: 1.0.0
title: Code Review Assistant
system: |
You are a code review specialist.
instructions: |
1. Analyze code quality
2. Check for security issues
3. Suggest improvements
user: |
Review this code:
```{{ language }}
{{ code }}
### YMD with Custom Sections
```yaml
meta:
id: api_designer
kind: api_design
version: 1.0.0
title: API Design Assistant
system: |
You are an API design expert.
context: |
This API will be used by {{ target_audience }}.
constraints: |
- RESTful principles
- JSON responses only
- Maximum response time: {{ max_response_time }}ms
user: |
Design an API for: {{ requirement }}
<!-- roles/expert.pmd -->
You are an expert in **{{ domain }}** with {{ years_experience }}+ years of experience.
<!-- roles/senior_dev.pmd -->
You are a senior software engineer specializing in {{ primary_language }}.
{% include "../shared/code_principles.pmd" %}
{% include "../shared/communication_style.pmd" %}
Approach | Modularity | Type Safety | Templating | Customization |
---|---|---|---|---|
Plain Text | ❌ No | ❌ No | ❌ No | ✅ Yes |
Markdown | ⚠️ Limited | ❌ No | ❌ No | ✅ Yes |
YAML | ⚠️ Limited | ✅ Yes | ❌ No | ✅ Yes |
YMD/PMD | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
vscode-ymd: VSCode extension for YMD/PMD syntax highlighting and navigation
ymd-prompt: Python library for loading and rendering YMD/PMD files
pip install ymd-prompt
(coming soon)Contributions are welcome! You can propose new features, refine examples, or extend the plugin.
MIT License - See LICENSE for details
Built with ❤️ by Davi Guides - enabling structured, modular, and reusable AI prompts.
0.1.0