Updating pages¶
Pages built by an older version of the plugin keep working, but they miss what came later. /update-communications
rebuilds them with the current templates, and keeps what only the pages hold: a model edited in the page, the history
embedded in it, and readers' notes on the user stories.
/c4-model-agentic-plugin:update-communications
/c4-model-agentic-plugin:update-communications communications/
/c4-model-agentic-plugin:update-communications ~/Downloads/explorer-edited.html
/c4-model-agentic-plugin:update-communications ~/Downloads/shop-explorer.zip
Claude runs a dry run first and shows you the plan, asks before writing, backs the old files up, updates, checks the result and reports. Or ask in your own words: "update the explorer to the latest version of the plugin".
What it updates¶
| Input | What happens |
|---|---|
A communications/ folder (or the project that holds it) |
The explorer, the user stories and the deck are rebuilt in place; the history is kept and embedded again |
| A single explorer page | Its own model (with edits made in the page) and its embedded history are taken from it, and the page is rebuilt in place |
| A single user stories page | Its stories, pictures and readers' notes are taken from it and the page is rebuilt in place; its journeys need the explorer's model.js |
An Everything ZIP (export ▾ → Everything) |
A new <name>-updated.zip next to it, with the page and the graph rebuilt; the original stays |
A deck page does not carry its source: without project-deck/src/deck.src.html it stays as it is.
How it knows which version made a page¶
Every page the plugin builds carries two lines in its <head>:
<meta name="generator" content="c4-model-agentic-plugin 0.1.0">
<meta name="c4-page" content="explorer; format 1; template sha256:fec282c4eb62">
A page without them was built before 0.1.0 was released. A page already stamped with the current version and template is left alone.
What it never loses¶
- A model edited in the page. If an explorer page's model differs from
model.js(someone edited it in the page and saved it), the plan says CONFLICT and you choose:--prefer-pageor--prefer-source. Without a choice,model.jswins and the page's model is kept asmodel.from-page.js. - Readers' notes. A stories page's notes are saved to
notes-from-page.jsonand built back into the new page; the report counts them before and after. - The old files. They go to
communications/.backup-<date>/first (or next to a single page).
Edits kept only in a reader's browser (the explorer's edit mode, story notes never downloaded) are not in any file, so ask readers to download the page or the model first.
Format changes¶
When a release changes the shape of the model or of the stories, the update migrates them and logs each migration in
the report. For example, rdf used to be the base IRI as a string and is now { base, vocab, prefixes }. A migration
that rewrites model.js writes it as JSON, so comments in it are lost; the backup has the original.
Run it yourself¶
node <plugin>/skills/update-communications/scripts/update-communications.mjs communications/ --dry-run
node <plugin>/skills/update-communications/scripts/update-communications.mjs communications/
| Option | Meaning |
|---|---|
--dry-run |
Show the plan; write nothing |
--backup <dir>, --no-backup |
Where the old files go (default communications/.backup-<date>/), or no backup |
--only explorer,stories,deck,history |
Only these |
--root <dir> |
The project root, to check source paths (default: the folder holding communications/, when the paths are there) |
--model <model.js> |
The explorer's model, for a single stories page |
--prefer-page, --prefer-source |
Which model wins when an explorer page and model.js differ |
--force |
Rebuild pages that are already current |
--json |
The result as JSON |
The result is in update-report.md (in the communications folder, or next to the page or the ZIP): before and after
versions, what was recovered, migrated and rebuilt, the builders' checks, and what is new since the old version, from
the changelog.
Source
The procedure Claude follows is skills/update-communications/SKILL.md.