| name | straymark-architecture |
| description | Generate the architecture model and refine it in one guided pass โ seed with `straymark architecture generate`, then reassign components into real layers, wire dependency links, sync the DrawIO, and validate to green. The agent-native counterpart to the manual DrawIO refinement. EXPERIMENTAL (Loom A1.x). |
| allowed-tools | Read, Write, Edit, Glob, Grep, Bash(straymark architecture *, git diff *, git log *, git status *, ls *, find *) |
StrayMark Architecture Skill
Drive the generate โ refine โ validate arc of the StrayMark architecture model from the agent window. straymark architecture generate mines structure (top-level source dirs โ components); the model encodes intent (real layers, dependency links, human labels) that the filesystem does not contain. This skill performs the refinement a human would otherwise do in DrawIO, using the agent's knowledge of the repo, and iterates validate to green in a single pass.
โ ๏ธ EXPERIMENTAL. The architecture model, its on-disk format, and Loom are an opt-in Loom A1.x experiment โ not part of the supported Framework/CLI contract. See docs/adopters/LOOM.md. The model lives at .straymark/architecture/{model.yml,plan.drawio}.
When to use this skill
Trigger on any of:
- The operator asks to "map the architecture", "set up the architecture model", or "refine the architecture seed".
- A
model.yml was just generated and every component still sits in the placeholder unassigned layer.
- The operator wants the 2D/3D Loom views to show real layers and dependency arrows.
If .straymark/architecture/model.yml already exists and is already refined (components assigned to real layers, links present), prefer /straymark-architecture-sync to extend it append-only instead of re-refining from scratch.
Instructions
1. Generate the seed
straymark architecture generate
straymark architecture generate --force
generate enriches from ADRs (C4 diagrams + "Affected Components" tables) only if they exist; with none, the seed is structure-only. It seeds every component into a placeholder unassigned layer and the .straymark stages 00โ09 as placeholder layers. The seed is a draft, not the answer โ the next step is where it becomes meaningful.
2. Refine the model (the phase that matters)
Read model.yml and the codebase, then edit model.yml to encode real intent:
- Replace the placeholder doc-stage layers with real architecture layers, inferred from directory conventions and ADRs (e.g.
entrypoints, domain, persistence, web). Ask the operator when the layering is ambiguous โ do not guess at the system's intended shape.
- Reassign every component out of
unassigned into a real layer.
- Fix labels to human names (
internal-modules-commshub โ "CommsHub").
- Tighten globs so each component owns exactly its files.
- Infer
links between components from the import graph / directory structure / ADR "Affected Components" tables.
The model schema (.straymark/architecture/model.yml):
version: 0
layers:
- { id: "domain", label: "Domain", order: 0 }
components:
- id: "commshub"
label: "CommsHub"
layer: "domain"
globs: ["internal/modules/commshub/**"]
links: ["audittrail"]
docs: []
external: false
Gotchas โ each one costs a debugging cycle; pre-empt them:
- A
component.id must not equal any layer.id. For a single-component layer use a suffixed id (core layer โ core-infra component). fw-4.27.0 emits a clear error for this, but write the model so it never trips.
links is a list of target component ids (strings) โ ["audittrail", "core"], not objects like [{to: โฆ}] (which fails to parse).
- Never delete a layer that a component still points at via
component.layer โ that yields references unknown layer. Reassign the components first, then drop the empty placeholder layer.
- The placeholder
unassigned layer is not required by the schema once empty โ but every component.layer must still name a layer that exists.
3. Sync the DrawIO so 2D shows arrows
3D renders edges from model.yml links; 2D renders them from plan.drawio edges. Write both, or arrows show in only one view. After editing model.yml, update plan.drawio so each component has a vertex and each link has an edge between the matching vertices (the DrawIO cell id joins on the component id). Keep human-authored geometry where it exists.
4. Validate โ iterate to green
straymark architecture validate
straymark architecture validate --output json
Resolve every signal, then re-run until it exits 0:
undrawn โ a component with no cell in plan.drawio โ add the vertex.
unmodeled โ a DrawIO cell with no component in model.yml โ add the component or remove the stale cell.
empty โ a component whose globs match no files on disk โ fix the globs.
5. Report result
Summarize what changed (layers created, components reassigned, links added) and surface the final validate output verbatim. Point the operator at the live views:
โ Architecture model refined: 4 layers, 13 components, 10 links โ validate is green.
Next: `/straymark-loom` up to see the 2D/3D overlay, or `straymark status --where` for the terminal view.
What this skill does NOT do
- It does not invent the intended architecture. When layering or boundaries are ambiguous, it asks the operator โ the model encodes human intent, not a filesystem heuristic.
- It does not maintain the status overlay.
active / in-progress / implemented / has-debt / uncharted are computed live from governance signals every time you look; this skill authors structure only.
- It does not re-refine an already-curated model. Use
/straymark-architecture-sync (append-only) once real layers and links exist.
Terminal compatibility: If the terminal does not support box-drawing characters (Unicode), use plain-text formatting with dashes and pipes instead.