@skill-map/cli 0.54.0 → 0.56.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.
- package/dist/cli/tutorial/sm-tutorial/SKILL.md +22 -24
- package/dist/cli/tutorial/sm-tutorial/references/_core.md +8 -7
- package/dist/cli/tutorial/sm-tutorial/references/_manifest.yml +21 -42
- package/dist/cli/tutorial/sm-tutorial/references/fixtures.md +15 -7
- package/dist/cli/tutorial/sm-tutorial/references/part-authoring.md +2 -2
- package/dist/cli/tutorial/sm-tutorial/references/part-cli.md +1 -1
- package/dist/cli/tutorial/sm-tutorial/references/part-connect-harness.md +9 -10
- package/dist/cli/tutorial/sm-tutorial/references/part-daily-loop.md +563 -0
- package/dist/cli/tutorial/sm-tutorial/references/part-mcp.md +5 -1
- package/dist/cli/tutorial/sm-tutorial/references/part-plugins.md +7 -7
- package/dist/cli/tutorial/sm-tutorial/references/part-project-kickoff.md +24 -12
- package/dist/cli/tutorial/sm-tutorial/references/part-settings.md +2 -2
- package/dist/cli.js +1785 -1102
- package/dist/index.js +148 -14
- package/dist/kernel/index.d.ts +229 -97
- package/dist/kernel/index.js +148 -14
- package/dist/migrations/001_initial.sql +5 -0
- package/dist/ui/chunk-4ITL7E6U.js +1 -0
- package/dist/ui/chunk-DWBJCNC7.js +2 -0
- package/dist/ui/{chunk-CXTU4HQV.js → chunk-GHOVZAAV.js} +1 -1
- package/dist/ui/{chunk-GBKHMJ4B.js → chunk-H6O2DYVT.js} +13 -13
- package/dist/ui/chunk-HDKR6XHG.js +917 -0
- package/dist/ui/{chunk-GEI6INVH.js → chunk-JA4Z74I3.js} +1 -1
- package/dist/ui/chunk-RS3ANRT5.js +1 -0
- package/dist/ui/chunk-VUNP5KNI.js +3 -0
- package/dist/ui/chunk-W3Z3CZL4.js +1844 -0
- package/dist/ui/chunk-YHJL5LP3.js +913 -0
- package/dist/ui/index.html +2 -2
- package/dist/ui/{main-HP3MOLI2.js → main-PL3BEVQI.js} +3 -3
- package/dist/ui/{styles-4SNVM34O.css → styles-RHEEXRHQ.css} +1 -1
- package/migrations/001_initial.sql +5 -0
- package/package.json +2 -2
- package/dist/cli/tutorial/sm-tutorial/references/part-live-site.md +0 -155
- package/dist/cli/tutorial/sm-tutorial/references/part-maintain.md +0 -284
- package/dist/cli/tutorial/sm-tutorial/references/part-run-harness.md +0 -181
- package/dist/ui/chunk-4CXAL43H.js +0 -1
- package/dist/ui/chunk-BUNPMGDX.js +0 -2205
- package/dist/ui/chunk-DSNBKMYU.js +0 -2
- package/dist/ui/chunk-JXRIGHET.js +0 -552
- package/dist/ui/chunk-MVRQGDZJ.js +0 -123
- package/dist/ui/chunk-WFLPMCK4.js +0 -392
|
@@ -38,6 +38,11 @@ CREATE TABLE scan_nodes (
|
|
|
38
38
|
-- inspector can list every external URL without a second round-trip.
|
|
39
39
|
external_refs_json TEXT,
|
|
40
40
|
scanned_at INTEGER NOT NULL,
|
|
41
|
+
-- File modification time (`mtime`) in Unix ms, captured at scan time
|
|
42
|
+
-- from the walker's `lstat`. NULL for virtual / derived nodes (no
|
|
43
|
+
-- backing file). Drives the UI "last modified" sortable column; never
|
|
44
|
+
-- participates in `body_hash` / `frontmatter_hash`.
|
|
45
|
+
modified_at_ms INTEGER,
|
|
41
46
|
-- Sidecar denormalisation (Step 9.6.2 — Decision #3, option (a)):
|
|
42
47
|
-- - `sidecar_present` — 1 when a co-located `.sm` file accompanies
|
|
43
48
|
-- this node, 0 otherwise.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skill-map/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.56.0",
|
|
4
4
|
"description": "skill-map reference implementation — kernel + CLI + adapters.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"smol-toml": "1.6.1",
|
|
62
62
|
"typanion": "3.14.0",
|
|
63
63
|
"ws": "8.21.0",
|
|
64
|
-
"@skill-map/spec": "0.
|
|
64
|
+
"@skill-map/spec": "0.50.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@eslint/js": "10.0.1",
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
# Part 5: Ship the site (the full publish pipeline) (step library, finale, `pipeline` + `golive`)
|
|
2
|
-
|
|
3
|
-
The finale, the climax of the whole campaign. In Part 3 you ran the
|
|
4
|
-
harness once, the simple way (generate two pages, serve them). Here you
|
|
5
|
-
operate it exactly as it was designed: you drive the `/publish` command
|
|
6
|
-
end to end, the way the handbook says to ship, and put a richer
|
|
7
|
-
multi-page site live next to the full graph. Pace `auto-advance`,
|
|
8
|
-
preflight `seed` (`harness-connected`), so a tester can jump straight
|
|
9
|
-
here. Two chapters, in order: `pipeline` (run `/publish`: check the
|
|
10
|
-
links, brief the editor, follow the deploy runbook) then `golive` (run
|
|
11
|
-
the server and click through the finished site). Shared conventions
|
|
12
|
-
live in `_core.md`.
|
|
13
|
-
|
|
14
|
-
## Chapter `pipeline` - Run /publish end to end (check-links, brief, deploy runbook) (~4 min)
|
|
15
|
-
|
|
16
|
-
**Context**: the harness is not just a picture, it is a set of
|
|
17
|
-
instructions, and `/publish` is the one that ties them together. Its
|
|
18
|
-
body says: run `/check-links`, brief `@content-editor` on any fix, then
|
|
19
|
-
follow the deploy runbook. Here the tester (playing the harness) walks
|
|
20
|
-
exactly those steps on a richer site. This is still Layer 1 vs Layer 2:
|
|
21
|
-
the pages are output, so the Map stays put while the files change, same
|
|
22
|
-
as Part 3, no need to re-teach it, just do not call it a bug if they
|
|
23
|
-
notice.
|
|
24
|
-
|
|
25
|
-
**Preparation** (the agent does this, playing `content-editor`):
|
|
26
|
-
|
|
27
|
-
1. Ensure the two base pages exist. If they are not already on disk
|
|
28
|
-
from Part 3 (a tester can land here via the seed), lay
|
|
29
|
-
`public/index.html` and `public/about.html` exactly as in
|
|
30
|
-
part-run-harness.md, chapter `generate`. They are the single source
|
|
31
|
-
for those two pages; do not restate their markup, copy it from
|
|
32
|
-
there.
|
|
33
|
-
2. Add a **Projects** link to the home nav. `Edit` `public/index.html`,
|
|
34
|
-
turning the About line of the nav into:
|
|
35
|
-
|
|
36
|
-
```html
|
|
37
|
-
<a href="/about.html">About</a> ·
|
|
38
|
-
<a href="/projects.html">Projects</a>
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
3. `Write` the new page `public/projects.html` (plain markup, links
|
|
42
|
-
back home, per the style guide):
|
|
43
|
-
|
|
44
|
-
```html
|
|
45
|
-
<!doctype html>
|
|
46
|
-
<html lang="en">
|
|
47
|
-
<head>
|
|
48
|
-
<meta charset="utf-8" />
|
|
49
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
50
|
-
<title>Projects</title>
|
|
51
|
-
</head>
|
|
52
|
-
<body>
|
|
53
|
-
<h1>Projects</h1>
|
|
54
|
-
<p>A few small things I have shipped.</p>
|
|
55
|
-
<nav>
|
|
56
|
-
<a href="/">Home</a>
|
|
57
|
-
</nav>
|
|
58
|
-
</body>
|
|
59
|
-
</html>
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
# Still nothing to run in the terminal. The publish steps below are
|
|
64
|
-
# you walking the harness; the server comes in the next chapter.
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
Tell the tester:
|
|
68
|
-
|
|
69
|
-
> Time to ship it the way your handbook says to. Open
|
|
70
|
-
> `.claude/commands/publish.md` and look at its steps: that command is
|
|
71
|
-
> the recipe, and you are about to run it by hand, the way the agent
|
|
72
|
-
> would. Three pages now live under `public/`: home, about, and a new
|
|
73
|
-
> projects page, with the home nav linking all three.
|
|
74
|
-
>
|
|
75
|
-
> **Step 1, check the links** (`/check-links`). Walk the three pages
|
|
76
|
-
> and follow every internal link: `/` resolves to the home page,
|
|
77
|
-
> `/about.html` and `/projects.html` to files that exist, and each
|
|
78
|
-
> page links back home. Nothing points at a missing file, so the link
|
|
79
|
-
> check is clean.
|
|
80
|
-
>
|
|
81
|
-
> **Step 2, brief the editor** (`@content-editor`). The check found
|
|
82
|
-
> nothing to fix, so there is no brief to hand off this time, that is
|
|
83
|
-
> the happy path. (Maintaining the harness is where a link actually
|
|
84
|
-
> breaks, and that is where this step earns its keep.)
|
|
85
|
-
>
|
|
86
|
-
> **Step 3, follow the deploy runbook** (`docs/DEPLOY.md`). It lists:
|
|
87
|
-
> generate the pages (done), run the link check (done), start the
|
|
88
|
-
> server (next chapter). You have walked the whole `/publish` flow.
|
|
89
|
-
>
|
|
90
|
-
> Glance at the Map one more time: it did not move while you added a
|
|
91
|
-
> page and ran the pipeline. The pages are Layer 2 output; the harness
|
|
92
|
-
> on the canvas is Layer 1, and that is what skill-map maps.
|
|
93
|
-
>
|
|
94
|
-
> Ready to put it live?
|
|
95
|
-
|
|
96
|
-
Wait for confirmation. You MAY `Read` the three files in `public/`
|
|
97
|
-
afterwards to confirm the edit and the new page landed. Mark
|
|
98
|
-
`pipeline`: done. Auto-advance to `golive`.
|
|
99
|
-
|
|
100
|
-
## Chapter `golive` - Ship it: the richer site live next to the full graph (~3 min)
|
|
101
|
-
|
|
102
|
-
**Context**: the climax. The tester starts the tiny Express server the
|
|
103
|
-
pre-flight left in `server.js` and clicks through the three-page site,
|
|
104
|
-
ending with the running portfolio on one side and the full skill-map
|
|
105
|
-
graph of the harness that built it on the other. This is one of the
|
|
106
|
-
few chapters where the tester runs non-`sm` commands themselves
|
|
107
|
-
(`npm install`, `node server.js`); guide them, do not run it for them.
|
|
108
|
-
`npm install` is idempotent, so it is safe whether or not they already
|
|
109
|
-
ran it in Part 3.
|
|
110
|
-
|
|
111
|
-
**Preparation**: none. `server.js` and `package.json` exist from the
|
|
112
|
-
kickoff pre-flight; the three pages exist from the `pipeline` chapter.
|
|
113
|
-
The tester runs everything here.
|
|
114
|
-
|
|
115
|
-
```bash
|
|
116
|
-
npm install
|
|
117
|
-
node server.js
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
Tell the tester:
|
|
121
|
-
|
|
122
|
-
> Last step, the fun one. In your terminal, run these two commands:
|
|
123
|
-
>
|
|
124
|
-
> `npm install` downloads the one small library the server needs
|
|
125
|
-
> (Express). If you already ran it earlier it just confirms it is
|
|
126
|
-
> there. Then `node server.js` starts the server; it prints a line
|
|
127
|
-
> like `Listening on http://localhost:3000`.
|
|
128
|
-
>
|
|
129
|
-
> Open `http://localhost:3000`. Click **About**, **Projects**, and
|
|
130
|
-
> **Home** to move between all three pages. Those are the pages your
|
|
131
|
-
> harness produced, shipped through the publish flow you just ran by
|
|
132
|
-
> hand.
|
|
133
|
-
>
|
|
134
|
-
> Now take it all in at once. On one side, the real running site you
|
|
135
|
-
> can click through. On the other, the skill-map graph of the harness
|
|
136
|
-
> that built it: the handbook, the content editor, the style guide,
|
|
137
|
-
> the publish command, the link checker, all wired
|
|
138
|
-
> together. You started in an empty folder with nothing, and you have
|
|
139
|
-
> ended with a real, running site and a living map of how it all fits.
|
|
140
|
-
>
|
|
141
|
-
> Does the site load, and can you click between Home, About and
|
|
142
|
-
> Projects?
|
|
143
|
-
|
|
144
|
-
Wait for confirmation. The tester runs the commands; do not run them
|
|
145
|
-
for them. If `npm install` fails, check they are in the project root
|
|
146
|
-
and Node is on PATH (`node --version` should print 24 or higher). If
|
|
147
|
-
the port is busy, stop the server with Ctrl+C and apply the ports edge
|
|
148
|
-
case. Remind them the server stays running until they press Ctrl+C.
|
|
149
|
-
|
|
150
|
-
This is the campaign finale. Congratulate them plainly: they went from
|
|
151
|
-
an empty directory to a real, running portfolio plus a complete map of
|
|
152
|
-
its harness. Mark `golive`: done. Last chapter of the part: apply
|
|
153
|
-
§Closing a part (name the part by its title; since this closes the
|
|
154
|
-
campaign spine, if every active part is now done route to the §Final
|
|
155
|
-
wrap-up instead of the menu).
|
|
@@ -1,284 +0,0 @@
|
|
|
1
|
-
# Part 4: Maintain the harness (step library, `maintain`)
|
|
2
|
-
|
|
3
|
-
This is the upkeep part. The harness from Part 2 is wired and clean; real projects drift, links break, drafts pile up, names collide. Here the tester breaks something on purpose and fixes it, meets the analyzer catalogue that catches those problems, finds an orphan nobody links to, clears a reserved-name warning, and learns the `.sm` companion files that carry the tool's bookkeeping. `pace: auto-advance` (walk straight into the next chapter once one is marked done), `preflight: seed` (it builds on the portfolio harness from Parts 1 and 2, reusing the accumulated state when its predecessors are done, no fresh fixture of its own). Shared conventions (tone, provider detection / substitution, the `> ` rendering rule, the per-step cycle) live in `_core.md`; do not restate them here.
|
|
4
|
-
|
|
5
|
-
## Chapter `broken-ref` - A link breaks (~3 min)
|
|
6
|
-
|
|
7
|
-
**Context**: the most common kind of decay in a real project is a link that points at a file someone renamed or moved. Here the tester renames `docs/DEPLOY.md`, which breaks the `/publish -> docs/DEPLOY.md` reference from Part 2, and `sm check` surfaces it as `core/reference-broken`. Then they fix it by updating the link. Same watcher / live-UI loop they already know, plus the CLI verb that catalogues the issue.
|
|
8
|
-
|
|
9
|
-
This chapter is the tester's hands the whole way (renaming and editing their own files, Inviolable rule #2). Tell the tester to start the server again first if it is not running:
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
sm
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
This part is the first time the live server and one-off `sm` commands run side by side, so give the tester the third-terminal heads-up below (substitute `<cwd>` with the tester's actual cwd, same substitution as every other `<cwd>` mention):
|
|
16
|
-
|
|
17
|
-
> ⚠️ Heads up: from here you run one-off commands (`sm scan`, `sm
|
|
18
|
-
> check`, the `mv` below) **while the `sm` server keeps running**. The
|
|
19
|
-
> server holds its terminal until you Ctrl+C it, so open a **third
|
|
20
|
-
> terminal** and anchor it to this same folder, that is where every
|
|
21
|
-
> one-off command from here on goes:
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
cd <cwd>
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
> Three terminals now: this chat, the one running the live `sm` server
|
|
28
|
-
> (leave it alone), and this new one for the one-off commands.
|
|
29
|
-
|
|
30
|
-
> Open the URL `sm` prints, same as before. Now break something on
|
|
31
|
-
> purpose. Rename your deploy runbook from `docs/DEPLOY.md` to
|
|
32
|
-
> `docs/DEPLOYMENT.md` (just change the filename, leave the contents
|
|
33
|
-
> alone). On most systems that is one command in the terminal:
|
|
34
|
-
>
|
|
35
|
-
> ```bash
|
|
36
|
-
> mv docs/DEPLOY.md docs/DEPLOYMENT.md
|
|
37
|
-
> ```
|
|
38
|
-
>
|
|
39
|
-
> Watch the **Map**: the `publish -> docs/DEPLOY.md` arrow can no
|
|
40
|
-
> longer find its target, because nothing called `docs/DEPLOY.md`
|
|
41
|
-
> exists anymore. The link is now dangling.
|
|
42
|
-
|
|
43
|
-
After they confirm the rename, have them ask skill-map about it:
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
sm scan
|
|
47
|
-
sm check
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
> `sm scan` refreshes what skill-map knows from disk, then `sm check`
|
|
51
|
-
> reports the problem: an issue from the `core/reference-broken`
|
|
52
|
-
> analyzer (a rule that flags links pointing at files that do not
|
|
53
|
-
> exist), naming the link `../../docs/DEPLOY.md` inside your `/publish`
|
|
54
|
-
> command. That is the broken reference you just created.
|
|
55
|
-
>
|
|
56
|
-
> Now fix it. Open `.claude/commands/publish.md` in your editor and
|
|
57
|
-
> change the deploy-runbook link so it points at the new filename:
|
|
58
|
-
> `[deploy runbook](../../docs/DEPLOYMENT.md)`. Save, then re-check:
|
|
59
|
-
>
|
|
60
|
-
> ```bash
|
|
61
|
-
> sm scan
|
|
62
|
-
> sm check
|
|
63
|
-
> ```
|
|
64
|
-
>
|
|
65
|
-
> `sm check` should print `✓ No issues` and the arrow comes back on
|
|
66
|
-
> the **Map**. (If you would rather not keep the new name, renaming
|
|
67
|
-
> the file back to `docs/DEPLOY.md` clears it just as well, but the
|
|
68
|
-
> link edit is the more realistic fix.)
|
|
69
|
-
>
|
|
70
|
-
> Did the issue surface and then clear?
|
|
71
|
-
|
|
72
|
-
Wait for confirmation. You MAY use `Read` on `.claude/commands/publish.md` to verify the link edit landed. Leave the server running, the next chapters reuse it. Mark `broken-ref`: done.
|
|
73
|
-
|
|
74
|
-
## Chapter `analyzers` - The analyzer catalogue (~3 min)
|
|
75
|
-
|
|
76
|
-
**Context**: `reference-broken` was just one rule. `sm check` runs a catalogue of around 16 deterministic analyzers, each catching a different family of problem. This chapter names a few and shows how to focus on one with `--analyzers`. No fixture changes, the tester just runs the verb against the clean harness.
|
|
77
|
-
|
|
78
|
-
No file edits in this chapter.
|
|
79
|
-
|
|
80
|
-
Tell the tester:
|
|
81
|
-
|
|
82
|
-
> The broken-ref you just saw is one rule out of a catalogue. `sm
|
|
83
|
-
> check` runs roughly 16 deterministic analyzers (each one a small
|
|
84
|
-
> rule that scans your harness for a specific kind of problem). A few
|
|
85
|
-
> of the families:
|
|
86
|
-
>
|
|
87
|
-
> - `core/reference-broken`: a link points at a file that does not
|
|
88
|
-
> exist (the one you just triggered).
|
|
89
|
-
> - `core/name-reserved`: a file is named after a built-in the vendor
|
|
90
|
-
> runtime owns, so that runtime would ignore it (you will see this
|
|
91
|
-
> one live in a couple of chapters).
|
|
92
|
-
> - `core/link-self-loop`: a node links to itself.
|
|
93
|
-
> - `core/reference-redundant`: the same body points at the same
|
|
94
|
-
> target twice.
|
|
95
|
-
> - `core/signal-collision`: two analyzers disagreed about the same
|
|
96
|
-
> slice of a file, and the warning explains who won and why.
|
|
97
|
-
>
|
|
98
|
-
> When you only care about one, focus on it:
|
|
99
|
-
>
|
|
100
|
-
> ```bash
|
|
101
|
-
> sm check
|
|
102
|
-
> sm check --analyzers reference-broken
|
|
103
|
-
> ```
|
|
104
|
-
>
|
|
105
|
-
> The first runs the whole catalogue; the second narrows the report to
|
|
106
|
-
> just the reference-broken rule. Your harness is clean right now, so
|
|
107
|
-
> both print `✓ No issues`, but the same `--analyzers <id>` pattern
|
|
108
|
-
> works for every rule in the catalogue.
|
|
109
|
-
>
|
|
110
|
-
> Paste me the output (or just an OK).
|
|
111
|
-
|
|
112
|
-
Wait for confirmation. Mark `analyzers`: done.
|
|
113
|
-
|
|
114
|
-
## Chapter `orphans` - A page nobody links to (~3 min)
|
|
115
|
-
|
|
116
|
-
**Context**: a different kind of loose end. A node can be perfectly valid and still be an orphan: nothing in the harness links to it. We create a draft page that no one references; it lands on the **Map** as a floating dot, and `sm show` confirms it has no incoming links. The point is to separate three ideas the tester now has names for: orphan (nothing points at it) vs broken-ref (a link with no target) vs issue (a rule violation). Note: orphan-ness is a property of the graph (visible on the Map / inspector), there is no `sm check` analyzer for it. The separate `sm orphans` verb is unrelated (it surfaces history stranded by a rename, not unlinked pages), so do NOT run it or bring it up with the tester here.
|
|
117
|
-
|
|
118
|
-
`Write` `docs/draft.md` (markdown kind), a half-finished page nobody has wired up yet:
|
|
119
|
-
|
|
120
|
-
```markdown
|
|
121
|
-
---
|
|
122
|
-
name: draft
|
|
123
|
-
description: |
|
|
124
|
-
Half-finished page nobody links to yet. Here to show what an
|
|
125
|
-
orphan looks like: a valid node with no incoming connectors.
|
|
126
|
-
---
|
|
127
|
-
|
|
128
|
-
# Draft page
|
|
129
|
-
|
|
130
|
-
Notes for a page that is not ready to link from anywhere yet.
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
Confirm the new `docs/draft` node appears on the **Map** as a floating dot with no arrows in or out.
|
|
134
|
-
|
|
135
|
-
Tell the tester:
|
|
136
|
-
|
|
137
|
-
> I dropped a new note into your project, `docs/draft.md`, a
|
|
138
|
-
> half-finished page. Look at the **Map**: it shows up as a floating
|
|
139
|
-
> dot with no arrows touching it. Nothing in your harness links to it,
|
|
140
|
-
> which makes it an **orphan**. Click the dot, the inspector shows no
|
|
141
|
-
> connections in or out.
|
|
142
|
-
>
|
|
143
|
-
> You can confirm the same thing from the CLI:
|
|
144
|
-
>
|
|
145
|
-
> ```bash
|
|
146
|
-
> sm show docs/draft.md
|
|
147
|
-
> ```
|
|
148
|
-
>
|
|
149
|
-
> It prints the node's details, and there is **no "Links in"
|
|
150
|
-
> section**, nothing references it. That absence is exactly what
|
|
151
|
-
> "orphan" means here.
|
|
152
|
-
>
|
|
153
|
-
> It is worth keeping three ideas apart, because they are easy to
|
|
154
|
-
> confuse:
|
|
155
|
-
>
|
|
156
|
-
> - **orphan**: a real, valid node that simply has no incoming link
|
|
157
|
-
> (your `docs/draft`). Not an error, just unreferenced, and visible
|
|
158
|
-
> on the Map as a floating dot.
|
|
159
|
-
> - **broken-ref**: a link whose target file does not exist (the one
|
|
160
|
-
> you triggered by renaming the runbook). That is a real issue
|
|
161
|
-
> `sm check` reports.
|
|
162
|
-
> - **issue**: any rule violation `sm check` reports (broken-ref is
|
|
163
|
-
> one family; name-reserved, self-loop and the rest are others).
|
|
164
|
-
>
|
|
165
|
-
> An orphan is not automatically a problem. Sometimes it is a draft you
|
|
166
|
-
> have not wired up yet; sometimes it is a node you deliberately keep on
|
|
167
|
-
> its own, isolated on purpose, and that is just as valid. skill-map is
|
|
168
|
-
> only pointing out that the page is not reachable from anywhere, not
|
|
169
|
-
> telling you to fix it: if you link to it later it stops being an
|
|
170
|
-
> orphan, and if you never do, that was your call, not an error.
|
|
171
|
-
>
|
|
172
|
-
> Did `docs/draft` land as a floating dot, with `sm show` confirming
|
|
173
|
-
> no links in?
|
|
174
|
-
|
|
175
|
-
Wait for confirmation. Mark `orphans`: done.
|
|
176
|
-
|
|
177
|
-
## Chapter `reserved` - A reserved name collides (~3 min)
|
|
178
|
-
|
|
179
|
-
**Context**: vendor runtimes own certain names (`/init`, `/help`, `/clear`, and friends). If the tester names a command after one of those, the runtime ignores their file and skill-map raises a `core/name-reserved` warning to say so. We create the collision, see the warning, then rename to clear it.
|
|
180
|
-
|
|
181
|
-
`Write` `.claude/commands/init.md` (substitute `<provider_dir>` per `_core.md`; on `agent-skills` / Antigravity there is no `command` kind, so skip this whole chapter), deliberately named after the built-in `/init`:
|
|
182
|
-
|
|
183
|
-
```markdown
|
|
184
|
-
---
|
|
185
|
-
name: init
|
|
186
|
-
description: |
|
|
187
|
-
Bootstraps a fresh portfolio scaffold. Named init on purpose, to
|
|
188
|
-
collide with the runtime built-in and trigger name-reserved.
|
|
189
|
-
---
|
|
190
|
-
|
|
191
|
-
# init
|
|
192
|
-
|
|
193
|
-
Sets up the empty folders a new portfolio needs.
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
Confirm the new `init` command node appears on the **Map**.
|
|
197
|
-
|
|
198
|
-
Tell the tester:
|
|
199
|
-
|
|
200
|
-
> I added a command called `/init` to your harness. There is a catch:
|
|
201
|
-
> `/init` is a name the vendor runtime already owns for its own
|
|
202
|
-
> built-in, so the runtime would quietly ignore your file and never
|
|
203
|
-
> run it. Skill-map flags exactly that:
|
|
204
|
-
>
|
|
205
|
-
> ```bash
|
|
206
|
-
> sm scan
|
|
207
|
-
> sm check
|
|
208
|
-
> ```
|
|
209
|
-
>
|
|
210
|
-
> You will see a `core/name-reserved` warning naming the `init`
|
|
211
|
-
> command. It is not skill-map being fussy, it is telling you "the
|
|
212
|
-
> runtime will never invoke this file, pick another name". On the
|
|
213
|
-
> **Map**, any link into a shadowed node is drawn faint for the same
|
|
214
|
-
> reason.
|
|
215
|
-
>
|
|
216
|
-
> The fix is just to rename it. Rename `.claude/commands/init.md` to
|
|
217
|
-
> something that is not reserved, for example
|
|
218
|
-
> `.claude/commands/scaffold.md` (and update the `name:` in its
|
|
219
|
-
> frontmatter to `scaffold`). On most systems:
|
|
220
|
-
>
|
|
221
|
-
> ```bash
|
|
222
|
-
> mv .claude/commands/init.md .claude/commands/scaffold.md
|
|
223
|
-
> ```
|
|
224
|
-
>
|
|
225
|
-
> Then re-check:
|
|
226
|
-
>
|
|
227
|
-
> ```bash
|
|
228
|
-
> sm scan
|
|
229
|
-
> sm check
|
|
230
|
-
> ```
|
|
231
|
-
>
|
|
232
|
-
> The warning should be gone. A reserved name is one of the rare
|
|
233
|
-
> mistakes skill-map can catch before the runtime ever bites you.
|
|
234
|
-
>
|
|
235
|
-
> Did the warning appear and then clear after the rename?
|
|
236
|
-
|
|
237
|
-
Wait for confirmation. You MAY use `Read` to verify the rename landed. Mark `reserved`: done.
|
|
238
|
-
|
|
239
|
-
## Chapter `sidecar` - The .sm companion file and its consent prompt (~3 min)
|
|
240
|
-
|
|
241
|
-
**Context**: every `.md` skill-map tracks can get a sibling **companion file** with extension `.sm` that carries all of the tool's metadata about that markdown (version, history, tags, annotations), so the `.md` stays clean and only holds the content you write. The `.md` is yours; the `.sm` is bookkeeping the tool writes. The first time skill-map wants to create one in a project it asks for consent, and the choice is remembered in `settings.local.json`. We demonstrate on the handbook.
|
|
242
|
-
|
|
243
|
-
This is a CLI beat, the tester runs everything. **Reset any prior consent first** so the `[Y/n]` prompt actually appears (an earlier session may have flipped the flag, in which case the verb would skip straight past it and the lesson would not land):
|
|
244
|
-
|
|
245
|
-
```bash
|
|
246
|
-
rm -f AGENTS.sm .skill-map/settings.local.json
|
|
247
|
-
sm sidecar annotate AGENTS.md
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
> `sm sidecar annotate` creates a fresh `.sm` companion file next to a
|
|
251
|
-
> markdown file. Because this is the first time skill-map wants to
|
|
252
|
-
> write one here, it shows a short explanation and then a `[Y/n]`
|
|
253
|
-
> prompt (capital Y is the default, so you can just press Enter to
|
|
254
|
-
> accept). skill-map never writes a `.sm` to your project without your
|
|
255
|
-
> OK.
|
|
256
|
-
>
|
|
257
|
-
> After you accept, two things happen: a new `AGENTS.sm` file appears
|
|
258
|
-
> next to `AGENTS.md` (carrying an `identity:` block and an empty
|
|
259
|
-
> `annotations: {}` block), and your project remembers the choice in
|
|
260
|
-
> `.skill-map/settings.local.json` so it never asks again. Take a look:
|
|
261
|
-
>
|
|
262
|
-
> ```bash
|
|
263
|
-
> cat AGENTS.sm
|
|
264
|
-
> cat .skill-map/settings.local.json
|
|
265
|
-
> ```
|
|
266
|
-
>
|
|
267
|
-
> You will see `AGENTS.sm` holds the tool's bookkeeping for the
|
|
268
|
-
> handbook, and `settings.local.json` now contains
|
|
269
|
-
> `{ "allowEditSmFiles": true }`. That flag lives in the local config
|
|
270
|
-
> layer (gitignored), so each contributor consents on their own
|
|
271
|
-
> checkout and the choice never travels through git.
|
|
272
|
-
>
|
|
273
|
-
> **Tip:** that `.sm` is also where the inspector gets a node's
|
|
274
|
-
> **Metadata**. With the live `sm` still running, click the `AGENTS`
|
|
275
|
-
> node on the **Map**: the inspector now shows a **Metadata** section
|
|
276
|
-
> that was not there before you created the companion file. It reads
|
|
277
|
-
> straight from `AGENTS.sm`, so a node with no `.sm` has no Metadata
|
|
278
|
-
> section at all. For now it reads **never bumped**, because you only
|
|
279
|
-
> scaffolded the file; once you start running `sm bump AGENTS.md` that
|
|
280
|
-
> panel fills in **Created** and **Last bumped**.
|
|
281
|
-
>
|
|
282
|
-
> Did the prompt appear, and does `AGENTS.sm` exist now?
|
|
283
|
-
|
|
284
|
-
Wait for confirmation. You MAY use `Read` on `AGENTS.sm` to verify it landed. Mark `sidecar`: done. Last chapter of the part: apply §Closing a part (the close names the part by its title and routes back to the menu).
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
# Part 3: Run the harness (your site, live) (step library, `generate` + `serve` + `editor-live`)
|
|
2
|
-
|
|
3
|
-
The first payoff: the harness you built and wired in the earlier parts
|
|
4
|
-
finally does its job and you see a real site running, without waiting
|
|
5
|
-
for the finale. Pace `auto-advance`, preflight `seed` (`harness-connected`,
|
|
6
|
-
so a tester can jump straight here). Three chapters: `generate` (the
|
|
7
|
-
agent writes the HTML pages), `serve` (the tester runs the site next to
|
|
8
|
-
the graph), then an optional `editor-live` (the tester lets the real
|
|
9
|
-
`content-editor` agent write a posts page). This is a deliberately
|
|
10
|
-
simple, working pass: maintenance, MCP and the full publish pipeline
|
|
11
|
-
come in the parts after it. Shared conventions live in `_core.md`.
|
|
12
|
-
|
|
13
|
-
These two HTML pages are the canonical site fixture: the full
|
|
14
|
-
publish finale (`live-site`) lays the same `public/index.html` and
|
|
15
|
-
`public/about.html` from here before adding its own extra page, so keep
|
|
16
|
-
them in sync here only.
|
|
17
|
-
|
|
18
|
-
## Chapter `generate` - The agent generates the HTML in public/ (~3 min)
|
|
19
|
-
|
|
20
|
-
**Context**: the `content-editor` agent exists to write the site's
|
|
21
|
-
pages, so now you (playing that agent) generate the actual HTML into
|
|
22
|
-
`public/`. The honest beat the tester must hear: writing HTML does NOT
|
|
23
|
-
move the skill-map graph. The graph is Layer 1, the `.md` harness that
|
|
24
|
-
builds the site; the HTML is Layer 2, the harness's OUTPUT, and
|
|
25
|
-
skill-map does not map it (HTML is not `.md`). So the Map will sit
|
|
26
|
-
still while real files land on disk, and that is correct, not a bug.
|
|
27
|
-
Keep the markup plain per the style guide: no framework, no client JS,
|
|
28
|
-
one H1 per page, every page links back home.
|
|
29
|
-
|
|
30
|
-
**Preparation**: `Write` two static pages into `public/`. The
|
|
31
|
-
pre-flight already left a placeholder `public/index.html`; this
|
|
32
|
-
overwrites it with the real home page and adds an about page. Keep the
|
|
33
|
-
markup plain.
|
|
34
|
-
|
|
35
|
-
`public/index.html`:
|
|
36
|
-
```html
|
|
37
|
-
<!doctype html>
|
|
38
|
-
<html lang="en">
|
|
39
|
-
<head>
|
|
40
|
-
<meta charset="utf-8" />
|
|
41
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
42
|
-
<title>My Portfolio</title>
|
|
43
|
-
</head>
|
|
44
|
-
<body>
|
|
45
|
-
<h1>My Portfolio</h1>
|
|
46
|
-
<p>Hi, I build small, sturdy things on the web.</p>
|
|
47
|
-
<nav>
|
|
48
|
-
<a href="/">Home</a> ·
|
|
49
|
-
<a href="/about.html">About</a>
|
|
50
|
-
</nav>
|
|
51
|
-
</body>
|
|
52
|
-
</html>
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
`public/about.html`:
|
|
56
|
-
```html
|
|
57
|
-
<!doctype html>
|
|
58
|
-
<html lang="en">
|
|
59
|
-
<head>
|
|
60
|
-
<meta charset="utf-8" />
|
|
61
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
62
|
-
<title>About</title>
|
|
63
|
-
</head>
|
|
64
|
-
<body>
|
|
65
|
-
<h1>About</h1>
|
|
66
|
-
<p>A short page about the person behind the portfolio.</p>
|
|
67
|
-
<nav>
|
|
68
|
-
<a href="/">Home</a>
|
|
69
|
-
</nav>
|
|
70
|
-
</body>
|
|
71
|
-
</html>
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
```bash
|
|
75
|
-
# Nothing for you to run yet. Look at both halves of your screen.
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
Tell the tester:
|
|
79
|
-
|
|
80
|
-
> Your `content-editor` agent just did its real job: it wrote the
|
|
81
|
-
> actual web pages. Two HTML files landed in your project under
|
|
82
|
-
> `public/`: the home page (`public/index.html`) and an about page
|
|
83
|
-
> (`public/about.html`), plain static markup that follows the style
|
|
84
|
-
> guide you set up earlier.
|
|
85
|
-
>
|
|
86
|
-
> Now glance at the Map. It did not change, and that is exactly
|
|
87
|
-
> right. Everything you watched grow on the canvas is your harness:
|
|
88
|
-
> the `.md` files and how they reference each other (call that
|
|
89
|
-
> Layer 1). The HTML pages are Layer 2, what the harness PRODUCES.
|
|
90
|
-
> skill-map maps the harness, not the pages it outputs (HTML is not
|
|
91
|
-
> `.md`), so writing real site files leaves the graph untouched. Two
|
|
92
|
-
> layers, one project: the graph that builds the site, and the site
|
|
93
|
-
> itself.
|
|
94
|
-
>
|
|
95
|
-
> Ready to see the site running?
|
|
96
|
-
|
|
97
|
-
Wait for confirmation. Mark `generate`: done. Auto-advance to `serve`.
|
|
98
|
-
|
|
99
|
-
## Chapter `serve` - node server.js: your portfolio, live next to the graph (~3 min)
|
|
100
|
-
|
|
101
|
-
**Context**: the tester installs the single dependency (Express) and
|
|
102
|
-
starts the tiny server that the pre-flight already left in
|
|
103
|
-
`server.js`, then opens the site in the browser. They end with two
|
|
104
|
-
things side by side: the real portfolio they can click through, and
|
|
105
|
-
the skill-map graph of the harness that built it. Express runs on
|
|
106
|
-
Node, which the tester has from pre-flight (Node 24+), so no new
|
|
107
|
-
install beyond `npm install`. This chapter is one of the few where the
|
|
108
|
-
tester runs a non-`sm` command themselves (`npm install`,
|
|
109
|
-
`node server.js`); guide them, do not run it for them.
|
|
110
|
-
|
|
111
|
-
**Preparation**: none. `server.js` and `package.json` already exist
|
|
112
|
-
from the kickoff pre-flight; the pages exist from the `generate`
|
|
113
|
-
chapter. The tester runs everything in this chapter.
|
|
114
|
-
|
|
115
|
-
```bash
|
|
116
|
-
npm install
|
|
117
|
-
node server.js
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
Tell the tester:
|
|
121
|
-
|
|
122
|
-
> You have the pages; now let's serve them. In your terminal, run
|
|
123
|
-
> these two commands:
|
|
124
|
-
>
|
|
125
|
-
> The first, `npm install`, downloads the one small library the
|
|
126
|
-
> server needs (Express, a tiny web server). It runs on Node, which
|
|
127
|
-
> you already installed at the very start, so there is nothing new to
|
|
128
|
-
> set up.
|
|
129
|
-
>
|
|
130
|
-
> The second, `node server.js`, starts the server. It prints a line
|
|
131
|
-
> telling you it is listening, something like `Listening on
|
|
132
|
-
> http://localhost:3000`.
|
|
133
|
-
>
|
|
134
|
-
> Open `http://localhost:3000` in your browser. There it is: your
|
|
135
|
-
> portfolio, live. Click the **About** link, then the **Home** link
|
|
136
|
-
> to come back. Those are the very pages your harness produced.
|
|
137
|
-
>
|
|
138
|
-
> Take a second to look at both halves: on one side the running site
|
|
139
|
-
> you can click through, on the other the skill-map graph of the
|
|
140
|
-
> harness that built it. You built the harness, wired it, and now you
|
|
141
|
-
> have run it once end to end.
|
|
142
|
-
>
|
|
143
|
-
> Does the site load, and can you click between Home and About?
|
|
144
|
-
|
|
145
|
-
Wait for confirmation. The tester runs the commands; do not run them
|
|
146
|
-
for them. If `npm install` fails, check they are in the project root
|
|
147
|
-
(the cwd they have used all along) and that Node is on PATH (`node
|
|
148
|
-
--version` should print 24 or higher). If the port is busy, they can
|
|
149
|
-
stop the server with Ctrl+C and the edge case for ports applies the
|
|
150
|
-
same as elsewhere. Remind them they can leave the server running or
|
|
151
|
-
stop it with Ctrl+C; either way the next parts do not need it.
|
|
152
|
-
|
|
153
|
-
Mark `serve`: done. Auto-advance to the optional `editor-live` chapter.
|
|
154
|
-
|
|
155
|
-
## Chapter `editor-live` - Let the content-editor agent write a posts page for real (optional) (~3 min)
|
|
156
|
-
|
|
157
|
-
**Context**: optional payoff, and the first time the tester runs a harness member for real instead of playing it. In `generate` the tester (as the agent) wrote the HTML by hand; here the actual `content-editor` agent does the job. The tester asks for a new **posts** page, the tutorial invokes the agent, and a real `public/posts.html` lands, proof that the nodes on the map are runnable, not just a diagram. The Layer-1 / Layer-2 split still holds: the new HTML does NOT move the graph (HTML is not `.md`). Fully skippable; run it or skip it, the part closes either way.
|
|
158
|
-
|
|
159
|
-
On `agent-skills` / Antigravity the `content-editor` member is a **skill**, not an `agent`; invoke it as a skill and keep everything else identical.
|
|
160
|
-
|
|
161
|
-
This chapter is OPTIONAL and the tester opts in. Offer it; if they skip, go straight to the part close below.
|
|
162
|
-
|
|
163
|
-
Tell the tester:
|
|
164
|
-
|
|
165
|
-
> Optional last beat, and the fun one: so far you have *played* the
|
|
166
|
-
> `content-editor` yourself. Want to see it run for real? Ask me to add
|
|
167
|
-
> a **posts** page with your agent, for example: "use the
|
|
168
|
-
> content-editor agent to add a posts page". I'll invoke the real
|
|
169
|
-
> `content-editor` in your project; it reads its own rules and the
|
|
170
|
-
> style guide, then writes a new static page into `public/`.
|
|
171
|
-
>
|
|
172
|
-
> Watch two things: the new page lands in `public/` (and shows on the
|
|
173
|
-
> live site when you open it), and the **Map does NOT move**, same
|
|
174
|
-
> Layer-1 / Layer-2 split as before, the agent's HTML output is not
|
|
175
|
-
> part of the harness graph.
|
|
176
|
-
>
|
|
177
|
-
> Or just tell me to skip it and we'll wrap up this part.
|
|
178
|
-
|
|
179
|
-
If the tester opts in: invoke the project's `content-editor` (the `<provider_dir>/agents/content-editor.md` agent, or the skill on `agent-skills`) via the Task tool to write ONE new static page `public/posts.html`, following the agent's own rules and `docs/STYLE.md` (plain HTML, no framework, no client JS, one page per file, a nav link back to Home), holding two or three short sample posts (a heading plus a sentence or two each). Do NOT edit `public/index.html` or any `.md` harness file, and do NOT edit the agent definition. If the subagent is not invocable in the tester's setup, act as the `content-editor` yourself following the same rules so the beat still lands. Then tell the tester to open `http://localhost:3000/posts.html` (refresh and navigate there), confirm the posts page is live and links back home, and confirm the **Map stayed still**.
|
|
180
|
-
|
|
181
|
-
Wait for confirmation (ran it or skipped). Mark `editor-live`: done. Last chapter of the part: apply §Closing a part (the close names the part by its title and routes back to the menu; this is a mid-campaign payoff, NOT the campaign finale, so do not sign the campaign off here).
|