archik 0.7.1 → 0.7.2
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/describe.md +1 -1
- package/.claude/commands/archik/dev.md +1 -1
- package/.claude/commands/archik/evolve.md +23 -14
- package/.claude/commands/archik/spawn.md +40 -20
- package/.claude/commands/archik/suggest.md +20 -14
- package/dist/cli/archik.mjs +474 -232
- package/dist/ui/assets/{index-DnHchl8n.js → index-4lFOVG8E.js} +63 -63
- package/dist/ui/index.html +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Propose a cleaner modular
|
|
3
|
-
argument-hint: [optional focus area
|
|
2
|
+
description: Propose a cleaner modular refactor
|
|
3
|
+
argument-hint: [optional focus area]
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# /archik:evolve — propose a cleaner, bounded architecture
|
|
@@ -74,9 +74,22 @@ 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. **Author
|
|
78
|
-
|
|
77
|
+
4. **Author + stage in one step.** Pipe the full proposed
|
|
78
|
+
end-state directly into `npx archik suggest set -` via a
|
|
79
|
+
heredoc — no temp files, no `/tmp/` paths:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
npx archik suggest set --note "evolve: <one-line summary>" - <<'YAML'
|
|
83
|
+
version: "1.0"
|
|
84
|
+
name: My Architecture
|
|
85
|
+
nodes:
|
|
86
|
+
# full proposed end-state — every node, not just the delta
|
|
87
|
+
edges:
|
|
88
|
+
# ...
|
|
89
|
+
YAML
|
|
90
|
+
```
|
|
79
91
|
|
|
92
|
+
Constraints when authoring the YAML:
|
|
80
93
|
- Preserve every existing node id you keep — only add or remove
|
|
81
94
|
ids, never rename. Renames break diff and require the user to
|
|
82
95
|
manually re-link references in code.
|
|
@@ -84,14 +97,10 @@ any file under `.archik/`.
|
|
|
84
97
|
fields the user authored. Carry them over verbatim.
|
|
85
98
|
- Every change should be motivated by step 3, not by aesthetics.
|
|
86
99
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
npx archik suggest set --note "evolve: <one-line summary>" /tmp/archik-evolve-<id>.yaml
|
|
90
|
-
```
|
|
91
|
-
Fix and re-run on validation errors. Never patch the sidecar
|
|
92
|
-
directly.
|
|
100
|
+
If `suggest set` reports validation errors, re-run with the
|
|
101
|
+
corrected YAML. Never patch the sidecar directly.
|
|
93
102
|
|
|
94
|
-
|
|
103
|
+
5. **Open the discussion.** Print, in this order:
|
|
95
104
|
|
|
96
105
|
a. The canvas URL with: *"📝 Evolved diagram staged — open
|
|
97
106
|
<URL> and toggle Review to see green / red / amber overlays."*
|
|
@@ -110,9 +119,9 @@ any file under `.archik/`.
|
|
|
110
119
|
## Iterating
|
|
111
120
|
|
|
112
121
|
If the user pushes back on specific items ("keep the orders
|
|
113
|
-
service whole; only fix the Stripe integration"),
|
|
114
|
-
|
|
115
|
-
|
|
122
|
+
service whole; only fix the Stripe integration"), re-run
|
|
123
|
+
`npx archik suggest set -` with the revised YAML — it overwrites
|
|
124
|
+
the previous sidecar. Acknowledge what you changed
|
|
116
125
|
since the last round so the user doesn't have to re-read the
|
|
117
126
|
whole diff.
|
|
118
127
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Mirror the source tree as a diagram
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# /archik:spawn — mirror the codebase as an archik diagram
|
|
@@ -102,27 +102,47 @@ archik suggest set` stages it.
|
|
|
102
102
|
When in doubt, leave the edge out. The user will add it via
|
|
103
103
|
`/archik:suggest` later.
|
|
104
104
|
|
|
105
|
-
7. **Stage the draft.**
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
and `suggest set`
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
105
|
+
7. **Stage the draft.** Pipe the YAML straight into `npx archik
|
|
106
|
+
suggest set -` via a heredoc — no temp files, no `/tmp/` paths.
|
|
107
|
+
Sub-files come first because the main draft references them via
|
|
108
|
+
`archikFile`, and `suggest set` validates that those targets
|
|
109
|
+
exist on disk.
|
|
110
|
+
|
|
111
|
+
a. **Each sub-file**: the parent file doesn't exist yet, so
|
|
112
|
+
pass `--allow-orphan` to opt in to writing a sidecar for a
|
|
113
|
+
missing main. Then accept it so the file lands at
|
|
114
|
+
`.archik/<id>.archik.yaml`:
|
|
115
|
+
```bash
|
|
116
|
+
npx archik suggest set --main .archik/<id>.archik.yaml \
|
|
117
|
+
--allow-orphan \
|
|
118
|
+
--note "spawn: <id> internals" - <<'YAML'
|
|
119
|
+
version: "1.0"
|
|
120
|
+
name: <Id> Internals
|
|
121
|
+
nodes: [ ... ]
|
|
122
|
+
edges: [ ... ]
|
|
123
|
+
YAML
|
|
124
|
+
npx archik suggest accept .archik/<id>.archik.yaml
|
|
121
125
|
```
|
|
122
|
-
|
|
126
|
+
Repeat for every sub-file. The `accept` step is what makes
|
|
127
|
+
the file real on disk — without it the orphan sidecar lingers
|
|
128
|
+
and the canvas shows it as "(pending)" rather than rendering it.
|
|
129
|
+
|
|
130
|
+
b. **Main draft**: once all sub-files exist (i.e. their
|
|
131
|
+
`accept`s succeeded), stage the main one. No `--allow-orphan`
|
|
132
|
+
needed because the main file already exists from `archik init`:
|
|
133
|
+
```bash
|
|
134
|
+
npx archik suggest set --note "spawn: mirror source tree" - <<'YAML'
|
|
135
|
+
version: "1.0"
|
|
136
|
+
name: My Architecture
|
|
137
|
+
nodes:
|
|
138
|
+
# full proposed end-state, with archikFile pointers
|
|
139
|
+
edges:
|
|
140
|
+
# ...
|
|
141
|
+
YAML
|
|
123
142
|
```
|
|
124
|
-
|
|
125
|
-
|
|
143
|
+
|
|
144
|
+
c. If `suggest set` reports validation errors, re-run with the
|
|
145
|
+
corrected YAML. Never edit the sidecar by hand.
|
|
126
146
|
|
|
127
147
|
8. **Tell the user how to review.** Surface the canvas URL plus:
|
|
128
148
|
- "📝 Initial diagram staged from source tree — open the
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Propose
|
|
2
|
+
description: Propose a diagram change
|
|
3
3
|
argument-hint: <feature description>
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -43,22 +43,28 @@ 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. **Author
|
|
47
|
-
|
|
48
|
-
The
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
3. **Author + stage in one step.** Pipe the draft straight into
|
|
47
|
+
`npx archik suggest set -` via a heredoc — no temp file, no
|
|
48
|
+
`/tmp/` paths. The CLI validates the schema, checks cross-file
|
|
49
|
+
references, stamps `metadata.suggestion`, and atomically writes
|
|
50
|
+
`.archik/main.archik.suggested.yaml`:
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
```bash
|
|
53
|
+
npx archik suggest set --note "$ARGUMENTS" - <<'YAML'
|
|
54
|
+
version: "1.0"
|
|
55
|
+
name: My Architecture
|
|
56
|
+
nodes:
|
|
57
|
+
# full proposed end-state — every node, not just the delta
|
|
58
|
+
edges:
|
|
59
|
+
# full proposed end-state — every edge, not just the delta
|
|
60
|
+
YAML
|
|
53
61
|
```
|
|
54
|
-
npx archik suggest set /tmp/archik-draft-<id>.yaml --note "$ARGUMENTS"
|
|
55
|
-
```
|
|
56
|
-
This validates the schema, checks cross-file references, stamps
|
|
57
|
-
`metadata.suggestion`, and atomically renames it into place. If
|
|
58
|
-
the command exits non-zero, fix the reported errors in the temp
|
|
59
|
-
file and re-run — never edit the sidecar directly.
|
|
60
62
|
|
|
61
|
-
|
|
63
|
+
If the command exits non-zero, re-run with the corrected YAML.
|
|
64
|
+
Never write a draft file under `.archik/` and never edit the
|
|
65
|
+
sidecar directly.
|
|
66
|
+
|
|
67
|
+
4. **Tell the user how to review**. Surface the canvas URL from
|
|
62
68
|
step 1 plus the terminal options:
|
|
63
69
|
- "📝 Suggestion ready — open the canvas at <URL> and use the
|
|
64
70
|
**Review** banner to see added/removed/changed nodes."
|