@skill-map/cli 0.20.1 → 0.21.0

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 (37) hide show
  1. package/dist/cli/tutorial/sm-tutorial.md +93 -14
  2. package/dist/cli.js +1332 -339
  3. package/dist/cli.js.map +1 -1
  4. package/dist/index.js +300 -238
  5. package/dist/index.js.map +1 -1
  6. package/dist/kernel/index.d.ts +91 -11
  7. package/dist/kernel/index.js +300 -238
  8. package/dist/kernel/index.js.map +1 -1
  9. package/dist/migrations/001_initial.sql +13 -0
  10. package/dist/ui/chunk-25AWRVIC.js +965 -0
  11. package/dist/ui/chunk-6FTVUS57.js +123 -0
  12. package/dist/ui/{chunk-4NLC7QD2.js → chunk-GXRWH2VL.js} +1 -1
  13. package/dist/ui/chunk-MF2M6GYF.js +1 -0
  14. package/dist/ui/{chunk-EZZF5RL5.js → chunk-MPMBTIUR.js} +2 -2
  15. package/dist/ui/chunk-N366HMME.js +1 -0
  16. package/dist/ui/{chunk-6GUHSAP5.js → chunk-OPPQMCMQ.js} +1 -1
  17. package/dist/ui/chunk-V3SZQETX.js +61 -0
  18. package/dist/ui/{chunk-E4ALROJS.js → chunk-VVOEPDQD.js} +1 -1
  19. package/dist/ui/{chunk-6BZZQV42.js → chunk-W2EFGI3J.js} +1 -1
  20. package/dist/ui/chunk-W62WVNU4.js +251 -0
  21. package/dist/ui/index.html +2 -10
  22. package/dist/ui/main-NIYE2VFS.js +2 -0
  23. package/dist/ui/media/fa-brands-400-AHOAZHCU.woff2 +0 -0
  24. package/dist/ui/media/fa-regular-400-VRZYIBIZ.woff2 +0 -0
  25. package/dist/ui/media/fa-solid-900-MDEYK55F.woff2 +0 -0
  26. package/dist/ui/media/fa-v4compatibility-ETEVP6IB.woff2 +0 -0
  27. package/dist/ui/styles-M2FETVAG.css +1 -0
  28. package/migrations/001_initial.sql +13 -0
  29. package/package.json +2 -2
  30. package/dist/ui/chunk-FWX4RRDF.js +0 -125
  31. package/dist/ui/chunk-GGMXMGRJ.js +0 -1
  32. package/dist/ui/chunk-K5PULFK7.js +0 -1
  33. package/dist/ui/chunk-OJ6W6OIB.js +0 -61
  34. package/dist/ui/chunk-PTCD42GB.js +0 -247
  35. package/dist/ui/chunk-ZSRIBCAW.js +0 -965
  36. package/dist/ui/main-5FJWWH5I.js +0 -1
  37. package/dist/ui/styles-VJ5Q6D2X.css +0 -1
@@ -413,6 +413,10 @@ long_steps:
413
413
  verbs: ["sm plugins list", "sm plugins show",
414
414
  "sm plugins doctor", "sm plugins enable",
415
415
  "sm plugins disable"]
416
+ - id: "9-annotations"
417
+ title: "Annotations and the .sm consent prompt"
418
+ status: "pending"
419
+ verbs: ["sm sidecar annotate"]
416
420
  findings_file: "./findings.md"
417
421
  ```
418
422
 
@@ -613,8 +617,12 @@ Create these four files (with `Write`), exactly in this order:
613
617
  target file. Connectors land in the next sub-step.
614
618
  ```
615
619
 
616
- 3. `.claude/hooks/demo-hook.md` (kind: hook — **don't skip this
617
- one**, fields differ on purpose):
620
+ 3. `.claude/hooks/demo-hook.md` — **don't skip this one**, the
621
+ fields differ on purpose so the body reads like a real hook
622
+ manifest. The CLI classifies it as `kind: markdown` today
623
+ (the catch-all kind for `.md` files outside the
624
+ skill / agent / command folders); a dedicated `hook` kind
625
+ is on the roadmap:
618
626
  ```markdown
619
627
  ---
620
628
  name: demo-hook
@@ -634,7 +642,9 @@ Create these four files (with `Write`), exactly in this order:
634
642
  wired into the rest of the fixture next.
635
643
  ```
636
644
 
637
- 4. `notes/todo.md` (kind: note):
645
+ 4. `notes/todo.md` — also classified as `kind: markdown` today
646
+ (same catch-all as the hook above; a dedicated `note` kind
647
+ is on the roadmap):
638
648
  ```markdown
639
649
  ---
640
650
  name: Demo TODO list
@@ -943,27 +953,38 @@ the server.
943
953
  sm list
944
954
  sm list --kind skill
945
955
  sm list --kind agent
956
+ sm list --kind markdown
946
957
  sm show .claude/skills/demo-skill/SKILL.md
947
958
  sm check
948
959
  ```
949
960
 
950
- Expected: you see the 5 fixture nodes listed with their kind;
951
- `check` runs the deterministic rules and reports a clean fixture
952
- (no issues at this point we will plant one in step 7 and watch
953
- the rule catch it).
961
+ Expected: you see the 5 fixture nodes listed with their kind:
962
+ `demo-skill` (skill), `demo-agent` (agent), `demo-command`
963
+ (command), and `demo-hook` + `notes/todo` (both `markdown`
964
+ the catch-all per Step 2.2). `check` reads the persisted
965
+ `scan_issues` table — it does NOT re-walk the filesystem. The
966
+ fixture is clean (the watcher in Step 2 captured the latest
967
+ state before Ctrl+C), so the verb prints `✓ No issues`. We will
968
+ plant one in Step 7 and watch the rule catch it after a fresh
969
+ `sm scan`.
954
970
 
955
971
  ### Step 6 — ASCII: graph + export (~3 min)
956
972
 
957
973
  ```bash
958
974
  sm graph
959
- sm graph --root .claude/skills/demo-skill/SKILL.md
960
975
  sm export --format md > export.md
961
- sm export --format json --kind note > export-notes.json
976
+ sm export "kind=markdown" --format json > export-markdown.json
977
+ sm export "path=notes/**" --format json > export-notes.json
962
978
  ls -la export.*
963
979
  ```
964
980
 
965
- `graph` draws an ASCII tree. `export` filters and serialises to md
966
- or json.
981
+ `graph` draws an ASCII tree of the whole persisted scan (no
982
+ `--root` flag — graph is whole-graph today). `export` takes a
983
+ positional query (`kind=…`, `path=…`, `has=issues`, comma-OR
984
+ within a key, AND across keys) and a `--format` of `md` or
985
+ `json`. The `path=` glob uses POSIX semantics (`*` is one
986
+ segment, `**` spans segments) so `path=notes/**` cleanly
987
+ captures the notes folder regardless of the catch-all kind.
967
988
 
968
989
  ### Step 7 — Issues: broken refs (~3 min)
969
990
 
@@ -980,7 +1001,14 @@ Ask the tester to **append one bullet** to `notes/todo.md`:
980
1001
 
981
1002
  `./missing-page.md` deliberately doesn't exist. Save the file.
982
1003
 
1004
+ The watcher was stopped at the end of Step 4, so the persisted
1005
+ `scan_issues` table still reflects the pre-edit state. `sm check`
1006
+ reads from that table without re-walking, so a bare `sm check`
1007
+ right now would still print `✓ No issues`. Run `sm scan` first
1008
+ to refresh the snapshot:
1009
+
983
1010
  ```bash
1011
+ sm scan
984
1012
  sm check
985
1013
  sm check --analyzers broken-ref
986
1014
  sm check --json
@@ -1033,6 +1061,57 @@ all Claude-kind extraction during the window.
1033
1061
  If `plugins list` shows zero entries (depends on the build), tell
1034
1062
  the tester no plugins are installed yet and offer to skip.
1035
1063
 
1064
+ ### Step 9 — Annotations and the `.sm` consent prompt (~3 min)
1065
+
1066
+ **Context**: skill-map keeps a small **companion file** (extension
1067
+ `.sm`) next to each `.md` to track its version, history, and tags.
1068
+ The first time skill-map wants to write one in a new project it asks
1069
+ for your consent — it never touches your filesystem without
1070
+ permission. After you say yes, the choice persists per-checkout
1071
+ (gitignored) and the prompt never appears again.
1072
+
1073
+ We'll demonstrate by creating an empty annotation scaffold for
1074
+ `notes/todo.md`.
1075
+
1076
+ ```bash
1077
+ sm sidecar annotate notes/todo.md
1078
+ ```
1079
+
1080
+ Expected: a short explanation paragraph appears in the terminal,
1081
+ followed by a `[Y/n]` prompt (capital Y = default Yes — you can just
1082
+ hit Enter). After accepting, `notes/todo.sm` appears next to
1083
+ `notes/todo.md` carrying an `identity:` block plus an empty
1084
+ `annotations: {}` block, and `.skill-map/settings.local.json` now
1085
+ contains `{ "allowEditSmFiles": true }`.
1086
+
1087
+ ```bash
1088
+ cat notes/todo.sm
1089
+ cat .skill-map/settings.local.json
1090
+ ```
1091
+
1092
+ **Why the prompt?** The choice is **per-user, per-project** — stored
1093
+ in the gitignored `settings.local.json` so each contributor consents
1094
+ independently and nothing about the choice travels via the repo. On a
1095
+ CI / non-interactive session, pass `--yes` to grant up-front.
1096
+
1097
+ **Try this**: delete `notes/todo.sm` and re-run the command — this
1098
+ time it goes through silently because the flag is already set:
1099
+
1100
+ ```bash
1101
+ rm notes/todo.sm
1102
+ sm sidecar annotate notes/todo.md
1103
+ ```
1104
+
1105
+ Expected: same scaffold reappears, no prompt.
1106
+
1107
+ > **Heads up about scope** (mention only if the tester asks):
1108
+ >
1109
+ > - `sm sidecar annotate` is the scaffold verb (creates a fresh `.sm`).
1110
+ > - `sm bump <node>` is the day-to-day verb that increments the
1111
+ > sidecar's version and refreshes its hashes — same consent gate.
1112
+ > - `sm sidecar refresh <node>` is the hash-only update (no version
1113
+ > bump).
1114
+
1036
1115
  ---
1037
1116
 
1038
1117
  ## Final wrap-up
@@ -1060,7 +1139,7 @@ template:
1060
1139
  - **Depth reached**: <basic | full>
1061
1140
  - **Tester**: level <N> (if applicable)
1062
1141
  - **Tutorial directory**: <cwd>
1063
- - **Steps completed**: N / 3 demo + X / 5 deep-dive (if applicable)
1142
+ - **Steps completed**: N / 3 demo + X / 6 deep-dive (if applicable)
1064
1143
  - **Steps skipped**: Y (if applicable)
1065
1144
  - **Total time**: ~<computed from timestamps>
1066
1145
 
@@ -1100,8 +1179,8 @@ the cwd, start like this (do NOT repeat pre-flight from scratch):
1100
1179
  > I see you already started the tutorial.
1101
1180
  >
1102
1181
  > You're at step <N> of 3 (or "you've already completed the demo
1103
- > (steps 1-3) and you're on step <M> of 5 of the deep-dive (steps
1104
- > 4-8)", depending on the yaml state).
1182
+ > (steps 1-3) and you're on step <M> of 6 of the deep-dive (steps
1183
+ > 4-9)", depending on the yaml state).
1105
1184
  >
1106
1185
  > 1. **Continue** from where you left off
1107
1186
  > 2. **Start over** — wipes all the tutorial content in this dir