/architecture:map-dependencies [path] [--include-external] [--external-only] [--cycles-only] [--out <dir>]from architecture
Builds a project dependency graph from build manifests, showing which projects depend on which with file and declaration citations. Outputs a JSON record and a Mermaid flowchart of internal edges.
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 default subject. Collect its root with one Bash call,
git rev-parse --show-toplevel. Treat a failure as an unknown root and ask for a path.
Do not walk the working directory for nested repositories.
Answer "which project depends on which, and in which direction" from build declarations
a script read. Every edge names the file and the declaration it came from. The canonical
artifact is dependency-graph.json. The human render is a mermaid flowchart of the
internal edges. This is the model, not a C4 diagram.
The dialect decision lives in ${CLAUDE_PLUGIN_ROOT}/reference/config.md. Read it.
Do not restate it, and do not emit a C4 view from this skill. This flowchart follows
neither landscape_dialect nor diagram_dialect.system, the key the C4 views read.
Read ${CLAUDE_PLUGIN_ROOT}/reference/config.md for architecture_dir. Run
bash "${CLAUDE_PLUGIN_ROOT}/lib/resolve-convention-home.sh" --root "${CLAUDE_PROJECT_DIR}"
and follow the exit code. Never parse the root instruction file yourself.
--out <dir> wins for this run alone. Then a declared architecture_dir. With neither,
including every non-interactive run, stop and point at /architecture:setup. This skill
never writes the topic doc.
"${CLAUDE_SKILL_DIR}/scripts/dependency-graph.sh" \
--out "<architecture_dir>/dependency-graph.json" "<repo-path>"
The script writes the record itself and exits 1 when it cannot. generated_on is the
HEAD commit date (unknown with no commit), so a second run on the same commit is
byte-identical; --generated-on <date> overrides it. The document is one object per
line. Do not pretty-print it. A reader given another layout exits 1.
result is ok or unknown. unknown means no shipped adapter could read the tree.
The message says which manifests were found. That is the answer. Do not draw a diagram,
and do not fill the arrays by hand. An empty graph is result ok with project nodes
and no edges. Read it as a repository that declares no references only when no
unread-reference-tags or unread-manifest finding exists. The first means the collector
skipped reference tags in a file, and the edge list is short by that count. The second
means a manifest holds a declaration whose shape no reader handles; its evidence is the
file, a colon, and the declaration skipped, one finding per declaration.
Every shipped adapter whose manifests are present runs, and their nodes, edges and
findings are one record. ecosystem is the adapter's name when one ran, mixed when
more than one ran, and unknown when none did. Each node carries its own ecosystem.
reference/dependency-graph-record.md records the upstream source, verification date
and recheck trigger behind each non-.NET adapter's rules below.
The .NET adapter:
ProjectReference is a directed internal edge. The target is the Include path
relative to the project file. A target that is missing, or that resolves outside the
repository root, is status unresolved. Never match it to a project of the same
name somewhere else on disk.PackageReference is an external package edge. The node id is pkg: plus the Include.ProjectReference or PackageReference in a Directory.Build.props or
Directory.Build.targets is an edge from every project under that file's folder whose
nearest such file it is, and the evidence cites the props file. A project never gets an
edge to itself that way. Any other .props or .targets file, and
Directory.Packages.props, has no known importer, so its references are counted in an
unread-reference-tags finding and not drawn.*.sln and *.slnx contribute membership. A project path that does not resolve inside
the root is a finding, not an edge.using or an import is not an edge.The Node adapter:
package.json outside node_modules is a project node, id its repo-relative path.
Workspace members are the package folders that the workspaces globs (array or
{"packages": [...]} form) and a pnpm-workspace.yaml packages list expand to.workspace:, file: or link: pointing at a
package folder inside the root, is an internal project edge. Every other entry is an
external package edge to pkg:node:<name>.package.json
is unresolved. Never match it to a package of the same name elsewhere on disk.packages:, a catalog: spec and a non-string dependency
value are unread-manifest findings, not edges.The Go adapter:
go.mod is a project node, id its repo-relative path, name its module path.replace whose target is a local path (./ or ../) holding a go.mod inside the
root is an internal project edge, and the evidence cites the replace line. A missing
or out-of-root target is unresolved.require of a module that is another go.mod in the repo is internal only when a
replace or a go.work use line points it there; otherwise it is an external edge
to pkg:go:<module>. go.work use lines are membership.go.work replace, and a use line
naming no go.mod in the root are unread-manifest findings.The Python adapter:
pyproject.toml is a project node, id its repo-relative path. A setup.py or
requirements*.txt with no manifest beside it is a node too; one beside a manifest is
read as that project.pyproject.toml (else a setup.py), and the evidence cites the declaration.
Path references are a name @ file: dependency string, a poetry or uv path = entry,
and a -e, ./ or ../ requirements line. A missing or out-of-root path is
unresolved.[tool.uv.workspace] members glob, minus exclude, is an internal project edge from
the workspace root to each pyproject.toml it matches; a literal member holding none is
unresolved.pkg:python:<normalized name>.
-r includes are followed only inside the root.setup.py is never executed or parsed; each one is an unread-manifest finding. So
are dynamic dependencies, a uv workspace = true source, a multi-line inline table, and
an include that is missing or outside the root.The Rust adapter:
Cargo.toml is a project node, id its repo-relative path.path = dependency in [dependencies], [dev-dependencies] or [build-dependencies]
is an internal project edge when it names a folder inside the root holding a
Cargo.toml, and the evidence cites the declaration. A missing or out-of-root path is
unresolved.[workspace] members glob, minus exclude, is an internal project edge from the
workspace root to each Cargo.toml it matches; a literal member holding none is
unresolved.workspace = true takes its source from the nearest ancestor
[workspace.dependencies]: a path = entry is an internal edge, any other entry an
external one, and the evidence cites both declarations. A workspace entry no member
inherits draws no edge.pkg:rust:<name>.[target.*] dependency table, a path = under [patch] or [replace], a
workspace = true with no workspace entry to resolve it, a multi-line inline table, and
a members glob the reader cannot resolve are unread-manifest findings.The JVM adapter (Gradle and Maven):
pom.xml, build.gradle and build.gradle.kts is a project node, id its
repo-relative path. A folder with a settings.gradle(.kts) and no build file is a node
under the settings file.settings.gradle(.kts) include argument is an internal project edge from the settings
folder's project to the folder its project path names, when that folder holds a build
file. A project(':x') or project(path = ':x') dependency in a build file resolves from
the nearest settings file above it. A pom.xml <modules><module> entry is an internal
project edge to the pom.xml in the folder it names. Each edge cites the declaration.
A project path or module naming no build file, or leaving the root, is unresolved.includeFlat, includeBuild, an include holding a variable, an interpolated string or a
spread, anything inside a loop, a projectDir, buildFileName or name assignment,
apply from, a projects.x type-safe accessor, a project(...) with a non-literal
argument, a module holding a ${property}, and a module naming a pom file not called
pom.xml are unread-manifest findings.Read: .NET, Node, Go, Python, Rust, and JVM (Gradle and Maven). Declined: Ruby (Gemfile) and
PHP (composer.json) are detected and named in the record's message, never parsed. The
unread rule: a manifest or declaration no reader handles is reported, never guessed at and
never dropped. A tree holding only declined manifests is unknown; in a tree a reader ran on,
the message still names the declined ecosystems and each skipped declaration is an
unread-manifest finding.
node_threshold in the record (40) is the documented count of internal project nodes
above which the human diagram aggregates to directories. The JSON stays at project
resolution.
"${CLAUDE_SKILL_DIR}/scripts/render-dependencies.sh" \
--record "<architecture_dir>/dependency-graph.json" \
--out "<architecture_dir>"
This writes dependency-graph.md. The summary line on stdout is the report's counts.
Keep it. Do not redraw the flowchart yourself.
--include-external: draw package edges as well.--external-only: draw package edges and not internal project edges.--cycles-only: draw only internal edges that sit on a reported cycle.--include-external and --external-only together are a usage error.Cycles are a section at the top of dependency-graph.md. Above the threshold the diagram
says it aggregated to directory level.
dependency-graph.json and dependency-graph.md, or none written when
there was no architecture_dir and no --out.ok or unknown, and the message when it is non-empty.unread_files count, each file and tag count from the
unread-reference-tags findings, and each skipped declaration from the
unread-manifest findings.no, or yes with the threshold the artifact states.After the report, offer an interactive view of dependency-graph.json in one sentence. The markdown and the
record stay authoritative. Build it only with ${CLAUDE_PLUGIN_ROOT}/scripts/build-view.mjs dependencies,
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.
ProjectReference by searching the disk for a matching file name./architecture:map-components
The component view reads dependency-graph.json.
Include on a later line and a single-quoted Include are edges. A
reference inside an XML comment is not, and an Update or Remove override is not a
reference. A reference-like tag it cannot turn into an edge (FrameworkReference,
GlobalPackageReference, an empty or missing Include) is counted in the
unread-reference-tags finding.Directory.Build.props above a project and resolves a relative Include in it from the
project's folder. It does not evaluate Condition or $(...) properties, so a props
reference that a condition would exclude is still drawn, and one built from a property is
unresolved.
Include, fetch
Customize by folder § Use case: multi-level merging
and
MSBuild items § Create items in a project file
live.Version child element on the following
lines is not part of the citation. A Version attribute on the same tag is.bin, obj, node_modules, vendor, and dot-directories other than the CI and
devcontainer directories are not walked. A project that lives only there is absent..csproj or .fsproj
are membership. A member with another project extension (.vbproj, .sqlproj) is an
unread-manifest finding.dependency-graph.json stays one node per project. The
markdown says when the flowchart collapsed to directories.landscape_dialect. That key is the system landscape.
This diagram is a mermaid flowchart either way.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./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-componentsMap componentsC4 component view of a deployable's modules: one arrow per internal build reference, citing its declaration. Use for 'component diagram', 'what is inside this service', 'module dependencies', arrow direction, or layering. Not for repos (/architecture:map-landscape), deployables (/architecture:map-containers), module design (/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.Other plugins' skills for the same job