superbee 0.1.1 → 0.1.2-pre.2

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/SKILL.md CHANGED
@@ -1,465 +1,92 @@
1
1
  ---
2
2
  name: superbee
3
3
  description: >-
4
- Read and write a local OKF knowledge bundle (agent context notes, docs, cross-links, and live
5
- bundle Views) from the shell via the Superbee CLI. Use when an agent
6
- needs to persist a context note across sessions, store a decision/spec as a doc, link concepts,
7
- query a bundle, share the project's board with teammates (`sync`), or open its local View UI.
8
- Runs standalone via `npx -y superbee`.
4
+ Use Superbee to preserve important knowledge, model recurring domain concepts, relate evidence,
5
+ coordinate work when appropriate, and present durable information to humans. Apply it when the
6
+ user's work would benefit from continuity, provenance, reusable structure, or reduced repeated
7
+ interpretation—not only when the user names Superbee.
9
8
  ---
10
9
 
11
- # superbee
10
+ # Superbee
12
11
 
13
- read and write a local OKF knowledge bundle (context notes, docs, cross-links, live bundle Views).
12
+ Superbee is a local, user-owned knowledge environment shared by humans and agents. Help with the
13
+ user's work first; improve that environment only where doing so removes real future effort.
14
14
 
15
- It is a standalone npm package (`superbee`) installing only the canonical `superbee` bin.
16
- Legacy `aslite` and `agentstate-lite` invocations are recognized only for migration.
15
+ ## Keep the front door short
17
16
 
18
- Output is TOON on stdout (a `--json` hatch exists). Errors are structured TOON on stdout with a
19
- capped exit-code taxonomy (0 ok/no-op, 2 usage, 4 auth, 5 conflict, 6 not-found, 1 runtime).
17
+ - If the user asks for concrete work, do it. Do not interrupt with onboarding.
18
+ - When the user is orienting, inspect the available project and bundle facts, then offer two or
19
+ three relevant one-line outcomes and one easy question. Each outcome is one short sentence;
20
+ omit its rationale unless asked. Keep the complete opener to five lines and at most 80 words.
21
+ - Use the user's language, not product vocabulary. Make declining explicit and drop declined offers
22
+ for the rest of the session.
23
+ - Treat `superbee home` offers as grounded candidates, not mandatory slots to fill.
24
+ - Never mutate while merely explaining options.
20
25
 
21
- <!-- GENERATED from src/reference.ts by scripts/gen-skill.mjs — do not edit by hand. -->
26
+ ## Recognize the smallest useful opportunity
22
27
 
23
- ## If `superbee` is not on PATH
28
+ Look for evidence that people or agents repeatedly:
24
29
 
25
- Every example below assumes the `superbee` bin is on PATH. If it is not:
30
+ - reconstruct the same context, rule, or decision;
31
+ - lose provenance between evidence and conclusions;
32
+ - handle a stable entity, lifecycle, state, or relationship inconsistently;
33
+ - assemble the same overview to understand or decide something; or
34
+ - coordinate dependencies, owners, and milestones across sessions.
26
35
 
27
- - `npm install -g superbee` puts the canonical `superbee` command on PATH.
28
- - `npx -y superbee …` runs any command below with no install at all — swap the leading `superbee`
29
- for that prefix and the rest of the line runs unchanged.
36
+ Offer the smallest durable improvement that matches the observed friction. Possibilities include
37
+ Release and Release Check; Claim, Evidence, and Verification; Interview, Need, and Insight;
38
+ Experiment, Run, and Result; Decision, Alternative, and Assumption; or Task, Roadmap, Milestone, and
39
+ Dependency when coordinated execution actually warrants them. These are examples, not a catalog.
30
40
 
31
- ## Complete host setup
41
+ A document preserves one important thing. A Kind makes a recurring domain concept consistent. A
42
+ recipe packages stable reusable definitions. A bundle View reduces repeated human interpretation without
43
+ becoming a second source of truth. Add only the layer justified by current evidence.
32
44
 
33
- After the global npm install, run:
45
+ ## Preserve boundaries and authority
34
46
 
35
- ```sh
36
- superbee setup
37
- ```
47
+ - Operate only on the bundle resolved from the current project or one the user explicitly selects.
48
+ A catalog entry is available for selection; it is not ambient project context.
49
+ - If no bundle resolves, determine whether this repository already shares a board and clarify the
50
+ intended purpose, privacy, participants, and sharing boundary before creating anything.
51
+ `superbee sync` joins an existing shared board; `superbee init --create-only --dir .superbee` is
52
+ only for a confirmed greenfield local bundle.
53
+ - Ask before creating durable structure or publishing a local bundle. `sync --establish` is an
54
+ explicit publication decision.
55
+ - Never silently rewrite an established Kind, recipe, or its instances. Inspect dependencies and
56
+ explain migration consequences first.
38
57
 
39
- Without `--host`, setup returns the four supported host rows. Select the exact host running
40
- this agent, run that row's command, then follow the one `next.command` in each host-scoped
41
- plan, filling any explicit placeholder it identifies. Bare and host-scoped setup are read-only: they compose npm,
42
- Skill, Hook, MCP, bundle, and catalog status but never treat detection as permission to write.
43
- Ask the human before running a returned mutating command. Restart the host after Skill, Hook,
44
- or MCP changes, then rerun the same setup command to verify. Foreign or unreadable state
45
- returns a read-only inspection command instead of overwriting it.
46
- If setup returns `superbee setup migrate-state`, that exact explicit command copies only
47
- validated private operational records into Superbee's canonical state root; it never moves
48
- bundles or deletes legacy bytes.
58
+ ## Deliver after acceptance
49
59
 
50
- A catalog entry preserves a workspace for explicit MCP selection; it never selects that
51
- workspace as the current project's context. Do not read, write, orient from, or sync a
52
- cataloged workspace merely because setup or a legacy MCP registration references it. Operate
53
- only on a bundle resolved from the current checkout or one the user explicitly selects. If
54
- the current checkout has no bundle, report that fact and stop bundle-oriented work.
60
+ Set `$REFS` from the skill base directory reported by the host:
55
61
 
56
- ## Stable MCP launch
62
+ `REFS="<skill-base-dir>/references"`
57
63
 
58
- For a persistent MCP integration, install the supported CLI with
59
- `npm install -g superbee`, then run `superbee mcp install --host <id>` with the exact
60
- current host: `codex`, `claude-code`, `claude-desktop`, or `opencode`. The command
61
- registers the durable npm runtime once at user scope, never an npx cache or one bundle directory.
62
- Use `superbee mcp status --host <id>` to verify it and restart the host after a change.
64
+ When the user accepts a domain-modeling offer, read `$REFS/modeling-and-delivery.md`. Inspect
65
+ existing documents, Kinds, recipes, and links before choosing a shape. Create the smallest coherent
66
+ representation, normally with one representative example, verify it, remove temporary authoring
67
+ files, and stop. Use `superbee <command> --help` for exact current syntax rather than relying on a
68
+ copied command manual. Use `--body-file` for multiline Markdown.
63
69
 
64
- ## Commands
70
+ Focused shipped material is available under `$REFS/recipes/` for portable examples,
71
+ `$REFS/views/` for View authoring and examples, and `$REFS/sample-bundle/` for OKF interop.
72
+ Read only what the accepted work requires.
65
73
 
66
- ### Bundle
74
+ ## Make the value visible
67
75
 
68
- - `superbee bundle locate [--dir <path>]`
69
- Resolve the exact canonical local bundle path and report why it won selection
70
- - `superbee catalog (add <label> [--dir <path>] | list | resolve <label-or-id> [--field path])`
71
- Register and deterministically resolve this user's explicitly named local workspaces
72
- - `superbee init [--dir <path>] [--okf-version <v>] [--recipe <name-or-path>] [--create-only]`
73
- — Create (or open) an OKF knowledge bundle in a directory — greenfield setup; a project that already shares a board is set up by sync, not init. --create-only requires a genuinely NEW target and refuses existing, non-empty, symlinked, enclosing, bound, or concurrent targets before publication; runtime failures retain and report any empty directories they created instead of deleting them — 'recipe add' modifies a verified existing bundle
74
- - `superbee index generate [--dir <path>] [--check] [--force] [--actor <name>]`
75
- — Generate complete portable Markdown navigation explicitly; refuses curated indexes unless --force adopts them
76
- - `superbee status [--limit <n>] [--dir <path>] [--remote <url>]`
77
- — Read-only bundle health report (kind lint, unresolved links, orphans, staleness, graph lints)
76
+ At a tangible result, say in one or two sentences what became durable or structured and what the
77
+ user or a later agent no longer needs to reconstruct. Show or offer the most useful authoritative
78
+ document or View once. Never return only a Markdown link or local filesystem path. When the user
79
+ asks to see it, invoke `show_document` or `show_view` in an MCP Apps host; otherwise invoke
80
+ `superbee doc open <id>`.
78
81
 
79
- ### Documents & links
82
+ ## Host setup
80
83
 
81
- - `superbee doc write <id> --type <t> [--title <t>] [--body <s> | --body-file <p>] [--actor <n>] [--dir <path>] [--remote <url>]`
82
- Write a generic OKF concept document
83
- - `superbee doc update <id> [--<field> <value> ...] [--title <t>] [--tag <t>] [--type <t>] [--body <s> | --body-file <p>] [--expected-version <v>] [--actor <n>] [--dir <path>] [--remote <url>]`
84
- Patch given fields (incl. kind-declared fields like --progress_status) of an existing doc, preserving the rest; optimistic-CAS with --expected-version
85
- - `superbee doc read <id> [--out (<path> | -) | --body-out (<path> | -) | --field <name>] [--dir <path>] [--remote <url>]`
86
- — Read a doc, export its raw markdown, export its body with a same-read CAS version, or print one raw field for scripting
87
- - `superbee doc open <id> [--dir <path> | --remote <url>] [--port <n>] [--actor <name>]`
88
- — Open one exact authoritative document in the existing rendered browser UI
89
- - `superbee doc history <id> [--limit <n>] [--dir <path>] [--remote <url>]`
90
- — Show a doc's version history (newest first, capped at 20 by default — --limit 0 for all; a history-keeping backend returns the full attributed chain, a local bundle just the current revision) — the tokens for --expected-version
91
- - `superbee doc delete <id> [--expected-version <v>] [--dir <path>] [--remote <url>]`
92
- — Hard-delete a doc (idempotent: absent -> deleted:false, exit 0)
93
- - `superbee list [--type <t>] [--tag <t>] [--field <k=v>] [--prefix <p>] [--open] [--limit <n>] [--dir <path>] [--remote <url>]`
94
- — Query concepts over their frontmatter (alias: query) — a comma in --field's value is set membership (OR); --open excludes terminal instances (declared kinds only)
95
- - `superbee link (add <from> <to> [--text <t>] [--actor <n>] | show <id> [--limit <n>] [--text <t>] | list [--from <id|prefix/>] [--to <id|prefix/>] [--text <t>] [--limit <n>]) [--dir <path>] [--remote <url>]`
96
- — Add a cross-link, show a concept's links + backlinks, or query the whole bundle's derived edge list filtered by from/to (id or prefix/, repeatable/union) and exact-match text
84
+ Persistent integrations require `npm install -g superbee` followed by `superbee setup`.
85
+ Setup is a read-only conductor: select the exact host, ask before running its returned mutating
86
+ command, restart after Skill, Hook, or MCP changes, and rerun setup to verify. A catalog entry
87
+ preserves a workspace for explicit selection; it never makes that workspace the current project.
88
+ If home or SessionStart reports `skill_update`, run its exact scope-specific command, restart the
89
+ host, and continue; Superbee never rewrites an installed Skill automatically.
90
+ `npx -y superbee` is suitable for ordinary bundle commands, not durable host integration.
97
91
 
98
- ### Artifacts
99
-
100
- - `superbee artifact create <file> --title <title> [--description <text>] [--supersedes <id>] [--actor <n>] [--dir <path>] [--remote <url>]`
101
- — Produce a shareable output (HTML) a human can view: one command promotes the bytes and writes the type:Artifact record
102
- - `superbee promote <file> --doc-key <key> [--content-type <mime>] [--expected-version <v>] [--dir <path>] [--remote <url>]`
103
- — Move a local file's bytes into the store (a .md key routes through the engine; else a blob)
104
- - `superbee pull --doc-key <key> --out (<path> | -) [--dir <path>] [--remote <url>]`
105
- — Pull a doc's canonical form or a blob's raw bytes out of the store (the reverse of promote)
106
- - `superbee blobs [--prefix <p>] [--limit <n>] [--dir <path>] [--remote <url>]`
107
- — List the store's blob (non-document) keys (documents are listed by 'list'/'query')
108
- - `superbee delete --doc-key <key> [--expected-version <v>] [--dir <path>] [--remote <url>]`
109
- — Hard-delete a doc or blob by key (idempotent: absent -> deleted:false, exit 0)
110
-
111
- ### Kinds
112
-
113
- - `superbee new "<Kind>" <id> --<field> <value> [...] [--body <markdown> | --body-file <path>] [--link "<type>=<target-id>" ...] [--no-prefix] [--actor <n>] [--dir <path>] [--remote <url>]`
114
- — Create a new instance of a bundle-declared kind — initial Markdown may come from --body or --body-file (otherwise declared sections are scaffolded); validates strictly, and repeatable --link wires typed cross-links in the same step
115
- - `superbee kinds [--dir <path>] [--remote <url>]`
116
- — List the kind conventions this bundle declares (purpose, described fields, exact required body headings, typed-link vocabulary, horizon)
117
- - `superbee kind field "<Kind>" (add <name> [--required] [--values <a,b,c>] | remove <name>) [--dir <path>] [--remote <url>]`
118
- — Edit a kind's schema — add/remove a declared field or enum value on its convention (idempotent)
119
- - `superbee recipes [--dir <path>] [--remote <url>]`
120
- — Browse built-in recipes before or after init; with a bundle, also show whether each is already applied
121
- - `superbee recipe add <name-or-path> [--dir <path>] [--remote <url>]`
122
- — Apply a recipe's content-free definitions — Kinds plus optional declared References and Views — idempotently
123
-
124
- ### Remote
125
-
126
- - `superbee serve [--dir <path>] [--host <h>] [--port <p>]`
127
- — Boot the reference wire-protocol server over a local bundle (loopback, no auth)
128
- - `superbee ui [--dir <path> | --remote <url>] [--port <p>] [--open]`
129
- — Boot the local web UI over the bundle (same origin, loopback-only): READ the bundle's docs as rendered pages (frontmatter, cross-links you can follow, derived backlinks), LAUNCH its registered Views (type: View docs framed in sandboxed iframes with live updates; legacy Page-typed docs no longer register — see status's legacy_naming finding), and see a live activity feed, the bundle's sharing status, and your registered workspaces. The header shows the bundle's display name — derived from the project folder unless set explicitly: doc write docs/bundle --type "Bundle Name" --title "<name>"
130
- - `superbee mcp [install|status|uninstall | --dir <path>]`
131
- — Run the local MCP Apps adapter, or explicitly install, inspect, and uninstall its user-level registration for Codex/ChatGPT, Claude Code, Claude Desktop, and OpenCode
132
- - `superbee view list [--limit <n>] [--dir <path> | --remote <url>]`
133
- — List the bundle's registered durable Views from the same catalog used by the web launcher and MCP list_views
134
- - `superbee sync [--establish [--yes] | --pull-only | --show-incoming <id> [--out <file>]] [--dir <path>] [--limit <n>]`
135
- — Share the board branch with a remote — commits, pulls, and pushes (git tier; --pull-only skips commit+push). `init` makes a LOCAL bundle; --establish is the separate, explicit act that starts sharing it (creates the board branch, pushes; never automatic). A bundle folder already committed on the code branch is the same flag's hard case: preview first, --yes executes, and the folder's removal from the code branch rides a prepared side-branch commit you push and open as a PR. A bundle committed with code and NO board branch anywhere is the IN-TREE mode (read-side): full sync refuses (sharing rides your normal commit/push), --pull-only fetches the branch's tracking upstream and reports incoming board docs ('git pull' delivers them), and --establish converts to a dedicated board branch. A doc changed on both sides converges: teammate's version kept, yours exported; --show-incoming <id> (exclusive with --pull-only) prints the incoming version as of the last fetch. Board-reading commands (list/doc read/status/home/link show) auto-run the ff-only pull when board state is >~5m stale — silent, bounded (~2s), never a push; SUPERBEE_NO_AUTOPULL=<any value, even 0> disables it
136
-
137
- ### Session
138
-
139
- - `superbee version [--check] [--tag latest|next] [--json]`
140
- — Show the complete local build/runtime identity, or perform one bounded read-only comparison against npm's exact latest/next release policy
141
- - `superbee session-start [--dir <path>] [--no-update-check]`
142
- — The SessionStart hook payload: pull then render; default TOON uses a nonblocking 24-hour cached latest check, while --no-update-check or SUPERBEE_NO_UPDATE_CHECK/NO_UPDATE_NOTIFIER/CI presence disables both display and refresh (legacy ASLITE_NO_UPDATE_CHECK remains supported); npm receives only the public package request and ordinary network metadata, never installed version, cwd, bundle, actor, or usage data
143
- - `superbee hook install|status|uninstall [--scope project|user]`
144
- — Install the SessionStart hook (runs session-start: pull the board, then render) for Claude Code, Codex, OpenCode
145
- - `superbee skill install|status|uninstall [--scope project|user]`
146
- — Install this package's Agent Skill (SKILL.md + references/) into Claude Code and Codex skill folders (OpenCode has no skill surface — its integration is `hook install`); manifest-tracked, idempotent, refuses folders it does not manage
147
- - `superbee setup [migrate-state] [--host codex|claude-code|claude-desktop|opencode] [--scope project|user] [--json]`
148
- — Inspect npm, private state, Skill, Hook, MCP, bundle, and catalog readiness, then emit one deterministic safe next command
149
-
150
- ## Workspaces — the project's bundle lives at `.superbee/` in the project root
151
-
152
- Unless the user directs otherwise, a project's workspace bundle lives in a `.superbee/`
153
- folder at the project root. Two verbs, two different jobs — `init` always creates a LOCAL
154
- bundle (solo use is first-class, nothing forces sharing); `sync` is how a project's board
155
- becomes — or stays — shared memory across clones and teammates. Three modes:
156
-
157
- - **A local-only board** — `init` creates a bundle that doesn't exist anywhere yet, and it
158
- stays LOCAL until someone chooses to share it. This is a first-class mode, not a limbo:
159
- everything works offline and remote-free, and board changes stay on this machine. A bare
160
- `sync` on a local-only bundle reports that state honestly (its note points at `--establish`)
161
- — it never establishes on its own, which would silently publish a bundle nobody asked to
162
- share.
163
- - **Joining an existing shared board** — if `.superbee/` or a legacy `.agentstate-lite/` is already in the clone, there
164
- is NOTHING to set up. If it isn't but the project already shares its board (the repo's
165
- remote has a `board` branch), `sync` is the setup verb — run it once and it creates the
166
- folder and pulls the shared state. NEVER init a project that already has a workspace: that
167
- creates a divergent second bundle.
168
- - **Sharing a board (`sync --establish`, once)** — the explicit act that publishes a local
169
- bundle as the repo's `board` branch; teammates then just run `sync` to join. It handles
170
- both shapes: an uncommitted local folder is snapshotted, pushed, and converted in place;
171
- a folder ALREADY COMMITTED on the code branch gets a preview first — re-run with `--yes`
172
- to execute, which also prepares a cleanup commit on a side branch that you push and open
173
- as a PR (it removes the folder from the code branch; the board branch takes over after the
174
- merge). If origin cannot be checked, `sync` reports the shared-board state as unknown and
175
- waits for a retry instead of recommending publication.
176
-
177
- ```sh
178
- superbee sync # existing shared project — provisions the board; a local-only bundle reports its state
179
- superbee init --create-only --dir .superbee # greenfield — creates one genuinely new LOCAL bundle
180
- superbee sync --establish # establish a new shared board after user approval
181
- ```
182
-
183
- That's the whole setup. The CLI discovers the conventional folder on its own (the way git
184
- finds `.git`), so every command runs BARE from anywhere in the project tree — no flags, no
185
- config files:
186
-
187
- ```sh
188
- superbee list
189
- superbee doc read context-notes/cycle-1
190
- ```
191
-
192
- Surfaces that label the workspace (the `ui` header, home's bundle block) derive its DISPLAY
193
- NAME from the project folder's name. To set it explicitly (it syncs to teammates with the
194
- board), write the well-known name doc — its title becomes the display name:
195
-
196
- ```sh
197
- superbee doc write docs/bundle --type "Bundle Name" --title "<display name>"
198
- superbee doc update docs/bundle --title "<new name>" # rename later
199
- ```
200
-
201
- The folder is LOCAL until you choose to share it: `superbee sync --establish` (once) publishes it
202
- onto its own `board` branch — from then on `sync` commits and pushes board changes itself, never
203
- batched with code. Until established, the bundle stays local — a fully supported mode, not a
204
- temporary one: everything works offline and remote-free, and board changes stay on this machine
205
- (either left uncommitted, or committed directly on the code branch like any other file,
206
- whichever the user prefers). (Gitignore the folder only if the workspace should stay private
207
- to this machine.)
208
-
209
- Write with attribution: set `SUPERBEE_ACTOR=<your-name>` once for `new`, `doc write`,
210
- `doc update`, and `link add`, or pass `--actor <your-name>` per command (the flag wins).
211
- Existing `AGENTSTATE_LITE_ACTOR` settings remain supported as a compatibility input.
212
- With neither source, no advisory actor label is stored in frontmatter or sent as an agent label;
213
- backend history still reports its own principal (for example, the local OS owner or an
214
- authenticated remote user). A present-but-blank flag or environment value is a usage error.
215
- Advisory attribution describes a real mutation and never creates a no-op write.
216
- Actor labels are advisory metadata, not authentication or authorization credentials.
217
-
218
- Each invocation is stateless. HTTP is activated only by explicit `--remote <url>`.
219
- Otherwise bundle resolution stays local: explicit `--dir` → nearest `.superbee.json` or
220
- supported `.agentstate.json` local-path binding up-tree → the cwd walk, which at each
221
- ancestor checks both binding names together (both at one level fail closed), then the
222
- directory's own `index.md`, then its
223
- conventional `.superbee/index.md` or legacy `.agentstate-lite/index.md`. Reserve `--dir` for the exceptions: a bundle outside
224
- If both conventional directories contain valid bundles at one project level, discovery refuses with a conflict; move the bundle you do not intend to use outside the project before retrying.
225
- any project, a second workspace, or reaching another project's bundle from elsewhere.
226
-
227
- Two things override the default:
228
-
229
- 1. **Explicit user direction** — the user names a directory or a `--remote`; use that. A local
230
- `.superbee.json` binding (`{ "bundle": "<path>" }` at the project root) is the
231
- preferred durable form; existing `.agentstate.json` bindings remain supported. A binding
232
- beats the conventional folder; both binding names at one level are a conflict.
233
- Remote URLs are never durable ambient bindings; pass `--remote <url>` per invocation.
234
- 2. **An existing workspace** — if a bare command already resolves (a binding, an enclosing
235
- bundle, or a conventional folder exists up-tree), that IS this project's workspace — use
236
- it rather than creating a second one.
237
-
238
- If the user wants the workspace PRIVATE to their machine instead of shared (a personal
239
- scratch workspace), keep the bundle OUT of the repo (e.g. under `~/superbee-workspaces/<name>/`)
240
- and point a git-excluded `.superbee.json` at it. Choose by one question: do teammates
241
- share this bundle? When the user's intent is ambiguous, ask rather than defaulting silently.
242
-
243
- Do not raise a sharing decision during ordinary local work. When the user names teammates,
244
- a shared board, a handoff, synchronization, or cross-clone coordination, use Superbee's
245
- built-in board path: run `sync` to join an existing `origin/board`; if none exists, explain
246
- that `sync --establish` creates it and offer to run that explicit one-time operation. If the
247
- user prefers an in-tree bundle, custom Git branch/path, or another sharing mechanism, surface
248
- the tradeoff and record that explicit choice; never silently substitute one for Superbee sync.
249
-
250
- ## Typical flow
251
-
252
- ```sh
253
- # One-time setup at the project root (see the Workspaces section) — run ONE of these:
254
- superbee sync # existing project that shares a board — sets up AND pulls the shared board
255
- superbee init --create-only --dir .superbee # GREENFIELD — never on a project that already has a workspace; makes a LOCAL bundle
256
-
257
- # If collaboration is requested, offer the explicit one-time shared-board operation:
258
- superbee sync --establish
259
-
260
- # Everything after runs bare, from anywhere in the project tree
261
- # Create a complete context note (an OKF concept) for the next session in one command
262
- superbee new "Context Note" cycle-1 --title "cycle-1" --body '# Summary
263
-
264
- What this session did and what comes next' --actor <your-name>
265
-
266
- # Read it back
267
- superbee doc read context-notes/cycle-1
268
-
269
- # Store a doc, cross-link it, and query the bundle
270
- superbee doc write specs/auth --type Spec --title "Auth" --body "…" --actor <your-name>
271
- superbee link add specs/auth context-notes/cycle-1
272
- superbee list --type Spec
273
-
274
- # For a shared board, sync after a unit of work; local-only work stays complete locally
275
- # (safe everywhere: a local-only board reports its state; outside any workspace it prints
276
- # "sync: nothing to sync" — in both cases nothing is committed or pushed)
277
- superbee sync
278
- ```
279
-
280
- ## Sharing the board — `sync`
281
-
282
- Ordinary `superbee sync` shares your board — commits your changes, pulls your teammate's, pushes yours,
283
- while leaving code-project files untouched.
284
-
285
- On a shared board, run it whenever you close a unit of work — a task finished, a decision recorded, a session
286
- ending. Local-only work remains complete locally. Three known empty states (all exit 0):
287
- in an ordinary directory outside any git repo or workspace it prints `sync: nothing to sync`
288
- (inside Superbee's private user-state root it refuses — that is a conflict, not an empty
289
- state); a LOCAL-ONLY board (a
290
- bundle with no shared `board` branch — a supported mode) reports itself as local-only, with
291
- nothing committed, pulled, or pushed, and its note points at `--establish` — but bare `sync`
292
- NEVER establishes on its own (that would silently publish a bundle nobody asked to share);
293
- a clean, already-current shared board prints `sync: already up to date`.
294
- If origin cannot be checked and no board ref is available, sync reports the remote state as
295
- unknown and recommends retrying before `--establish`.
296
-
297
- `sync --establish` is the one explicit, one-time act that starts sharing a project's local
298
- bundle: it snapshots and publishes the bundle, checks out the `board` branch at the same path,
299
- and appends that path to the root working-tree `.gitignore`; teammates then just run plain
300
- `sync` to join. Never run it on a project that already shares a board (it
301
- detects that state, notes `already established`, and proceeds as an ordinary sync instead of
302
- erroring).
303
-
304
- The same flag handles a bundle folder ALREADY COMMITTED on the code branch: `sync --establish`
305
- prints a preview and changes nothing; `sync --establish --yes` creates the `board` branch from
306
- the folder's current files (files only — the folder's history stays on the code branch),
307
- pushes it, and prepares ONE commit on a local `board-cleanup` branch that removes the folder
308
- from the code branch and gitignores it — you push that branch and open the PR yourself;
309
- nothing on the code branch is pushed or changed. Until that PR merges, the old committed
310
- folder is a frozen read-only snapshot; after the merge, `git pull` then `sync` brings the
311
- live board back on every clone.
312
-
313
- Sharing is an explicit act: nothing ever creates or publishes a board branch on its own —
314
- only `sync --establish` does. The session-start hook and the read-time refresh below only
315
- ever PULL an already-shared board (bounded, fast-forward, never a push); your changes leave
316
- the machine only when you run `sync`.
317
-
318
- When a doc changed on BOTH sides, sync converges instead of stopping: your teammate's version
319
- is kept on the board, YOURS is saved to an export file named in the receipt, and the run
320
- exits 5 with one row per conflicted doc. Reconcile with the doc verbs, never git:
321
-
322
- ```sh
323
- superbee sync --show-incoming <id> # view the kept incoming version (as of the last fetch)
324
- superbee doc update <id> --body-file <export-file> # write your merged version on top
325
- superbee sync # share it
326
- ```
327
-
328
- `sync --pull-only` picks up teammates' changes without publishing local ones. If a push fails
329
- (offline, auth), your work is already committed locally — re-running sync retries the push.
330
-
331
- Reads stay fresh on their own: board-reading commands (`list`, `doc read`, `status`, `home`,
332
- `link show`) automatically run the same fast-forward-only pull when the board's state is older
333
- than ~5 minutes — silent, time-boxed (~2s), never a rebase, never a push, and it never sets a
334
- board up (that stays `sync`'s job) — so a plain `list` can advance the board checkout's HEAD.
335
- Your OWN changes still only leave the machine when you run `sync`. To disable the auto-pull
336
- (CI, scripted runs), set `SUPERBEE_NO_AUTOPULL` to any non-empty value — even `0`
337
- disables it; the variable's presence is the switch.
338
- Legacy `AGENTSTATE_LITE_NO_AUTOPULL` remains supported with the same presence semantics.
339
-
340
- On projects that share their board you may notice a `board` branch in the repo's GitHub —
341
- that's the board; it never merges into main (it has no common history with it, by design).
342
- Protect it like main: enable delete and force-push protection on `board` in the repo settings
343
- — sync only ever appends commits to it.
344
-
345
- ## Remote bundle access (--remote, serve)
346
-
347
- Remote bundle access remains explicit and wired the same way as `--dir`: use `serve` to expose
348
- a local bundle over the wire protocol, or pass `--remote <url>` to a bundle-facing command.
349
- For an authenticated remote, provide `SUPERBEE_API_KEY`; an already-provisioned
350
- stored per-origin credential is also consumed when present. Legacy `AGENTSTATE_LITE_API_KEY`
351
- remains supported as a compatibility input. Account and admin credential
352
- provisioning is outside the default CLI surface.
353
-
354
- ```bash
355
- superbee serve --dir ./my-bundle --port 4818 &
356
- superbee list --remote http://127.0.0.1:4818
357
- ```
358
-
359
- ## Shipped references — worked examples & contracts alongside this file
360
-
361
- A few capabilities below (bundle views, custom recipes) are backed by a full contract or a
362
- worked example shipped in this package's `references/` folder rather than inlined here. The
363
- folder sits NEXT TO this SKILL.md — in the npm package root, and in any host skill folder
364
- this file is installed into (`superbee skill install`).
365
-
366
- Shell commands resolve paths against YOUR working directory, not this file's folder, so set
367
- `$REFS` once per session: your host names this skill's base directory when it loads it
368
- (e.g. "Base directory for this skill: <path>"). Use that:
369
-
370
- ```bash
371
- REFS="<skill-base-dir>/references" # substitute the base directory your host reported
372
- ```
373
-
374
- Every `$REFS/…` path below then runs from any cwd. Each shipped file is a byte-for-byte copy
375
- of the matching file in the CLI's own repo — one authority, regenerated on every release,
376
- never hand-duplicated.
377
-
378
- ## Bundle views — ship a live UI as bundle content
379
-
380
- A **bundle view** is a self-contained HTML file living IN the bundle: promoted as a blob under
381
- `views/…`, declared by a `type: View` registry doc (`title`, `entry`, `access` — the legacy
382
- `bridge` spelling is no longer read: a doc declaring only `bridge` resolves to `access: none`,
383
- so author with `access`), and rendered by
384
- `superbee ui` inside a sandboxed, opaque-origin iframe. A data-bearing View is executable
385
- code: the shell requires local approval of its exact bytes and declared access, and changed
386
- bytes ask again. The sandbox and CSP deny direct credentials/data-API access and restrict
387
- ordinary network APIs as defense-in-depth; approval remains the decision to trust the View's
388
- source. Bundle data flows only through the narrow postMessage bridge to the trusted shell.
389
- (`Page` is the legacy name and no longer registers: the launcher ignores `type: Page` docs.
390
- `superbee status` lists legacy-named docs under its legacy_naming finding, and the
391
- repo's migrate-legacy-view-names script renames legacy content in place; docs under the
392
- legacy `pages-registry/`/`pages/` folders stay recognized once typed `View`.)
393
-
394
- The bridge (protocol `v0`) has six read-only data request types: `hello` (bundle identity), `query`
395
- (frontmatter-filtered rows — the same head projection `list` uses), `read` (one doc), `render-document`
396
- (the shared bounded Markdown presentation for one canonical doc), `edges` (the general
397
- from/to/text graph query — backlinks and containment both reduce to this), and `subscribe`
398
- (opt into a server-pushed `change` event whenever the watched bundle moves). There
399
- is no mutation message in v0 — read-only is enforced by construction. A View that declares
400
- `bundle-propose` may use the local-only v1 contract to propose ONE governed scalar-field
401
- change; the trusted shell revalidates it, shows canonical before/after values, and writes
402
- only after explicit human confirmation with hard CAS. The View never receives a write token.
403
- `open-page`
404
- (a wire verb, stable across the rename) is a separate fire-and-forget shell action available
405
- to every View capability; it opens only another valid registered View and returns none of
406
- that target's content or metadata.
407
-
408
- Author a view in four steps:
409
-
410
- ```bash
411
- # 1. write a self-contained views/my-view.html (inline CSS/JS, no external hosts),
412
- # embedding the bridge client copied from the shipped contract below
413
- superbee promote my-view.html --doc-key views/my-view.html # 2. promote the HTML blob
414
- superbee promote my-view-registry.md --doc-key views-registry/my-view.md # 3. promote its type: View doc (title, entry, access)
415
- superbee promote "$REFS/views/conventions/view.md" --doc-key conventions/view.md # 4. declare the View convention (once per bundle, ready-made)
416
- ```
417
-
418
- Full message shapes, the trust model, the copy-paste bridge client with safe live-refresh
419
- examples (including a live graph view over Roadmap Items) are in the shipped contract:
420
-
421
- ```bash
422
- cat "$REFS/views/references/view-authoring-v0.md"
423
- ```
424
-
425
- ## Human review
426
-
427
- When you create or materially revise a bundle document for human review, display it when the
428
- human asks and otherwise offer once. In an MCP Apps host, call `list_workspaces` when needed,
429
- then `show_document` with the exact workspace label or ID and document ID; do not return only
430
- a filesystem path. In fixed `mcp --dir` compatibility mode, the workspace argument is omitted.
431
- To present an existing interactive View, call `list_views` and then `show_view` with that same
432
- workspace and the exact View ID; later View lifecycle calls use only the returned launch ID.
433
- Outside an MCP Apps host, run
434
- `superbee doc open <id>` to open that exact document in the existing browser reader.
435
-
436
- ## Notes
437
-
438
- - `doc read <id>` truncates a large body and points at `doc read <id> --out <file>`, which streams
439
- the raw markdown bytes to disk without loading them into the model context window.
440
- - To revise body prose without parsing YAML, run `doc read <id> --body-out <file> --json`; edit the
441
- file, then pass it to `doc update <id> --body-file <file> --expected-version <receipt-version>`.
442
- The body-out receipt's version comes from the same read, so this is a safe CAS edit cycle.
443
- - Mutations are idempotent: re-writing a doc or re-adding an existing link is a no-op (exit 0).
444
- - `new` and `doc update` accept a kind's declared fields as `--<field> <value>` (e.g. `--progress_status done`);
445
- an unknown field or an out-of-enum value is rejected (exit 2). Run `kinds` to see a kind's fields.
446
- - `hook install` registers a SessionStart hook (Claude Code, Codex, OpenCode) that runs
447
- `session-start`: a quick best-effort pull of the shared board, then the home view — so a new
448
- session starts with the bundle's state AND any teammate changes already in context. Offline is
449
- fine: the render always appears, labeled with the last known state. A global npm install binds
450
- absolute Node and CLI paths, so GUI sessions do not depend on their inherited PATH. If you
451
- installed the hook before `session-start` existed, re-run `hook install` once to upgrade it.
452
- - Edit a doc's body through `doc update --body-file` (or `--body`), never by pulling the raw file
453
- with `--out`, editing it with text tools, and re-promoting it — that risks corrupting the
454
- frontmatter (the engine rejects it, but the right tool avoids the dance entirely).
455
- - Writing a custom recipe: a worked example (the `Claim` kind — event-lifecycle findings with
456
- provenance, composed from lite primitives) ships at `$REFS/recipes/claims/`; copy its shape,
457
- then `superbee recipe add <folder>` to apply it (built-in recipes are named directly, e.g.
458
- `superbee recipe add work-tracking`).
459
- - Packaging a content-free cognitive ecosystem: `$REFS/recipes/review-workflow/` carries a
460
- self-describing Review Request kind plus a generic live View, but no review instances. A
461
- definitions-only recipe may contain only its manifest, convention docs, explicitly declared
462
- static Reference docs, and View registry/HTML pairs; install it with the same `recipe add <folder>` command.
463
- - A full interop-shaped example bundle (externally-authored markdown: unquoted timestamps,
464
- relative links, wrapped bullets) ships at `$REFS/sample-bundle/` — copy it and point `--dir` at
465
- the copy to explore a populated bundle without writing one from scratch.
92
+ <!-- GENERATED by packages/cli/scripts/gen-skill.mjs — do not edit by hand. -->