How it works¶
The plugin is two commands and five skills. A command decides what to produce; the skills do the work, and each one is a set of instructions, templates and scripts that Claude follows.
flowchart LR
cmd["/explain-project"] --> explore["explore-project"]
explore --> brief[("project-brief.md")]
brief --> deck["project-deck"]
brief --> explorer["architecture-explorer"]
deck --> d["project-deck/index.html"]
explorer --> e["architecture-explorer/index.html<br/>+ model.js + architecture.ttl / .jsonld"]
brief --> stories["user-stories"]
e -. "model.js: people, scenarios" .-> stories
stories --> s["user-stories/index.html<br/>+ stories.js"]
hcmd["/architecture-history"] --> hist["architecture-history"]
e -. "model.js in git" .-> hist
hist --> h["history.trig, reports<br/>+ explorer with versions"]
1. Explore: explore-project¶
The goal is a project brief: a compact model of the system, with a file reference for every element. Claude works outside in and stops reading as soon as a question is answered:
- Orient. README, docs, then deployment files (
docker-compose, Dockerfiles, Kubernetes, Terraform, CI), which are the most reliable source for containers. Then manifests and the top of the directory tree. - Ask. One round of questions, each with a recommended default: audience, scope, outputs, emphasis, and "what did I get wrong?" about its summary. See the question bank.
- Map the structure, C4 style. People and external systems (L1), separately deployed units and stores (L2), and the modules inside the containers that matter (L3), each tested against Modelling with C4. Every relationship gets a verb and a protocol. The data too: every schema and where it lives (tables, file formats and API payloads, queue messages, object keys, ontologies), and the identifiers that cross stores.
- Trace the flows. Two to five flows end to end through real code, plus any state machine. At each step that touches data, what it reads and writes, from the statement itself.
- Write the brief from the template, and ask for corrections before generating anything.
Rules it follows: evidence over plausibility, uncertainty marked as "inferred", the project's own vocabulary, and no opinions about the architecture unless you ask for them. The playbook covers where to look per stack, and how to handle monorepos, libraries, CLIs and data pipelines.
The brief from the example is here.
2. Generate: project-deck, architecture-explorer and user-stories¶
Once the brief exists the deck and the explorer are independent, so Claude can build them in parallel. The user stories come after the explorer, because they use its model.
The deck. Claude writes an outline first (chapters, slide pattern, headline sentence and the source of each fact), then copies the slide patterns it needs from the template, draws figures with a small Python SVG library, and builds one HTML file. See Project deck.
The explorer. Claude writes the architecture as one data block, window.MODEL: nodes, relationships,
scenarios with their use cases, state machines and, where they help, pictures. When the data matters it adds the
schemas, tables and fields, imported from the migrations and schema files with import-schema.mjs and tied by hand to
the boxes they live in and the steps that read and write them. The build script puts it into the explorer template,
validates it, and writes the same model as an RDF graph in the terms of the plugin's ontology.
Where the architecture should also live in the repository (a README, docs/, a pull request), the map can be written
as Mermaid diagrams. See Architecture explorer, Schemas and data and
RDF export.
The user stories. Claude plans the stories with you, one line each, from the brief and the explorer's model: its
people are the actors and its scenarios the journeys. It gets one or two screens per story (screenshots of the running
app when it can run and you agree, else pictures the project has, else illustrative wireframes drawn from the UI
code), writes the stories as one data block, window.STORIES, with acceptance criteria and the files and lines where
they can be checked, and builds one HTML file with the screens inside. See User stories and feedback.
3. Check¶
No output is reported as done until Claude has looked at it:
- the explorer build checks the model, every source path and line number, every image file, and the layout (arrows that bend around boxes, cross, or pass behind them; lines of the Data view that cross a card);
- the deck build reports text that does not fit, arrows through boxes and labels that overrun;
- the stories build checks every actor, scenario, step range, image and source line, and a check in headless Chrome draws on a screen, records a voice note, exports a story and imports it back;
- each page is opened in headless Chrome or Edge and screenshotted at the states that matter, and Claude reads the screenshots.
Anything it could not verify is listed in its final report.
4. Later: architecture-history¶
Committed with the code, model.js has a history. /c4-model-agentic-plugin:architecture-history reads it with git,
without changing your checkout, and writes the versions as an RDF 1.2 dataset with PROV-O provenance, Markdown diffs
between commits, branches or pull requests, and blame; then it rebuilds the explorer with a history bar and a compare
mode. A model that is missing or out of date at a commit you need is regenerated in a worktree outside your checkout.
See History and diffs.
Outside Claude Code¶
The MCP server in mcp/ gives ChatGPT, Claude and other MCP clients the same method for a public GitHub
repository: the explorer's own validator, the ontology's shapes and the real file paths check the model, and the
explorer is drawn inside the chat.