edsger 0.81.1 → 0.83.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -0
- package/assets/README.md +21 -18
- package/assets/diagrams/base.yaml +351 -0
- package/assets/diagrams/csharp.yaml +48 -0
- package/assets/diagrams/dart.yaml +41 -0
- package/assets/diagrams/go.yaml +44 -0
- package/assets/diagrams/java.yaml +43 -0
- package/assets/diagrams/python.yaml +41 -0
- package/assets/diagrams/typescript.yaml +45 -0
- package/assets/diagrams-viewer/assets/abnfDiagram-VRR7QNED-BuBTl7CD.js +1 -0
- package/assets/diagrams-viewer/assets/arc-OMyuAfpK.js +1 -0
- package/assets/diagrams-viewer/assets/architectureDiagram-ZJ3FMSHR-BtZuD4Oc.js +36 -0
- package/assets/diagrams-viewer/assets/blockDiagram-677ZJIJ3-BXUV3Kw8.js +132 -0
- package/assets/diagrams-viewer/assets/c4Diagram-LMCZKHZV-CB6FLms7.js +10 -0
- package/assets/diagrams-viewer/assets/channel-DfIqGUHQ.js +1 -0
- package/assets/diagrams-viewer/assets/chunk-2Q5K7J3B-mPN4SRuj.js +1 -0
- package/assets/diagrams-viewer/assets/chunk-32BRIVSS-DVv1-dcH.js +1 -0
- package/assets/diagrams-viewer/assets/chunk-5VM5RSS4-CV1HWp5i.js +15 -0
- package/assets/diagrams-viewer/assets/chunk-EX3LRPZG-Dka-2CXP.js +231 -0
- package/assets/diagrams-viewer/assets/chunk-JWPE2WC7-D18DLD3z.js +1 -0
- package/assets/diagrams-viewer/assets/chunk-MOJQB5TN-DZ8recee.js +88 -0
- package/assets/diagrams-viewer/assets/chunk-RYQCIY6F-D-T7U7G_.js +1 -0
- package/assets/diagrams-viewer/assets/chunk-V7JOEXUC-CycRbumY.js +206 -0
- package/assets/diagrams-viewer/assets/chunk-VR4S4FIN-CgtEJekm.js +1 -0
- package/assets/diagrams-viewer/assets/chunk-XXDRQBXY-N1fSDz2n.js +1 -0
- package/assets/diagrams-viewer/assets/classDiagram-OUVF2IWQ-D7S3taPH.js +1 -0
- package/assets/diagrams-viewer/assets/classDiagram-v2-EOCWNBFH-D7S3taPH.js +1 -0
- package/assets/diagrams-viewer/assets/cose-bilkent-JH36ORCC-x2DnNSLL.js +1 -0
- package/assets/diagrams-viewer/assets/cynefin-VYW2F7L2-CWCJCs-i.js +178 -0
- package/assets/diagrams-viewer/assets/cynefinDiagram-TSTJHNR4-mn39JWqG.js +62 -0
- package/assets/diagrams-viewer/assets/cytoscape.esm-CUqq0XTU.js +331 -0
- package/assets/diagrams-viewer/assets/dagre-VKFMJZFB-iOjB5Pax.js +4 -0
- package/assets/diagrams-viewer/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/assets/diagrams-viewer/assets/diagram-FQU43EPY-DIFXEG6K.js +3 -0
- package/assets/diagrams-viewer/assets/diagram-G47NLZAW-CUFys0Kk.js +24 -0
- package/assets/diagrams-viewer/assets/diagram-NH7WQ7WH-ByXjnNJR.js +24 -0
- package/assets/diagrams-viewer/assets/diagram-OA4YK3LP-B7VCnnms.js +30 -0
- package/assets/diagrams-viewer/assets/diagram-WEI45ONY-DdmQeP2M.js +41 -0
- package/assets/diagrams-viewer/assets/diagrams-DFlErBCY.js +314 -0
- package/assets/diagrams-viewer/assets/diagrams-hdYg_gGB.css +1 -0
- package/assets/diagrams-viewer/assets/ebnfDiagram-CCIWWBDH-B54UVMil.js +1 -0
- package/assets/diagrams-viewer/assets/erDiagram-Q63AITRT-zkOgYlyz.js +85 -0
- package/assets/diagrams-viewer/assets/flowDiagram-23GEKE2U-CCNIfraz.js +156 -0
- package/assets/diagrams-viewer/assets/ganttDiagram-NO4QXBWP-DCn2zVSV.js +292 -0
- package/assets/diagrams-viewer/assets/gitGraphDiagram-IHSO6WYX-lB6SW9xm.js +106 -0
- package/assets/diagrams-viewer/assets/graph-C2PyVmSI.js +1 -0
- package/assets/diagrams-viewer/assets/infoDiagram-FWYZ7A6U-CvGfGSmH.js +2 -0
- package/assets/diagrams-viewer/assets/init-Gi6I4Gst.js +1 -0
- package/assets/diagrams-viewer/assets/ishikawaDiagram-FXEZZL3T-DnwhjgE5.js +70 -0
- package/assets/diagrams-viewer/assets/journeyDiagram-5HDEW3XC-C8LVhqZM.js +139 -0
- package/assets/diagrams-viewer/assets/kanban-definition-HUTT4EX6-PYOrsIQc.js +89 -0
- package/assets/diagrams-viewer/assets/katex-C5jXJg4s.js +257 -0
- package/assets/diagrams-viewer/assets/layout-HEHzrzvT.js +1 -0
- package/assets/diagrams-viewer/assets/linear-CIU4B3PA.js +1 -0
- package/assets/diagrams-viewer/assets/map-BQHxRNoK.js +1 -0
- package/assets/diagrams-viewer/assets/mindmap-definition-LN4V7U3C-B-HjOMSw.js +96 -0
- package/assets/diagrams-viewer/assets/ordinal-Cboi1Yqb.js +1 -0
- package/assets/diagrams-viewer/assets/pegDiagram-2B236MQR-dAvsUVxy.js +1 -0
- package/assets/diagrams-viewer/assets/pieDiagram-ENE6RG2P-W-6EgmyD.js +39 -0
- package/assets/diagrams-viewer/assets/quadrantDiagram-ABIIQ3AL-SlUlWOO8.js +7 -0
- package/assets/diagrams-viewer/assets/railroadDiagram-RFXS5EU6-KjtAtTVy.js +1 -0
- package/assets/diagrams-viewer/assets/requirementDiagram-TGXJPOKE-DZtlwaER.js +84 -0
- package/assets/diagrams-viewer/assets/sankeyDiagram-HTMAVEWB-1Ae4oRc3.js +40 -0
- package/assets/diagrams-viewer/assets/sequenceDiagram-DBY2YBRQ-DU-x0cLP.js +162 -0
- package/assets/diagrams-viewer/assets/sizeCapture-X5ZJPWSS-Cemh16BZ.js +1 -0
- package/assets/diagrams-viewer/assets/stateDiagram-2N3HPSRC-CtfrA6gP.js +1 -0
- package/assets/diagrams-viewer/assets/stateDiagram-v2-6OUMAXLB-BU13FASH.js +1 -0
- package/assets/diagrams-viewer/assets/swimlanes-5IMT3BWC-BkZY9GJ7.js +2 -0
- package/assets/diagrams-viewer/assets/swimlanesDiagram-G3AALYLV-03GXtgC-.js +8 -0
- package/assets/diagrams-viewer/assets/timeline-definition-FHXFAJF6-DikyXYB3.js +120 -0
- package/assets/diagrams-viewer/assets/vennDiagram-L72KCM5P-C_7veK57.js +34 -0
- package/assets/diagrams-viewer/assets/wardleyDiagram-EHGQE667-Das_YJGv.js +78 -0
- package/assets/diagrams-viewer/assets/xychartDiagram-FW5EYKEG-B5fwef3a.js +7 -0
- package/assets/diagrams-viewer/diagrams.html +14 -0
- package/assets/diagrams-viewer-single.html +3576 -0
- package/assets/manifest.yaml +5 -1
- package/assets/schema/diagrams.schema.json +100 -0
- package/assets/skills/diagram/SKILL.md +70 -0
- package/assets/viewer/assets/index-C7hwGkuU.js +3 -0
- package/assets/viewer/assets/index-Dhc-7q5o.css +1 -0
- package/assets/viewer/index.html +14 -0
- package/assets/viewer-single.html +16 -0
- package/dist/index.js +776 -38
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -36,6 +36,69 @@ The agent detects the project's language(s), loads the matching rubric, inspects
|
|
|
36
36
|
the code, scores every criterion with evidence, and edsger aggregates the
|
|
37
37
|
weighted total into a 0–100 score and a letter grade.
|
|
38
38
|
|
|
39
|
+
Every run is archived under `.edsger/benchmark/runs/<timestamp>/` and appended to
|
|
40
|
+
`.edsger/benchmark/history.jsonl`, so the JSON data is committable and the
|
|
41
|
+
dashboard can show history and trends over time.
|
|
42
|
+
|
|
43
|
+
### `edsger serve` — dashboard (current, history, trends)
|
|
44
|
+
|
|
45
|
+
Serve an interactive dashboard for the benchmark results in the current repo —
|
|
46
|
+
overall score, category breakdown, per-criterion evidence, run history, and
|
|
47
|
+
trend charts. Reads `.edsger/benchmark/`; writes nothing.
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
edsger serve # open the dashboard in your browser
|
|
51
|
+
edsger serve --port 8080 # pick a port
|
|
52
|
+
edsger serve --no-open # just print the URL
|
|
53
|
+
edsger benchmark --serve # benchmark, then open the dashboard
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### `edsger report --html <path>` — shareable export
|
|
57
|
+
|
|
58
|
+
Export a **self-contained** HTML file (all data inlined, no server needed) for
|
|
59
|
+
sharing or committing. HTML is only written when you ask for it.
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
edsger report --html report.html # write a single shareable file
|
|
63
|
+
edsger report --html report.html --open # …and open it
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### `edsger diagram` — generate diagrams from the code
|
|
67
|
+
|
|
68
|
+
Analyse the repository, decide which professional diagrams actually fit **this**
|
|
69
|
+
project (a library needs different diagrams than a microservice), and generate
|
|
70
|
+
each as renderable **Mermaid**. Writes to `.edsger/diagrams/` (`diagrams.md` +
|
|
71
|
+
`diagrams.json`, with each run archived under `runs/<timestamp>/`).
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
edsger diagram # generate diagrams for the current repo
|
|
75
|
+
edsger diagram -C ./service # …for another directory
|
|
76
|
+
edsger diagram --serve # generate, then open the diagram dashboard
|
|
77
|
+
edsger diagram --only er-diagram,request-sequence # just specific diagrams
|
|
78
|
+
edsger diagram --json # also print JSON to stdout
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
The agent detects the project's language(s), loads the matching diagram
|
|
82
|
+
**catalog** (from [edsger-assets](https://github.com/stevenzg/edsger-assets),
|
|
83
|
+
fully overridable), profiles the project, and emits diagrams grounded in real
|
|
84
|
+
files: **C4** system-context/container/component/deployment, **module dependency**
|
|
85
|
+
graphs, **class** & **domain models**, **ER** database schemas, **sequence**
|
|
86
|
+
flows, **function flowcharts**, **state machines**, **data-flow**, **CI/CD
|
|
87
|
+
pipelines**, and more — plus language-specific ones (React component trees, JPA
|
|
88
|
+
entity models, goroutine pipelines…).
|
|
89
|
+
|
|
90
|
+
The `diagrams.md` renders directly on GitHub. For an interactive, browsable view:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
edsger diagram serve # serve the diagram dashboard (renders Mermaid)
|
|
94
|
+
edsger diagram report --html diagrams.html # export a self-contained HTML file
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
The dashboard renders every diagram as Mermaid with per-diagram **zoom**, a
|
|
98
|
+
**source/copy** toggle, and **SVG / PNG download**; each generated diagram also
|
|
99
|
+
gets a static Mermaid sanity check whose warnings surface in the CLI, in
|
|
100
|
+
`diagrams.md`, and on the card.
|
|
101
|
+
|
|
39
102
|
### `edsger pr-review <pr>` (requires `gh`)
|
|
40
103
|
|
|
41
104
|
Review a pull request against the review standard. Previews by default; pass
|
package/assets/README.md
CHANGED
|
@@ -8,6 +8,9 @@ This repository is the canonical source of truth for:
|
|
|
8
8
|
maintainability, testing, documentation, delivery, and language-specific quality.
|
|
9
9
|
- **PR review standards** (`review/`) — what a reviewer (human or agent) should look
|
|
10
10
|
for when reviewing a pull request, and how findings are prioritised.
|
|
11
|
+
- **Diagram catalogs** (`diagrams/`) — the professional software diagrams (C4
|
|
12
|
+
architecture, ER, sequence, class, state, data-flow, deployment, and more), when
|
|
13
|
+
each applies to a project, and how to build it as renderable Mermaid.
|
|
11
14
|
|
|
12
15
|
The content here encodes widely accepted engineering best practices (OWASP, the
|
|
13
16
|
Twelve-Factor App, Google Engineering Practices, SLSA, Keep a Changelog, Semantic
|
|
@@ -18,9 +21,9 @@ These standards can be consumed three ways:
|
|
|
18
21
|
|
|
19
22
|
1. **The [`edsger`](https://www.npmjs.com/package/edsger) CLI** — bundles these
|
|
20
23
|
assets and runs them with the Claude Agent SDK.
|
|
21
|
-
2. **As a Claude Code plugin** — `/benchmark`, `/pr-review`, `/pr-resolve`
|
|
22
|
-
that work inside Claude Code with no CLI install (see below).
|
|
23
|
-
3. **Raw YAML** — point any tooling at the files in `benchmark
|
|
24
|
+
2. **As a Claude Code plugin** — `/benchmark`, `/pr-review`, `/pr-resolve`, `/diagram`
|
|
25
|
+
skills that work inside Claude Code with no CLI install (see below).
|
|
26
|
+
3. **Raw YAML** — point any tooling at the files in `benchmark/`, `review/`, and `diagrams/`.
|
|
24
27
|
|
|
25
28
|
## Use inside Claude Code (no CLI install)
|
|
26
29
|
|
|
@@ -32,10 +35,10 @@ plugin to get the skills as slash commands:
|
|
|
32
35
|
/plugin install edsger@edsger-assets
|
|
33
36
|
```
|
|
34
37
|
|
|
35
|
-
Then run `/benchmark`, `/pr-review`,
|
|
36
|
-
|
|
37
|
-
`edsger` CLI when it is
|
|
38
|
-
Code's own tools.
|
|
38
|
+
Then run `/benchmark`, `/pr-review`, `/pr-resolve`, or `/diagram`. The skills read
|
|
39
|
+
the same YAML from this repo (`${CLAUDE_PLUGIN_ROOT}/benchmark/...`,
|
|
40
|
+
`${CLAUDE_PLUGIN_ROOT}/diagrams/...`) and prefer the `edsger` CLI when it is
|
|
41
|
+
installed, falling back to running natively with Claude Code's own tools.
|
|
39
42
|
|
|
40
43
|
## Layout
|
|
41
44
|
|
|
@@ -44,15 +47,17 @@ edsger-assets/
|
|
|
44
47
|
├── .claude-plugin/ # Claude Code plugin + marketplace manifests
|
|
45
48
|
│ ├── plugin.json
|
|
46
49
|
│ └── marketplace.json
|
|
47
|
-
├── skills/ # Claude Code skills (/benchmark, /pr-review, /pr-resolve)
|
|
50
|
+
├── skills/ # Claude Code skills (/benchmark, /pr-review, /pr-resolve, /diagram)
|
|
48
51
|
│ ├── benchmark/SKILL.md
|
|
49
52
|
│ ├── pr-review/SKILL.md
|
|
50
|
-
│
|
|
53
|
+
│ ├── pr-resolve/SKILL.md
|
|
54
|
+
│ └── diagram/SKILL.md
|
|
51
55
|
├── manifest.yaml # registry: versions, languages, default chains
|
|
52
56
|
├── languages.yaml # language detection heuristics (markers + globs)
|
|
53
57
|
├── schema/
|
|
54
58
|
│ ├── benchmark.schema.json # JSON Schema for a benchmark rubric
|
|
55
|
-
│
|
|
59
|
+
│ ├── review.schema.json # JSON Schema for a review standard
|
|
60
|
+
│ └── diagrams.schema.json # JSON Schema for a diagram catalog
|
|
56
61
|
├── benchmark/
|
|
57
62
|
│ ├── base.yaml # language-agnostic baseline (always applied)
|
|
58
63
|
│ ├── typescript.yaml # overlays, merged on top of base
|
|
@@ -61,14 +66,12 @@ edsger-assets/
|
|
|
61
66
|
│ ├── csharp.yaml
|
|
62
67
|
│ ├── java.yaml
|
|
63
68
|
│ └── dart.yaml
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
├──
|
|
69
|
-
|
|
70
|
-
├── java.yaml
|
|
71
|
-
└── dart.yaml
|
|
69
|
+
├── review/
|
|
70
|
+
│ ├── base.yaml
|
|
71
|
+
│ └── … # language overlays
|
|
72
|
+
└── diagrams/
|
|
73
|
+
├── base.yaml # universal diagram catalog (C4, ER, sequence, flow, …)
|
|
74
|
+
└── … # language overlays (react tree, JPA model, goroutines, …)
|
|
72
75
|
```
|
|
73
76
|
|
|
74
77
|
## How standards are resolved
|
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
id: base
|
|
2
|
+
name: Universal Diagram Catalog
|
|
3
|
+
version: 0.1.0
|
|
4
|
+
kind: diagrams
|
|
5
|
+
extends: null
|
|
6
|
+
appliesTo: ["*"]
|
|
7
|
+
# A catalog of professional software diagrams. For a given repository the agent
|
|
8
|
+
# inspects the code, decides which diagrams genuinely fit the project's
|
|
9
|
+
# characteristics (using `detect` + `appliesWhen`), then emits Mermaid source for
|
|
10
|
+
# each selected diagram, grounded in real files. Diagrams that do not apply are
|
|
11
|
+
# simply omitted — a library needs different diagrams than a microservice.
|
|
12
|
+
|
|
13
|
+
groups:
|
|
14
|
+
# ----------------------------------------------------------------------------
|
|
15
|
+
- id: architecture
|
|
16
|
+
name: Architecture & Structure
|
|
17
|
+
description: >
|
|
18
|
+
How the system is decomposed into parts and how those parts relate — from
|
|
19
|
+
the outside-in (C4) down to individual types. The backbone for almost any
|
|
20
|
+
repository.
|
|
21
|
+
diagrams:
|
|
22
|
+
- id: system-context
|
|
23
|
+
title: System Context
|
|
24
|
+
type: flowchart
|
|
25
|
+
appliesWhen: >
|
|
26
|
+
Almost any project. Shows the software as a single box surrounded by
|
|
27
|
+
the users (personas) and external systems it talks to (APIs, queues,
|
|
28
|
+
third-party services, databases it does not own).
|
|
29
|
+
detect: ["*"]
|
|
30
|
+
guidance: >
|
|
31
|
+
C4 Level 1. Read the README, entry points, HTTP/SDK clients, env vars,
|
|
32
|
+
and config to find who uses the system and which external systems it
|
|
33
|
+
integrates with. Emit a `flowchart LR` with the system as one central
|
|
34
|
+
node, actors on the left, external systems on the right, and labelled
|
|
35
|
+
edges describing each relationship ("uses", "reads from", "publishes
|
|
36
|
+
to"). Keep it to a single screen — do not expand internals here.
|
|
37
|
+
references:
|
|
38
|
+
- "https://c4model.com/#SystemContextDiagram"
|
|
39
|
+
- id: container-architecture
|
|
40
|
+
title: Container / Service Architecture
|
|
41
|
+
type: flowchart
|
|
42
|
+
appliesWhen: >
|
|
43
|
+
Projects made of more than one deployable/runnable unit, or a clear
|
|
44
|
+
app + datastore + worker split (web app, API, SPA frontend, worker,
|
|
45
|
+
cache, database, message broker). Skip for a single-file script.
|
|
46
|
+
detect: ["docker-compose*", "Dockerfile", "k8s", "*.tf", "helm", "procfile", "services"]
|
|
47
|
+
guidance: >
|
|
48
|
+
C4 Level 2. Identify the runnable containers (frontend, backend, worker,
|
|
49
|
+
scheduler) and the data stores/brokers they use. Read docker-compose,
|
|
50
|
+
Kubernetes/Helm manifests, Terraform, Procfile, and the service dirs.
|
|
51
|
+
Emit a `flowchart TB` grouping related containers in `subgraph`s, with
|
|
52
|
+
each container labelled by its technology (e.g. "API [Node/Express]")
|
|
53
|
+
and edges labelled with the protocol ("HTTPS/JSON", "gRPC", "SQL",
|
|
54
|
+
"AMQP"). Include datastores as cylinder-style nodes.
|
|
55
|
+
references:
|
|
56
|
+
- "https://c4model.com/#ContainerDiagram"
|
|
57
|
+
- id: component-breakdown
|
|
58
|
+
title: Component Breakdown
|
|
59
|
+
type: flowchart
|
|
60
|
+
appliesWhen: >
|
|
61
|
+
A single application/service with enough internal structure that its
|
|
62
|
+
major components (controllers, services, repositories, adapters) are
|
|
63
|
+
worth showing. Best for a backend/service with layered architecture.
|
|
64
|
+
detect: ["controllers", "services", "repositories", "handlers", "usecases", "domain"]
|
|
65
|
+
guidance: >
|
|
66
|
+
C4 Level 3 — zoom into one container. Read the source tree of the main
|
|
67
|
+
app and identify its cohesive components and the direction of
|
|
68
|
+
dependencies between them (e.g. HTTP layer → use-cases → repositories →
|
|
69
|
+
DB). Emit a `flowchart TB` with one node per component and directed
|
|
70
|
+
edges. Prefer showing the dependency direction faithfully over being
|
|
71
|
+
exhaustive.
|
|
72
|
+
references:
|
|
73
|
+
- "https://c4model.com/#ComponentDiagram"
|
|
74
|
+
- id: module-dependency
|
|
75
|
+
title: Module / Package Dependency Graph
|
|
76
|
+
type: flowchart
|
|
77
|
+
appliesWhen: >
|
|
78
|
+
Any non-trivial codebase, especially monorepos and multi-package repos.
|
|
79
|
+
Shows how top-level modules/packages import one another and surfaces
|
|
80
|
+
layering violations or cycles.
|
|
81
|
+
detect:
|
|
82
|
+
[
|
|
83
|
+
"packages",
|
|
84
|
+
"apps",
|
|
85
|
+
"libs",
|
|
86
|
+
"src",
|
|
87
|
+
"internal",
|
|
88
|
+
"pnpm-workspace.yaml",
|
|
89
|
+
"lerna.json",
|
|
90
|
+
"go.mod"
|
|
91
|
+
]
|
|
92
|
+
guidance: >
|
|
93
|
+
Map the import/dependency edges between the top-level modules or
|
|
94
|
+
workspace packages (not every file — the coarse structure). Use Grep on
|
|
95
|
+
import/require/use statements or read the workspace manifest. Emit a
|
|
96
|
+
`flowchart LR`; if you detect an import cycle, keep the edges honest and
|
|
97
|
+
note the cycle in the description. Aim for 5–20 nodes.
|
|
98
|
+
- id: class-structure
|
|
99
|
+
title: Key Class / Type Structure
|
|
100
|
+
type: classDiagram
|
|
101
|
+
appliesWhen: >
|
|
102
|
+
Object-oriented or strongly-typed codebases where the core abstractions
|
|
103
|
+
are classes/interfaces/structs with inheritance or composition worth
|
|
104
|
+
showing (frameworks, SDKs, domain-rich services). Skip for thin
|
|
105
|
+
script-style code.
|
|
106
|
+
detect: ["class ", "interface ", "abstract", "struct ", "trait "]
|
|
107
|
+
guidance: >
|
|
108
|
+
Pick the 6–15 most important types on the core domain/abstraction and
|
|
109
|
+
model them with a Mermaid `classDiagram`: key fields and methods,
|
|
110
|
+
inheritance (`<|--`), composition (`*--`), and association (`-->`).
|
|
111
|
+
Favour the load-bearing abstractions over data-transfer objects.
|
|
112
|
+
references:
|
|
113
|
+
- "https://en.wikipedia.org/wiki/Class_diagram"
|
|
114
|
+
|
|
115
|
+
# ----------------------------------------------------------------------------
|
|
116
|
+
- id: behavioral
|
|
117
|
+
name: Behaviour & Control Flow
|
|
118
|
+
description: >
|
|
119
|
+
How the system behaves over time — the ordered interactions, the control
|
|
120
|
+
flow of important logic, and the lifecycles of stateful things.
|
|
121
|
+
diagrams:
|
|
122
|
+
- id: request-sequence
|
|
123
|
+
title: Request / Interaction Sequence
|
|
124
|
+
type: sequenceDiagram
|
|
125
|
+
appliesWhen: >
|
|
126
|
+
Any system with a meaningful end-to-end flow across participants — an
|
|
127
|
+
HTTP request through middleware to the DB, a CLI command, an auth
|
|
128
|
+
handshake, a webhook round-trip, an agent tool-call loop.
|
|
129
|
+
detect: ["route", "handler", "controller", "middleware", "endpoint", "api", "rpc"]
|
|
130
|
+
guidance: >
|
|
131
|
+
Choose the single most representative flow (e.g. the primary API request
|
|
132
|
+
or the main command) and trace it through the real participants (Client,
|
|
133
|
+
API, Service, DB, external API). Emit a `sequenceDiagram` with `->>`
|
|
134
|
+
calls and `-->>` returns, `activate`/`deactivate` where it clarifies,
|
|
135
|
+
and `alt`/`opt` for the important branches (error/success). Keep to one
|
|
136
|
+
coherent scenario rather than every path.
|
|
137
|
+
references:
|
|
138
|
+
- "https://en.wikipedia.org/wiki/Sequence_diagram"
|
|
139
|
+
- id: function-flowchart
|
|
140
|
+
title: Critical Function Flowchart
|
|
141
|
+
type: flowchart
|
|
142
|
+
appliesWhen: >
|
|
143
|
+
There is a non-trivial algorithm or decision-heavy function at the heart
|
|
144
|
+
of the project (a scheduler, parser, pricing/scoring engine, state
|
|
145
|
+
reducer, retry/backoff loop). Skip if the logic is mostly straight-line.
|
|
146
|
+
detect: ["*"]
|
|
147
|
+
guidance: >
|
|
148
|
+
Find the most important branching function and render its control flow
|
|
149
|
+
as a `flowchart TD`: decisions as `{diamond}` nodes with Yes/No edges,
|
|
150
|
+
processing as rectangles, and terminal states clearly marked. Stay
|
|
151
|
+
faithful to the actual branches and loops in the code; reference the
|
|
152
|
+
function by file and name in the description.
|
|
153
|
+
references:
|
|
154
|
+
- "https://en.wikipedia.org/wiki/Flowchart"
|
|
155
|
+
- id: state-machine
|
|
156
|
+
title: Lifecycle / State Machine
|
|
157
|
+
type: stateDiagram-v2
|
|
158
|
+
appliesWhen: >
|
|
159
|
+
Something in the domain moves through explicit states — an order,
|
|
160
|
+
job, session, connection, deployment, request, or a UI/workflow with
|
|
161
|
+
statuses/enums. Very common in services and workflow engines.
|
|
162
|
+
detect: ["status", "state", "enum", "PENDING", "ACTIVE", "workflow", "lifecycle"]
|
|
163
|
+
guidance: >
|
|
164
|
+
Identify a stateful entity and its transitions from enums/status fields
|
|
165
|
+
and the code that mutates them. Emit a `stateDiagram-v2` with `[*]`
|
|
166
|
+
start/end, named states, and labelled transitions (the event/condition
|
|
167
|
+
that causes each move). Keep every transition traceable to real code.
|
|
168
|
+
references:
|
|
169
|
+
- "https://en.wikipedia.org/wiki/UML_state_machine"
|
|
170
|
+
- id: user-journey
|
|
171
|
+
title: User Journey
|
|
172
|
+
type: journey
|
|
173
|
+
appliesWhen: >
|
|
174
|
+
Products with a human-facing flow (web/mobile app, CLI UX, onboarding)
|
|
175
|
+
where the sequence of user steps and their friction is meaningful.
|
|
176
|
+
Skip for pure infrastructure/libraries.
|
|
177
|
+
detect: ["frontend", "ui", "pages", "views", "components", "onboarding", "signup"]
|
|
178
|
+
guidance: >
|
|
179
|
+
Sketch the primary user's path through the product as a Mermaid
|
|
180
|
+
`journey` with 1–2 sections and steps scored 1–5 for experience. Ground
|
|
181
|
+
the steps in real screens/commands/endpoints, not invented ones.
|
|
182
|
+
|
|
183
|
+
# ----------------------------------------------------------------------------
|
|
184
|
+
- id: data
|
|
185
|
+
name: Data & Persistence
|
|
186
|
+
description: >
|
|
187
|
+
The shape of the data the system owns and how it moves — schemas, domain
|
|
188
|
+
models, and data-flow.
|
|
189
|
+
diagrams:
|
|
190
|
+
- id: er-diagram
|
|
191
|
+
title: Entity–Relationship (Database Schema)
|
|
192
|
+
type: erDiagram
|
|
193
|
+
appliesWhen: >
|
|
194
|
+
The project owns a relational schema or ORM models/migrations. One of
|
|
195
|
+
the highest-value diagrams whenever a database is present.
|
|
196
|
+
detect:
|
|
197
|
+
[
|
|
198
|
+
"*.sql",
|
|
199
|
+
"migrations",
|
|
200
|
+
"schema.prisma",
|
|
201
|
+
"models",
|
|
202
|
+
"entity",
|
|
203
|
+
"@Entity",
|
|
204
|
+
"CREATE TABLE",
|
|
205
|
+
"ActiveRecord",
|
|
206
|
+
"sqlalchemy",
|
|
207
|
+
"gorm"
|
|
208
|
+
]
|
|
209
|
+
guidance: >
|
|
210
|
+
Read the schema/migrations/ORM models and reconstruct the entities,
|
|
211
|
+
their key columns (with types and PK/FK markers), and the relationships
|
|
212
|
+
with correct cardinality. Emit a Mermaid `erDiagram` using
|
|
213
|
+
`||--o{`-style crow's-foot notation. Include the important tables; you
|
|
214
|
+
may omit pure join-table noise if you show the relationship it encodes.
|
|
215
|
+
references:
|
|
216
|
+
- "https://en.wikipedia.org/wiki/Entity%E2%80%93relationship_model"
|
|
217
|
+
- id: data-flow
|
|
218
|
+
title: Data Flow Diagram
|
|
219
|
+
type: flowchart
|
|
220
|
+
appliesWhen: >
|
|
221
|
+
Data moves through stages/transformations — pipelines, ETL/ELT, event
|
|
222
|
+
streaming, ingestion→processing→storage, ML training/inference. Skip
|
|
223
|
+
for simple CRUD apps already covered by the ER diagram.
|
|
224
|
+
detect:
|
|
225
|
+
["pipeline", "etl", "kafka", "queue", "stream", "worker", "producer", "consumer", "dag"]
|
|
226
|
+
guidance: >
|
|
227
|
+
Trace data from its sources through each processing step to its sinks.
|
|
228
|
+
Emit a `flowchart LR` where external entities/sources and data stores
|
|
229
|
+
are visually distinct from processes; label edges with what data flows.
|
|
230
|
+
Follow classic DFD intent (processes, data stores, data flows, external
|
|
231
|
+
entities) using Mermaid shapes.
|
|
232
|
+
references:
|
|
233
|
+
- "https://en.wikipedia.org/wiki/Data-flow_diagram"
|
|
234
|
+
- id: domain-model
|
|
235
|
+
title: Domain Model
|
|
236
|
+
type: classDiagram
|
|
237
|
+
appliesWhen: >
|
|
238
|
+
Domain-rich applications whose core concepts and relationships are not
|
|
239
|
+
fully captured by a database schema (DDD-style aggregates, value
|
|
240
|
+
objects, rich business entities). Complements or replaces the ER diagram
|
|
241
|
+
for non-relational or logic-heavy domains.
|
|
242
|
+
detect: ["domain", "aggregate", "entity", "valueobject", "model"]
|
|
243
|
+
guidance: >
|
|
244
|
+
Model the ubiquitous-language concepts and their relationships as a
|
|
245
|
+
`classDiagram`, emphasising aggregates/roots, multiplicities, and the
|
|
246
|
+
associations that carry business meaning rather than storage details.
|
|
247
|
+
references:
|
|
248
|
+
- "https://martinfowler.com/eaaCatalog/domainModel.html"
|
|
249
|
+
|
|
250
|
+
# ----------------------------------------------------------------------------
|
|
251
|
+
- id: deployment
|
|
252
|
+
name: Deployment & Operations
|
|
253
|
+
description: >
|
|
254
|
+
Where the code runs and how it gets there — runtime topology and the
|
|
255
|
+
delivery pipeline.
|
|
256
|
+
diagrams:
|
|
257
|
+
- id: deployment-topology
|
|
258
|
+
title: Deployment Topology
|
|
259
|
+
type: flowchart
|
|
260
|
+
appliesWhen: >
|
|
261
|
+
Anything with a defined runtime environment: containers, Kubernetes,
|
|
262
|
+
serverless, VMs, a CDN/edge, managed databases. Skip for a plain
|
|
263
|
+
library with no deployment story.
|
|
264
|
+
detect:
|
|
265
|
+
[
|
|
266
|
+
"Dockerfile",
|
|
267
|
+
"docker-compose*",
|
|
268
|
+
"k8s",
|
|
269
|
+
"kubernetes",
|
|
270
|
+
"helm",
|
|
271
|
+
"*.tf",
|
|
272
|
+
"serverless.yml",
|
|
273
|
+
"vercel.json",
|
|
274
|
+
"fly.toml",
|
|
275
|
+
".github/workflows"
|
|
276
|
+
]
|
|
277
|
+
guidance: >
|
|
278
|
+
Read infra manifests (Docker/K8s/Helm/Terraform/serverless configs) and
|
|
279
|
+
model the runtime nodes/zones and what is deployed onto each. Emit a
|
|
280
|
+
`flowchart TB` using `subgraph`s for boundaries (client, edge/CDN,
|
|
281
|
+
cluster/VPC, managed services) and nodes for the deployed units, with
|
|
282
|
+
edges for network paths. This is the C4 deployment view.
|
|
283
|
+
references:
|
|
284
|
+
- "https://c4model.com/#DeploymentDiagram"
|
|
285
|
+
- id: cicd-pipeline
|
|
286
|
+
title: CI/CD Pipeline
|
|
287
|
+
type: flowchart
|
|
288
|
+
appliesWhen: >
|
|
289
|
+
A CI/CD configuration exists (GitHub Actions, GitLab CI, CircleCI,
|
|
290
|
+
Jenkins, etc.). Shows the stages from commit to release.
|
|
291
|
+
detect:
|
|
292
|
+
[
|
|
293
|
+
".github/workflows",
|
|
294
|
+
".gitlab-ci.yml",
|
|
295
|
+
"Jenkinsfile",
|
|
296
|
+
".circleci",
|
|
297
|
+
"azure-pipelines.yml",
|
|
298
|
+
"buildkite"
|
|
299
|
+
]
|
|
300
|
+
guidance: >
|
|
301
|
+
Read the pipeline definition(s) and render the stages and their
|
|
302
|
+
dependencies as a `flowchart LR` (trigger → build → test/lint →
|
|
303
|
+
package → deploy environments), including gates/approvals and parallel
|
|
304
|
+
jobs where present. Keep stage names faithful to the config.
|
|
305
|
+
|
|
306
|
+
# ----------------------------------------------------------------------------
|
|
307
|
+
- id: process
|
|
308
|
+
name: Process, Domain & Planning
|
|
309
|
+
description: >
|
|
310
|
+
Higher-level maps of the domain, the collaboration workflow, and the plan —
|
|
311
|
+
useful for onboarding and communication. Include only when the evidence
|
|
312
|
+
exists; never invent a roadmap.
|
|
313
|
+
diagrams:
|
|
314
|
+
- id: domain-mindmap
|
|
315
|
+
title: Domain / Feature Mind Map
|
|
316
|
+
type: mindmap
|
|
317
|
+
appliesWhen: >
|
|
318
|
+
A useful onboarding overview for most non-trivial repos: the main
|
|
319
|
+
feature areas / bounded contexts / subsystems and what each contains.
|
|
320
|
+
detect: ["*"]
|
|
321
|
+
guidance: >
|
|
322
|
+
Summarise the repository's major areas as a Mermaid `mindmap` rooted at
|
|
323
|
+
the project name, branching into subsystems/features and their notable
|
|
324
|
+
pieces. Derive branches from the real directory structure and README,
|
|
325
|
+
not aspiration.
|
|
326
|
+
- id: git-branching
|
|
327
|
+
title: Branching / Release Model
|
|
328
|
+
type: gitGraph
|
|
329
|
+
appliesWhen: >
|
|
330
|
+
The repository follows a discernible branching or release strategy
|
|
331
|
+
(trunk-based, GitFlow, release branches, tags) worth documenting.
|
|
332
|
+
Optional; skip if history is trivial.
|
|
333
|
+
detect: ["CONTRIBUTING", "release", "CHANGELOG", "tags", ".github"]
|
|
334
|
+
guidance: >
|
|
335
|
+
Infer the branching model from CONTRIBUTING docs, branch names, tags,
|
|
336
|
+
and CHANGELOG, and illustrate it with a Mermaid `gitGraph` (main plus
|
|
337
|
+
representative feature/release branches, commits, merges, tags). This is
|
|
338
|
+
illustrative of the model, not a literal replay of history.
|
|
339
|
+
- id: requirements
|
|
340
|
+
title: Requirements Traceability
|
|
341
|
+
type: requirementDiagram
|
|
342
|
+
appliesWhen: >
|
|
343
|
+
The repo documents explicit requirements/specs and you can trace them to
|
|
344
|
+
components that satisfy them (regulated, spec-driven, or RFC-heavy
|
|
345
|
+
projects). Optional and evidence-gated.
|
|
346
|
+
detect: ["requirements", "specs", "rfc", "docs/adr", "SPEC"]
|
|
347
|
+
guidance: >
|
|
348
|
+
Extract stated requirements and the elements that satisfy them from
|
|
349
|
+
docs/specs, and render a Mermaid `requirementDiagram` with
|
|
350
|
+
`requirement`/`element` nodes and `satisfies`/`traces` relationships.
|
|
351
|
+
Only include requirements actually written down in the repo.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
id: csharp
|
|
2
|
+
name: C# / .NET Overlay
|
|
3
|
+
version: 0.1.0
|
|
4
|
+
kind: diagrams
|
|
5
|
+
extends: base
|
|
6
|
+
appliesTo: [csharp]
|
|
7
|
+
|
|
8
|
+
groups:
|
|
9
|
+
- id: architecture
|
|
10
|
+
name: Architecture & Structure
|
|
11
|
+
diagrams:
|
|
12
|
+
- id: aspnet-layers
|
|
13
|
+
title: ASP.NET Layered Architecture
|
|
14
|
+
type: flowchart
|
|
15
|
+
appliesWhen: >
|
|
16
|
+
An ASP.NET Core web API/app (Controllers or Minimal APIs) with services
|
|
17
|
+
and EF Core. Shows the request path through the layers and DI.
|
|
18
|
+
detect:
|
|
19
|
+
[
|
|
20
|
+
"ControllerBase",
|
|
21
|
+
"[ApiController]",
|
|
22
|
+
"MapGet",
|
|
23
|
+
"MapPost",
|
|
24
|
+
"AddScoped",
|
|
25
|
+
"IServiceCollection"
|
|
26
|
+
]
|
|
27
|
+
guidance: >
|
|
28
|
+
Read the controllers/endpoints, registered services, and DbContext to
|
|
29
|
+
map Endpoints → Services → Repositories/DbContext → Database as a
|
|
30
|
+
`flowchart TB` with layers in `subgraph`s. Reflect the real
|
|
31
|
+
dependency-injection wiring where you can see it.
|
|
32
|
+
references:
|
|
33
|
+
- "https://learn.microsoft.com/aspnet/core/fundamentals/"
|
|
34
|
+
|
|
35
|
+
- id: data
|
|
36
|
+
name: Data & Persistence
|
|
37
|
+
diagrams:
|
|
38
|
+
- id: efcore-model
|
|
39
|
+
title: EF Core Model
|
|
40
|
+
type: classDiagram
|
|
41
|
+
appliesWhen: >
|
|
42
|
+
Entity Framework Core models / a DbContext are present. Shows the
|
|
43
|
+
entity classes and their navigation-property relationships.
|
|
44
|
+
detect: ["DbContext", "DbSet<", "[Key]", "HasMany", "WithOne", "EntityFramework"]
|
|
45
|
+
guidance: >
|
|
46
|
+
Model the entity POCOs and their navigation properties as a
|
|
47
|
+
`classDiagram`, using the DbContext `DbSet`s and fluent/attribute
|
|
48
|
+
configuration to get the relationships and multiplicities right.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
id: dart
|
|
2
|
+
name: Dart / Flutter Overlay
|
|
3
|
+
version: 0.1.0
|
|
4
|
+
kind: diagrams
|
|
5
|
+
extends: base
|
|
6
|
+
appliesTo: [dart]
|
|
7
|
+
|
|
8
|
+
groups:
|
|
9
|
+
- id: architecture
|
|
10
|
+
name: Architecture & Structure
|
|
11
|
+
diagrams:
|
|
12
|
+
- id: flutter-widget-tree
|
|
13
|
+
title: Flutter Widget Tree
|
|
14
|
+
type: flowchart
|
|
15
|
+
appliesWhen: >
|
|
16
|
+
A Flutter app. Shows the widget composition for the main screens —
|
|
17
|
+
the Flutter equivalent of a component tree.
|
|
18
|
+
detect:
|
|
19
|
+
["flutter", "StatelessWidget", "StatefulWidget", "MaterialApp", "Scaffold", "*.dart"]
|
|
20
|
+
guidance: >
|
|
21
|
+
From `main.dart` and the routed screens, map the important widgets and
|
|
22
|
+
their build-tree composition as a `flowchart TD`. Focus on the screen
|
|
23
|
+
scaffolds and reusable widgets; note where state is injected
|
|
24
|
+
(Provider/InheritedWidget) rather than every layout widget.
|
|
25
|
+
references:
|
|
26
|
+
- "https://docs.flutter.dev/ui/widgets-intro"
|
|
27
|
+
|
|
28
|
+
- id: behavioral
|
|
29
|
+
name: Behaviour & Control Flow
|
|
30
|
+
diagrams:
|
|
31
|
+
- id: bloc-state
|
|
32
|
+
title: State Management (BLoC / Cubit)
|
|
33
|
+
type: stateDiagram-v2
|
|
34
|
+
appliesWhen: >
|
|
35
|
+
The app uses BLoC/Cubit (or Riverpod/Provider) state management. Shows
|
|
36
|
+
the states a feature moves through and the events driving them.
|
|
37
|
+
detect: ["bloc", "cubit", "riverpod", "provider", "emit(", "StateNotifier"]
|
|
38
|
+
guidance: >
|
|
39
|
+
Pick a representative feature's BLoC/Cubit and model its states and the
|
|
40
|
+
events/transitions between them as a `stateDiagram-v2`, tracing each
|
|
41
|
+
transition to an `emit`/event handler in the code.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
id: go
|
|
2
|
+
name: Go Overlay
|
|
3
|
+
version: 0.1.0
|
|
4
|
+
kind: diagrams
|
|
5
|
+
extends: base
|
|
6
|
+
appliesTo: [go]
|
|
7
|
+
|
|
8
|
+
groups:
|
|
9
|
+
- id: behavioral
|
|
10
|
+
name: Behaviour & Control Flow
|
|
11
|
+
diagrams:
|
|
12
|
+
- id: goroutine-concurrency
|
|
13
|
+
title: Goroutine / Channel Concurrency
|
|
14
|
+
type: flowchart
|
|
15
|
+
appliesWhen: >
|
|
16
|
+
The program uses goroutines and channels for a concurrent pipeline,
|
|
17
|
+
fan-out/fan-in, or worker pool. One of Go's most illuminating and
|
|
18
|
+
hardest-to-read-from-source structures.
|
|
19
|
+
detect: ["go func", "chan ", "make(chan", "sync.WaitGroup", "errgroup", "worker pool"]
|
|
20
|
+
guidance: >
|
|
21
|
+
Identify the concurrent structure (producers, worker pool, fan-in
|
|
22
|
+
collector) and render it as a `flowchart LR` where goroutines are nodes
|
|
23
|
+
and channels are the edges between them (label edges with the channel's
|
|
24
|
+
element type). Show closing/cancellation (context) where it matters.
|
|
25
|
+
references:
|
|
26
|
+
- "https://go.dev/blog/pipelines"
|
|
27
|
+
|
|
28
|
+
- id: architecture
|
|
29
|
+
name: Architecture & Structure
|
|
30
|
+
diagrams:
|
|
31
|
+
- id: go-package-layout
|
|
32
|
+
title: Package Layout (cmd / internal / pkg)
|
|
33
|
+
type: flowchart
|
|
34
|
+
appliesWhen: >
|
|
35
|
+
A multi-package Go module, especially one using the standard
|
|
36
|
+
cmd/internal/pkg layout. Shows the import direction between packages.
|
|
37
|
+
detect: ["cmd/", "internal/", "pkg/", "go.mod"]
|
|
38
|
+
guidance: >
|
|
39
|
+
Read go.mod and the package imports to map the top-level packages and
|
|
40
|
+
their import edges as a `flowchart LR`, keeping the dependency direction
|
|
41
|
+
faithful (binaries in cmd/ depend inward on internal/pkg, never the
|
|
42
|
+
reverse). Flag any import cycle you find.
|
|
43
|
+
references:
|
|
44
|
+
- "https://go.dev/doc/modules/layout"
|