Skip to content

feat(architecture): add map-flow, a sequence diagram traced from one entry point #4645

Closed

Description

@kyle-sexton

Part of #4639. Not blocked by map-dependencies.

Problem

Every existing and proposed structural view shows what exists. None shows what happens over time.
"Walk me through what happens when a user signs in" and "trace this request end to end" are among the
most common architecture questions, and no skill answers them. Today the answer is prose, or a sequence
diagram drawn from memory with no citations. plugins/architecture/skills/ on main has no map-flow.

Evidence

Verified this pass (main a6ba321):

  • The skill does not exist.
  • /planning:design emits a mermaid sequenceDiagram (sequence-flows.md) for a design, not traced
    from code (plugins/planning/skills/design/SKILL.md:176).
  • Design tension, inferred from reading the family's rules: tracing a call path needs source-level
    evidence (call sites, DI registrations). The family's shared extractor reads declarations only, and
    map-dependencies rules out import-level analysis. This skill therefore needs its own evidence rule,
    which is why it is labeled for design.

Proposed approach

/architecture:map-flow <entry point> [--depth N]

  1. Resolve the entry point: an endpoint route, a handler type, a command or query, a CLI verb, or a
    message consumer.
  2. Walk outward through the boundaries that matter: transport to application, application to domain,
    domain to infrastructure, and out to external systems.
  3. Stop at a bounded depth, and say on the artifact where it stopped.
  4. Render a sequence diagram whose participants are architectural roles, not every class touched.
    State what was collapsed.

Design questions to settle before building:

  • What counts as a citable hop: a static call site found by a tested script, or a model reading code
    with a required file:line citation per hop?
  • Which language to support first.
  • The dialect key. diagram_dialect.data does not cover sequences, and /planning:design hard-codes
    mermaid for them.

Files:

  • new plugins/architecture/skills/map-flow/{SKILL.md,scripts,evals}
  • plugin.json, CHANGELOG.md, README.md

Acceptance criteria

  • From a named endpoint in a layered fixture, every hop in the sequence diagram corresponds to a
    real call site cited as file:line.
  • A hop resolved through DI registration, a strategy lookup, a broker or reflection is marked
    unresolved and names the mechanism. It is never resolved to a guessed implementation.
  • Every hop is labeled as either statically resolved or inferred.
  • Asynchronous hops render differently from synchronous calls. A path that leaves the process is
    marked as a hand-off to map-events.
  • Depth truncation is stated on the artifact.

Constraints and gotchas

  • A truncated trace presented as complete misrepresents the system. Always state the stopping point.
  • Out of scope: timing and performance data, exhaustive call graphs, and structural views.
  • Follow .claude/rules/skill-bodies-state-current-rules.md, keep the description under 1024
    codepoints, and bump the version and add a CHANGELOG entry.

Context

Source: local handoff item 20260907-094202-map-flow-skill-proposal.md (retired into this issue).
Parent epic: #4639. Hands off to the map-events issue at process boundaries.

Activity

  1. added
    needs-owner-decision
    wayfind: design
    on Sep 27, 2026
  2. kyle-sexton commented on Sep 29, 2026

    @kyle-sexton
    MemberAuthor

    Refs #4645. The 2026-09-29 audit of the Cursor run found three problems in map-flow: hops came out of call order, broker hand-offs were mislabelled, and the entry grammar was narrow. #5392 (T15, T16) fixes them:

    • Hops are emitted in call order.
    • A Publish or Send is labelled as an asynchronous broker hand-off with its mechanism, and it stays unresolved.
    • Access modifiers match only as whole words.
    • A call binds only through the receiver's declared type.
    • The entry accepts Type.Method and VERB /route, and a Map* route binds to the handler it names.

    Composing a class-level [Route(...)] with a method route is still not supported, and SKILL.md documents it as a limit. No follow-up is needed.

  3. removed
    needs-owner-decision
    on Sep 29, 2026
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

    wayfind: design

    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