name: pm-publish
description: Generate markdown documents from the PM database. Publishes all items regardless of approval status. Iterator glossary at top.
argument-hint: [product features |product requirements |product full ]
PM Publish — Markdown Generator
Generate markdown from database. The ONLY thing that writes markdown feature docs. Database is the source of truth.
Invocation
/pm-publish myriplay features docs/features.md
/pm-publish myriplay features docs/features.md security,api,performance
/pm-publish myriplay requirements docs/requirements.md
/pm-publish myriplay full docs/product-spec.md
Database
Path: .claude/db/marketing.sqlite | PRAGMA foreign_keys=ON;
Output Types
Features
Tag-based sections. Features grouped by first matching tag.
Requirements
Hierarchical: Epic > Feature > Requirement > Test
Full
Complete product spec: everything in hierarchy with all detail.
Iterator Glossary
Always at the top, right after the title. Scan all text fields in the output for iterator names, then resolve:
SELECT i.name, i.description,
GROUP_CONCAT(iv.value, ', ' ORDER BY iv.position) AS vals
FROM iterators i
JOIN iterator_values iv ON iv.iterator_id = i.id
WHERE i.product_id = :pid GROUP BY i.id ORDER BY i.name;
Output format:
## Iterators
| Name | Description | Values |
|------|-------------|--------|
| CLUSTER_TYPES | Supported cluster types | kubernetes, docker, nomad |
| SOFTWARE_ARCHS | Target build architectures | x86, amd64, arm64, mips |
Only include iterators that are actually referenced in the published content.
Features Format
# Product Name — Features
> Auto-generated by PM. Do not edit directly.
> 47 features | Published: 2026-03-25
## Iterators
| Name | Description | Values |
|------|-------------|--------|
---
## Security
### Mutual TLS for device authentication
*Epic: Device Security | Release: 1.0 | Version: 3 | Status: implemented*
Description paragraphs...
**Test:** Verify mTLS handshake rejects unsigned device certificates
> Test description as blockquote...
**Requirements:**
- System enforces client certificate validation for each SUPPORTED_PROTOCOLS
- System rejects connections without valid CA-signed certificates
- System logs rejection events with device ID and timestamp
`Tags: security, tls, authentication`
---
Section ordering: If tags provided as argument, use that order and save to publish_tag_order. Otherwise use stored order. Fallback: order by feature count descending. Each feature appears once, in its first matching section. Unmatched → "Other" at end.
Full Format
# Product Name — Product Specification
> Auto-generated by PM. Do not edit directly.
## Iterators
...
---
## Epic: Multi-Tenant Cluster Visualization
*Version: 3 | Status: approved*
Description and rationale...
### Feature: Render cluster topology diagrams
*Release: 1.0 | Version: 2 | Status: implemented*
Description...
#### Requirements
1. **System renders HC containers with node counts** (v1)
> Acceptance: Each HC container displays...
**Test:** Verify HC container count matches input (v1)
> Confirm that exactly N containers render...
2. **System supports each CLUSTER_TYPES** (v1)
...
Rules
- Publishes ALL items regardless of
human_approvedstatus. - Database is source of truth. Never read from existing markdown.
- Overwrite target file completely on each publish.
- Never expand iterators inline. Keep names as-is in body text.
- Glossary at top. Only include referenced iterators.
- Save tag order to
publish_tag_orderwhen provided as argument.