/architecture:map-deployment [environment] [--diff <env-a> <env-b>] [--dialect likec4|c4-plantuml] [--out <dir>]from architecture
Generates C4 deployment diagrams from committed IaC, showing which containers run on which nodes per environment, with a diff between two environments. Use for deployment topology, IaC visualization, or environment comparison.
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, whose tracked IaC declares the topology.
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.
Answer "where does this run, and what is different about that environment" from committed infrastructure as code. Every node traces to a named file. The scripts collect and render. Do not draw a node the script did not emit, and do not describe a live cloud. This is the C4 deployment view; each environment is its own deployment environment in the diagram.
Read ${CLAUDE_PLUGIN_ROOT}/reference/config.md first. This skill writes into architecture_dir.
It does not read landscape_dialect and adds no dialect key: the diagram dialect is
diagram_dialect.system from the authoring-formats topic doc. likec4 writes deployment.md with
one fenced likec4 block, c4-plantuml with one fenced plantuml block. Mermaid is not offered.
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, emit no C4 deployment view. The record is still written.
6. Degrade soft, and say so. No pointer, no doc, no key, or an unrecognized value (mermaid
included) each resolve to emitting nothing. 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.
"${CLAUDE_SKILL_DIR}/scripts/collect-deployment.sh" \
--repo "<subject-repo>" --out "<architecture_dir>/deployment.json" \
--generated-on "<YYYY-MM-DD|unknown>" \
--containers "<architecture_dir>/containers.json"
Pass --generated-on from git -C <root> log -1 --format=%cs, or unknown when that fails.
Omit --containers when containers.json is not already in the architecture directory; when
present it must be schema_version 1, and an unreadable catalog refuses the run. Pass --live only
when the invocation asked for live state. The script does not call a cloud API.
Shipped readers, every one that is present:
compose.yaml, docker-compose.yml, and compose.<env>.yaml). The
environment is the filename suffix of compose.<env>.yaml, otherwise the parent directory name
(deploy/<env>/compose.yaml), and default for a file at the repository root. A base file and
its compose.override.yaml, or the files a tracked .env COMPOSE_FILE lists, merge in Compose
merge order into one environment named for the directory: scalars (image, replicas) are
overridden, ports and networks append without duplicates, environment merges by key. Any
other file beside them (a variant with no listed order, an override with no base, a second base)
or a !reset or !override tag is refused by name as compose-not-mergeable:<file>, never
guessed. Environment-per-directory layouts are unaffected. Each service is a compute node, and
its placement names it in compute.kind is Deployment, StatefulSet, DaemonSet, Service, or Ingress.
Each container of a workload, a sidecar included, is its own placement, and every container of a
workload runs on that workload's one compute node. The environment is the namespace, otherwise
the parent directory. A Service selects the containers of each workload in its namespace whose
pod template labels hold the whole selector; an Ingress routes to the containers behind each
Service its backends name. Each is a relationships entry from the Service or Ingress node to a
container. A selector that matches no pod template labels draws nothing..tf, .tf.json, .tfvars, .tfvars.json), read as text: no terraform
binary, state, or credentials. A root is a directory of configuration that no local module source
names. Its environments are the <env> of an envs/<env>/ or environments/<env>/ path, else
one per <env>.tfvars at or above it, else the directory name (default at the repository
root). terraform.tfvars and *.auto.tfvars apply to every environment of their root and are
not environments themselves. Containers come from aws_ecs_task_definition
container_definitions (jsonencode([...]) or heredoc JSON), azurerm_container_app,
google_cloud_run_v2_service, and kubernetes_deployment, kubernetes_stateful_set, and
kubernetes_daemonset (with or without _v1). Compute nodes are aws_ecs_cluster,
aws_eks_cluster, azurerm_container_app_environment, azurerm_kubernetes_cluster,
google_container_cluster, and each Kubernetes workload. An ECS container runs on the cluster
its aws_ecs_service names, with the service's desired_count. A container app runs on the
environment its container_app_environment_id names. A Cloud Run container sits directly in the
environment. A module-only root follows local module sources, each resource addressed
module.<name>.<type>.<name>. A remote module source, or a local one with no tracked
configuration, refuses the record as terraform-module-unread:<file>:module.<name>, and the
source itself is never printed. A file that does not parse is terraform-unreadable:<file>. A
tfvars file with no configuration at or above it is terraform-orphan-tfvars:<file>..bicep, .bicepparam) and ARM templates (JSON whose $schema names
deploymentTemplate, any scope), read as text: no bicep or az binary, no registry restore.
A root is a template that no module names, or one a parameters file names. Its environments are
one per .bicepparam whose using names it (main.prod.bicepparam is prod) and one per JSON
parameters file ($schema names deploymentParameters): <name>.parameters.<env>.json beside
<name>.bicep or <name>.json, or parameters.<env>.json beside the directory's only template.
With none, the environment is the directory name (default at the repository root). Containers
come from Microsoft.App/containerApps (template.containers, scale.minReplicas,
ingress.targetPort), Microsoft.ContainerInstance/containerGroups (each group is the compute
node of its containers), and Microsoft.Web/sites whose linuxFxVersion or windowsFxVersion
is DOCKER|<image> (appSettings are its parameters). Compute nodes are
Microsoft.App/managedEnvironments and connectedEnvironments, Microsoft.Web/serverfarms,
and Microsoft.ContainerService/managedClusters. A container app runs on the environment its
managedEnvironmentId or environmentId names, a site on its serverFarmId: a Bicep
<symbol>.id, or an ARM resourceId('<type>', <name>) whose name matches a declared resource.
A local module (Bicep or ARM) is followed, each resource addressed module.<name>.<symbol>. A
registry or template-spec module, or a local one that is not a tracked template, refuses the
record as bicep-module-unread:<file>:module.<name>, and the source is never printed. A file
that does not parse is bicep-unreadable:<file> or arm-unreadable:<file>. A .bicepparam
with using none, extends, or an untracked using target is bicep-param-unread:<file>. A
JSON parameters file with no template to pair is arm-parameters-unpaired:<file>. A nested
Microsoft.Resources/deployments resource is <bicep|arm>-deployment-unread:<file>:<symbol>.aws binary, stack, or credentials. A
template names AWSTemplateFormatVersion, or holds a top-level Resources section with AWS::
types (Resources at the left margin in YAML). The short tags (!Ref, !Sub, !GetAtt,
!Join, !If) read the same as Ref and Fn::* in JSON. Containers come from
AWS::ECS::TaskDefinition ContainerDefinitions (Name, Image, PortMappings,
Environment, Secrets), and compute nodes from AWS::ECS::Cluster. An AWS::ECS::Service
names the task definition and cluster it runs (!Ref or !GetAtt) and gives DesiredCount.
Environments come from parameter files, one per environment, in either JSON shape (the
ParameterKey/ParameterValue array, or {"Parameters": {}}): <stem>.<env>.json or
<stem>.parameters.<env>.json beside <stem>.<ext>, else, when the repository holds exactly
one template, <env>.json or parameters.<env>.json anywhere. With no parameter
file the environment is the directory name (default at the repository root). A Ref to a
template parameter and a Sub over parameters resolve, from the parameter file and then the
parameter Default. A Transform (SAM, a macro) refuses as
cloudformation-transform-unread:<file>, a nested AWS::CloudFormation::Stack as
cloudformation-stack-unread:<file>:<id> (its TemplateURL is never printed), a parameter file
that pairs with no template as cloudformation-parameters-unpaired:<file>, and a file that does
not parse as cloudformation-unreadable:<file>.Pulumi.yaml whose runtime is yaml and that holds its own program (no
main, no runtime options). Its environments are the Pulumi.<stack>.yaml files beside it, else
the directory name. The mapped resources are aws:ecs:Cluster, aws:ecs:TaskDefinition (with
containerDefinitions as fn::toJSON), and aws:ecs:Service, in the short or the
aws:ecs/<type>:<Type> form. ${pulumi.stack} and ${pulumi.project} resolve. ${key}
resolves from the stack file's config (<project>:<key> or <key>), then the project's
config default. ${resource.attr} links a service to its cluster and task definition. A file
that does not parse is pulumi-unreadable:<file>.<< merge key, duplicate keys, a tab in the
indentation, and more than one document. Their containerDefinitions given as anything but a
non-empty list (absent, empty, a JSON string, a function) places one container whose image is
unresolved:containerDefinitions.<container>@<service>. The service part is the resource's
address in the file (the Terraform label, the CloudFormation logical ID, the Pulumi resource
name), not its name property, so the placement keeps one name in every environment and is
diffed like any other container. A task definition one service runs keeps the plain container
name. A containers.json name matches its @<service> placements.A Pulumi project of any other runtime (nodejs, python, go, dotnet, ...), Helm (a
Chart.yaml, a Terraform helm_release, or a kubernetes:helm.sh/ resource in a Pulumi YAML
program), and Kustomize are recognized and named, never read. If any of them is present, the
record is refused, including when a shipped reader also matches, because a diagram of only the
shipped tool would be a partial read. Shipped readers beside each other (Terraform, Bicep,
CloudFormation, or Pulumi YAML beside Compose) are all read. A repository whose only IaC is a
declined tool is refused as adapter-not-shipped, not drawn empty. The declined Pulumi projects are
the tool pulumi with the runtime in the evidence (Pulumi.yaml (runtime nodejs)); the shipped
reader is the tool pulumi-yaml. Files under CI directories such as .github/ are not IaC and are
skipped.
A resource the Terraform, Bicep, ARM, CloudFormation, or Pulumi YAML reader parses and has no
mapping for is listed in the record's unmapped array (tool, resource type, file) and in the
## Unmapped resources table of deployment.md, never dropped without a trace. When no container
is placed and unmapped is not empty (a Terraform root of only aws_lambda_function and
aws_s3_bucket), the record is refused as no-mapped-container and keeps the list, rather than
drawn as an empty environment. A repository that also places containers is drawn with the list
beside it. The Compose reader adds nothing to the list. The Kubernetes reader lists a CronJob and
a Job (tool kubernetes, the kind, the file) and places none of their containers or parameters,
so a repository of only those is refused as no-mapped-container. They add no environment, and
their kind: must come before spec: for their env entries to stay out of the record. A double-brace expression in
a Compose or Kubernetes value (a Go template in a healthcheck) reads normally; one in a name,
image, namespace, replicas, or kind field refuses the file as unreadable.
Every value the collector writes and the renderer prints passes through
${CLAUDE_PLUGIN_ROOT}/lib/redact-connection.awk. A parameter whose key names a credential, or
whose value carries one (a connection-string password or key, a SAS signature, a GitHub token, a
cloud access key, a private key, URL userinfo, or an HTTP Basic or Bearer credential), is recorded
with an empty value and "redacted":"yes". So is a value resolved from a Terraform variable, a
Bicep, ARM or CloudFormation parameter, or a Pulumi config key whose name names a credential,
whatever the name of the env var it lands in and with or without a native secret marker. Any other
emitted field that carries one prints as [redacted]. A secret must not appear in the record, the
diagram, the diff, or stdout. A diff of two secret values says that the parameter differs and
prints neither value.
A diff compares two environments of one tool over these kinds, for every shipped reader: a
container present in one environment only, image, replicas, ports, a parameter present in one
environment only, a plain parameter value, a secret parameter that differs, a network (a Compose
network or a Kubernetes Service) or an Ingress present in one environment only, and a network
exposure or port or an Ingress host that differs. A compute node (a cluster, service plan or node
pool) of the Terraform, Bicep, ARM, CloudFormation and Pulumi readers is compared too: present in
one environment only (compute-added, compute-removed), or, for Bicep, CloudFormation and
Pulumi, at one address with a different resource type (compute). It is matched by resource
address, not name, since a name usually differs per environment, so a changed name alone is not a
difference. An ARM resource has no stable address, so it is matched by type and its order among
nodes of that type. A Terraform Kubernetes workload and an Azure container group are compute nodes
too. A Kubernetes
container port (containerPort) is the placement's ports. A Kubernetes valueFrom reference
counts as a secret parameter whose presence is compared; envFrom is not read. The report's diff
section lists these kinds, and an empty diff reads No differences of these kinds: ... so a clean
diff is never mistaken for a full comparison.
When <architecture_dir>/containers.json exists, container names that the IaC does not place are
listed. When it does not exist, the artifact says container names came from the IaC.
"${CLAUDE_SKILL_DIR}/scripts/render-deployment.sh" \
--record "<architecture_dir>/deployment.json" --out "<architecture_dir>" \
--dialect "<likec4|c4-plantuml|none>" --env "<environment>" --diff "<env-a>" "<env-b>"
Pass the resolved dialect. With none the script still writes deployment.md with the tools,
environments, diff, and container tables, and draws no diagram block. Omit --env to draw every
collected environment, one deployment environment each inside the one fenced block. Omit --diff
when the invocation did not ask for a comparison. The unmapped resources, when there are any, and
then the diff table follow the tools. An unknown --env or --diff name writes a refusal that
lists the environments and exits 3. In a non-interactive run, stop there.
The script prints one summary line. Keep it:
deployment: status=<drawn|refused> reason=<reason|none> tools=<list> environments=<n> placements=<n> diffs=<n> dialect=<likec4|c4-plantuml|none> unmapped=<n>
Exit 1 means the record is unreadable or not schema_version 1 in the one-object-per-line layout; nothing was written. Do not reformat the record by hand.
End every run with this block, in this order:
none written when the run stopped before a home existed.drawn or refused, and the reason when it is a refusal.unmapped= count and each resource type listed under
## Unmapped resources with its file, or that none were listed.diffs= count, or that --diff was not requested.diagram_dialect.system, the value, and the layer (argument,
team convention doc <path>, or unset (no C4 view emitted)).map-containers output was used, or it was absent and names came from the IaC.After the report, offer an interactive view of deployment.json in one sentence. The markdown and
the record stay authoritative. Build it only with
${CLAUDE_PLUGIN_ROOT}/scripts/build-view.mjs deployment, 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.
terraform, read Terraform state, or fetch a remote module.bicep or az, restore a registry module, or evaluate an ARM function.aws or pulumi, expand a CloudFormation Transform, or evaluate Fn::If, Fn::FindInMap,
Fn::Join, or a Pulumi fn::* function.landscape_dialect, or emit mermaid. The dialect is the existing
diagram_dialect.system./architecture:adr./planning:design system./architecture:map-landscape.C4 scopes a deployment diagram to one environment. This skill writes one fenced block with
every environment inside it as its own deployment environment; --env narrows the block to
one. The diff is a table, not a picture. Pointer: when checking a deployment view's scope or
elements, fetch C4 deployment diagram § Scope and § Primary and supporting elements
live.
C4-PlantUML deployment syntax: read against the README, never run. The renderer writes the
macros. The C4_Deployment include name is our inference from the README's container
example. No PlantUML run has parsed this output. Rel is drawn from a container to a network
node its placement names, and from a Kubernetes Service or Ingress node to a container in the
record's relationships. Pointer: when checking the macros or the include the renderer
writes, fetch C4-PlantUML README § Deployment diagram and
§ Including the C4-PlantUML library live.
LikeC4 deployment syntax: parsed by the CLI. The record is a probe: [email protected] validate exits 0 on the golden blocks in ${CLAUDE_PLUGIN_ROOT}/lib/likec4-golden/
(deployment-compose.c4, deployment-kubernetes.c4, deployment-ecs-shared.c4), which
collect-deployment.test.sh diffs against. Pointer: when checking the syntax the collector
writes, fetch LikeC4 deployment model § Deployment nodes,
§ Deployed instances, § Deployment relationships
and deployment views § View definition 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.
Labels cannot leave the block. Quotes, backticks, backslashes, and line breaks are stripped
from labels, @ prints as (at), and every identifier is prefixed and numbered, so a hostile
name cannot close the fence, end the diagram, or collide with a keyword.
Compose without a networks entry joins the default network. A service that declares none
is recorded on default; a service that names a network is recorded on that network.
A required secret is not a topology fact. The value is dropped. The diff can say the parameter differs. It cannot show the value.
IaC dialect rules. When the record reads a CloudFormation, Pulumi, Bicep, ARM or Terraform file, read reference/iac-dialect-gotchas.md first.
--live is a refusal. Committed files are not silently substituted for a live comparison.
A reformatted record is refused. Render exits 1 and writes nothing.
Tracked files only. git ls-files is the source list. A tracked symlink is skipped, so it
cannot pull in an untracked file.
evals/evals.json (opens in a new tab)reference/iac-dialect-gotchas.md (opens in a new tab)scripts/azure-reader.awk (opens in a new tab)scripts/cloudformation-reader.awk (opens in a new tab)scripts/collect-deployment.sh (opens in a new tab)scripts/collect-deployment.test.sh (opens in a new tab)scripts/deployment-diff.awk (opens in a new tab)scripts/pulumi-reader.awk (opens in a new tab)scripts/render-deployment.sh (opens in a new tab)scripts/terraform-reader.awk (opens in a new tab)scripts/yaml-rows.awk (opens in a new tab)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