Current Architecture Documenter skill

Documents current architecture from implementation evidence.

by levnikolaevich·MIT license·★ 568 Stars on the repo·GitHub ↗

Use now

Files of Current Architecture Documenter

levnikolaevich/master1 file shown
SKILL.md
Show the full text99 lines

Current Architecture Documenter

Goal: Produce a trustworthy snapshot of the architecture implemented in the checked-out repository. Document what exists and how it behaves; do not score it, prescribe a target architecture, repair code, or turn intended diagrams into facts.

Execution contract: The checklist defines completion. Track each item internally as PENDING, PROVEN with evidence, CLEARED with evidence its condition is absent, or UNPROVEN with a gap; reading, delegation, tool failure, a zero exit status, or a self-reported success is not proof; only the observed outcome is. Reconcile after each section. Before returning, resolve all PENDING, count only PROVEN and CLEARED, and apply verdict and approval rules to every gap. Preserve intent, scope, and existing authorization. Continue authorized work; ask only for consequential unresolved choices or required external approval. When no one can answer during the run, state the exact question and apply the skill's verdict for the remaining gap instead of waiting or guessing. Scale depth to material risk without skipping checks. Preserve dependency and safety order; otherwise choose an appropriate verification method. Accept equivalent user or repository evidence; no other skill, named artifact, or complete lifecycle is required. Preserve source requirement and decision IDs. Bind reused evidence to relevant source versions, dirty changes, configuration, and environment; invalidate only affected claims. On continuation, reconcile task, authorization, current state, and unresolved evidence. For long work, return a compact continuation record or update an already authorized artifact; read-only skills do not persist it. Distinguish artifact readiness, verified behavior, and external-action authority. Prepare authorized work before required approval. If blocked by an instruction, cite its exact source and unresolved boundary; do not invent approval gates from caution.

Tool Routing

Need Preferred capability Fallback
Snapshot identity and worktree state Git status, branch, remote, and HEAD Record the supplied snapshot as UNVERIFIED
Structure and configuration Native listing, search, manifests, and direct file reads Narrow manual inspection
Symbols, dependencies, and consumers Language intelligence or resolved dependency tooling Search definitions, registrations, imports, and callers
Runtime and deployment topology Entrypoints, IaC, containers, CI, configuration, and runtime evidence Mark deployment relationships UNKNOWN
Document mutation Minimal patch to the approved architecture document Return BLOCKED if no writable path is authorized

Prefer local evidence over remote repository state. A path, diagram, or naming convention is a lead until executable wiring or an authoritative contract confirms it.

Artifact Rules

  • Reuse a clear current-state architecture document; otherwise use docs/architecture/current-state.md.
  • Anchor the document to remote, branch, HEAD, worktree state, and observation date.
  • Cite material claims with file paths, symbols, commands, or configuration keys.
  • Label claims OBSERVED, DOCUMENTED, INFERRED, or UNKNOWN.
  • Separate actual structure from intended target design and from audit findings.
  • Map the declared system scope at a coarse level first, then deepen only what explains its critical behavior; do not expand a bounded request into a repository-wide inventory.
  • Prefer responsibility-oriented descriptions over exhaustive file inventories.
  • Record the evidence cutoff so readers can distinguish uninspected scope from genuine absence.
  • Keep volatile counts or inventories only when they affect architectural understanding.

Checklist

1. Establish the Documentation Contract
  • Resolve repository scope, intended readers, approved destination, required depth, and language.
  • Read repository instructions and record snapshot identity plus dirty-worktree limitations.
  • Search for existing current-state, baseline, target-design, decision, diagram, and deployment artifacts.
  • Reuse an unambiguous current-state document or select the default path without duplicating project knowledge.
  • Keep the run read-only except for the approved architecture document.
2. Map the System Breadth
  • Identify languages, frameworks, package roots, generated surfaces, and canonical build or run commands from manifests and CI.
  • Identify users, external systems, entrypoints, applications, services, processes, workers, scheduled jobs, and deployment units.
  • Map major domains or modules, responsibilities, ownership, and dependency direction.
  • Map data stores, caches, queues, files, external APIs, schemas, and systems of record.
  • Record public interfaces, runtime discovery, registration, configuration composition, and environment boundaries.
  • Record build, deploy, scale, and failure boundaries without inferring independence from directory names.
3. Trace Critical Behavior
  • Select representative critical flows based on business importance and architectural reach.
  • Trace each flow from actor or trigger through entrypoint, runtime coordination, domain behavior, persistence or integration, and observable outcome.
  • Record synchronous and asynchronous hops, transaction ownership, consistency, retry, timeout, idempotency, and error propagation where evidenced.
  • Describe deployment, startup, shutdown, health, observability, and recovery paths visible from repository evidence.
  • Deepen only subsystems whose complexity or uncertainty affects architectural understanding; keep ordinary implementation detail out of the architecture document.
4. Write the Current-State Artifact
  • Write snapshot identity, system context, component inventory, responsibilities, dependency and data flow, runtime topology, critical flows, deployment, ownership, and evidence index.
  • Include the minimum useful diagrams inline or link existing diagram artifacts by path.
  • Distinguish observed implementation from documented intent and explicitly list drift or contradictions without assigning severity.
  • Mark remote-only, runtime-only, organizational, or production facts UNKNOWN unless supplied authoritative evidence establishes them; distinguish declared deployment configuration from observed live topology.
  • Preserve sourced manually maintained context with its evidence status; document contradictions and label unsupported historical claims instead of inheriting them as observed facts.
5. Verify and Report
  • Verify every citation against inspected snapshot evidence and remove unsupported claims; reopen sources only if they changed or the prior inspection did not establish the claim.
  • Confirm the map explains how critical behavior is discovered, executed, persisted, and deployed.
  • Confirm abstraction levels are not mixed and names remain consistent across prose and diagrams.
  • Bind the current-state account to the inspected revision and relevant dirty/configuration state; identify changes that would make a documented boundary stale.
  • Use READY when the snapshot is evidence-backed and useful; use INCOMPLETE when material topology remains unknown; use BLOCKED when repository identity, scope, or destination cannot be established safely.

Self-Check

  • Reconcile before returning. Check item-level evidence, requirement coverage, contradictions, scope, verdict, and applicable cleanup. Correct the report or authorized artifacts. Reuse valid evidence; do not automatically rescan the repository or rerun successful commands. Repeat checks only for relevant changes, failures, or unresolved evidence. Disclose remaining gaps.

Output Contract

Report in the user's language, in this order; label all five fields and state each fact once. Use controlled plain language: one fact per sentence, usually under 20 words, active voice, and one term per concept, with no synonyms for verdicts, IDs, or states. Small results may use one line per field; omit empty tables and do not copy linked artifacts:

  1. Result: The exact skill-specific verdict token first, then the supported outcome.
  2. Scope: Reviewed/changed scope, exclusions, baseline, and material assumptions.
  3. Evidence: Skill-specific fields below; distinguish facts, inferences, and unverified claims. Link artifacts; use tables when useful.
  4. Verification: Checks/results, unavailable evidence, and applicable cleanup/external state.
  5. Completion: Checklist: X/Y complete; Incomplete: None or each UNPROVEN item's reason, outcome impact, and exact next action; residual risks and required decisions.

Skill-specific evidence: Artifact path and snapshot identity (remote, branch, HEAD, worktree, date); mapped context, modules, runtime/deployment, data/interfaces, ownership, and critical flows. Identify changed sections/diagrams and claims or areas needing runtime, organizational, or external confirmation with status, inspected evidence, and exact next action.

1---
2name: ln-22-current-architecture-documenter
3description: "Documents current architecture from implementation evidence; does not propose a target or audit fitness."
4---
5 
6# Current Architecture Documenter
7 
8**Goal:** Produce a trustworthy snapshot of the architecture implemented in the checked-out repository. Document what exists and how it behaves; do not score it, prescribe a target architecture, repair code, or turn intended diagrams into facts.
9 
10**Execution contract:** The checklist defines completion. Track each item internally as `PENDING`, `PROVEN` with evidence, `CLEARED` with evidence its condition is absent, or `UNPROVEN` with a gap; reading, delegation, tool failure, a zero exit status, or a self-reported success is not proof; only the observed outcome is. Reconcile after each section. Before returning, resolve all `PENDING`, count only `PROVEN` and `CLEARED`, and apply verdict and approval rules to every gap.
11Preserve intent, scope, and existing authorization. Continue authorized work; ask only for consequential unresolved choices or required external approval. When no one can answer during the run, state the exact question and apply the skill's verdict for the remaining gap instead of waiting or guessing. Scale depth to material risk without skipping checks. Preserve dependency and safety order; otherwise choose an appropriate verification method.
12Accept equivalent user or repository evidence; no other skill, named artifact, or complete lifecycle is required. Preserve source requirement and decision IDs. Bind reused evidence to relevant source versions, dirty changes, configuration, and environment; invalidate only affected claims.
13On continuation, reconcile task, authorization, current state, and unresolved evidence. For long work, return a compact continuation record or update an already authorized artifact; read-only skills do not persist it. Distinguish artifact readiness, verified behavior, and external-action authority.
14Prepare authorized work before required approval. If blocked by an instruction, cite its exact source and unresolved boundary; do not invent approval gates from caution.
15 
16 
17## Tool Routing
18 
19| Need | Preferred capability | Fallback |
20|---|---|---|
21| Snapshot identity and worktree state | Git status, branch, remote, and HEAD | Record the supplied snapshot as `UNVERIFIED` |
22| Structure and configuration | Native listing, search, manifests, and direct file reads | Narrow manual inspection |
23| Symbols, dependencies, and consumers | Language intelligence or resolved dependency tooling | Search definitions, registrations, imports, and callers |
24| Runtime and deployment topology | Entrypoints, IaC, containers, CI, configuration, and runtime evidence | Mark deployment relationships `UNKNOWN` |
25| Document mutation | Minimal patch to the approved architecture document | Return `BLOCKED` if no writable path is authorized |
26 
27Prefer local evidence over remote repository state. A path, diagram, or naming convention is a lead until executable wiring or an authoritative contract confirms it.
28 
29## Artifact Rules
30 
31- Reuse a clear current-state architecture document; otherwise use `docs/architecture/current-state.md`.
32- Anchor the document to remote, branch, HEAD, worktree state, and observation date.
33- Cite material claims with file paths, symbols, commands, or configuration keys.
34- Label claims `OBSERVED`, `DOCUMENTED`, `INFERRED`, or `UNKNOWN`.
35- Separate actual structure from intended target design and from audit findings.
36- Map the declared system scope at a coarse level first, then deepen only what explains its critical behavior; do not expand a bounded request into a repository-wide inventory.
37- Prefer responsibility-oriented descriptions over exhaustive file inventories.
38- Record the evidence cutoff so readers can distinguish uninspected scope from genuine absence.
39- Keep volatile counts or inventories only when they affect architectural understanding.
40 
41## Checklist
42 
43### 1. Establish the Documentation Contract
44 
45- [ ] Resolve repository scope, intended readers, approved destination, required depth, and language.
46- [ ] Read repository instructions and record snapshot identity plus dirty-worktree limitations.
47- [ ] Search for existing current-state, baseline, target-design, decision, diagram, and deployment artifacts.
48- [ ] Reuse an unambiguous current-state document or select the default path without duplicating project knowledge.
49- [ ] Keep the run read-only except for the approved architecture document.
50 
51### 2. Map the System Breadth
52 
53- [ ] Identify languages, frameworks, package roots, generated surfaces, and canonical build or run commands from manifests and CI.
54- [ ] Identify users, external systems, entrypoints, applications, services, processes, workers, scheduled jobs, and deployment units.
55- [ ] Map major domains or modules, responsibilities, ownership, and dependency direction.
56- [ ] Map data stores, caches, queues, files, external APIs, schemas, and systems of record.
57- [ ] Record public interfaces, runtime discovery, registration, configuration composition, and environment boundaries.
58- [ ] Record build, deploy, scale, and failure boundaries without inferring independence from directory names.
59 
60### 3. Trace Critical Behavior
61 
62- [ ] Select representative critical flows based on business importance and architectural reach.
63- [ ] Trace each flow from actor or trigger through entrypoint, runtime coordination, domain behavior, persistence or integration, and observable outcome.
64- [ ] Record synchronous and asynchronous hops, transaction ownership, consistency, retry, timeout, idempotency, and error propagation where evidenced.
65- [ ] Describe deployment, startup, shutdown, health, observability, and recovery paths visible from repository evidence.
66- [ ] Deepen only subsystems whose complexity or uncertainty affects architectural understanding; keep ordinary implementation detail out of the architecture document.
67 
68### 4. Write the Current-State Artifact
69 
70- [ ] Write snapshot identity, system context, component inventory, responsibilities, dependency and data flow, runtime topology, critical flows, deployment, ownership, and evidence index.
71- [ ] Include the minimum useful diagrams inline or link existing diagram artifacts by path.
72- [ ] Distinguish observed implementation from documented intent and explicitly list drift or contradictions without assigning severity.
73- [ ] Mark remote-only, runtime-only, organizational, or production facts `UNKNOWN` unless supplied authoritative evidence establishes them; distinguish declared deployment configuration from observed live topology.
74- [ ] Preserve sourced manually maintained context with its evidence status; document contradictions and label unsupported historical claims instead of inheriting them as observed facts.
75 
76### 5. Verify and Report
77 
78- [ ] Verify every citation against inspected snapshot evidence and remove unsupported claims; reopen sources only if they changed or the prior inspection did not establish the claim.
79- [ ] Confirm the map explains how critical behavior is discovered, executed, persisted, and deployed.
80- [ ] Confirm abstraction levels are not mixed and names remain consistent across prose and diagrams.
81- [ ] Bind the current-state account to the inspected revision and relevant dirty/configuration state; identify changes that would make a documented boundary stale.
82- [ ] Use `READY` when the snapshot is evidence-backed and useful; use `INCOMPLETE` when material topology remains unknown; use `BLOCKED` when repository identity, scope, or destination cannot be established safely.
83 
84## Self-Check
85 
86- [ ] **Reconcile before returning.** Check item-level evidence, requirement coverage, contradictions, scope, verdict, and applicable cleanup. Correct the report or authorized artifacts. Reuse valid evidence; do not automatically rescan the repository or rerun successful commands. Repeat checks only for relevant changes, failures, or unresolved evidence. Disclose remaining gaps.
87 
88## Output Contract
89 
90Report in the user's language, in this order; label all five fields and state each fact once. Use controlled plain language: one fact per sentence, usually under 20 words, active voice, and one term per concept, with no synonyms for verdicts, IDs, or states. Small results may use one line per field; omit empty tables and do not copy linked artifacts:
91 
921. **Result:** The exact skill-specific verdict token first, then the supported outcome.
932. **Scope:** Reviewed/changed scope, exclusions, baseline, and material assumptions.
943. **Evidence:** Skill-specific fields below; distinguish facts, inferences, and unverified claims. Link artifacts; use tables when useful.
954. **Verification:** Checks/results, unavailable evidence, and applicable cleanup/external state.
965. **Completion:** `Checklist: X/Y complete`; `Incomplete: None` or each `UNPROVEN` item's reason, outcome impact, and exact next action; residual risks and required decisions.
97 
98**Skill-specific evidence:** Artifact path and snapshot identity (remote, branch, HEAD, worktree, date); mapped context, modules, runtime/deployment, data/interfaces, ownership, and critical flows. Identify changed sections/diagrams and claims or areas needing runtime, organizational, or external confirmation with status, inspected evidence, and exact next action.
99 

Discussion

Alternatives

Diagram designCreate branded architecture, architecture delta, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, polar chart (polar/radial lollipop), loop/flywheel, nested, tree, org chart, layer stack, Venn, pyramid/funnel, treemap and marimekko, heatmap, bar and dumbbell, waterfall, line (slopegraph, ridgeline, streamgraph, bump), Gantt and scatter charts (bubble, beeswarm), high-level, process, medallion, data flow, DP integration, DP security matrix, Sankey, fishbone, Wardley map, kanban, user journey, deployment, dependency graph, UML class, story map, or database schema diagrams as HTML/SVG/PNG, with .drawio, Mermaid, and .excalidraw import, plus lifecycle phase maps, block decomposition trees, and onboarding guidance.Coding · MITReview architectureReview a PR against the Pascal architectural rules — package boundaries (core/viewer/editor/nodes), the registry-driven composition model (def.geometry / def.renderer / def.system), legacy-dispatch regressions, the slots + world-scale-UV convention for new nodes/geometry, hook hygiene (useEditor/useScene/useViewer), and selector performance. Use when the user asks to review a PR, audit a branch, or check that changes respect the codebase's architecture.Coding · MITDraw.io Architecture StudioCreate and edit draw.io/diagrams.net diagrams as editable `.drawio` files. Covers architecture, UML/ERD/sequence, BPMN, network, and swimlane views authored from a description or converted from code, IaC, SQL, and API schemas, plus sync, query, test, review, export, and publish of existing diagrams. Use when the user asks for draw.io/diagrams.net or an editable diagram; prefer Mermaid/PlantUML when diagrams-as-code is enough.Coding · MITLLM Wiki — Knowledge Distillation PatternThe foundational knowledge distillation pattern for building and maintaining an AI-powered Obsidian wiki. Based on Andrej Karpathy's LLM Wiki architecture. Use this skill whenever the user wants to understand the wiki pattern, set up a new knowledge base, or needs guidance on the three-layer architecture (raw sources → wiki → schema). Also use when discussing knowledge management strategy, wiki structure decisions, or how to organize distilled knowledge. This is the "theory" skill — other skills handle specific operations (ingesting, querying, linting).Coding · MIT