archik 0.7.1 → 0.7.3

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.
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Explain a node and its connections
2
+ description: Show a node's connections
3
3
  argument-hint: <node-id>
4
4
  ---
5
5
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Start the live canvas in the browser
2
+ description: Open the live canvas
3
3
  ---
4
4
 
5
5
  # /archik:dev — open the archik canvas
@@ -1,6 +1,6 @@
1
1
  ---
2
- description: Propose a cleaner modular architecture
3
- argument-hint: [optional focus area, e.g. "payments domain"]
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 the full proposed end-state** in a workspace temp file:
78
- `/tmp/archik-evolve-<short-id>.yaml`. Constraints:
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
- 5. **Stage the draft via the CLI**:
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
- 6. **Open the discussion.** Print, in this order:
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"), update the
114
- draft in the same temp file and re-run `npx archik suggest set` —
115
- it overwrites the previous sidecar. Acknowledge what you changed
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: Bootstrap the diagram from the source tree
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.** Write the full proposed end-state to
106
- `/tmp/archik-spawn-<short-id>.yaml`. If you generated sub-files,
107
- write each one to its own temp file (`/tmp/archik-spawn-<sub>-<id>.yaml`)
108
- and `suggest set` them too — but only the main file becomes a
109
- sidecar. The sub-files need to live at their final
110
- `.archik/<id>.archik.yaml` paths *before* you stage the main
111
- draft, otherwise cross-file validation fails. So:
112
-
113
- a. For each `archikFile: .archik/<id>.archik.yaml` you reference,
114
- stage that sub-file first with its own
115
- `npx archik suggest set` … then accept it immediately
116
- (`npx archik suggest accept`) so the file is on disk under
117
- `.archik/<id>.archik.yaml`. Yes, this is a chain of
118
- micro-commits — that's the only CLI-blessed way to land
119
- sub-files.
120
- b. After all sub-files exist, stage the main draft:
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
- npx archik suggest set --note "spawn: mirror source tree" /tmp/archik-spawn-<id>.yaml
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
- c. If `suggest set` reports validation errors, fix the temp
125
- file and re-run. Never edit the sidecar by hand.
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 diagram changes from a feature description
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 the draft** in a workspace temp file (NOT under
47
- `.archik/`). Use the path `/tmp/archik-draft-<short-id>.yaml`.
48
- The draft is the *full proposed end-state* of the document — every
49
- node and edge, not just the delta. Follow the schema, kinds, and
50
- relationships documented in the archik skill.
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
- 4. **Stage the draft as the sidecar via the CLI**:
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
- 5. **Tell the user how to review**. Surface the canvas URL from
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."