archik 0.6.18 → 0.6.21
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/.claude/skills/archik/SKILL.md +47 -20
- package/README.md +0 -4
- package/dist/cli/archik.mjs +314 -316
- package/dist/ui/assets/{index-Ds3t5e5F.js → index-8KJeg2t9.js} +114 -114
- package/dist/ui/index.html +1 -1
- package/package.json +5 -5
|
@@ -37,8 +37,12 @@ you can talk about the system without re-explaining it every time.
|
|
|
37
37
|
see "Suggesting changes" below). Don't edit the main file
|
|
38
38
|
directly; the user reviews and accepts in the canvas or via
|
|
39
39
|
`archik suggest accept`.
|
|
40
|
-
3. **After** every edit to a YAML, run `archik validate
|
|
41
|
-
|
|
40
|
+
3. **After** every edit to a YAML, run `archik validate <path>`
|
|
41
|
+
against the file you actually wrote — the canonical root file, a
|
|
42
|
+
sidecar, or any sub-file under `.archik/`. Validate covers schema
|
|
43
|
+
errors AND cross-file existence (`archikFile` / `fromFile` /
|
|
44
|
+
`toFile` targets must be on disk). Fix every reported error before
|
|
45
|
+
declaring the change done.
|
|
42
46
|
|
|
43
47
|
The sections below are the detailed reference behind these three
|
|
44
48
|
rules — *when* to consult, *when* to propose, schema, taxonomy,
|
|
@@ -68,11 +72,11 @@ service" but not where to go to read or edit it. So:
|
|
|
68
72
|
— those are the places where moving a folder will outgrow the
|
|
69
73
|
diagram, and where new code is most likely to need a YAML
|
|
70
74
|
update too.
|
|
71
|
-
4. **
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
4. **Cross-check the source tree** when answering structural
|
|
76
|
+
questions: most projects keep one folder per top-level node under
|
|
77
|
+
`src/` (or `services/` / `packages/`). Mismatches are where
|
|
78
|
+
moving code will outgrow the diagram and where new code most
|
|
79
|
+
often needs a YAML update too.
|
|
76
80
|
|
|
77
81
|
When the user asks "where would I add X?" or "what's the right
|
|
78
82
|
place for Y?", you should already have the answer because step 3
|
|
@@ -135,9 +139,13 @@ asked).
|
|
|
135
139
|
|
|
136
140
|
* Write the *full proposed document*, not a patch. The diff is
|
|
137
141
|
computed by archik between the main file and the sidecar.
|
|
138
|
-
* Run `archik validate
|
|
139
|
-
|
|
140
|
-
|
|
142
|
+
* Run `archik validate <sidecar-path>` after writing — that's
|
|
143
|
+
`.archik/main.archik.suggested.yaml` under the new layout, or
|
|
144
|
+
`architecture.archik.suggested.yaml` under the legacy one. Validate
|
|
145
|
+
catches schema errors (dangling edges, parent cycles, duplicate
|
|
146
|
+
ids) AND missing cross-file targets (`archikFile` / `fromFile` /
|
|
147
|
+
`toFile` resolved against the project root). Silent failures are
|
|
148
|
+
not OK — re-edit and re-run until it passes.
|
|
141
149
|
* If a suggestion sidecar already exists, treat it as your previous
|
|
142
150
|
proposal — extend or replace it. Don't write a new sidecar with a
|
|
143
151
|
different name.
|
|
@@ -264,6 +272,10 @@ Constraints (the schema enforces them):
|
|
|
264
272
|
|
|
265
273
|
- The cross-file path follows the same rules as `archikFile` (relative,
|
|
266
274
|
forward slashes, no `..`, ends in `.archik.yaml`).
|
|
275
|
+
- The path is resolved against the **project root** (parent of
|
|
276
|
+
`.archik/` under the new layout, the doc's own directory under the
|
|
277
|
+
legacy one) — same rule as `archikFile`. `archik validate` exits
|
|
278
|
+
1 if the file isn't on disk.
|
|
267
279
|
- The *local* endpoint id must still match a node in this file.
|
|
268
280
|
- An edge with **both** `fromFile` and `toFile` is rejected — author
|
|
269
281
|
it inside one of the two referenced files instead.
|
|
@@ -282,12 +294,18 @@ Constraints (the schema enforces them):
|
|
|
282
294
|
- Must use forward slashes; `..` segments are rejected.
|
|
283
295
|
- Must end in `.archik.yaml` (the suggestion sidecar is derived
|
|
284
296
|
automatically as `<stem>.suggested.yaml` next to it).
|
|
297
|
+
- **Resolved against the project root**, not the file's own
|
|
298
|
+
directory. With the new layout the project root is the parent of
|
|
299
|
+
`.archik/`, so a sibling sub-file is `.archik/orders.archik.yaml`
|
|
300
|
+
(with the prefix), NOT `orders.archik.yaml`. `archik validate`
|
|
301
|
+
exits 1 if the target file isn't on disk — catch it there instead
|
|
302
|
+
of as a 404 in the canvas.
|
|
285
303
|
- Cycles aren't checked at parse time (each file validates on its
|
|
286
304
|
own); if you wire a loop the canvas just lets the user navigate
|
|
287
305
|
in and out.
|
|
288
306
|
|
|
289
307
|
Conventional layout: keep sub-files under `.archik/` next to
|
|
290
|
-
`main.archik.yaml`.
|
|
308
|
+
`main.archik.yaml`, and reference them with the `.archik/` prefix:
|
|
291
309
|
|
|
292
310
|
```
|
|
293
311
|
.archik/main.archik.yaml # entry point
|
|
@@ -295,6 +313,16 @@ Conventional layout: keep sub-files under `.archik/` next to
|
|
|
295
313
|
.archik/payments.archik.yaml # Payments service internals
|
|
296
314
|
```
|
|
297
315
|
|
|
316
|
+
```yaml
|
|
317
|
+
# in .archik/main.archik.yaml
|
|
318
|
+
nodes:
|
|
319
|
+
- id: orders
|
|
320
|
+
kind: service
|
|
321
|
+
name: Orders
|
|
322
|
+
archikFile: .archik/orders.archik.yaml # ✅ project-root relative
|
|
323
|
+
# archikFile: orders.archik.yaml # ❌ validate fails
|
|
324
|
+
```
|
|
325
|
+
|
|
298
326
|
## Node kinds (27 total, grouped by purpose)
|
|
299
327
|
|
|
300
328
|
| Group | Kinds |
|
|
@@ -590,7 +618,6 @@ archik suggest show # summary of pending sidecar (default)
|
|
|
590
618
|
archik suggest accept # apply the sidecar over the main file
|
|
591
619
|
archik suggest reject # discard the sidecar
|
|
592
620
|
archik watch # re-render SVG on save
|
|
593
|
-
archik check # drift: nodes vs source dirs
|
|
594
621
|
archik dev # open the live editor in the browser (foreground)
|
|
595
622
|
archik start # same as dev, detached — returns the prompt
|
|
596
623
|
archik stop # stop the background server
|
|
@@ -605,20 +632,20 @@ archik checkout.
|
|
|
605
632
|
|
|
606
633
|
## Verification workflow
|
|
607
634
|
|
|
608
|
-
After **every** edit you make to
|
|
635
|
+
After **every** edit you make to an archik file (root, sidecar, or
|
|
636
|
+
sub-file):
|
|
609
637
|
|
|
610
|
-
1. Run `archik validate
|
|
611
|
-
|
|
612
|
-
|
|
638
|
+
1. Run `archik validate <path>` against the file you wrote. Validate
|
|
639
|
+
covers schema errors (with the field path so you can fix them
|
|
640
|
+
precisely) AND cross-file existence — `archikFile`, `fromFile`,
|
|
641
|
+
and `toFile` are resolved against the project root and the
|
|
642
|
+
command exits 1 if the target file isn't on disk. Fix every
|
|
643
|
+
reported error before declaring the change done.
|
|
613
644
|
2. If the project has an `archik dev` server running, the file watcher
|
|
614
645
|
broadcasts the change automatically — no restart needed.
|
|
615
646
|
3. If the project commits a rendered SVG (e.g. `docs/architecture.svg`),
|
|
616
647
|
regenerate it with `archik render --out docs/architecture.svg` so
|
|
617
648
|
the committed picture matches the YAML.
|
|
618
|
-
4. For nodes whose `kind` implies code (`service`, `function`, `worker`,
|
|
619
|
-
`agent`, `frontend`, `gateway`, `tool`, `module`), consider
|
|
620
|
-
`archik check` to flag nodes that don't have a matching source
|
|
621
|
-
folder under `src/`, `services/`, `packages/`, or `apps/`.
|
|
622
649
|
|
|
623
650
|
## Things to avoid
|
|
624
651
|
|
package/README.md
CHANGED
|
@@ -129,7 +129,6 @@ archik render [path] Render to a self-contained SVG file
|
|
|
129
129
|
--out <file> output path (default: diagram.svg)
|
|
130
130
|
--theme <name> "dark" (default) or "light"
|
|
131
131
|
archik watch [path] Re-render to SVG on every file change (Ctrl+C to stop)
|
|
132
|
-
archik check [path] Drift detection — flag nodes without matching source dirs
|
|
133
132
|
|
|
134
133
|
archik skill Install the Claude skill for AI editing
|
|
135
134
|
--user install into ~/.claude/skills (all projects)
|
|
@@ -153,9 +152,6 @@ archik validate
|
|
|
153
152
|
|
|
154
153
|
# Generate a committable SVG of your architecture for the docs site
|
|
155
154
|
archik render --theme light --out docs/architecture.svg
|
|
156
|
-
|
|
157
|
-
# Warn when nodes don't have a matching source folder under src/, services/, packages/, or apps/
|
|
158
|
-
archik check
|
|
159
155
|
```
|
|
160
156
|
|
|
161
157
|
## Schema
|