---
name: source-command-prd-graph
description: Build/query the machine-first traceability graph (impact, provenance, gaps, ai-collab export). Host-native /prd-graph equivalent for hosts that load skills instead of Claude command files; trigger on "/prd-graph", "prd-graph", or a request to run the prd-graph operation.
---

# /prd-graph (host-native command skill)

Generated from `commands/prd-graph.md` by `scripts/generate_command_skills.py` — do not edit by hand; edit the command file and regenerate.

Treat the user's invocation as this command. Where the instructions use `$ARGUMENTS`, substitute the arguments the user supplied (expected: [gaps | <ID> impact | <ID> why | export | auto on|off]).

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.

## Staleness

This adapter owns no records of its own; apply the shared policy in `.prd_plugin/method/staleness-rules.md` to any records the underlying operation reads or writes.
