archik 0.7.3 → 0.7.5
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/commands/archik/evolve.md +11 -2
- package/.claude/commands/archik/spawn.md +35 -6
- package/.claude/commands/archik/suggest.md +19 -3
- package/.claude/skills/archik/SKILL.md +144 -695
- package/dist/cli/archik.mjs +207 -180
- package/dist/ui/assets/{index-4lFOVG8E.js → index-oT0Jx4nQ.js} +66 -65
- package/dist/ui/index.html +1 -1
- package/package.json +1 -1
|
@@ -74,7 +74,16 @@ any file under `.archik/`.
|
|
|
74
74
|
the highest-impact subset and tell the user the rest is round
|
|
75
75
|
two.
|
|
76
76
|
|
|
77
|
-
4. **
|
|
77
|
+
4. **Lock in the schema before authoring.** Run this once so you
|
|
78
|
+
draft against the actual shape, not from intuition:
|
|
79
|
+
```
|
|
80
|
+
npx archik schema
|
|
81
|
+
```
|
|
82
|
+
Note which fields are arrays vs strings; every edge needs an
|
|
83
|
+
`id`. Validation errors on the first attempt are almost always
|
|
84
|
+
one of these two patterns.
|
|
85
|
+
|
|
86
|
+
5. **Author + stage in one step.** Pipe the full proposed
|
|
78
87
|
end-state directly into `npx archik suggest set -` via a
|
|
79
88
|
heredoc — no temp files, no `/tmp/` paths:
|
|
80
89
|
|
|
@@ -100,7 +109,7 @@ any file under `.archik/`.
|
|
|
100
109
|
If `suggest set` reports validation errors, re-run with the
|
|
101
110
|
corrected YAML. Never patch the sidecar directly.
|
|
102
111
|
|
|
103
|
-
|
|
112
|
+
6. **Open the discussion.** Print, in this order:
|
|
104
113
|
|
|
105
114
|
a. The canvas URL with: *"📝 Evolved diagram staged — open
|
|
106
115
|
<URL> and toggle Review to see green / red / amber overlays."*
|
|
@@ -43,7 +43,17 @@ archik suggest set` stages it.
|
|
|
43
43
|
this will produce a sidecar you can review or reject. Want me
|
|
44
44
|
to continue?" Wait for confirmation.
|
|
45
45
|
|
|
46
|
-
3. **
|
|
46
|
+
3. **Lock in the schema.** Run this before drafting any YAML —
|
|
47
|
+
the prose below describes the workflow, not the field shapes.
|
|
48
|
+
The CLI is the schema:
|
|
49
|
+
```
|
|
50
|
+
npx archik schema
|
|
51
|
+
```
|
|
52
|
+
Pay attention to which fields are arrays vs strings, and that
|
|
53
|
+
every edge requires an `id` (kebab-case). Authoring from
|
|
54
|
+
intuition produces predictable validation errors.
|
|
55
|
+
|
|
56
|
+
4. **Map the source tree.** Walk the project from cwd, paying
|
|
47
57
|
attention to conventional layouts. Don't recurse into
|
|
48
58
|
`node_modules`, `dist`, `build`, `.git`, `.next`,
|
|
49
59
|
`target`, `venv`, `.venv`, or `vendor`.
|
|
@@ -73,13 +83,13 @@ archik suggest set` stages it.
|
|
|
73
83
|
- **Frontends**: `apps/web`, `apps/mobile`, `client/`,
|
|
74
84
|
`packages/ui` apps that ship a UI → `frontend`.
|
|
75
85
|
|
|
76
|
-
|
|
86
|
+
5. **Choose the kind for each node.** Default: `service`. Use the
|
|
77
87
|
taxonomy from the skill — `function` for serverless, `worker`
|
|
78
88
|
for background consumers, `agent` for LLM-driven agents, etc.
|
|
79
89
|
When unsure, pick the closest fit and add a `notes:` entry
|
|
80
90
|
explaining the inference rather than picking `custom`.
|
|
81
91
|
|
|
82
|
-
|
|
92
|
+
6. **Nest by structure**, mirroring the directories.
|
|
83
93
|
- Top-level grouping dir (e.g. `services/`) → a `module` container.
|
|
84
94
|
- Each child dir → a node with `parentId` pointing at the container.
|
|
85
95
|
- If a node has substantial internal structure (e.g.
|
|
@@ -88,7 +98,7 @@ archik suggest set` stages it.
|
|
|
88
98
|
sub-file. Don't nest beyond two levels in the main file —
|
|
89
99
|
drill-down is what `archikFile` is for.
|
|
90
100
|
|
|
91
|
-
|
|
101
|
+
7. **Wire the edges.** Be conservative — only add an edge when you
|
|
92
102
|
have actual evidence:
|
|
93
103
|
- Cross-package imports → `depends_on` or a more specific
|
|
94
104
|
relationship (`uses`, `invokes`).
|
|
@@ -102,7 +112,7 @@ archik suggest set` stages it.
|
|
|
102
112
|
When in doubt, leave the edge out. The user will add it via
|
|
103
113
|
`/archik:suggest` later.
|
|
104
114
|
|
|
105
|
-
|
|
115
|
+
8. **Stage the draft.** Pipe the YAML straight into `npx archik
|
|
106
116
|
suggest set -` via a heredoc — no temp files, no `/tmp/` paths.
|
|
107
117
|
Sub-files come first because the main draft references them via
|
|
108
118
|
`archikFile`, and `suggest set` validates that those targets
|
|
@@ -121,12 +131,30 @@ archik suggest set` stages it.
|
|
|
121
131
|
nodes: [ ... ]
|
|
122
132
|
edges: [ ... ]
|
|
123
133
|
YAML
|
|
134
|
+
# mechanical: puts sub-file on disk so the main draft's
|
|
135
|
+
# archikFile: pointer validates. NOT the user's review gate
|
|
136
|
+
# on the main draft — that one is always left as a sidecar.
|
|
124
137
|
npx archik suggest accept .archik/<id>.archik.yaml
|
|
125
138
|
```
|
|
126
139
|
Repeat for every sub-file. The `accept` step is what makes
|
|
127
140
|
the file real on disk — without it the orphan sidecar lingers
|
|
128
141
|
and the canvas shows it as "(pending)" rather than rendering it.
|
|
129
142
|
|
|
143
|
+
**Narrate each auto-accept with its rationale**, not just
|
|
144
|
+
"accept each". The user must be able to tell from your status
|
|
145
|
+
line that you are NOT bypassing their `/archik:accept` review
|
|
146
|
+
on the main draft. Example narration:
|
|
147
|
+
|
|
148
|
+
> Auto-accepting `agent` sub-file so the main draft can
|
|
149
|
+
> reference it via `archikFile:` — the next `suggest set`
|
|
150
|
+
> would fail validation otherwise. The main draft will still
|
|
151
|
+
> be left as a sidecar for you to review.
|
|
152
|
+
|
|
153
|
+
The main draft (step 8b) is always left as a sidecar.
|
|
154
|
+
`/archik:accept` is the user's gate; `npx archik suggest
|
|
155
|
+
accept <sub-file>` here is mechanical plumbing for the
|
|
156
|
+
cross-file reference, not a substitute for that gate.
|
|
157
|
+
|
|
130
158
|
b. **Main draft**: once all sub-files exist (i.e. their
|
|
131
159
|
`accept`s succeeded), stage the main one. No `--allow-orphan`
|
|
132
160
|
needed because the main file already exists from `archik init`:
|
|
@@ -144,7 +172,8 @@ archik suggest set` stages it.
|
|
|
144
172
|
c. If `suggest set` reports validation errors, re-run with the
|
|
145
173
|
corrected YAML. Never edit the sidecar by hand.
|
|
146
174
|
|
|
147
|
-
|
|
175
|
+
9. **Tell the user how to review and what's next.** Surface the
|
|
176
|
+
canvas URL plus the natural follow-up:
|
|
148
177
|
- "📝 Initial diagram staged from source tree — open the
|
|
149
178
|
canvas at <URL> and use Review to see the proposed nodes."
|
|
150
179
|
- "Looks wrong? Run `/archik:reject` and we'll iterate. Or run
|
|
@@ -43,7 +43,18 @@ the contract with the user.
|
|
|
43
43
|
If `$ARGUMENTS` mentions a specific node by name, also run
|
|
44
44
|
`npx archik q describe <id>` for it.
|
|
45
45
|
|
|
46
|
-
3. **
|
|
46
|
+
3. **Lock in the schema.** Run this before drafting any YAML —
|
|
47
|
+
the prose in this file describes the workflow, not the field
|
|
48
|
+
shapes. The CLI is the schema:
|
|
49
|
+
```
|
|
50
|
+
npx archik schema
|
|
51
|
+
```
|
|
52
|
+
Pay attention to which fields are arrays (`notes`,
|
|
53
|
+
`responsibilities`, `interfaces`) and which are required
|
|
54
|
+
strings (every edge needs an `id`). Authoring from intuition
|
|
55
|
+
produces predictable validation errors.
|
|
56
|
+
|
|
57
|
+
4. **Author + stage in one step.** Pipe the draft straight into
|
|
47
58
|
`npx archik suggest set -` via a heredoc — no temp file, no
|
|
48
59
|
`/tmp/` paths. The CLI validates the schema, checks cross-file
|
|
49
60
|
references, stamps `metadata.suggestion`, and atomically writes
|
|
@@ -64,12 +75,17 @@ the contract with the user.
|
|
|
64
75
|
Never write a draft file under `.archik/` and never edit the
|
|
65
76
|
sidecar directly.
|
|
66
77
|
|
|
67
|
-
|
|
68
|
-
step 1 plus the terminal options
|
|
78
|
+
5. **Tell the user how to review and what's next**. Surface the
|
|
79
|
+
canvas URL from step 1 plus the terminal options, then offer a
|
|
80
|
+
concrete follow-up:
|
|
69
81
|
- "📝 Suggestion ready — open the canvas at <URL> and use the
|
|
70
82
|
**Review** banner to see added/removed/changed nodes."
|
|
71
83
|
- "Or from the terminal: `npx archik suggest show` /
|
|
72
84
|
`npx archik suggest accept` / `npx archik suggest reject`."
|
|
85
|
+
- One follow-up sentence picking from: implement the new
|
|
86
|
+
node(s) in code, run `/archik:evolve` if the change exposed
|
|
87
|
+
architectural smells, regenerate `docs/architecture.svg` if
|
|
88
|
+
the project commits one. Don't end the turn at "done".
|
|
73
89
|
|
|
74
90
|
## Notes
|
|
75
91
|
|