/architect:initfrom architect
Discovers and models architecture of unfamiliar codebases, producing canonical model, structured views (C4, sequence, deployment), and an interactive HTML diagram via handoff to architect-diagram.
Ships in architect. 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.
None: SKILL.md is the whole skill.
Use this skill to inspect a codebase for the first time and produce structured architecture artifacts. The deliverable is a canonical architecture model plus derived view files, followed by a handoff to architect-diagram for diagram.html.
Default modeling style:
C4 for static structureSequence views for critical workflowsDeployment view only when topology materially affects understandingThe source of truth is the canonical architecture model, not the audience-specific views.
Produce a small, grounded set of artifacts that explain:
The minimum useful output is usually:
architecture/model.yamlarchitecture/views/system-context.yamlarchitecture/views/container.yaml when deployable/runtime units existarchitecture/views/component-*.yaml only for important internal boundariesarchitecture/views/sequence-*.yaml only for critical workflowsarchitecture/views/deployment.yaml only when topology mattersarchitecture/manifest.yamlarchitecture/summary.mdarchitecture/diff.yaml in update mode onlyarchitecture/diagram.htmlBefore writing outputs, read ../references/architecture-contract.md and follow its schemas exactly.
Resolve the contract through the skill-relative reference path only.
../references/architecture-contract.md.skills/references/architecture-contract.md.manifest.yaml, model.yaml, or nearby architecture outputs.Default output path:
architecture/manifest.yamlarchitecture/model.yamlarchitecture/views/*.yamlarchitecture/summary.mdarchitecture/diff.yaml in update modearchitecture/diagram.htmlarchitecture/diagram-prompt.md only when explicitly requestedIf the user specifies a different output path, honor it.
evals/, examples/, iteration-*, skill-snapshot/, or similar archive/snapshot directories to infer the contract or bootstrap artifacts.confirmed, strong_inference, weak_inference.relationship_id for that step.architect-diagram using the same output root so the rendered HTML diagram stays in sync with the latest artifacts.architect-init owns discovery and artifact generation; architect-diagram owns diagram.html rendering.When signals conflict, trust them in this order:
Do not let weak naming signals override runtime or contract evidence.
If docs and runtime evidence diverge, model runtime truth, record the conflict in unknowns or notes, and avoid silently blending the two.
If README-level claims conflict with stronger runtime evidence or more specific architecture docs, explicitly say so in summary.md or unknowns instead of silently averaging them together.
Version and capability claims (supported protocol versions, feature coverage, API compatibility) must be verified against code artifacts — contract files, feature flags, protocol definitions, version constants — not documentation alone. If the model states "supports v0.6 and v0.7", the code must contain evidence for exactly those versions.
Classify the repo before deciding which views to emit. Use one primary archetype:
library_packagefrontend_only_appmodular_monolithservice_oriented_backendfull_stack_productinfrastructure_repoApply these defaults:
library_package: produce a context view only if consumers are visible; prefer component/module views over container views.frontend_only_app: one frontend container plus external APIs; add component views for state, routing, or domain modules only if meaningful.modular_monolith: one deployable container; represent bounded modules as components; do not invent multiple containers unless runtime evidence supports them.service_oriented_backend: always produce model, manifest, summary, system-context, and container; add component views only for containers with meaningful internal boundaries and sequence views only for critical workflows.full_stack_product: context plus container views across frontend, backend, data, and external systems; add sequence views for critical user journeys.infrastructure_repo: always produce model, manifest, summary, and deployment; only create context/container views if the repo defines a runnable platform or control plane.If the correct answer is "this repo is a library, not a deployable system", say so and adjust outputs accordingly.
Use the smallest artifact set that still explains the runtime truth. Every container should support drill-down when it has meaningful, evidenced internal boundaries. Do not produce component or deployment views by default if they add no explanatory value.
Define:
initial or updateGuardrail:
If the request is planning-only (no repo to inspect yet), stop and route to architect-plan instead of continuing discovery.
Reason: Architecture artifacts are communication tools. Scope and mode must be explicit before modeling.
Create a short internal modeling ledger and keep it stable while you work. At minimum capture:
system_in_scoperepo_archetypestable_runtime_unitsstate_ownersoptional_externalsplugin_mechanisms: identified extension/plugin systems (e.g., custom senders, aggregators, middleware hooks) with an explicit in-scope or out-of-scope decision for eachdeployment_modesout_of_scopeThe ledger is a preflight checkpoint, not a deliverable. Use it to decide what the canonical containers are before writing files.
In update mode, or whenever architecture artifacts already exist:
architecture/model.yaml, manifest.yaml, and relevant views firstarchitecture/diff.yaml describing added, removed, and changed elements, relationships, and viewsReason: Architecture maintenance depends on stable identity and diffability.
Inspect:
AGENTS.md, CLAUDE.md, or similarly named contributor/agent instructions when presentUse targeted discovery. Prefer rg --files and focused rg searches over broad scans.
Use a discovery budget:
Do not keep reading files once additional scans are only repeating already-confirmed structure.
Add an early path sanity check before writing anything:
If the target repo contains repo-local guidance files, extract any explicit architectural constraints before modeling. Especially look for:
Treat these as strong documentation signals, but still verify them against runtime and code evidence before writing them into the model.
Determine which primary archetype best fits the repository. Base this on runtime and packaging evidence, not naming preference.
Reason: The correct artifact set differs across libraries, monoliths, service-oriented systems, frontend apps, and infra repos.
Before committing to containers and externals, enumerate any supported modes that materially change runtime boundaries. At minimum check:
For each meaningful mode, note:
Reason: Many repos support both in-process and externalized modes. Failing to model that split is a common source of false external dependencies and incorrect container boundaries.
Populate the canonical model with normalized, deduplicated elements.
Required questions:
Do not create near-duplicate elements such as Order Service, Orders API, and Order Backend unless evidence shows they are distinct.
Classify each important data object as one of:
Do a data coverage pass before moving on:
owned_data and, where appropriate, system_of_recordIf a dependency is configuration-gated and not required for baseline operation, model it as optional external infrastructure unless it owns core business state.
When a component appears to submit work to an external system, inspect the transport layer before assigning the external relationship. Search for client, sender, adapter, transport, gateway, or relay abstractions so you do not over-attribute transport behavior to an orchestrator, tracker, or controller that merely delegates into a lower layer.
After identifying canonical elements, check which internal modules or crates are consumed by multiple runtime units. This catches shared infrastructure that crosses container boundaries.
For each runtime unit (container), inspect its dependency declarations:
Cargo.toml dependencies for references to other workspace cratespackage.json dependencies for workspace packagesgo.mod or import paths for internal packagesFor any internal module depended on by 2+ runtime units:
This step prevents the common mistake of attributing a shared module to only one container while other containers silently depend on it.
For each important path, identify:
Critical workflows usually include:
API/RPC containers are frequently assumed to be stateless thin proxies. Do not accept this assumption without checking the container's actual dependencies. If an API layer performs computation (validation, estimation, transformation, simulation) beyond routing, model those dependencies explicitly.
Before writing views, do a relationship preflight. For each important relationship, note:
relationship_idIf the relationship would force mixed abstraction levels in a view, change the model or use a different view.
For config-gated behavior, record that conditionality explicitly. If a relationship depends on enabled namespaces, feature flags, optional integrations, or deployment mode, preserve the relationship in the canonical model when it is real, but call out the condition in view notes, assumptions, or unknowns instead of implying the traffic is always active.
Before finalizing sequence views, cross-check step order against the actual handler/command path for that workflow. Do not let a plausible conceptual flow override the real execution order.
Inspect deployment and operational artifacts:
Reason: Static code alone often misstates runtime truth.
Write architecture/model.yaml before writing any views.
The model is the only place where architecture facts are defined. Views only reference model IDs and filter/present them.
Apply strict view rules:
system_context: only the system of interest, people, and external systemscontainer: only deployable/runtime units, datastores, queues/brokers, and relevant externalscomponent: only meaningful internal modules within one containersequence: only previously defined model elements; do not invent ad hoc participantsdeployment: only nodes, zones, and placement when topology is architecturally relevantOperational view rules:
relationship_id.Write summary.md using the fixed structure in the reference file.
In update mode, write diff.yaml with:
Run a lightweight consistency pass after generation. At minimum verify:
model.yamlmodel.yamlmodel.yamlmodel.yamlrelationship_id uses a relationship whose direction matches the step source and targetIf validation fails, fix the artifacts before completing the task.
After architecture artifacts are complete for the current draft/final revision, hand off to architect-diagram.
Pass it:
architecture/manifest.yaml, model.yaml, and views/*.yamlExpected default visible output in the same artifact package:
architecture/diagram.html (primary interactive diagram)Optional only when the user explicitly requests it:
architecture/diagram-prompt.md via architect-diagram-promptPresent the rendered diagram as part of the same discovery response so the diagram step feels automatic, not separately requested.
Do not generate architecture/diagram.html or architecture/diagram-prompt.md directly in this skill; use the dedicated diagram skills for those outputs.
System Context: system-of-interest, people, external systems only.Container: deployable/runtime units plus stateful stores and brokers only.Component: internal modules inside exactly one container only.Code: out of scope for this skill unless the user explicitly requests code-level modeling.Do not place components on a system-context or container view. Do not place classes on component views. Do not let deployment modes, CLIs, or launch commands become containers when they only package existing runtime roles.
Whenever applicable, every container or component in the canonical model should declare:
owned_datasystem_of_recordIf ownership is unclear, record an unknown rather than omitting the issue silently. Be explicit about the difference between:
If an element does not authoritatively own an entity, do not imply that it does.
Do not:
diff.yaml in update modeThe skill is complete only when:
architecture/model.yaml exists and follows the schemasummary.md follows the fixed structuremanifest.yaml records scope, archetype, mode, and artifactsdiff.yaml exists in update modearchitecture/diagram.html has been generated for the current artifact set via architect-diagramarchitecture/diagram-prompt.md has been generated for the current artifact set via architect-diagram-promptWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub willhennessy/architect --plugin architect4 skills in this plugin
/diagramGenerate an interactive HTML architecture diagram (`diagram.html`) with drill-down navigation and Comment Mode. If architecture artifacts already exist, render from them; if not, first run architect-init to discover the repo and create the artifacts./diagram-promptGenerate the secondary Claude Imagine upload bundle (`diagram-prompt.md`) from existing architecture artifacts and rendered diagram output. Use when explicitly requested./planArchitecture planning sidecar for Claude's native Plan Mode. Turn product requirements, constraints, team size, timeline, assumptions, and tradeoffs into canonical architecture artifacts and, when useful, an interactive diagram. Strongly consider this skill in Plan Mode when a user is planning a new or changing software system and asks for the architecture, system design, service breakdown, or technical plan before implementation, including prompts like "propose the architecture", "design the system", or "help me plan the architecture."Other plugins' skills for the same job