@jkwd/inbase 0.1.10 → 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,10 +2,11 @@
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. Patch files are the single
7
- source of truth: never Write, StrReplace, or Delete project files; only write
8
- a unified diff and publish it. Do not use for git, docs-only, lockfiles, or
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
9
10
  questions.
10
11
  ---
11
12
 
@@ -15,50 +16,91 @@ Apply this skill **whenever the work is file changes in this repository**.
15
16
  Skip it for git, lockfiles, `.inbase`, `.cursor`, or questions with no code
16
17
  changes.
17
18
 
18
- The LLM uses a plan-first loop. It reports the complete plan before writing a
19
- patch. When **Step by step** is on, it waits for the user to invoke the first
20
- step, publishes only that step's diff, then waits for **Accept proposal** on
21
- that step or an alternative instruction. When **Step by step** is
22
- off, `inbase wait-for-approval` returns `VISUAL_CODER_EXECUTE` for every
23
- remaining step without the user clicking; after the last patch, wait
24
- for the user to **Accept proposal**. They can still walk Previous/Next over the diffs.
19
+ Sessions start only from the visualizer (**Setup LLM session**). This chat
20
+ cannot open a session.
25
21
 
26
- **Patch files are the single source of truth.** Do not Write, StrReplace, or
27
- Delete project files. Only write a unified diff and publish it with
28
- `inbase propose-patch`. That command stores the patch and applies the live
29
- patch chain (baseline + accepted patches + this step). A later instruction
30
- replaces the withdrawn step's patch; write the new diff against the accepted
31
- live files, not against the withdrawn proposal.
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**:
32
28
 
33
- Every Cursor chat has an explicit session ID. Pass that same ID to every
34
- command. The visualizer stores immutable diffs under `.inbase/diff-sessions/<session-id>/diffs/`.
35
-
36
- Inbase must already be running (`inbase run` or `npx inbase run`). Prefer
37
- `npx inbase` so the local package is used.
38
-
39
- ## Required sequence
29
+ ```
30
+ direct chat interaction not allowed use /skipinbase [request] to bypass inbase.
31
+ ```
40
32
 
41
- 1. As soon as this skill applies, start the visual session so the explorer can
42
- 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:
43
55
 
44
56
  ```bash
45
- npx inbase start-session --session "<current-cursor-chat-id>"
57
+ npx inbase attach
46
58
  ```
47
59
 
48
- 2. **Stop and wait for the blueprint handshake**. Do not report a plan and do
49
- 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.
50
90
 
51
91
  ```bash
52
- npx inbase wait-for-blueprint --session "<current-cursor-chat-id>"
92
+ npx inbase wait-for-blueprint --session "<session-id>"
53
93
  ```
54
94
 
55
- The explorer asks **Setup blueprint: Yes vs No**.
56
- - **No**: skip the initial placement. The user can still place files and
57
- islands on later steps; re-read this session's `blueprint.json` before
58
- each step.
59
- - **Yes**: the user places files (`Space`) and islands (`B`), then clicks
60
- **Send blueprint**. They can keep placing on later steps. This chat's
61
- blueprint is stored only for this session.
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.
62
104
  3. Read the handshake output between `VISUAL_CODER_BLUEPRINT_START` and
63
105
  `VISUAL_CODER_BLUEPRINT_END`, or read
64
106
  `.inbase/diff-sessions/<session-id>/blueprint.json`.
@@ -84,13 +126,13 @@ npx inbase wait-for-blueprint --session "<current-cursor-chat-id>"
84
126
  and choose files from the request itself. Viewpoint never overrides the
85
127
  blueprint: still follow this session's blueprint when `enabled` is true.
86
128
  6. List **all** steps needed to finish the feature. Keep steps small enough that
87
- one patch is one landscape change (usually one new file, or a few related
88
- edits).
89
- 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:
90
132
 
91
133
  ```bash
92
134
  npx inbase report-plan \
93
- --session "<current-cursor-chat-id>" \
135
+ --session "<session-id>" \
94
136
  --feature "short feature name" \
95
137
  --steps "Add Clock component" \
96
138
  --steps "Show Clock on Home"
@@ -99,105 +141,92 @@ npx inbase report-plan \
99
141
  8. **Stop and wait for invocation**:
100
142
 
101
143
  ```bash
102
- npx inbase wait-for-approval --session "<current-cursor-chat-id>"
103
- ```
104
-
105
- Do not write a patch until this prints `VISUAL_CODER_EXECUTE`. If Step by
106
- step is off, this returns immediately for each remaining step. Before
107
- implementing, re-read this session's `blueprint.json`; the user can place
108
- files and islands on any step.
109
- 9. Implement only the invoked step as a unified diff against the current live
110
- files (baseline + accepted patch files). Paths are relative to the
111
- project root (same ids as `codebase.json`):
112
-
113
- ```diff
114
- --- /dev/null
115
- +++ b/src/components/Clock.tsx
116
- @@ -0,0 +1,5 @@
117
- +export function Clock() {
118
- + return <time>00:00</time>
119
- +}
120
- ```
121
-
122
- ```diff
123
- --- a/src/pages/Home.tsx
124
- +++ b/src/pages/Home.tsx
125
- @@ -1,3 +1,4 @@
126
- +import { Clock } from '../components/Clock'
127
- import { Counter } from '../components/Counter'
144
+ npx inbase wait-for-approval --session "<session-id>"
128
145
  ```
129
146
 
130
- 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:
131
156
 
132
157
  ```bash
133
- npx inbase propose-patch \
134
- --session "<current-cursor-chat-id>" \
135
- /tmp/step.patch
158
+ npx inbase propose-patch --session "<session-id>"
136
159
  ```
137
160
 
138
- The patch path or stdin is required. Never write or replace a patch already
139
- stored in the session folder. `inbase propose-patch` stores the new file and
140
- applies the live patch chain. Do not `git apply`, copy files, or edit
141
- project files yourself.
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.
142
163
 
143
- 10. **Stop.** Do not edit project files. The stored patch files are already the
144
- live tree.
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.
145
167
  11. Wait until the user clicks **Accept proposal** on the current step (or, when Step by
146
168
  step is off, until the next step is auto-invoked), sends an alternative
147
169
  instruction, or stops the workflow:
148
170
 
149
171
  ```bash
150
- npx inbase wait-for-approval --session "<current-cursor-chat-id>"
172
+ npx inbase wait-for-approval --session "<session-id>"
151
173
  ```
152
174
 
153
- 12. Read the wait command output:
154
-
155
- - Exit `0` (`VISUAL_CODER_EXECUTE`): the highlighted step was invoked. Re-read
156
- this session's `blueprint.json` first; the user can place files and islands
157
- on any step, not only during the initial blueprint. Build only that step as
158
- a unified diff against the live files, publish it with `inbase propose-patch`,
159
- then wait again. Do not edit project files.
160
- - Exit `5` (`VISUAL_CODER_FINISHED`): that was the last step. The visualizer
161
- already applied the final patch and removed stored session diffs and
162
- blueprint drafts. Optionally run `--clear` if anything remains, tell the
163
- user the feature is done, and **stop**. Do not propose another patch.
164
- - Exit `4` (`VISUAL_CODER_REPLAN`): do **not** edit project files and do not
165
- rewrite an earlier accepted patch. The withdrawn proposal is no longer live;
166
- disk is baseline + accepted patch files. Follow the text between
167
- `VISUAL_CODER_INSTRUCTION_START` and `VISUAL_CODER_INSTRUCTION_END`, read
168
- this session's `blueprint.json` when it is enabled (files, islands,
169
- `addedFunctions`, `addedVariables`, `addedImports`). The blueprint stays
170
- leading. If the new instruction would differ from it, ask the user before
171
- replacing the plan. Read `user-context.json` (follow the viewpoint only if
172
- `followLook` is true), replace the plan from the current step onward using
173
- `inbase report-plan`, then wait for the user to invoke the first revised
174
- step. The replacement patch must apply on top of the accepted live files,
175
- not the withdrawn proposal.
176
- - Exit `2` (`VISUAL_CODER_STOPPED`) or `3` (timeout): make no further
177
- project changes.
175
+ 12. Read the wait command output. Reply in chat with the `VISUAL_CODER_ACK`
176
+ line first, then:
177
+
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),
183
+ then wait again.
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.
178
204
 
179
205
  13. After a finished handshake, the explorer already removed stored session
180
206
  diffs and blueprint drafts. Optionally run:
181
207
 
182
208
  ```bash
183
- npx inbase propose-patch --session "<current-cursor-chat-id>" --clear
209
+ npx inbase propose-patch --session "<session-id>" --clear
184
210
  ```
185
211
 
186
212
  ## Do not
187
213
 
188
- - Skip `inbase start-session` once this skill applies
189
- - 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
190
219
  - Treat the chat request, viewpoint, or your own plan as overriding an enabled blueprint
191
220
  - Skip, rename, relocate, or replace this session's `blueprint.json` files, islands, functions, variables, or imports when `enabled` is true
192
221
  - Silently differ from the blueprint; ask the user first
193
222
  - Read global `user-context.json` for placed files; those live on the session blueprint
194
223
  - Follow the user's look when `followLook` is false
195
- - Write, edit, create, or delete project files directly
196
- - `git apply`, copy, or otherwise materialize a patch yourself
197
- - Treat on-disk project files as something to edit; they are a replay of the
198
- stored patch files
199
- - Announce file lists instead of a patch
200
- - 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
201
230
  - Propose the next step before `inbase wait-for-approval` returns `VISUAL_CODER_EXECUTE`
202
231
  - Propose another patch after `VISUAL_CODER_FINISHED`
203
232
  - Reuse, overwrite, or expand an existing session diff