Claude
Skills
Sign in
Back

pm-publish

Included with Lifetime
$97 forever

Generate markdown documents from the PM database. Publishes all items regardless of approval status. Iterator glossary at top.

Writing & Docs

What this skill does


# 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:

```sql
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:
```markdown
## 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

```markdown
# 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

```markdown
# 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

1. **Publishes ALL items** regardless of `human_approved` status.
2. **Database is source of truth.** Never read from existing markdown.
3. **Overwrite target file completely** on each publish.
4. **Never expand iterators inline.** Keep names as-is in body text.
5. **Glossary at top.** Only include referenced iterators.
6. Save tag order to `publish_tag_order` when provided as argument.
Files: 1
Size: 3.7 KB
Complexity: 11/100
Category: Writing & Docs

Related in Writing & Docs