| name | map |
| description | Regenerate the PRD dependency map from the frontmatter of every Work Package — the interactive map.html plus the GitHub-rendered ROADMAP.md. Run after any PRD changes status, dependencies or scope. |
| argument-hint | [optional: path to the PRD folder] |
/prd:map — regenerate the dependency map
The map is derived, never edited: the source of truth is the YAML frontmatter of the
WP-*.md files. This command re-reads all of them and regenerates the two artifacts in
the PRD folder:
map.html — the interactive dependency map (layers, owners, critical path,
hover tracing). Self-contained; open in any browser.
ROADMAP.md — the GitHub-rendered version: Mermaid graph + status table.
Step 1 — Collect the data
- Locate the PRD folder (
$ARGUMENTS, or auto-detect: docs/prds/, docs/PRD/,
prds/ — whichever holds WP-*.md).
- Parse the YAML frontmatter of every
WP-*.md: id, title, status, size,
depends_on, milestone, owner, external, critical, issue.
- Validate before generating; report (and ask to fix) any of:
- duplicate ids, or a
depends_on pointing to a non-existent WP,
- dependency cycles (A→B→A) — these are always a planning bug,
- invalid
status (must be skeleton | specified | building | done),
- a
done WP that depends on a non-done WP (suspicious; confirm with the user).
- Derive a short
desc per WP for the node cards if the title alone is too long
(first sentence of §1 Objective works well, trimmed to ~6 words).
Step 2 — Generate map.html
- Copy
${CLAUDE_PLUGIN_ROOT}/templates/map.html to <prd-folder>/map.html.
- Replace the block between
/*PRD-KIT:DATA*/ and /*END PRD-KIT:DATA*/ with the real
data object:
{
project: "<project name>",
updated: "<today, YYYY-MM-DD>",
source: "<prd folder path>",
wps: [
{ id:"WP-01", title:"shared", desc:"config · DB · money type", owner:"Ana",
status:"done", size:"M", deps:[], external:"", issue:"SHOP-21", critical:false },
...
]
}
- Everything else (layers, critical path, legend, stats, footnotes) is computed by the
template's own JavaScript — do not modify the code, only the data block.
Step 3 — Generate ROADMAP.md
Follow ${CLAUDE_PLUGIN_ROOT}/templates/ROADMAP-TEMPLATE.md:
- Mermaid
flowchart TD with one node per WP (WPNN["WP-NN · title"]:::status) and one
edge per dependency. Mermaid ids must not contain - — use WP01, WP02…
- The table: one row per WP, linking each id to its file, with size, status emoji
(⬜ skeleton · 📘 specified · 🔨 building · ✅ done), dependencies, owner and issue.
- Keep the "Reading the map" section.
Step 4 — Report
Tell the user, in prose:
- The critical path (heaviest chain weighted by size S=1/M=2/L=3) and its first
not-done WP — that is the one delaying everything.
- Ready to start: WPs not started whose dependencies are all
done (flag the ones
still skeleton — they need /prd:fill first).
- External blockers still open.
- Any validation problems from Step 1.
Optional — publish as a shareable page
If running in an environment with an artifact/publishing tool available, offer to also
publish map.html as a shareable page for stakeholders. Otherwise map.html opens
locally in any browser.
Do not commit unless asked.