---
description: Build/query the machine-first traceability graph (impact, provenance, gaps, ai-collab export)
argument-hint: "[gaps | <ID> impact | <ID> why | export | auto on|off]"
allowed-tools: Bash(python:*)
---

Use the PRD Plugin traceability graph. Resolve the script under
`.prd_plugin/scripts/` (downstream) or `scripts/` (hub), then run the action that
matches `$ARGUMENTS` (default: write + summarize):

- **default / no args** — write the graph and show a summary:
  `prd_graph.py --out .prd_plugin/local/traceability-graph.json`
- **`gaps`** — incomplete chains (requirements with no task, tasks with no
  validation/evidence), orphans, dangling links: `prd_graph.py --gaps`
- **`<ID> impact`** — everything downstream of a node (blast radius before a
  change): `prd_graph.py --node <ID> --impact`
- **`<ID> why`** — everything upstream of a node (provenance / why it exists):
  `prd_graph.py --node <ID> --provenance`
- **`export`** — AI-Collab-v3 causal edge list `[{cause, effect, label}]`:
  `prd_graph.py --format cause-effect`
- **`auto on` / `auto off`** — toggle automatic regeneration on session close
  (off by default): `prd_graph.py --set-auto on|off`

The graph is JSON, keyed by the shared PRD Plugin IDs, with directed labeled
edges that map onto AI-Collab-v3's `{cause, effect, label}` model. Read-only —
only `auto on|off` changes a config flag; it never edits project state.
