/architecture:map-components [container] [--group-by directory|namespace|layer] [--layers <list>] [--dialect likec4|c4-plantuml]from architecture
Charts modules inside one deployable as a C4 component diagram from build declarations. Answers which way internal arrows point and how modules layer.
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 the subject. Collect its root with an individual Bash
call, git rev-parse --show-toplevel. A failure (not a repository, git
unavailable) is an unknown value; ${CLAUDE_PROJECT_DIR} is the root either way.
Answer "what are the modules inside this one deployable, and which way do the
arrows point" from build declarations, not from recall. The scope is one
container. Charting every deployable is /architecture:map-containers. The
landscape of repositories is /architecture:map-landscape.
Read ${CLAUDE_PLUGIN_ROOT}/reference/config.md first. Run
bash "${CLAUDE_PLUGIN_ROOT}/lib/resolve-convention-home.sh" --root "${CLAUDE_PROJECT_DIR}"
and resolve architecture_dir and the optional component_layers per ${CLAUDE_PLUGIN_ROOT}/reference/config.md
"Where the config lives" and "Resolution order, per key"; never parse the root instruction file
yourself. component_layers has no default. Absent, --group-by layer cannot run.
This skill does not read landscape_dialect and does not add a dialect key.
The diagram dialect is diagram_dialect.system from the authoring-formats
topic doc. Resolve it 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 `components.md` with the prose and 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. c4-plantuml writes components.md with one fenced
plantuml block (C4_Component); likec4 writes it with one fenced likec4
block and a component view of the container. Both carry the tables. none
writes components.md with the prose and tables and no diagram block.
This skill never writes the consumer's root instruction file or its topic doc.
The view is a render of dependency-graph.json, the record
/architecture:map-dependencies writes. The writer's layout is in the header
of its dependency-graph.sh (--help prints it), and what this renderer reads
from it is in dependency-graph.md. Do not draw
a box the record does not contain, and do not add an edge the record does not
cite.
<architecture_dir>/dependency-graph.json already exists, confirm it
is schema_version 1, then render that file. Do not recollect, and leave the
file untouched. Say so in the report.bash "${CLAUDE_PLUGIN_ROOT}/skills/map-dependencies/scripts/dependency-graph.sh" \
--out "<architecture_dir>/dependency-graph.json" "<root>"
A tree holding no manifest that a reader handles is result unknown with empty
node and edge arrays, not an empty architecture. The render says so and draws
nothing. The ecosystems the extractor reads, and the ones it declines, are listed
in /architecture:map-dependencies.
A container is one deployable: an indegree-zero project, plus the projects
reached by following internal edges. A test project (the node's test field) is
not a deployable: its references are not counted toward a project's indegree, so
Api.Tests referencing Api leaves Api a root, and it is never listed as a
choice. A stray manifest is not a deployable either: a project no internal edge
touches, in an ecosystem that no linked project and no .NET project shares (a
tooling package.json, a requirements file beside a .NET tree). It is not a
choice, it is not counted as outside the container, and the report says how many
were set aside. --container charts one anyway. A Node workspace root draws no
edge to its members and shares their ecosystem, so it is not set aside: a plain Node
workspace lists the root beside its top member, and --container picks the member. When exactly one deployable
covers every project, that is the subject.
When the renderer exits 3, it lists the choices and writes nothing. It also
exits 3 when every project is a test project, and says so; --container still
charts one on request. In an interactive run, ask which one and re-run with
--container. In a non-interactive run, stop and report the list. Do not chart
all of them.
--group-by is directory (the default), namespace, or layer.
directory groups by the parent of the project's own directory, one level up:
src/Api/Api.csproj and src/Domain/Domain.csproj both group under src.
A project directly under the root, or one folder down, groups under ..namespace groups by the containing namespace: the node's namespace field
(RootNamespace, else AssemblyName, from the project file), else the project
name, with the last dotted segment dropped. Billing.Api and
Billing.Domain both group under Billing. A name with no dot is its own
group.layer requires a declared layering convention: component_layers in the
topic doc, or --layers host,application,domain ordered from outside to
inside. A node matches a layer by a whole path segment or a dotted name
segment. An edge from a later layer to an earlier one is drawn as a layer
violation. The mark is informational. The exit code stays 0. Enforcement
belongs to the consumer's architecture tests.Above the node threshold (the record's node_threshold, else 40, or
--node-threshold), the view collapses to coarser groups and says so on the
artifact. It does not drop a component or an evidence row.
"${CLAUDE_SKILL_DIR}/scripts/render-components.sh" \
--graph "<architecture_dir>/dependency-graph.json" \
--out "<architecture_dir>" \
--dialect "<likec4|c4-plantuml|none>" \
--group-by directory \
--root "<root>" \
--layers "<component_layers>" \
--container "<name>" \
--notes "<architecture_dir>/components-notes.md"
Omit --layers when no convention is declared. Omit --container when the
graph has a single deployable. Omit --notes when components-notes.md does
not exist yet.
components-notes.md is the only file in the architecture directory you author,
and the only one you never overwrite: read it, extend it, and mark an
annotation as an annotation. Annotations say what a component is for.
The renderer prints one summary line. Keep it for the report:
components: container="<name>" components=<n> edges=<n> drawn_edges=<n> violations=<n> aggregated=<yes|no> thin=<yes|no> external_collapsed=<n> unresolved=<n> dialect=<likec4|c4-plantuml|none>
--root lets the renderer compare the record's generated_on with the HEAD
commit date of <root>. When they differ it writes one line, dependency-graph.json was generated on <d>; HEAD commit date is <d2>, into components.md and to
stderr, and renders anyway.
A thin result (thin=yes) is a single module with no internal edges. The
artifact says so and names the neighboring rungs. It does not present a one-box
diagram as the answer.
End every run with this block, in this order:
none written when the run stopped to
ask for a container.components=, edges=, drawn_edges=, quoted from the
summary line.no, or yes with the neighboring rungs named in the
artifact (/architecture:map-landscape, /architecture:map-containers,
/architecture:improve).no, or yes with the threshold and the statement that
nothing was dropped.dependency-graph.json, or the one
dependency-graph.sh wrote this run. Quote the staleness warning when the
renderer printed one.diagram_dialect.system, its value, and the layer: argument,
team convention doc <path>, or unset (no C4 view emitted).After the report, offer an interactive view of the chosen deployable's closure in one sentence. The markdown
and dependency-graph.json stay authoritative. Build it only with
${CLAUDE_PLUGIN_ROOT}/scripts/build-view.mjs components --record <dependency-graph.json> --from <the chosen deployable's node id>, 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.
/architecture:map-containers.<architecture_dir>
(or --out).<architecture_dir>/dependency-graph.json is already present.
Whether a stale graph should be regenerated is the caller's call; the
renderer's warning is how the staleness is surfaced, and it never blocks./architecture:improve./planning:design module./architecture:map-landscape./architecture:adr.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. The key is documented in ${CLAUDE_PLUGIN_ROOT}/reference/config.md.
Unset, components.md carries the tables and no diagram, and the report says no view was
emitted.
Mermaid stays out, and render-components.sh has no mermaid C4 path. The decision, its pointer
and its recheck trigger live in the convention's
record.Rel (AddRelTag plus $tags), never an
UpdateRelStyle call. The C4_Component 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 § Component diagram
and
§ Including the C4-PlantUML library
live.[email protected] validate exits 0 on the golden blocks in ${CLAUDE_PLUGIN_ROOT}/lib/likec4-golden/
(components.c4, components-aggregated.c4), which render-components.test.sh diffs
against. Pointer: when checking the syntax the renderer writes, fetch
LikeC4 specification § Element kind,
model § Element,
views § Scoped views and
styling § Relationship 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.{"id":. An
edge line starts with {"from":. Any other layout exits 1 and writes
nothing. Regenerate the graph; do not pretty-print it.result key
did not come from dependency-graph.sh. The renderer exits 1 and writes
nothing. Stop and point at /architecture:map-dependencies, which owns
rewriting that file.What SKILL.md sets; muted values are Claude Code's defaults
bash15 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./improveCodebase scan for module friction (shallow modules, module seams, locality, cross-boundary leaks): HTML report, Design-It-Twice interview. Use for 'improve architecture', 'shallow modules', 'locality', deepening, compare interface, derive conventions, layer boundaries, which references cross a boundary. Not for cross-dimension: /improvement:find./improve-layoutImprove layoutCo-change folder-layout check from git history: finds co-change clusters and folder spread, judges cards against repo layout style, and interviews on a target layout (moves no files). Use for 'co-change layout', 'co-change clusters', or whether co-changing files live in the right folders. Not for module depth/boundaries: /architecture:improve./map-containersMap containersC4 container diagram of a system: deployables, stores and brokers their tracked config binds, and resolved endpoint edges. Use for 'what actually runs', 'deployables and databases', 'modular monolith', or service-to-broker binding. Not for repos (/architecture:map-landscape), one deployable (/architecture:map-components), or environment topology./map-contextMap contextC4 system context of one system from tracked config: actors and external systems from connection strings, base URLs, and broker namespaces (credentials redacted). Use for 'context diagram', 'what does this system talk to', 'who uses this system'. Not for repos (/architecture:map-landscape) or module depth (/architecture:improve).npx claudepluginhub melodic-software/claude-code-plugins --plugin architectureOther plugins' skills for the same job