@jkwd/inbase 0.1.9 → 0.1.11

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.
@@ -2,9 +2,12 @@
2
2
  name: inbase
3
3
  description: >-
4
4
  Grounds source-file changes in the Inbase visual map. Use when creating,
5
- editing, or deleting application source files in this repository. Lists every
6
- feature step, then works only via patch files. Do not use for git, docs-only,
7
- lockfiles, or questions.
5
+ editing, or deleting application source files in this repository, including
6
+ when the user chats a change request without /inbase. Direct chat is blocked
7
+ unless they invoked /inbase or /skipinbase. Lists every feature step, then
8
+ edits live files after invocation and records each step with inbase
9
+ propose-patch (no patch file). Do not use for git, docs-only, lockfiles, or
10
+ questions.
8
11
  ---
9
12
 
10
13
  # Inbase visual edits
@@ -13,41 +16,91 @@ Apply this skill **whenever the work is file changes in this repository**.
13
16
  Skip it for git, lockfiles, `.inbase`, `.cursor`, or questions with no code
14
17
  changes.
15
18
 
16
- The LLM uses a plan-first loop. It reports the complete plan before writing a
17
- patch. When **Step by step** is on, it waits for the user to invoke the
18
- highlighted step, publishes only that step's diff, then waits for **Run step**
19
- on the following step or an alternative instruction. When **Step by step** is
20
- off, `inbase wait-for-approval` returns `VISUAL_CODER_EXECUTE` for every
21
- remaining step without the user clicking Run step; after the last patch, wait
22
- for the user to **Complete**. They can still walk Previous/Next over the diffs.
23
- Always work via patch files. Do not Write, StrReplace, or Delete project files.
19
+ Sessions start only from the visualizer (**Setup LLM session**). This chat
20
+ cannot open a session.
24
21
 
25
- Every Cursor chat has an explicit session ID. Pass that same ID to every
26
- command. The visualizer stores immutable diffs under `.inbase/diff-sessions/<session-id>/diffs/`.
22
+ - **`/skipinbase`**: do the user's request without Inbase. Do not attach, wait,
23
+ or record patches.
24
+ - **`/inbase`**, or this conversation already has a `VISUAL_CODER_SESSION` from
25
+ `/inbase`: connect if needed, then follow Required sequence. Do not refuse.
26
+ - **Any other file-change request**: do not edit files and do not run Inbase
27
+ commands. Reply with exactly this line, then **stop**:
27
28
 
28
- Inbase must already be running (`inbase run` or `npx inbase run`). Prefer
29
- `npx inbase` so the local package is used.
30
-
31
- ## Required sequence
29
+ ```
30
+ direct chat interaction not allowed use /skipinbase [request] to bypass inbase.
31
+ ```
32
32
 
33
- 1. As soon as this skill applies, start the visual session so the explorer can
34
- offer a blueprint handshake. Do this before reading context or listing steps:
33
+ The LLM uses a plan-first loop. It reports the complete plan before editing
34
+ files. When **Step by step** is on, it waits for the user to click **Create
35
+ proposal** on the first step, edits live files for that step, records them with `inbase propose-patch`,
36
+ then waits for **Accept proposal** or an alternative instruction. When **Step
37
+ by step** is off, `inbase wait-for-approval` returns `VISUAL_CODER_EXECUTE` for
38
+ every remaining step without the user clicking; after the last recorded step,
39
+ wait for the user to **Accept proposal**. They can still walk Previous/Next
40
+ over the recorded diffs.
41
+
42
+ **Recorded patches are the session record.** After `VISUAL_CODER_EXECUTE`, edit
43
+ live project files with Write, StrReplace, and Delete for that step only. Then
44
+ run `inbase propose-patch` with no patch file. Inbase diffs the working tree
45
+ against the snapshot taken at invoke and stores that patch. A later instruction
46
+ replaces the withdrawn step; edit from the accepted live files, not from the
47
+ withdrawn proposal. Do not write a unified diff yourself.
48
+
49
+ The visualizer stores immutable diffs under
50
+ `.inbase/diff-sessions/<session-id>/diffs/`. Inbase must already be running
51
+ (`inbase run` or `npx inbase run`). Prefer `npx inbase` so the local package
52
+ is used.
53
+
54
+ If this chat is not yet attached, run:
35
55
 
36
56
  ```bash
37
- npx inbase start-session --session "<current-cursor-chat-id>"
57
+ npx inbase attach
38
58
  ```
39
59
 
40
- 2. **Stop and wait for the blueprint handshake**. Do not report a plan and do
41
- not write a patch until this prints `VISUAL_CODER_BLUEPRINT_READY`:
60
+ That attaches this chat to the session currently focused in the map. No id is
61
+ passed in; read `VISUAL_CODER_SESSION` from the output and use that
62
+ `--session` value for every later command. Then continue from
63
+ `wait-for-blueprint` below. Do **not** run `start-session`. Do **not** wait
64
+ for a blueprint handshake.
65
+
66
+ ## Direct response
67
+
68
+ Visualizer signals arrive as `VISUAL_CODER_ACK` from `attach`,
69
+ `wait-for-blueprint`, and `wait-for-approval`. While a wait command is running
70
+ you cannot chat; that process is the listen loop.
71
+
72
+ The moment a command prints `VISUAL_CODER_ACK`, **reply in this chat first**
73
+ with one short sentence that acknowledges the signal. Echo the ack, for
74
+ example: `Got it — running step 2: Show ColorGenerator on Home.` Then continue
75
+ the required tools in the same turn. Do not wait for the user after the ack.
76
+ Do not start with a long analysis. Do not call tools before that sentence.
77
+
78
+ After `propose-patch` on a non-final step, the **next tool call must be**
79
+ `wait-for-approval`. Do not explore, search, or re-plan in between. **Accept
80
+ proposal** invokes the next step; when that wait returns `EXECUTE`, implement
81
+ that step immediately. Do not run `wait-for-blueprint` again. Do not report a
82
+ new plan.
83
+
84
+ ## Required sequence
85
+
86
+ 1. **Read the current layout**. `/inbase` already started the session. Run
87
+ this once to load the optional blueprint and instruction — it returns
88
+ immediately. Do not wait for the user to send a blueprint. Then report a
89
+ plan.
42
90
 
43
91
  ```bash
44
- npx inbase wait-for-blueprint --session "<current-cursor-chat-id>"
92
+ npx inbase wait-for-blueprint --session "<session-id>"
45
93
  ```
46
94
 
47
- The explorer asks **Setup blueprint: Yes vs No**.
48
- - **No**: skip placement; continue without user-placed files or islands.
49
- - **Yes**: the user places files (`Space`) and islands (`B`), then clicks
50
- **Send blueprint**.
95
+ The user may have placed files (`Space`) and islands (`B`), or left the
96
+ blueprint empty. That choice is already on the session. They can keep
97
+ placing on later steps. This chat's blueprint is stored only for this
98
+ session.
99
+ If `wait-for-blueprint` prints `VISUAL_CODER_INSTRUCTION_START` /
100
+ `VISUAL_CODER_INSTRUCTION_END`, that text is the user's request for this
101
+ session. Plan from that instruction and the blueprint together. The
102
+ instruction does not override an enabled blueprint; if they conflict,
103
+ ask the user.
51
104
  3. Read the handshake output between `VISUAL_CODER_BLUEPRINT_START` and
52
105
  `VISUAL_CODER_BLUEPRINT_END`, or read
53
106
  `.inbase/diff-sessions/<session-id>/blueprint.json`.
@@ -73,13 +126,13 @@ npx inbase wait-for-blueprint --session "<current-cursor-chat-id>"
73
126
  and choose files from the request itself. Viewpoint never overrides the
74
127
  blueprint: still follow this session's blueprint when `enabled` is true.
75
128
  6. List **all** steps needed to finish the feature. Keep steps small enough that
76
- one patch is one landscape change (usually one new file, or a few related
77
- edits).
78
- 7. Report the plan before making a diff:
129
+ one recorded step is one landscape change (usually one new file, or a few
130
+ related edits).
131
+ 7. Report the plan before editing files:
79
132
 
80
133
  ```bash
81
134
  npx inbase report-plan \
82
- --session "<current-cursor-chat-id>" \
135
+ --session "<session-id>" \
83
136
  --feature "short feature name" \
84
137
  --steps "Add Clock component" \
85
138
  --steps "Show Clock on Home"
@@ -88,92 +141,92 @@ npx inbase report-plan \
88
141
  8. **Stop and wait for invocation**:
89
142
 
90
143
  ```bash
91
- npx inbase wait-for-approval --session "<current-cursor-chat-id>"
92
- ```
93
-
94
- Do not write a patch until this prints `VISUAL_CODER_EXECUTE`. If Step by
95
- step is off, this returns immediately for each remaining step.
96
- 9. Implement only the invoked step as a unified diff. Paths are relative to the
97
- project root (same ids as `codebase.json`):
98
-
99
- ```diff
100
- --- /dev/null
101
- +++ b/src/components/Clock.tsx
102
- @@ -0,0 +1,5 @@
103
- +export function Clock() {
104
- + return <time>00:00</time>
105
- +}
106
- ```
107
-
108
- ```diff
109
- --- a/src/pages/Home.tsx
110
- +++ b/src/pages/Home.tsx
111
- @@ -1,3 +1,4 @@
112
- +import { Clock } from '../components/Clock'
113
- import { Counter } from '../components/Counter'
144
+ npx inbase wait-for-approval --session "<session-id>"
114
145
  ```
115
146
 
116
- Write that diff to a new `.patch` file, then publish it:
147
+ Do not edit project files until this prints `VISUAL_CODER_ACK execute` /
148
+ `VISUAL_CODER_EXECUTE`. If Step by step is off, this returns immediately for
149
+ each remaining step. First reply in chat acknowledging the ack, then re-read
150
+ this session's `blueprint.json`; the user can place files and islands on any
151
+ step.
152
+ 9. Implement only the invoked step by editing the live project files (Write,
153
+ StrReplace, Delete). Paths are the same ids as `codebase.json`. Then record
154
+ the step — Inbase diffs the working tree against the snapshot taken at
155
+ invoke:
117
156
 
118
157
  ```bash
119
- npx inbase propose-patch \
120
- --session "<current-cursor-chat-id>" \
121
- /tmp/step.patch
158
+ npx inbase propose-patch --session "<session-id>"
122
159
  ```
123
160
 
124
- The patch path or stdin is required. Never write or replace a patch already
125
- stored in the session folder.
161
+ Do not write a unified diff. Do not pass a `.patch` file. Never write or
162
+ replace a patch already stored in the session folder.
126
163
 
127
- 10. **Stop.** Do not apply the patch and do not edit project files directly.
128
- 11. Wait until the user clicks **Run step** on the next step (or, when Step by
164
+ 10. **Stop editing** until the next `VISUAL_CODER_EXECUTE`. The stored patch is
165
+ the session record; disk already has your edits. Your next tool call is
166
+ `wait-for-approval` — nothing else.
167
+ 11. Wait until the user clicks **Accept proposal** on the current step (or, when Step by
129
168
  step is off, until the next step is auto-invoked), sends an alternative
130
- instruction, clicks **Complete** on the last step, or stops the workflow:
169
+ instruction, or stops the workflow:
131
170
 
132
171
  ```bash
133
- npx inbase wait-for-approval --session "<current-cursor-chat-id>"
172
+ npx inbase wait-for-approval --session "<session-id>"
134
173
  ```
135
174
 
136
- 12. Read the wait command output:
175
+ 12. Read the wait command output. Reply in chat with the `VISUAL_CODER_ACK`
176
+ line first, then:
137
177
 
138
- - Exit `0` (`VISUAL_CODER_EXECUTE`): the highlighted step was invoked. Build
139
- only that step, publish its incremental diff with `inbase propose-patch`,
178
+ - Exit `0` (`VISUAL_CODER_ACK execute` / `VISUAL_CODER_EXECUTE`): the
179
+ highlighted step was invoked. If this is a later step, implement it now —
180
+ do not explore, re-plan, or run `wait-for-blueprint`. Re-read this
181
+ session's `blueprint.json` only if you need placed files. Edit live files
182
+ for that step only, record with `inbase propose-patch` (no patch file),
140
183
  then wait again.
141
- - Exit `5` (`VISUAL_CODER_FINISHED`): that was the last step. The visualizer
142
- already applied the final patch and removed stored session diffs and
143
- blueprint drafts. Optionally run `--clear` if anything remains, tell the
144
- user the feature is done, and **stop**. Do not propose another patch.
145
- - Exit `4` (`VISUAL_CODER_REPLAN`): do **not** apply files and do not rewrite
146
- an earlier diff. Follow the text between
147
- `VISUAL_CODER_INSTRUCTION_START` and `VISUAL_CODER_INSTRUCTION_END`, read
148
- this session's `blueprint.json` when it is enabled (files, islands,
149
- `addedFunctions`, `addedVariables`, `addedImports`). The blueprint stays
150
- leading. If the new instruction would differ from it, ask the user before
151
- replacing the plan. Read `user-context.json` (follow the viewpoint only if
152
- `followLook` is true), replace the plan from the current step onward using
153
- `inbase report-plan`, then wait for the user to invoke the first revised
154
- step.
155
- - Exit `2` (`VISUAL_CODER_STOPPED`) or `3` (timeout): make no further
156
- project changes.
184
+ - Exit `5` (`VISUAL_CODER_ACK finished` / `VISUAL_CODER_FINISHED`): that was
185
+ the last step. The visualizer already applied the final patch and removed
186
+ stored session diffs and blueprint drafts. Optionally run `--clear` if
187
+ anything remains, tell the user the feature is done, and **stop**. Do not
188
+ propose another patch.
189
+ - Exit `4` (`VISUAL_CODER_ACK replan` / `VISUAL_CODER_REPLAN`): do **not**
190
+ edit project files and do not rewrite an earlier accepted patch. The
191
+ withdrawn proposal is no longer live; disk is baseline + accepted patch
192
+ files. Follow the text between `VISUAL_CODER_INSTRUCTION_START` and
193
+ `VISUAL_CODER_INSTRUCTION_END`, read this session's `blueprint.json` when
194
+ it is enabled (files, islands, `addedFunctions`, `addedVariables`,
195
+ `addedImports`). The blueprint stays leading. If the new instruction would
196
+ differ from it, ask the user before replacing the plan. Read
197
+ `user-context.json` (follow the viewpoint only if `followLook` is true),
198
+ replace the plan from the current step onward using `inbase report-plan`,
199
+ then wait for the next `VISUAL_CODER_EXECUTE` before editing again. The
200
+ replacement edits must sit on the accepted live files, not the withdrawn
201
+ proposal.
202
+ - Exit `2` (`VISUAL_CODER_ACK stopped` / `VISUAL_CODER_STOPPED`) or `3`
203
+ (`VISUAL_CODER_ACK timeout`): make no further project changes.
157
204
 
158
205
  13. After a finished handshake, the explorer already removed stored session
159
206
  diffs and blueprint drafts. Optionally run:
160
207
 
161
208
  ```bash
162
- npx inbase propose-patch --session "<current-cursor-chat-id>" --clear
209
+ npx inbase propose-patch --session "<session-id>" --clear
163
210
  ```
164
211
 
165
212
  ## Do not
166
213
 
167
- - Skip `inbase start-session` once this skill applies
168
- - Skip `inbase wait-for-blueprint` or report a plan before `VISUAL_CODER_BLUEPRINT_READY`
214
+ - Start a visual session from chat with `start-session`; sessions start only
215
+ from **Setup LLM session** in the map
216
+ - Edit files on a direct chat request; reply with the `/skipinbase` line and stop
217
+ - Invent a session id for `/inbase`; run `npx inbase attach` with no `--session`
218
+ - Skip `inbase wait-for-blueprint`; it returns immediately and provides the optional blueprint and instruction
169
219
  - Treat the chat request, viewpoint, or your own plan as overriding an enabled blueprint
170
220
  - Skip, rename, relocate, or replace this session's `blueprint.json` files, islands, functions, variables, or imports when `enabled` is true
171
221
  - Silently differ from the blueprint; ask the user first
172
222
  - Read global `user-context.json` for placed files; those live on the session blueprint
173
223
  - Follow the user's look when `followLook` is false
174
- - Write, edit, create, or delete project files directly
175
- - Announce file lists instead of a patch
176
- - Write a patch before its plan step is invoked
224
+ - Edit project files before `VISUAL_CODER_EXECUTE`
225
+ - Keep editing after `inbase propose-patch` until the next `VISUAL_CODER_EXECUTE`
226
+ - Write a unified diff yourself; `inbase propose-patch` with no file records the git diff
227
+ - Pass a `.patch` file to `propose-patch` unless you are debugging the CLI
228
+ - Explore, search, or re-plan after `propose-patch` before `wait-for-approval`
229
+ - Stay silent or call tools before acknowledging a `VISUAL_CODER_ACK` in chat
177
230
  - Propose the next step before `inbase wait-for-approval` returns `VISUAL_CODER_EXECUTE`
178
231
  - Propose another patch after `VISUAL_CODER_FINISHED`
179
232
  - Reuse, overwrite, or expand an existing session diff