/architecture:map-context [system] [--actors <file>] [--focal <name>] [--dialect likec4|c4-plantuml] [--out <dir>]from architecture
Charts a C4 system context diagram for one software system from tracked configuration, showing actors and external systems derived from connection strings, base URLs, and broker namespaces.
Ships in architecture. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
The current repository is both the consumer, whose convention home declares where artifacts land, and the default subject, the repository whose tracked configuration names external systems.
Collect with an individual Bash call, one command per call: the project root,
git rev-parse --show-toplevel. Treat a failure (not a repository, git unavailable) as an unknown
value and carry on; ${CLAUDE_PROJECT_DIR} is the resolver's --root either way. A [system]
argument is the focal name (--focal). It does not select a different tree.
Answer "what is this system, who uses it, and which external systems does its configuration name" for one software system. Every external node traces to a config key in a tracked file. The scripts collect and render. Do not draw a node the script did not emit, and do not invent a person.
Read ${CLAUDE_PLUGIN_ROOT}/reference/config.md first. This skill writes into architecture_dir.
It does not read landscape_dialect and it does not add a dialect key. The diagram dialect is
diagram_dialect.system from the authoring-formats topic doc.
Run bash "${CLAUDE_PLUGIN_ROOT}/lib/resolve-convention-home.sh" --root "${CLAUDE_PROJECT_DIR}"
and resolve architecture_dir per ${CLAUDE_PLUGIN_ROOT}/reference/config.md "Where the config lives" and
"Resolution order, per key"; never parse the root instruction file yourself.
Resolve diagram_dialect.system by restating this ladder, then running the resolver rather than
parsing the topic doc yourself. The ladder is a resolution order, not a task list:
1. Anchor at the repository root: `${CLAUDE_PROJECT_DIR}` when set, otherwise
`git rev-parse --show-toplevel`. Never a CWD-relative read.
2. Resolve the convention home `<home>` with the bundled resolver above. Never hand-parse the root
file.
3. The printed home is repo-relative: join it to the root, then pass
`<root>/<home>/authoring-formats/README.md` to the resolver.
4. Layer order is one layer deep: an explicit `--dialect` argument, then the team convention doc.
There is no personal override.
5. `diagram_dialect.system` has no default. Allowed values are `likec4` and `c4-plantuml`. When it
is unset, write `context.json` and `context.md` with the tables, and draw no diagram block.
6. Degrade soft, and say so. No pointer, no doc, no key, or an unrecognized value (mermaid
included, which the convention refuses) each resolve to emitting no view. The resolver names
the cause on stderr. Do not hard-fail and do not ask the operator to create the surface
mid-task.
7. Report provenance: the key, the value, and the layer (`argument`, `team convention doc <path>`,
or `unset (no C4 view emitted)`).
bash "${CLAUDE_PLUGIN_ROOT}/lib/resolve-diagram-dialect.sh" --kind system \
--formats "<root>/<home>/authoring-formats/README.md"
Omit --formats when no convention home resolved. Stdout is likec4, c4-plantuml, or none.
An explicit --dialect likec4|c4-plantuml on the invocation wins and the resolver is not required.
This skill never writes the consumer's root instruction file or its topic doc. /architecture:setup apply owns both.
Actors are operator-stated. Ask once, in an interactive run, who uses the system. Write only the
names and descriptions the operator stated, one name<TAB>description line each, to a temp file,
and pass that file as --actors. If the operator names nobody, omit --actors.
A non-interactive run omits --actors. The actors array stays empty. Never fill it from
CODEOWNERS, git history, a README, or a guess.
The collector screens each line with the same redactor as config values and skips a line that carries
a credential (Token=, ClientSecret=, Bearer <value>, a cloud key id, URL userinfo), naming the
skip on stderr. Reword the line without the credential and pass it again.
"${CLAUDE_SKILL_DIR}/scripts/collect-context.sh" \
--repo "<subject-repo>" --generated-on "<YYYY-MM-DD>" \
--out "<architecture_dir>/context.json"
Add --focal "<system>" when the invocation named one. Add --actors "<file>" only for
operator-stated rows. Keep the ${CLAUDE_SKILL_DIR} anchor;
${CLAUDE_PLUGIN_ROOT}/reference/config.md § Script paths
says why.
The collector creates the parent directory of --out. Exit 1 means the record could not be written
and nothing was: report the message and stop before rendering.
The record is schema_version 1 in the one-object-per-line layout the script writes. focal.origin
is derived. Each external row carries host, kind, port, file, key, and
origin: derived. The value that produced the row is not stored. Actor rows exist only from
--actors, and their origin is operator.
The collector reads tracked files only (git ls-files). It matches JSON, YAML, env, XML, config,
Terraform, Bicep, TOML, properties, ini, and conf text. It skips package manifests and previously
generated architecture artifacts. A gitignored or untracked file is not a source. Configuration is
untrusted text: the script matches it and never executes it.
An http URL becomes an external system only under a key that names an integration: a key ending in
url, uri, endpoint, host, hostname, address, authority, or server (Partner.BaseUrl,
ApiBaseUrl, Smtp.Host). A URL under homepage, repository, bugs, license, contact,
docs, site_url, repo_url, or an OpenAPI servers or externalDocs entry describes the system
or its documentation, so it draws no node, and neither does a URL under a key with no such name. The
other kinds (sql, storage, broker, authority, cache, mail) are not gated by key name. A
Data Source that names a .db, .sqlite, .sqlite3, .mdb, or .mdf file is a local file, not
a host.
Redaction is ${CLAUDE_PLUGIN_ROOT}/lib/redact-connection.awk, the same functions
map-containers and map-deployment call. It scans every value whatever its key. A password,
account key, token, URL userinfo, or query string cannot become a field. The closing report quotes
the summary line, not a raw value.
subject is the github.com origin repository name when that remote resolves, otherwise the
directory basename. --focal overrides the name drawn in the center. The helper is inline in
collect-context.sh, the same github.com rule portfolio-facts.sh uses.
"${CLAUDE_SKILL_DIR}/scripts/render-context.sh" \
--record "<architecture_dir>/context.json" --out "<architecture_dir>" \
--dialect "<likec4|c4-plantuml|none>"
Write context.json first, then render from it. c4-plantuml writes context.md with one fenced
plantuml block: a focal System, a Person for each operator-stated actor, and a System_Ext
for each derived external system. likec4 writes context.md with one fenced likec4 block: the
same elements as softwareSystem, person, and externalSystem, and a context view. none
writes context.md with the node and evidence tables and no diagram block. Every dialect carries
those tables.
The script prints one summary line on stdout:
context: focal=<name> externals=<n> actors=<n> thin=<yes|no> dialect=<likec4|c4-plantuml|none>.
Keep it for the report. thin=yes means no external systems were derived.
Exit 1 means the record is unreadable, not schema_version 1, or not in the one-object-per-line layout. Nothing was written. Report that message. Do not reformat the record by hand.
End every run with this block, in this order, filled from the record and the script exits:
none written when the run stopped before a home existed.--focal or the repository name.diagram_dialect.system, its value, and the layer: argument,
team convention doc <path>, or unset (no C4 view emitted).externals= and actors= quoted from the summary line.none when no --actors file was passed, or the operator-stated names when one was.no, or yes. On yes, say that no external systems were found in tracked
configuration and name the neighboring rungs the artifact names: /architecture:map-landscape,
and containers (the deployables inside this system).After the report, offer an interactive view of context.json in one sentence. The markdown and the record
stay authoritative. Build it only with ${CLAUDE_PLUGIN_ROOT}/scripts/build-view.mjs context, never
hand-written; the shared medium resolver decides the destination, with this plugin's medium option
${user_config.medium}, or "" when that reads empty or unsubstituted (never put a
${user_config.*} string in a shell command), and its report line is printed. Procedure:
${CLAUDE_PLUGIN_ROOT}/reference/rendered-view.md.
landscape_dialect, or draw mermaid C4.context.json and context.md under
the resolved output directory.--out, and no confirmed architecture_dir is a stop, not a
default./architecture:map-landscape./architecture:adr./architecture:improve./planning:design integration.C4_Context include name is our inference from the README's container example.
No PlantUML run has parsed this output. Pointer: when checking the macros or the include the
renderer writes, fetch
C4-PlantUML README § System Context & System Landscape diagrams
and
§ Including the C4-PlantUML library
live.[email protected] validate
exits 0 on the golden block in ${CLAUDE_PLUGIN_ROOT}/lib/likec4-golden/ (context.c4),
which render-context.test.sh diffs against. Pointer: when checking the syntax the renderer
writes, fetch
LikeC4 specification § Element kind,
model § Element,
views § View definition and
styling § Shape live. As of: 2026-11-10. Recheck
trigger: any of those sections changes that syntax, or a newer likec4 release ships: set
LIKEC4_VALIDATE=1 when running the test to re-run the CLI.--actors file. A non-interactive run passes no file, and the artifact says so.diagram_dialect.system, and it has no default. Every C4 view of the code reads the key
the authoring-formats convention assigns to
C4 system views, which refuses mermaid. An unset key is the
common case: the run still writes context.json and a context.md with no diagram, and the report says no
view was emitted. The
key is documented in ${CLAUDE_PLUGIN_ROOT}/reference/config.md.
Mermaid stays out, and render-context.sh has no mermaid C4 path. The decision, its pointer
and its recheck trigger live in the convention's
record.Password, ClientSecret, AccountKey, and the rest named in redact-connection.awk)
produces no row. Loopback hosts are not external systems. Do not paste a raw value into the
report to show the work.{"name":
object per line and externals are one {"host": object per line, or the array is [] on its
key's line. render-context.sh exits 1 on any other shape and writes nothing.git ls-files is the file set. A gitignored .env and an untracked
config file contribute no node, which is what keeps a local secret file out of a committed
diagram.context.json is not re-read as evidence.What SKILL.md sets; muted values are Claude Code's defaults
bashnpx claudepluginhub melodic-software/claude-code-plugins --plugin architecture15 skills in this plugin
/adrArchitecture decision records: record (retires reversed record on yes; if no convention, writes nothing until human picks a shape), audit unbacked records (read-only), prune accepted. Use for 'write an ADR', 'record this decision', why we chose X, design interview, current ADRs. Skip if no alternative was weighed, or indices/migrations/status./enforce-boundariesEnforce boundariesArchitecture module-boundary checks in the repo: each rule recorded in ## Boundary rules gets the strongest supported mechanism, proven to fail on an injected violation and pass once removed. Use for 'enforce our boundary rules', 'add an architecture test', 'make this layering rule fail the build', or confirmed boundary findings./Other plugins' skills for the same job