Skip to content

Getting started

Install

Let your agent do it: paste this into Claude Code.

Install the Claude Code plugin c4-model-agentic-plugin for me.
Read https://raw.githubusercontent.com/caviri/c4-model-agentic-plugin/main/INSTALL.md
and follow its "Steps for the agent" section exactly. When you are done, tell me
what you ran, what you checked, and how I start using the plugin.

INSTALL.md has the agent's steps, team installs, updating and removing. Or add the marketplace and install the plugin yourself, in Claude Code:

/plugin marketplace add caviri/c4-model-agentic-plugin
/plugin install c4-model-agentic-plugin@c4-model-agentic-plugin

To try it from a local clone without installing:

git clone https://github.com/caviri/c4-model-agentic-plugin
claude --plugin-dir ./c4-model-agentic-plugin

Requirements

Tool Needed for Required
Python 3 Building the deck (standard library only) For the deck
Node.js 18+ Building and validating the explorer No: without it, Claude pastes the model into the template by hand
Node.js 18+ and git The architecture history For the history
Node.js 18+ Building the user stories page (22+ for its browser check) For the user stories
Chrome or Edge Screenshots, so Claude can look at its own output and fix layout problems No, but recommended

Not using Claude Code? The MCP server brings the explorer to ChatGPT and Claude.

Run it

Open Claude Code in the project you want documented and run:

/c4-model-agentic-plugin:explain-project
Command Result
/c4-model-agentic-plugin:explain-project Both outputs, for a new developer
/c4-model-agentic-plugin:explain-project deck Only the deck
/c4-model-agentic-plugin:explain-project explorer Only the explorer
/c4-model-agentic-plugin:explain-project stories Only the user stories page (it uses the explorer's model)
/c4-model-agentic-plugin:explain-project all The deck, the explorer, then the user stories
/c4-model-agentic-plugin:explain-project both for stakeholders, focus on the review flow Free text sets audience and emphasis

Plain requests work too: "explain this project as a deck", "build an architecture explorer for this repository", "write the user stories of this project with screens we can comment on".

Claude asks a few questions before it writes anything (who will read it, what to include, which flows matter) and shows you its summary and container list to correct. Answer "just go" to accept its defaults; it then lists its assumptions at the top of the brief.

What you get

communications/
  project-brief.md
  project-deck/
    index.html              the deck
    src/                    slide source, figure code, build script
  architecture-explorer/
    index.html              the explorer
    model.js                the architecture model it was built from
    architecture.jsonld     the same model as an RDF graph
    architecture.ttl        the same graph in Turtle
    architecture.rete       written when the rete CLI or npm package is available
    img/                    pictures the model shows, if any
  user-stories/
    index.html              the stories page, with the screens inside
    stories.js              the stories it was built from
    img/                    screens captured or drawn for it

Open any index.html directly from disk. The example shows what each one looks like for a small project. When the data matters to the project, the explorer has a Data tab with its schemas, tables and fields (Schemas and data). On the user stories page readers draw and talk over the screens and send the stories back to you (User stories and feedback).

Follow the architecture over time

Commit communications/architecture-explorer/model.js with the code. Once it has a few versions:

/c4-model-agentic-plugin:architecture-history
/c4-model-agentic-plugin:architecture-history diff main feature/x
/c4-model-agentic-plugin:architecture-history pr 42

These write a timeline, diffs and a pull request's architecture impact, and rebuild the explorer with a history bar and a compare mode. See History and diffs.

Update the output later

Each page is built from sources kept next to it, so you can edit and rebuild without the plugin.

Edit communications/architecture-explorer/model.js, then from the project root:

node <plugin>/skills/architecture-explorer/scripts/build-explorer.mjs \
  communications/architecture-explorer/model.js \
  communications/architecture-explorer/index.html --root .

The build validates the model, checks every source path and image, reports arrows that bend or cross, writes the library icons the model names into the page (fetched once from jsDelivr and cached, unless --no-fetch), and writes architecture.jsonld and architecture.ttl. See the data model, and Modelling with C4 for what belongs in a container, a component or a code element. You can also edit the model in the page itself (✎ edit) and download the new model.js; see Edit the model in the page.

After a migration or a schema change, import-schema.mjs <files> --check communications/architecture-explorer/model.js lists where the model's tables and fields no longer match the source; see Schemas and data.

Edit communications/project-deck/src/deck.src.html or figures.py, then:

cd communications/project-deck/src
python -B figures.py figs.json
python -B build.py deck.src.html --figs figs.json

See Project deck for the static and offline variants.

Edit communications/user-stories/stories.js, then from the project root:

node <plugin>/skills/user-stories/scripts/build-stories.mjs \
  communications/user-stories/stories.js --root .

Add --notes <files> to put the feedback readers sent back into the page. See User stories and feedback.

Or ask Claude: "update the architecture explorer, the export flow changed".

Pages made by an older version of the plugin: /c4-model-agentic-plugin:update-communications rebuilds them with the current templates, keeping a model edited in the page and readers' notes; see Updating pages.

Publish the output

All the outputs are static files. To share them, publish the communications/ folder on any static host. On GitHub Pages, for example, commit the folder and point Pages at it, or copy the index.html files into an existing Pages site. These docs do the same with the example.

To put the architecture in the repository itself, model-to-mermaid.mjs writes the map as Mermaid diagrams that GitHub and GitLab draw in Markdown (--all --out docs/architecture.md: the context, the containers and each container's components); see Mermaid in your README.

The explorer loads its web fonts from Google Fonts and needs nothing else from the network, except for the .rete download (see RDF export), the preview of the Mermaid panel (mermaid.js from jsDelivr, loaded when the panel opens) and pictures given as web addresses. Pictures given as files sit in img/ next to the page: publish that folder too, or build with --embed-images to put them inside the page. The deck loads reveal.js from a CDN unless it was built with --inline-js. The user stories page loads nothing from the network; readers' notes stay in their browser until they download them.