In this section: How C-DAD Works

cdad graph

One contract tells you about one capability. What you actually want, once a few of them exist, is to see how they connect. That's what cdad graph does. It walks every contract in the repo and renders the dependency map as three artifacts at once:cdad-graph.mmd as a Mermaid diagram, cdad-graph.jsonas an adjacency list, and cdad-graph.md as a Markdown summary.

Of the three, the JSON adjacency list is the one meant to last. It's deliberately kept stable so other tooling, including an agent deciding whether a change is safe, can consume it without any scraping or parsing tricks. The Mermaid file is for humans, drop it into a doc or a PR description and it renders as an actual diagram. The Markdown file sits in between, readable on its own and still structured enough to skim quickly.

You don't have to render the whole repo every time. --capability <id>scopes the graph to one capability and whatever it touches,--domain <name> scopes it to everything under one domain, and --state <state> filters by lifecycle state if you only care about, say, what's still in draft. If you only need one of the three output formats, --no-mermaidand --no-json skip the ones you don't want, and--output <dir> moves the artifacts somewhere other than the default location.

This is also the command that makes gaps visible. A capability with no incoming or outgoing edges either genuinely stands alone or hasn't been connected to its neighbors yet, and the graph is usually the fastest way to tell which one is true.

cdad graph
cdad graph --domain payments --no-mermaid