Skip to content

feat(architecture): add map-components, a C4 component view of one deployable #4642

Closed

Description

@kyle-sexton

Part of #4639. Blocked by #4641.

Problem

"Map my architecture" usually means inside one system: its modules, its layers, and which way the
arrows point. That is the C4 component rung, and no skill works at it. The nearest skill,
map-landscape, answers a question about a set of repositories. This is the most common way the
architecture plugin disappoints, and it does so silently: the output is well formed but not about what
was asked. plugins/architecture/skills/ on main has no map-components.

Evidence

Verified this pass (main a6ba321):

Proposed approach

/architecture:map-components [container] [--group-by layer|directory|namespace]

  1. Read dependency-graph.json from map-dependencies. If it is absent, tell the user to run that skill,
    or run its script. Do not re-implement extraction.
  2. Scope to one container. When a repository holds several deployables, take the container as an
    argument, or ask for it in an interactive run. Charting all of them is map-containers' job.
  3. Group nodes with one of three strategies:
    • layer, only when the consumer declares a layering convention
    • directory, the default
    • namespace
  4. Render grouping as containment and dependencies as directed arrows, in the dialect the epic's
    decision picks.

Files:

  • new plugins/architecture/skills/map-components/{SKILL.md,scripts,evals}
  • plugins/architecture/skills/map-landscape/SKILL.md (the thin-result remedy and ## Next now name
    map-components)
  • config.md, plugin.json, CHANGELOG.md, README.md

Acceptance criteria

  • Against a layered multi-module fixture, the diagram's arrows match the declared references, and
    all three grouping strategies work.
  • Every edge is directed and cites its declaration.
  • With a declared layering convention, an edge that violates it in a fixture is visibly
    distinguishable. It is not scored and does not fail the run.
  • Above a documented node threshold the view aggregates and says so on the artifact. It never
    truncates silently.
  • A single-module fixture produces the thin-result message and names the neighboring rungs, instead
    of presenting a one-box diagram as the answer.
  • map-landscape's Thin result remedy and ## Next route to map-components.

Constraints and gotchas

  • Enforcing layer violations belongs to the consumer's architecture tests. Showing them here is
    informational only, so the two do not become competing sources of truth.
  • Out of scope: class-level and code-rung diagrams, behavior (map-flow), and deployment
    (map-containers, map-deployment).
  • Dialect: follow the epic's decision. Mermaid C4 is experimental, and the authoring-formats convention
    refuses mermaid for diagram_dialect.system.
  • Follow .claude/rules/skill-bodies-state-current-rules.md (## Next, a verification record for any
    volatile upstream specific, and the 1024-codepoint description cap).
  • Bump the version and add a CHANGELOG entry. The scripts use bash plus POSIX awk/sed only.

Context

Source: local handoff item 20260907-094159-map-components-skill-proposal.md (retired into this issue).
Parent epic: #4639. Depends on: #4641. Related: PR #4559.

Activity

  1. kyle-sexton commented on Sep 29, 2026

    @kyle-sexton
    MemberAuthor

    Refs #4642. The 2026-09-29 audit of the Cursor run found this delivery partial. A second .NET extractor, component-graph.sh, had been added against this issue, and directory and namespace grouping were degenerate on real graphs. #5392 (T4, T6) fixes both, so nothing remains to file:

    • component-graph.sh is deleted, and map-components reads only dependency-graph.json from the shared reader.
    • Test projects are excluded from container inference.
    • directory grouping uses the parent of the project's own directory.
    • namespace grouping uses RootNamespace, else AssemblyName, from the project file.
    • A graph older than the sources produces a staleness warning.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions