archgen-skill 0.0.5 → 0.0.6

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.
Files changed (36) hide show
  1. package/README.md +12 -6
  2. package/bin/archgen.mjs +22 -5
  3. package/lib/block.js +1 -1
  4. package/lib/bootstrap.js +103 -0
  5. package/lib/doctor.js +45 -2
  6. package/lib/init.js +32 -3
  7. package/lib/install.js +20 -1
  8. package/lib/mcp-server.js +159 -0
  9. package/lib/migrations/001-stamp-provenance.mjs +3 -3
  10. package/lib/spawn-npm.js +54 -0
  11. package/lib/store.js +75 -5
  12. package/lib/uninstall-project.js +16 -3
  13. package/lib/version.js +11 -3
  14. package/package.json +3 -3
  15. package/vendor/skills/archgen/SKILL.md +363 -213
  16. package/vendor/skills/archgen/archgen.config.json +1 -1
  17. package/vendor/skills/archgen/references/code-standards.md +2 -2
  18. package/vendor/skills/archgen/assets/mcp-template.json +0 -42
  19. package/vendor/skills/archgen/assets/skill-registry.json +0 -24
  20. package/vendor/skills/archgen/references/artifact-templates.md +0 -406
  21. package/vendor/skills/archgen/references/interview.md +0 -275
  22. package/vendor/skills/archgen/references/mcp-and-skills.md +0 -117
  23. package/vendor/skills/archgen/references/orchestration.md +0 -292
  24. package/vendor/skills/archgen/references/platforms.md +0 -138
  25. package/vendor/skills/archgen/scripts/doc-index.mjs +0 -457
  26. package/vendor/skills/archgen/scripts/impact.mjs +0 -77
  27. package/vendor/skills/archgen/scripts/lib/graph.mjs +0 -222
  28. package/vendor/skills/archgen/scripts/lib/plan-coverage.mjs +0 -32
  29. package/vendor/skills/archgen/scripts/lib/scope.mjs +0 -65
  30. package/vendor/skills/archgen/scripts/lib/yaml.mjs +0 -492
  31. package/vendor/skills/archgen/scripts/next-tasks.mjs +0 -55
  32. package/vendor/skills/archgen/scripts/plan-graph.mjs +0 -329
  33. package/vendor/skills/archgen/scripts/set-status.mjs +0 -82
  34. package/vendor/skills/archgen/scripts/update-agents.mjs +0 -213
  35. package/vendor/skills/archgen/scripts/validate.mjs +0 -87
  36. package/vendor/skills/archgen/scripts/verify-plan.mjs +0 -70
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.5",
2
+ "version": "0.0.6",
3
3
  "skillName": "archgen",
4
4
  "markers": {
5
5
  "start": "<!-- archgen:start (managed block - do not edit between markers) -->",
@@ -64,7 +64,7 @@ Per-language conventions (professional, descriptive, consistent):
64
64
 
65
65
  - tasks.yaml acceptance criteria MUST include at least one objectively
66
66
  checkable statement (command exit, observable output).
67
- - The verifier runs verify-plan.mjs AND reads plans against this file;
68
- violations = ISSUES, not warnings.
67
+ - The verifier runs `archgen_plan{action:'verify'}` AND reads plans against this
68
+ file; violations = ISSUES, not warnings.
69
69
  - Workers receive this reference in their prompt contract; "I didn't know" is
70
70
  not available to them.
@@ -1,42 +0,0 @@
1
- {
2
- "_readme": "Canonical MCP server declarations. COPY the variant matching your platform (see references/platforms.md for file paths). Keys DIFFER per platform: mcpServers | servers | mcp | context_servers. Remote URL field varies: url | serverUrl | httpUrl.",
3
- "_claude_code_cursor_windsurf_kiro_gemini": {
4
- "mcpServers": {
5
- "codegraph": {
6
- "type": "stdio",
7
- "command": "npx",
8
- "args": ["-y", "@colbymchenry/codegraph", "mcp"],
9
- "env": {}
10
- },
11
- "context7-remote": {
12
- "type": "http",
13
- "url": "https://mcp.context7.com/mcp",
14
- "headers": { "Authorization": "Bearer ${env:CONTEXT7_TOKEN}" }
15
- }
16
- }
17
- },
18
- "_vscode_copilot": {
19
- "servers": {
20
- "codegraph": { "type": "stdio", "command": "npx", "args": ["-y", "@colbymchenry/codegraph", "mcp"] },
21
- "context7": { "type": "http", "url": "https://mcp.context7.com/mcp" }
22
- },
23
- "inputs": []
24
- },
25
- "_opencode": {
26
- "mcp": {
27
- "codegraph": { "type": "local", "command": ["npx", "-y", "@colbymchenry/codegraph", "mcp"], "environment": {}, "enabled": true },
28
- "context7": { "type": "remote", "url": "https://mcp.context7.com/mcp", "enabled": true }
29
- }
30
- },
31
- "_zed": {
32
- "context_servers": {
33
- "context7": { "url": "https://mcp.context7.com/mcp" }
34
- }
35
- },
36
- "_codex_toml": {
37
- "_note": "TOML in ~/.codex/config.toml",
38
- "mcp_servers.codegraph": { "command": "npx", "args": ["-y", "@colbymchenry/codegraph", "mcp"] },
39
- "mcp_servers.context7": { "url": "https://mcp.context7.com/mcp" }
40
- },
41
- "_antigravity_warning": "Remote servers MUST use serverUrl (url/httpUrl are rejected): { mcpServers: { name: { serverUrl: '...' } } }"
42
- }
@@ -1,24 +0,0 @@
1
- {
2
- "version": 1,
3
- "skills": [
4
- {
5
- "name": "ui-skills",
6
- "purpose": "Design-engineering skill collection for frontend/UI/UX work: motion, baseline UI, component patterns",
7
- "repo": "ibelick/ui-skills",
8
- "install": "npx skills add ibelick/ui-skills",
9
- "direct_fetch": "npx ui-skills get <skill-name>",
10
- "browse": "npx ui-skills list --category <category>",
11
- "mcp_endpoint": "https://www.ui-skills.com/mcp",
12
- "matches": ["frontend", "ui", "ux", "design", "component", "animation", "motion", "landing page"],
13
- "policy": "required"
14
- },
15
- {
16
- "name": "vercel-skills-installer",
17
- "purpose": "Canonical cross-harness skill installer (75+ agents) - use when a registry entry lacks a direct command",
18
- "repo": "vercel-labs/skills",
19
- "install": "npx skills add <owner>/<repo> [-a <agent>] [-g] [--copy]",
20
- "matches": ["installer"],
21
- "policy": "on-demand"
22
- }
23
- ]
24
- }
@@ -1,406 +0,0 @@
1
- # Artifact templates — copy, fill, never invent structure
2
-
3
- ## Provenance header (SHOULD on every NEW tasks.yaml / architecture.yaml)
4
-
5
- Begin both files with three YAML comment lines. Comments are ignored by every
6
- consumer (skill scripts, VS Code extension, any YAML toolchain), so this is
7
- purely additive metadata — it can never break a parser:
8
-
9
- ```yaml
10
- # schema_version: 1
11
- # generator: archgen v0.0.4
12
- # generated_at: 2026-08-26T09:00:00.000Z
13
- ```
14
-
15
- Version token rules — code-defensive, NEVER guess:
16
-
17
- 1. If a `.archgen-version` stamp sits next to `SKILL.md` (the installed skill
18
- root) and reads as exact `MAJOR.MINOR.PATCH`, write `generator: archgen vX.Y.Z`.
19
- 2. Else if an adjacent `archgen.config.json` carries a semver-shaped
20
- `"version"` field, use that value the same way.
21
- 3. Else omit the version token entirely: plain `# generator: archgen`.
22
-
23
- `generated_at` is one ISO-8601 timestamp per generation run (all files written
24
- by the same run share it). Keep the header at the very top of the file; never
25
- place content above it and never encode meaning anywhere except these three
26
- lines.
27
-
28
- Older artifacts without the header are backfilled by
29
- `npx archgen-skill migrate --apply` (dry-run `--check` is the default), which
30
- snapshots each file into `.archgen/.backup/<ts>/migrate/` before touching it
31
- and skips already-stamped files, so re-running is always safe.
32
-
33
- ## Self-containment rules (anti-hallucination)
34
-
35
- Artifacts are executed by sessions and sub-agents that were NEVER part of the
36
- conversation that produced them. Hard rules, no exceptions:
37
-
38
- 1. **Full paths, always.** Every task step, `file_ownership` glob, artifact,
39
- and verification command uses complete repo-root-relative paths
40
- (`src/features/catalog/api/routes.ts`), never bare filenames (`routes.ts`)
41
- and never invented directories. Paths come from `structure:` /
42
- `owns[]` in architecture.yaml or from surveyed code — nowhere else.
43
- 2. **Names derive from naming_conventions.** Every file, symbol, table, and
44
- env-var name you introduce cites WHICH convention key produced it, e.g.
45
- `camelCase symbols per naming_conventions.symbol_casing`. If no key covers
46
- it, add the key first, then use it.
47
- 3. **Plans survive context summarization alone.** Any session reading ONLY
48
- `.archgen/<slug>/` must execute correctly with zero chat history. If a fact
49
- matters, it is written in an artifact; if it is not written, it does not
50
- exist.
51
- 4. **Forbidden phrases** (in any artifact): "as discussed", "the usual
52
- pattern", "same as before", "see chat". Replace each with the concrete
53
- artifact reference it was standing in for.
54
- 5. **Cross-references are artifact-relative**, e.g.
55
- `see ../architecture.yaml data_contracts.orders` or
56
- `payload per ../architecture.yaml api_contracts.payments.request_payload`.
57
- Never restate a contract from memory — point at it.
58
- 6. **Verifier-compatible ids in plans.** `verify-plan.mjs` rejects any
59
- UPPERCASE-numbered token in `plans/*.md` that is not a real tasks.yaml id
60
- (`TASK-999` fails; your actual ids pass). So: requirement ids
61
- (`FR-<MODULE>-nn`) are cited from `tasks.yaml` acceptance lines and
62
- `docs/prd.md` itself; inside plan prose link the anchor instead —
63
- `../docs/prd.md#fr-catalog-01`. Every tasks.yaml id MUST appear in some
64
- plan file (coverage check runs both directions).
65
-
66
- ## Plan depth by scope class
67
-
68
- Pick ONE class before writing any artifact; depth scales with risk, not
69
- enthusiasm. Misclassifying is a defect: inflating SMALL wastes tokens,
70
- shrinking LARGE hallucinates.
71
-
72
- - **SMALL** (add/touch few things): lean plan-note shape stays —
73
-
74
- ```markdown
75
- # <feature> — plan note (SMALL)
76
- Intent: <one paragraph>
77
- Tasks: see tasks.yaml entries <ids>
78
- Risks: <bullets or none>
79
- ```
80
-
81
- Every task entry STILL carries absolute-from-repo-root paths verbatim —
82
- in `file_ownership`, in each step, in verification commands. No Context
83
- section, no diagrams, no PRD.
84
-
85
- - **MEDIUM**: `plans/<feature>.md` gains, in order:
86
- - **Context** — 2–4 paragraphs max: why now, what exists, what changes.
87
- - **Per-task sections** (one `<id> — <title>` heading per task):
88
- Approach (short bullets) + **Edge cases** (min 3 bullets each, feeding
89
- the edge-case matrix below) + **Out-of-scope** (explicit non-goals).
90
- - **Verification steps** — ordered, runnable, repo-root-relative.
91
- No PRD, no diagrams unless structure changed.
92
-
93
- - **LARGE / greenfield-from-scratch**: FULL professional stack — PRD
94
- (`docs/prd.md`, ~1 page per major module) + expanded `architecture.yaml`
95
- (naming_conventions, data_contracts, api_contracts, environment_matrix) +
96
- per-task edge-case matrices + per-module diagrams + MEDIUM-grade plan
97
- sections. Every diagram ≤15 nodes.
98
-
99
- ## Structural correctness — verifier-enforced authoring rules
100
-
101
- - **Waves derive from `depends_on`.** Declared wave / `parallel_group` labels
102
- MUST match the dependency-derived topological order — never hand-label a
103
- task into a wave that contradicts its `depends_on`. A dependent task may not
104
- sit in an earlier (or parallel) wave than its prerequisite.
105
- `plan-graph.mjs --mermaid` is the ground truth for wave order.
106
- - **artifacts ⊆ file_ownership.** Every path a task lists in `artifacts` must
107
- fall inside that task's `file_ownership` globs — workers can write ONLY
108
- owned paths. Listing a doc the task doesn't own is a verifier-blocking
109
- defect.
110
- - **Verification commands**: repo-root-relative (no `../`, no `--plan .`),
111
- fully specific — exact commands, versions, sample sizes, thresholds — the
112
- same form a worker would actually run. Generic "run the tests" or
113
- wrong-root-resolved paths fail.
114
- - **YAML subset**: emit only the parser's supported subset — block mappings
115
- and block sequences only. Avoid flow mappings (`{...}`), block scalars
116
- (`|` / `>`), duplicate keys, and comma-heavy inline values, which the
117
- strict parser rejects (these caused format-repair loops).
118
- - **tasks.yaml edits**: make small targeted edits or one clean full
119
- regeneration — never large multi-region patches (they corrupted tasks.yaml
120
- in the field).
121
-
122
- ## Agent workspace & artifact location — the two-tier rule
123
-
124
- Location follows LIFETIME + AUDIENCE: the plan (and its rationale) travels as
125
- ONE self-contained, reviewable, git-versioned unit; the product's deliverables
126
- travel with the product.
127
-
128
- INSIDE `.archgen/<slug>/` — the plan + everything needed to execute/review it:
129
- - tasks.yaml, plans/, architecture.yaml, answers.yaml, codebase-map.md.
130
- - `docs/prd.md` — a PLANNING artifact (defines the FR-ids tasks cite), not a
131
- shipped doc — stays inside so doc-index can validate FR references.
132
- - `decisions/NNNN-title.md` — the plan's formal ADRs (its rationale). Inside
133
- keeps the feature folder self-contained and ADR↔task↔plan references valid.
134
- - `.agent/` — ALL agent/sub-agent working state. The leading dot keeps it out
135
- of doc-index scans (process state, not a validated artifact):
136
- - `.agent/decisions/NNNN-<slug>.md` — EXECUTION-time decisions a sub-agent
137
- takes while working (distinct from the plan's formal ADRs in `decisions/`).
138
- - `.agent/learnings.md` — conventions/patterns discovered (append-only).
139
- - `.agent/notes/<task-id-or-topic>.md` — worker/survey/investigator notes.
140
- - `.agent/reports/<verifier|reviewer|investigate>-<round>.md` — persisted
141
- verifier/reviewer/investigation findings.
142
-
143
- OUTSIDE `.archgen/` — project DELIVERABLES an approved task produces, written
144
- to the task's `file_ownership` paths at the repo root (never into `.archgen/`):
145
- - source code (`src/...`), and
146
- - shipped documentation: README, API reference, deployment/runbooks, user
147
- guides — the docs the running software ships to users/operators.
148
-
149
- Enterprise refinement — durable ADRs: a decision that outlives this feature
150
- (project-wide, e.g. "Postgres over MongoDB") SHOULD also be promoted to the
151
- project's canonical ADR register (`docs/adr/` or the team's equivalent) so
152
- future features discover it. `.archgen/<slug>/decisions/` is the working
153
- record; the register is the durable project-wide copy. Never delete or
154
- re-number an accepted ADR — supersede it.
155
-
156
- ## architecture.yaml (LARGE scope)
157
-
158
- The four contract blocks below (`naming_conventions`, `data_contracts`,
159
- `api_contracts`, `environment_matrix`) are THE anti-hallucination source of
160
- truth: tasks cite them by key instead of re-describing shapes from memory.
161
- Module entries extend `schemas/architecture-conventions.md` (its
162
- `name`/`responsibility`/`owns[]` trio is unchanged and still normative).
163
-
164
- ```yaml
165
- name: Acme Shop
166
- slug: acme-shop # becomes .archgen/acme-shop/
167
- stack:
168
- language: typescript
169
- runtime: node20
170
- framework: nextjs
171
- database: postgres
172
- structure: # planned folder tree — planned BEFORE code exists
173
- - path: src/features/<feature>/
174
- purpose: feature modules (api, internal, tests colocated)
175
- - path: src/shared/
176
- purpose: cross-feature utilities, no feature imports
177
- - path: src/config/
178
- purpose: env parsing + constants
179
- naming_conventions: # filled during generation; referenced by EVERY task
180
- file_naming: kebab-case files, feature folder mirrors module name
181
- dir_layout: "<module>/{api,internal,tests}; shared code only in src/shared/"
182
- symbol_casing: PascalCase types, camelCase functions, SCREAMING_SNAKE env
183
- test_placement: colocated <name>.test.ts next to unit under test
184
- modules:
185
- - name: catalog
186
- responsibility: product browsing + search
187
- owns: ["src/features/catalog/**"]
188
- depends_on_modules: [] # acyclic; drives task depends_on edges
189
- key_interfaces: # what OTHER modules may import — nothing else
190
- - CatalogApi (src/features/catalog/api/index.ts)
191
- - name: checkout
192
- responsibility: cart → payment orchestration
193
- owns: ["src/features/checkout/**"]
194
- depends_on_modules: [catalog]
195
- key_interfaces:
196
- - CheckoutApi (src/features/checkout/api/index.ts)
197
- data_contracts: # schemas/entities; field tables, not prose
198
- orders:
199
- storage: postgres table orders (migration migrations/NNNN_orders.sql)
200
- fields:
201
- - {field: id, type: uuid, required: true, notes: pk}
202
- - {field: session_id, type: uuid, required: true, notes: fk sessions}
203
- - {field: total_cents, type: integer, required: true, notes: >= 0}
204
- - {field: status, type: enum(pending,paid,failed), required: true}
205
- - {field: created_at, type: timestamptz, required: true, notes: db default now()}
206
- api_contracts: # endpoint/method/auth/payload/error-shape tables
207
- payments:
208
- - endpoint: /api/checkout/pay
209
- method: POST
210
- auth: session cookie; 401 when absent
211
- request_payload: {order_id: uuid}
212
- success: 200 {payment_id: uuid, status: paid}
213
- error_shape: {code: string, message: string, retryable: boolean}
214
- environment_matrix: # vars per env; unparsed vars fail fast in src/config/
215
- - {var: DATABASE_URL, dev: local docker postgres, ci: ephemeral service, prod: secret ref, required: true}
216
- - {var: PAYMENT_API_KEY, dev: stub key, ci: stub key, prod: secret ref, required: true}
217
- decisions: # ADR-lite; full ADRs live in decisions/
218
- - id: D1
219
- title: Postgres over MongoDB
220
- context: transactional orders + reporting queries
221
- decision: Postgres 16 with Prisma
222
- consequences: schema migrations required per release
223
- ```
224
-
225
- Token balance: one contract block per module/domain (~10–20 lines each);
226
- split further rather than letting any single block exceed ~40 lines.
227
-
228
- ## Product requirements document (PRD) — LARGE/greenfield
229
-
230
- Written to `docs/prd.md` BEFORE tasks.yaml. Bullet-dense prose, zero filler
231
- paragraphs; target ~1 page per major module. Requirement ids here are the
232
- stable handles every task acceptance cites.
233
-
234
- ```markdown
235
- # PRD — <project name>
236
-
237
- ## Problem statement & goals
238
- - <pain, quantified where possible>
239
- - Goals: <3–5 outcome bullets, each measurable>
240
-
241
- ## Non-goals
242
- - <explicitly out; prevents scope creep mid-execution>
243
-
244
- ## Personas / stakeholders
245
- - <persona>: <need>, <success looks like>
246
-
247
- ## Functional requirements — <module-name> (repeat per module)
248
- - FR-<MODULE>-01: <single verifiable behavior statement>
249
- - FR-<MODULE>-02: ...
250
- <!-- ids are immutable once tasks reference them -->
251
-
252
- ## Non-functional requirements (measurable targets, no adjectives)
253
- - Perf: p95 API latency < 300 ms at 50 rps; LCP < 2.5 s
254
- - Security: authz check on every endpoint; no secrets in repo; OWASP top-10 reviewed
255
- - i18n: all user-facing strings externalized; ICU plurals; RTL-safe layouts
256
- - A11y: WCAG 2.1 AA; full keyboard nav; contrast ≥ 4.5:1
257
-
258
- ## Success metrics
259
- - <metric>: <baseline> → <target> within <window>
260
-
261
- ## Risks & mitigations
262
- - <risk> → <mitigation>, <owner task id or ADR ref>
263
-
264
- ## Open questions
265
- - <question> — owner <name/role>, blocks <task id | none>
266
- ```
267
-
268
- ## tasks.yaml (canonical shape)
269
-
270
- ```yaml
271
- # comment lines are preserved by set-status.mjs — annotate freely
272
- tasks:
273
- # Core pipeline — do first
274
- - id: C
275
- title: Scaffold project skeleton + config loading
276
- depends_on: []
277
- file_ownership: ["src/config/**", "package.json"] # FULL repo-root-relative paths, never bare filenames
278
- acceptance:
279
- - "npm run build exits 0"
280
- - "config loads from env with typed schema"
281
- - id: B
282
- title: Catalog API endpoints
283
- depends_on: [C]
284
- file_ownership: ["src/features/catalog/**"]
285
- acceptance:
286
- - "GET /products returns seeded list"
287
- - id: A
288
- title: Checkout flow wired to catalog
289
- depends_on: [B]
290
- parallel_group: wave-final
291
- file_ownership: ["src/features/checkout/**"]
292
- artifacts: ["docs/checkout-flow.md"]
293
- acceptance:
294
- - "e2e test completes purchase with stub payment"
295
- ```
296
-
297
- Rules encoded above: depends_on = prerequisites; ownership globs disjoint
298
- within a wave; acceptance = objectively checkable statements. Acceptance
299
- bullets SHOULD reference edge-matrix rows (`E1`–`En` of that task's matrix)
300
- and, on LARGE, the FR ids they implement. Schema stays stable
301
- (`schemas/tasks.schema.json`, schema_version 1) — no new required fields;
302
- guidance lives in comments and plan files.
303
-
304
- LARGE-grade example task (same schema, richer acceptance — sits beside the
305
- minimal ones above, never replaces them):
306
-
307
- ```yaml
308
- - id: PAY-2
309
- title: Order payment capture with retry
310
- depends_on: [A]
311
- parallel_group: wave-payments
312
- file_ownership:
313
- - src/features/checkout/internal/capture.ts # full path per naming_conventions.dir_layout
314
- - src/features/checkout/internal/capture.test.ts # colocated per naming_conventions.test_placement
315
- artifacts: ["docs/payment-retry.md"]
316
- acceptance:
317
- - "capture() sends idempotency key; double submit charges once (E3)"
318
- - "gateway 5xx retries 3x exponential backoff, then raises PaymentFailed (E5)"
319
- - "denied card → 402 with error_shape from ../architecture.yaml api_contracts.payments (FR-PAYMENTS-02)"
320
- - "amounts render via session locale, cents-safe integer math (E6)"
321
- ```
322
-
323
- ## Edge-case matrix (per task, MEDIUM+)
324
-
325
- Each MEDIUM/LARGE task carries a matrix in its plan section. Every row MUST
326
- map to an acceptance bullet — no orphan rows; every acceptance bullet SHOULD
327
- trace to ≥1 row. Minimum coverage classes per task: empty/null, boundary
328
- values, authz denied, concurrent/conflicting write, failure/retry path,
329
- i18n/formatting edge. Tasks touching infra (migrations, deploys, queues)
330
- ADD: partial-failure recovery, rollback story.
331
-
332
- ```markdown
333
- | Case | Input/state | Expected behavior | Covered by |
334
- | ---- | ------------------------------- | ------------------------------------ | ---------- |
335
- | E1 | empty/null: cart with 0 items | 200, total 0, no gateway call | PAY-2#1 |
336
- | E2 | boundary: qty = max allowed 999 | accepted; 1000 rejected with 422 | PAY-2#1 |
337
- | E3 | concurrent: same order paid 2x | idempotency key → single charge | PAY-2#1 |
338
- | E4 | authz denied: expired session | 401 error_shape, no state change | PAY-2#2 |
339
- | E5 | failure/retry: gateway 5xx x3 | backoff retry then PaymentFailed | PAY-2#2 |
340
- | E6 | i18n: locale de-DE, ¥-less cur | EUR formatting, correct decimal comma| PAY-2#3 |
341
- ```
342
-
343
- `Covered by` = `<task-id>#<acceptance index>` (1-based, matching the
344
- tasks.yaml `acceptance` array). Rows are additive across waves; keep each
345
- matrix ≤10 rows — split into per-concern tables beyond that.
346
-
347
- ## ADR template (decisions/NNNN-title.md)
348
-
349
- ```markdown
350
- # NNNN. <decision title>
351
- Date: YYYY-MM-DD · Status: accepted
352
- ## Context
353
- <forces at play>
354
- ## Decision
355
- <what we chose>
356
- ## Consequences
357
- <positive / negative / neutral>
358
- ```
359
-
360
- ## Mermaid snippets
361
-
362
- C4 context:
363
- ```mermaid
364
- graph TB
365
- user([Customer]) --> sys[Acme Shop]
366
- sys --> pay[Stripe]
367
- sys --> mail[Email Service]
368
- ```
369
-
370
- Container:
371
- ```mermaid
372
- graph LR
373
- web[Next.js App] --> api[API Routes]
374
- api --> db[(Postgres)]
375
- api --> cache[(Redis)]
376
- ```
377
-
378
- ## Per-module diagram (LARGE)
379
-
380
- For EACH `modules:` entry in architecture.yaml, one small flowchart of its
381
- internal components plus its `depends_on_modules` edges (arrow points from
382
- consumer to provider). Plus ONE integration diagram wiring all modules —
383
- edges between modules only, no internals. HARD LIMIT: ≤15 nodes per diagram;
384
- split into two diagrams rather than cramming. Internals stay ≤6 nodes per
385
- module.
386
-
387
- Catalog module (internal + inbound depends_on edge):
388
-
389
- ```mermaid
390
- graph LR
391
- subgraph catalog
392
- routes[api routes] --> svc[search service]
393
- svc --> repo[(product repository)]
394
- end
395
- checkout -.->|depends_on CatalogApi| routes
396
- ```
397
-
398
- Integration (modules as atoms, mirrors depends_on_modules):
399
-
400
- ```mermaid
401
- graph LR
402
- accounts --> catalog
403
- cart --> catalog
404
- checkout --> cart
405
- checkout --> accounts
406
- ```