@skill-map/cli 0.61.5 → 0.62.1

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.
Files changed (43) hide show
  1. package/dist/cli/tutorial/sm-tutorial/references/_core.md +8 -1
  2. package/dist/cli/tutorial/sm-tutorial/references/_manifest.json +1 -11
  3. package/dist/cli/tutorial/sm-tutorial/references/_manifest.yml +1 -3
  4. package/dist/cli/tutorial/sm-tutorial/references/part-authoring.md +43 -76
  5. package/dist/cli/tutorial/sm-tutorial/references/part-plugins.md +14 -9
  6. package/dist/cli/tutorial/sm-tutorial/references/part-settings.md +10 -58
  7. package/dist/cli.js +1346 -479
  8. package/dist/index.js +368 -96
  9. package/dist/kernel/index.d.ts +232 -25
  10. package/dist/kernel/index.js +368 -96
  11. package/dist/migrations/001_initial.sql +18 -8
  12. package/dist/ui/{chunk-4N3NRZEH.js → chunk-276RLZR4.js} +1 -1
  13. package/dist/ui/{chunk-MGWGV4VD.js → chunk-34ZZDYNQ.js} +1 -1
  14. package/dist/ui/chunk-56CBK7LB.js +1 -0
  15. package/dist/ui/{chunk-OVVTCPBJ.js → chunk-7ANZW2OI.js} +1 -1
  16. package/dist/ui/chunk-BJ6X6WBO.js +4 -0
  17. package/dist/ui/{chunk-5SSKJ7AM.js → chunk-BOVJVOLH.js} +1 -1
  18. package/dist/ui/{chunk-GKQA75EF.js → chunk-CJURGJTN.js} +1 -1
  19. package/dist/ui/chunk-CM4YB7L4.js +2 -0
  20. package/dist/ui/{chunk-Q4PXVDJA.js → chunk-CZSLV6YD.js} +1 -1
  21. package/dist/ui/{chunk-7X3DZNG4.js → chunk-DLYJHLJX.js} +2 -2
  22. package/dist/ui/chunk-ECKRC6XD.js +1843 -0
  23. package/dist/ui/{chunk-JTCIY3SL.js → chunk-FC22ZJQZ.js} +1 -1
  24. package/dist/ui/{chunk-FRUHVCND.js → chunk-FYATUDAH.js} +1 -1
  25. package/dist/ui/chunk-HLHEDNSJ.js +3 -0
  26. package/dist/ui/chunk-IYC5ZW4L.js +2 -0
  27. package/dist/ui/{chunk-MBBJJEUX.js → chunk-JZ2YF7EL.js} +1 -1
  28. package/dist/ui/{chunk-HQ6M2HXK.js → chunk-LPDD2DHE.js} +1 -1
  29. package/dist/ui/{chunk-I52OQIZQ.js → chunk-NC3HOVDG.js} +1 -1
  30. package/dist/ui/{chunk-N6MUHKWR.js → chunk-UTRZTB6V.js} +1 -1
  31. package/dist/ui/chunk-VHEFRMK3.js +1 -0
  32. package/dist/ui/chunk-Y2Z26SRI.js +1 -0
  33. package/dist/ui/index.html +1 -1
  34. package/dist/ui/main-CBZBFVUW.js +4 -0
  35. package/migrations/001_initial.sql +18 -8
  36. package/package.json +2 -2
  37. package/dist/ui/chunk-6NYH7LND.js +0 -3
  38. package/dist/ui/chunk-7VUEZZFJ.js +0 -1
  39. package/dist/ui/chunk-AKKFFP7Y.js +0 -1
  40. package/dist/ui/chunk-L34EUS75.js +0 -2
  41. package/dist/ui/chunk-UTGLW5ON.js +0 -1843
  42. package/dist/ui/chunk-ZYPXVXYF.js +0 -4
  43. package/dist/ui/main-OTDMPZHD.js +0 -4
@@ -415,7 +415,14 @@ inside the content, mirroring the `✓` confirmations used elsewhere,
415
415
  never as a title prefix.
416
416
  NO blank line between a title and its description; ONE blank line
417
417
  between parts; NO outer blockquote around the whole menu. Close with a
418
- short "¿Cuál?" / "Which one?" on its own line. Sample (Claude variant,
418
+ short "¿Cuál?" / "Which one?" on its own line.
419
+
420
+ **Developer aside for section 5 (Extend)**: append to its one-line
421
+ description a short note that this section is mostly for developers
422
+ who want to get more out of skill-map (writing plugins, tuning
423
+ settings, moving view-slots). Mirror the tester's language.
424
+
425
+ Sample (Claude variant,
419
426
  fill the parts and durations from `_manifest.yml`):
420
427
 
421
428
  ```
@@ -205,7 +205,7 @@
205
205
  },
206
206
  {
207
207
  "id": "authoring-1-scaffold",
208
- "title": "`sm plugins create demo-highlight`",
208
+ "title": "`sm plugins create extractor demo-highlight`",
209
209
  "est_min": 2
210
210
  },
211
211
  {
@@ -223,20 +223,10 @@
223
223
  "title": "Change the view-slot the contribution targets",
224
224
  "est_min": 2
225
225
  },
226
- {
227
- "id": "settings-6-contributions",
228
- "title": "Watch contributions land in the inspector",
229
- "est_min": 2
230
- },
231
226
  {
232
227
  "id": "authoring-5-doctor-author",
233
228
  "title": "Catch a manifest mistake with `sm plugins doctor`",
234
229
  "est_min": 2
235
- },
236
- {
237
- "id": "authoring-6-upgrade",
238
- "title": "Try `sm plugins upgrade`",
239
- "est_min": 2
240
230
  }
241
231
  ]
242
232
  },
@@ -72,13 +72,11 @@ parts:
72
72
  - id: tour-1-intro ; title: "How plugins work" ; est_min: 4
73
73
  - id: tour-2-kinds ; title: "The six extension kinds" ; est_min: 5
74
74
  - id: tour-3-explore ; title: "Explore one extension up close" ; est_min: 4
75
- - id: authoring-1-scaffold ; title: "`sm plugins create demo-highlight`" ; est_min: 2
75
+ - id: authoring-1-scaffold ; title: "`sm plugins create extractor demo-highlight`" ; est_min: 2
76
76
  - id: authoring-2-anatomy ; title: "Tour the scaffold (plugin.json + stubs + README)" ; est_min: 3
77
77
  - id: authoring-3-edit-setting ; title: "Edit a setting (string-list) and observe it in the UI" ; est_min: 3
78
78
  - id: authoring-4-edit-slot ; title: "Change the view-slot the contribution targets" ; est_min: 2
79
- - id: settings-6-contributions ; title: "Watch contributions land in the inspector" ; est_min: 2
80
79
  - id: authoring-5-doctor-author ; title: "Catch a manifest mistake with `sm plugins doctor`" ; est_min: 2
81
- - id: authoring-6-upgrade ; title: "Try `sm plugins upgrade`" ; est_min: 2
82
80
 
83
81
  - id: cli
84
82
  order: 5
@@ -19,7 +19,7 @@ of whether the tester ran the plugins chapters first). If `.skill-map/` is missi
19
19
  is corrupted: surface the mismatch ("the project bootstrap is
20
20
  gone, re-invoke the tutorial from an empty dir") and stop.
21
21
 
22
- ## Step `authoring-1-scaffold` - `sm plugins create demo-highlight` (~2 min)
22
+ ## Step `authoring-1-scaffold` - `sm plugins create extractor demo-highlight` (~2 min)
23
23
 
24
24
  **Context**: We're building `demo-highlight`: a tiny extractor
25
25
  that scans each node's body for the keywords `TODO` and `FIXME`
@@ -31,7 +31,7 @@ manifest on purpose to see the diagnostic catch it.
31
31
  > Let's scaffold it with `sm plugins create`:
32
32
 
33
33
  ```bash
34
- sm plugins create demo-highlight
34
+ sm plugins create extractor demo-highlight
35
35
  ```
36
36
 
37
37
  Expected output:
@@ -39,9 +39,9 @@ Expected output:
39
39
  ```
40
40
  Created /<cwd>/.skill-map/plugins/demo-highlight
41
41
  Next:
42
- - Edit demo-highlight/extractors/demo-highlight-extractor/index.js (the extract() body)
43
- - Run sm scan to see the contribution surface
44
- - sm plugins slots list: browse other slots
42
+ - Edit extractors/demo-highlight-extractor/index.js
43
+ - Run sm plugins doctor to confirm it loads
44
+ - sm plugins slots list: browse slots and input-types
45
45
  ```
46
46
 
47
47
  **Heads up on the id**: it must be **kebab-case lowercase**, no
@@ -89,35 +89,25 @@ Then narrate, one file at a time:
89
89
  > **`extractors/demo-highlight-extractor/index.js`**: the code
90
90
  >
91
91
  > Plain JavaScript with a default export. **Structure-as-truth**:
92
- > the loader derives the extension `id` and its `pluginId` from the
93
- > folder path, so the export never repeats them. It does declare its
94
- > `kind` (`extractor`), which the loader cross-checks against the
95
- > parent folder (`extractors/`); a mismatch is rejected at load.
92
+ > the loader derives the extension `kind` (`extractor`), its `id`,
93
+ > and its `pluginId` from the folder path, so the export never
94
+ > repeats them. Re-declaring `kind` or `id` is rejected at load as
95
+ > `invalid-manifest`.
96
96
  >
97
97
  > **What the loader reads:**
98
98
  >
99
- > - The folder layout tells the loader this is an extractor named
100
- > `demo-highlight-extractor` (`extractors/<id>/index.js`).
99
+ > - **folder layout**: marks this as the extractor
100
+ > `demo-highlight-extractor`.
101
+ > - **`ui`**: where the chip shows. The scaffold sends `count` to
102
+ > the `card.footer.left` slot; the slot picks the renderer and
103
+ > payload shape for you.
104
+ > - **`settings`**: the user knobs (here, the `keywords` list),
105
+ > read at runtime via `ctx.settings`.
106
+ > - **`extract(ctx)`**: runs once per node. It reads the body from
107
+ > `ctx.body` and emits the count via `ctx.emitContribution`.
101
108
  >
102
- > - `ui`: which slots the extension emits to. The scaffold declares
103
- > `count`, targeting `card.footer.left` (the chip in the
104
- > bottom-left of every node card). The slot pins both the renderer
105
- > (`NodeCounter`) and the payload shape.
106
- >
107
- > - `settings`: the per-extension user-configurable knobs, this is
108
- > where the `keywords` list lives. Exposed at runtime via
109
- > `ctx.settings.<settingId>`.
110
- >
111
- > - `extract(ctx)`: the function the kernel runs per node.
112
- > `ctx.body` is the markdown body, `ctx.settings` carries what
113
- > the user set on this extension, and `ctx.emitContribution(id,
114
- > payload)` sends data to the slot.
115
- >
116
- > Heads up: the body has `|| ['TODO', 'FIXME']` as a defensive
117
- > fallback in case `ctx.settings` is missing. In normal
118
- > operation the kernel always passes the manifest's default (or
119
- > the user's override), so the hardcoded list is never used,
120
- > the manifest is the real source of truth.
109
+ > The `|| ['TODO', 'FIXME']` you see in the code is just a safety
110
+ > fallback; the real keyword list comes from the manifest.
121
111
 
122
112
  > **`README.md`**: the docs
123
113
  >
@@ -162,13 +152,10 @@ Now re-scan so the extractor re-reads its settings and re-counts:
162
152
  sm scan
163
153
  ```
164
154
 
165
- The scan re-emits the contribution with the new count. To actually
166
- see it we open the UI: `sm show` covers a node's frontmatter, links,
167
- and issues, but not plugin contributions. Ask the tester to run `sm`
168
- in the second terminal, open the browser, click `notes/ideas`, and
169
- spot the chip in the **left footer** of the card (or the bottom-left
170
- badge in the inspector). It reads `🔍 kw 3`, one match per keyword,
171
- the icon and label come from the manifest's `ui.count`.
155
+ The scan re-emits the contribution with the new count. To see it,
156
+ run `sm`, open the browser, click `notes/ideas`, and find the chip
157
+ in the card's **left footer** (it also shows in the inspector). It
158
+ reads `🔍 kw 3`, one match per keyword.
172
159
 
173
160
  > Three matches. The setting flowed from the extension's `settings`
174
161
  > through `ctx.settings.keywords` into the extractor, the extractor
@@ -179,14 +166,14 @@ Mark `authoring-3-edit-setting: done`.
179
166
 
180
167
  ## Step `authoring-4-edit-slot` - change the view-slot (~2 min)
181
168
 
182
- > Same contribution, different home. We'll move it from the
183
- > footer to the top-right corner of the card.
169
+ > Same contribution, different home. We'll move it from the left
170
+ > footer to the right footer of the card.
184
171
 
185
172
  The tester edits the extractor source:
186
173
 
187
174
  > Open `.skill-map/plugins/demo-highlight/extractors/demo-highlight-extractor/index.js`.
188
- > Find the `ui.count.slot` line. Change
189
- > `'card.footer.left'` to `'card.title.right'`. Save.
175
+ > Find the `slot` line in the `count` contribution. Change
176
+ > `'card.footer.left'` to `'card.footer.right'`. Save.
190
177
 
191
178
  Re-scan:
192
179
 
@@ -197,17 +184,22 @@ sm scan
197
184
  If `sm` is still running, the watcher picks up the file change
198
185
  and re-emits contributions live. If not, run the scan manually.
199
186
 
200
- Refresh the UI, the chip should now appear next to the **title**
201
- on the node card instead of the footer.
187
+ Refresh the UI, the chip should now appear in the **right footer**
188
+ of the node card instead of the left.
202
189
 
203
190
  > Notice we did not write any UI code. The slot decides the
204
- > renderer (`NodeCounter` here, same widget reused across four
205
- > slots) and the position. You picked a position, the UI did the
206
- > rest.
191
+ > renderer and the position. You picked a position, the UI did
192
+ > the rest.
207
193
 
208
- **Side trip if the tester asks**: `sm plugins slots list` shows
209
- all 14 slots with one-line descriptions. They are the closed
210
- catalogue, picking an unknown slot id is rejected at load.
194
+ > **Two ways to see the whole slot catalogue:**
195
+ >
196
+ > - **In the UI**, add `?debug=1` to the URL. Every view-contribution
197
+ > slot lights up with a coloured ring and its id, so you can see
198
+ > exactly where `card.footer.left` and `card.footer.right` sit.
199
+ > Turn it back off with `?debug=0`.
200
+ > - **In the CLI**, run `sm plugins slots list`: all 14 slots with a
201
+ > one-line description each. The catalogue is closed, an unknown
202
+ > slot id is rejected at load.
211
203
 
212
204
  Mark `authoring-4-edit-slot: done`.
213
205
 
@@ -218,7 +210,7 @@ Mark `authoring-4-edit-slot: done`.
218
210
 
219
211
  Have the tester change the slot to a value that does not exist:
220
212
 
221
- > In the same file, change `'card.title.right'` to
213
+ > In the same file, change `'card.footer.right'` to
222
214
  > `'card.footer.bottom'` (made up). Save.
223
215
 
224
216
  ```bash
@@ -233,7 +225,7 @@ on `demo-highlight`, pointing at the unknown slot name.
233
225
  > the loader catches the typo before any scan happens.
234
226
 
235
227
  Restore the slot to a real value (back to `'card.footer.left'` or
236
- `'card.title.right'`, the tester's choice) and re-run doctor:
228
+ `'card.footer.right'`, the tester's choice) and re-run doctor:
237
229
 
238
230
  ```bash
239
231
  sm plugins doctor
@@ -243,29 +235,6 @@ Back to clean.
243
235
 
244
236
  Mark `authoring-5-doctor-author: done`.
245
237
 
246
- ## Step `authoring-6-upgrade` - `sm plugins upgrade` (~2 min)
247
-
248
- > One last verb. `sm plugins upgrade` applies catalog migrations
249
- > to plugin manifests. Today the catalog is at `1.0.0` with zero
250
- > migrations registered, so the verb is a **no-op**. The point of
251
- > the step is to know the verb exists and what it does.
252
-
253
- ```bash
254
- sm plugins upgrade
255
- sm plugins upgrade demo-highlight
256
- ```
257
-
258
- Expected: both report no migrations to apply.
259
-
260
- > When the catalog evolves (slot renames, deprecations, setting
261
- > shape changes), `sm plugins upgrade` is the verb that walks
262
- > your manifests and rewrites them to the new shape. Without
263
- > that, every catalog change would force every plugin author to
264
- > re-author by hand. The structure is in place so future bumps
265
- > land smoothly.
266
-
267
- Mark `authoring-6-upgrade: done`.
268
-
269
238
  ## Wrap-up (fires at the end of the authoring chapters)
270
239
 
271
240
  > You wrote a plugin. From here:
@@ -277,8 +246,6 @@ Mark `authoring-6-upgrade: done`.
277
246
  > misalign them.
278
247
  > - `sm plugins doctor` is the diagnostic verb, run it after any
279
248
  > manifest edit.
280
- > - `sm plugins upgrade` is the migration verb (no-op today, the
281
- > structure is ready for future catalog changes).
282
249
  >
283
250
  > Anything weird worth logging? If not, back to the menu.
284
251
 
@@ -97,8 +97,8 @@ Mark `tour-1-intro: done`.
97
97
  > 🎣 **hook**
98
98
  > Fires on one of 10 lifecycle events (`boot`, `scan.started`,
99
99
  > `shutdown`, etc.). `update-check`, for instance, listens on
100
- > `boot` (throttled to once a day) and prints a banner if a
101
- > newer skill-map is available on npm.
100
+ > `boot` and prints a banner if a newer skill-map is available
101
+ > on npm.
102
102
  > Example: `update-check`.
103
103
  >
104
104
  > Putting it together: a **plugin** packages one or more
@@ -106,10 +106,11 @@ Mark `tour-1-intro: done`.
106
106
  > where it plugs into the kernel.
107
107
  >
108
108
  > Heads up: every `sm plugins` verb you'll run in this part is
109
- > also available from the UI. From any `sm serve` session, open
110
- > the **gear icon Plugins** tab to browse and toggle plugins
111
- > from there. CLI and UI use the same store, so a change in one
112
- > is reflected in the other.
109
+ > also available from the UI. From any `sm` session, open the
110
+ > **Settings** panel (the sliders icon, top-right) and its
111
+ > **Plugins** tab to browse and toggle plugins from there. CLI and
112
+ > UI use the same store, so a change in one is reflected in the
113
+ > other.
113
114
 
114
115
  > Now let's see those six kinds inside a real plugin. Open `core`
115
116
  > in your second terminal:
@@ -121,7 +122,9 @@ sm plugins list core
121
122
  Expected: the extensions grouped by kind, each row showing its
122
123
  kind and qualified id (e.g. `extractor core/markdown-link`). You
123
124
  can spot at least one of each of the six kinds you just read about,
124
- all packed into a single plugin.
125
+ all packed into a single plugin. A few rows are marked `✕` with an
126
+ `(experimental)` tag, those extensions ship disabled by default;
127
+ you'll toggle one yourself in the next step.
125
128
 
126
129
  Mark `tour-2-kinds: done`.
127
130
 
@@ -151,8 +154,10 @@ line (`✓ core/external-url-counter built-in`) plus its Kind
151
154
  sm plugins doctor
152
155
  ```
153
156
 
154
- Expected on a clean machine: `35 enabled extensions · 0 issues · 0 warnings`.
155
- If any plugin reports a load error, manifest validity issue, or
157
+ Expected on a clean machine: `30 enabled extensions · 0 issues · 0 warnings`.
158
+ That counts the enabled extensions only, the experimental ones you
159
+ saw marked `✕` ship disabled, so they sit outside this total. If any
160
+ plugin reports a load error, manifest validity issue, or
156
161
  spec-compatibility mismatch, `doctor` is the verb that flags it.
157
162
 
158
163
  > Last, toggle one extension off and back on so you see the state
@@ -1,10 +1,9 @@
1
1
  # Part 4 (a): Extend skill-map - settings (step library, `settings-*` ids)
2
2
 
3
3
  Step bodies for the settings chapters of Part 4 (config layers, the
4
- `sm config` verbs, the active provider lens), plus the shared step
5
- `settings-6-contributions` that the plugin-authoring chapters reuse.
6
- The SKILL.md orchestrator dispatches each `settings-*` chapter id
7
- here; `authoring-*` ids it dispatches to `part-authoring.md`.
4
+ `sm config` verbs, the active provider lens). The SKILL.md
5
+ orchestrator dispatches each `settings-*` chapter id here;
6
+ `authoring-*` ids it dispatches to `part-authoring.md`.
8
7
 
9
8
  The `.sm` consent gate (companion files, `allowEditSmFiles`,
10
9
  `sm sidecar annotate`) is covered elsewhere in this tutorial, so
@@ -126,16 +125,16 @@ Mark `settings-2-resolve: done`.
126
125
 
127
126
  **Context**: the single most consequential setting, the lens that
128
127
  decides which provider types the project's files. It auto-detects and
129
- never touches your `.md` files, only the scan cache.
128
+ never touches your `.md` files.
130
129
 
131
130
  > One setting earns its own step: the **active provider lens**. A
132
- > skill-map project sees its filesystem through exactly **one**
133
- > provider at a time, and that lens decides how each file is read.
134
- > Under the `claude` lens a `.claude/agents/*.md` is an agent and
135
- > `@`-mentions / `/`-commands become links. Same files, one reading.
131
+ > skill-map project reads its files through exactly **one** provider
132
+ > at a time, and that lens decides how each file is interpreted, so
133
+ > the same files can read differently depending on which lens is active.
136
134
 
137
- > The lens auto-detects on the first scan from the markers in your
138
- > project (`.claude/` claude). Scan once and check where it landed:
135
+ > The lens auto-detects on the first scan from your project's layout
136
+ > (a `.claude/` folder selects the `claude` lens). Scan once and check
137
+ > where it landed:
139
138
 
140
139
  ```bash
141
140
  sm scan
@@ -157,53 +156,6 @@ is just a key in `settings.json`, persisted like any other setting.
157
156
 
158
157
  Mark `settings-3-lens: done`.
159
158
 
160
- ## Step `settings-6-contributions` - watch contributions land (~2 min)
161
-
162
- > Last step. Let's watch a contribution land on a node card live.
163
- > The fixture's `master-agent` declares `tools: [Read, Bash,
164
- > Edit]`, which the `core/tools-counter` extractor picks up.
165
-
166
- If the tester does not have `sm` running, ask them to launch it
167
- in their second terminal (same drill as the fundamentals part:
168
- `sm`, copy the link from the output, open the browser, arrange
169
- the screen). If `sm` is still running, leave it.
170
-
171
- ```bash
172
- sm
173
- ```
174
-
175
- Once the UI is open, ask the tester to:
176
-
177
- > Find the `master-agent` card in the graph. Look at its **left
178
- > footer** (the bottom-left corner of the card): you should see a
179
- > small wrench chip from `tools-counter` labelled `tools` showing
180
- > the value `3`. Hover it to see the tool names.
181
- >
182
- > That chip is a plugin contribution. It landed in the slot
183
- > `card.footer.left`, the renderer is `NodeCounter` (same one your
184
- > scaffold uses), the payload was `{ value: 3 }`.
185
-
186
- If the `demo-highlight` plugin from the earlier authoring chapters
187
- of this part is still installed, point the tester at the
188
- contribution it emits too:
189
-
190
- > The `demo-highlight` you scaffolded earlier in this part also
191
- > shows up: its chip lands on every node that has a TODO / FIXME
192
- > / XXX in its body. Click `notes/ideas` to find it.
193
-
194
- Have the tester change `master-agent`'s `tools` array (add or
195
- remove one tool), save, and watch the chip refresh.
196
-
197
- > Same flow as the fundamentals part's live UI: edit the markdown,
198
- > watch the UI refresh. The difference is that the value flowed
199
- > through a plugin (`core/tools-counter`) and landed in a specific
200
- > slot (`card.footer.left`). You now know the full path from `.md`
201
- > to UI chip.
202
-
203
- Have them Ctrl+C the server when done.
204
-
205
- Mark `settings-6-contributions: done`.
206
-
207
159
  ## Reference: where each catalogue lives in the repo
208
160
 
209
161
  Not for the tester unless they ask. Cheat sheet for the agent: