@storybloq/storybloq 1.5.2 → 1.7.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/NOTICE ADDED
@@ -0,0 +1 @@
1
+ Required Notice: Copyright (c) 2026 Amir Shayegh / Storybloq (https://storybloq.com)
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  <p align="center">
8
8
  <strong>Cross-session context persistence for AI coding.</strong><br />
9
- A file convention, a CLI, an MCP server, and a Claude Code skill that together turn every coding session into a building block instead of a reset.
9
+ A file convention, a CLI, an MCP server, and Claude Code/Codex skills that together turn every coding session into a building block instead of a reset.
10
10
  </p>
11
11
 
12
12
  <p align="center">
@@ -14,6 +14,7 @@
14
14
  <a href="https://github.com/Storybloq/storybloq/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-PolyForm--Shield%201.0-blue" alt="License" /></a>
15
15
  <img src="https://img.shields.io/badge/node-%E2%89%A520-brightgreen" alt="Node" />
16
16
  <img src="https://img.shields.io/badge/claude%20code-compatible-orange" alt="Claude Code compatible" />
17
+ <img src="https://img.shields.io/badge/codex-compatible-111" alt="Codex compatible" />
17
18
  </p>
18
19
 
19
20
  <p align="center">
@@ -24,7 +25,7 @@
24
25
  </p>
25
26
 
26
27
  <p align="center">
27
- <img src="https://raw.githubusercontent.com/Storybloq/storybloq/main/assets/hero.png" alt="Storybloq Mac app showing a live project sidebar alongside a Claude Code terminal" />
28
+ <img src="https://raw.githubusercontent.com/Storybloq/storybloq/main/assets/hero.png" alt="Storybloq Mac app showing a live project sidebar alongside an AI coding terminal" />
28
29
  </p>
29
30
 
30
31
  ---
@@ -40,7 +41,7 @@ The real cost isn't wasted setup time. It's repeated mistakes, relitigated desig
40
41
  Every project gets a `.story/` directory of JSON and markdown files. Tickets, issues, roadmap phases, session handovers, and lessons learned all live there, tracked by git, readable by any AI.
41
42
 
42
43
  - **CLI:** `storybloq` - inspect and mutate `.story/` from the terminal.
43
- - **MCP server:** 53 tools Claude Code and Codex can call directly, no subprocess spawning.
44
+ - **MCP server:** structured tools Claude Code and Codex can call directly, with five additional tools when the local Bus is enabled. No subprocess spawning.
44
45
  - **Skill:** `/story` in Claude Code or `$story` in Codex loads project state at the start of every session.
45
46
  - **Mac app:** native sidebar that watches `.story/` and updates live while your AI client works (separate product, free on the App Store).
46
47
 
@@ -53,7 +54,7 @@ storybloq setup --client all
53
54
 
54
55
  Requires Node.js 20+ and at least one AI client: Claude Code or Codex CLI 0.130.0+. Package lives on npm at [**@storybloq/storybloq**](https://www.npmjs.com/package/@storybloq/storybloq); releases are tagged on this repo at [github.com/Storybloq/storybloq/releases](https://github.com/Storybloq/storybloq/releases).
55
56
 
56
- `setup --client all` installs the Storybloq skill for Claude and Codex, registers this package as an MCP server, and configures available client hooks. Re-running it is safe. `setup-skill` remains as a compatibility alias for Claude-only setup.
57
+ `setup --client all` installs the Storybloq skill for Claude and Codex, registers this package as an MCP server, and configures available client hooks. Re-running it is safe. Codex reports installed hooks with trust `unknown`; open `/hooks` in Codex to review and trust them. `setup-skill` remains as a compatibility alias for Claude-only setup.
57
58
 
58
59
  ## Upgrading
59
60
 
@@ -106,15 +107,38 @@ Commit everything except `.story/snapshots/`.
106
107
 
107
108
  ## Daily use
108
109
 
109
- Inside Claude Code:
110
+ Inside Claude Code or Codex:
110
111
 
111
- - **`/story`** - loads project status, reads the latest handover, surfaces open tickets and issues, lists blocked work, summarizes recent changes. When the client can run background agents and the actionable backlog is large, it also surfaces the orchestrate working style proactively (a recommendation, still gated by explicit opt-in).
112
- - **`/story auto T-001 T-002 ISS-013`** - autonomous mode scoped to those items. Drives a ticket through plan -> plan review -> implement -> tests -> code review -> commit with handovers at each checkpoint.
113
- - **`/story review T-001`** - runs the multi-lens review (see [Storybloq/lenses](https://github.com/Storybloq/lenses)) against a ticket's diff.
114
- - **`/story orchestrate`** - drives a multi-repo (or large single-repo) backlog as an orchestrator: scouts verify state, enrichment agents rewrite items into byte-verified specs, a cheaper tier implements when the client offers one, and the session model reviews and gates every ship.
115
- - **`/story handover`** - writes a session handover capturing decisions, blockers, and next steps.
112
+ - **`/story` in Claude Code or `$story` in Codex** - loads project status, reads the latest handover, surfaces open tickets and issues, lists blocked work, summarizes recent changes. When the client can run background agents and the actionable backlog is large, it also surfaces the orchestrate working style proactively (a recommendation, still gated by explicit opt-in).
113
+ - **`/story auto T-001 T-002 ISS-013` / `$story auto T-001 T-002 ISS-013`** - autonomous mode scoped to those items. Drives a ticket through plan -> plan review -> implement -> tests -> code review -> commit with handovers at each checkpoint.
114
+ - **`/story review T-001` / `$story review T-001`** - runs the multi-lens review (see [Storybloq/lenses](https://github.com/Storybloq/lenses)) against a ticket's diff.
115
+ - **`/story orchestrate` / `$story orchestrate`** - drives a multi-repo (or large single-repo) backlog when the client exposes exact callable workflow/subagent tools. Codex uses `multi_agent_v1.spawn_agent`, its normalized `multi_agent_v1__spawn_agent` identifier, or an exact `spawn_agent` tool. The Claude Agent View-backed `storybloq dispatch` command is shipped; a product-managed Codex dispatch backend is not.
116
+ - **`/story bus` / `$story bus`** - polls a task-bound local Bus endpoint so an implementer and an independent reviewer can exchange advisory findings without copy and paste.
117
+ - **`/story handover` / `$story handover`** - writes a session handover capturing decisions, blockers, and next steps.
116
118
 
117
- Outside Claude Code, the same state is one `storybloq` invocation away.
119
+ Both clients support context loading, autonomous mode, MCP, and compaction/status hooks. Codex Desktop can open an autonomous session's owning task and relay an exact owner response to it; Codex CLI safely falls back to a manual task switch. Autonomous code review defaults to a 12-round landing cap (clamped upward by ticket risk): unresolved critical findings and rejects still block, while non-blocking findings become follow-up issues at the cap. Set `recipeOverrides.stages.CODE_REVIEW.maxReviewRounds` to `0` to disable the cap explicitly.
120
+
121
+ `recipeOverrides.compactThreshold` accepts `medium`, `high` (default), or `critical`. The value selects both the pressure limits and the rotation trigger: `medium` uses lower limits and rotates at medium pressure, while `critical` uses higher limits and waits for critical pressure. At a clean COMPLETE boundary, threshold pressure ends the bounded session through HANDOVER because Storybloq cannot invoke a client compaction command. When the client itself compacts, the PreCompact and SessionStart hooks preserve the same session; pressure resets only after SessionStart confirms `source: compact`.
122
+
123
+ Outside the AI client, the same state is one `storybloq` invocation away.
124
+
125
+ ## Storybloq Bus
126
+
127
+ Storybloq Bus is an optional local coordination protocol for one implementer task and one reviewer task. Runtime state lives under gitignored `.story/bus/`; confirmed findings still become canonical Storybloq issues with durable source provenance before they are sent as issue notices.
128
+
129
+ ```bash
130
+ storybloq bus init
131
+ storybloq bus join implementer --client codex
132
+ storybloq bus join reviewer --client claude
133
+ storybloq bus hooks enable --client codex
134
+ storybloq bus hooks enable --client claude
135
+ ```
136
+
137
+ Bus runtime is local and gitignored, so run `storybloq bus init` once in each checkout that will participate. Status and doctor report a fresh checkout as enabled but not initialized; that healthy inactive state does not block commits or autonomous FINALIZE. Other Bus commands and MCP tools never initialize the runtime implicitly. Initialization rejects symlinked ignore files and negation patterns because it cannot safely prove that Git will exclude the complete runtime otherwise.
138
+
139
+ The foreground protocol includes send, poll, acknowledge, thread state, status, doctor, export, and ship checks. Messages are hash-chained, idempotent, bounded, task-bound, secret-screened, and delivered through crash-recoverable recipient mailboxes. Critical messages require a matching unresolved critical issue by default. Bus text is always peer-agent advice: it never grants owner approval or authorizes merge, push, signing, deployment, credentials, spending, or destructive actions.
140
+
141
+ V1 does not include a daemon, process spawning, headless resume, or automatic offline wake. Natural SessionStart/Stop hooks and explicit polling are the delivery paths. Codex Desktop remains non-wakeable.
118
142
 
119
143
  <p align="center">
120
144
  <img src="https://raw.githubusercontent.com/Storybloq/storybloq/main/assets/autonomous.png" alt="Autonomous mode running a ticket through plan, implement, test, review" />
@@ -160,7 +184,7 @@ All commands accept `--format json|md` (default `md`). Pipe JSON through `jq` fo
160
184
  |---------|-------------|
161
185
  | `storybloq init [--name] [--type orchestrator] [--force]` | Scaffold `.story/` (add `--type orchestrator` for multi-repo) |
162
186
  | `storybloq status` | Project summary with phase statuses, counts, and risks |
163
- | `storybloq validate` | Reference integrity + schema checks |
187
+ | `storybloq validate [--integrity-only]` | Reference, schema, source-provenance, and loader-independent JSON checks |
164
188
  | `storybloq setup --client claude\|codex\|all [--skip-hooks]` | Install Storybloq skills, register MCP, and configure client hooks |
165
189
  | `storybloq setup-skill [--skip-hooks]` | Compatibility alias for `storybloq setup --client claude` |
166
190
  | `storybloq recommend --count N` | Context-aware work suggestions |
@@ -196,8 +220,8 @@ All commands accept `--format json|md` (default `md`). Pipe JSON through `jq` fo
196
220
  |---------|-------------|
197
221
  | `storybloq issue list [--status] [--severity] [--component] [--phase]` | List issues |
198
222
  | `storybloq issue get <id>` | Issue detail |
199
- | `storybloq issue create --title --severity --impact [--components] [--related-tickets] [--location]` | Create |
200
- | `storybloq issue update <id> [--status] [--title] [--severity] ...` | Update |
223
+ | `storybloq issue create --title --severity --impact [--components] [--related-tickets] [--location] [--source-ref <json>] [--dedupe-key] [--created-by]` | Create, with optional durable review evidence and retry identity |
224
+ | `storybloq issue update <id> [--status] [--title] [--severity] [--source-ref <json>] ...` | Update |
201
225
  | `storybloq issue meta get\|set\|unset <id> [path] [value]` | Manage custom passthrough metadata |
202
226
  | `storybloq issue delete <id>` | Delete |
203
227
 
@@ -219,6 +243,21 @@ All commands accept `--format json|md` (default `md`). Pipe JSON through `jq` fo
219
243
  | `storybloq snapshot` · `storybloq recap` | Capture state and diff against the last snapshot |
220
244
  | `storybloq export [--phase <id>] [--all] [--format json\|md]` | Self-contained project document |
221
245
 
246
+ ### Storybloq Bus (opt-in)
247
+
248
+ | Command | Description |
249
+ |---------|-------------|
250
+ | `storybloq bus init` | Enable the local Bus and create gitignored runtime state |
251
+ | `storybloq bus join implementer\|reviewer [--client] [--replace]` | Bind the current client task to one exclusive role |
252
+ | `storybloq bus send ...` | Create a thread or send a reply with a required idempotency key |
253
+ | `storybloq bus poll` | Read unacknowledged messages for the task-bound endpoint |
254
+ | `storybloq bus ack <message-id> --disposition ...` | Record accepted, rejected, or deferred delivery state |
255
+ | `storybloq bus thread show\|update ...` | Inspect or transition a participant thread |
256
+ | `storybloq bus hooks enable\|disable [--client]` | Control guarded live delivery for this project |
257
+ | `storybloq bus status\|doctor` | Inspect state and validate integrity |
258
+ | `storybloq bus check --ship` | Fail when critical Bus work blocks release |
259
+ | `storybloq bus export <thread-id>` | Explicitly export one runtime transcript |
260
+
222
261
  ### Federation (orchestrator projects)
223
262
 
224
263
  | Command | Description |
@@ -257,7 +296,7 @@ codex mcp add storybloq --env STORYBLOQ_CLIENT=codex -- storybloq --mcp
257
296
 
258
297
  The server imports the same TypeScript modules as the CLI directly, so there's no subprocess overhead. It auto-discovers the project root by walking up from the working directory to the nearest `.story/` parent.
259
298
 
260
- **53 tools** grouped by responsibility:
299
+ The base tools are grouped by responsibility. Bus-enabled projects register five additional tools at MCP process start; restart connected clients after `storybloq bus init`.
261
300
 
262
301
  ### Read (no side effects)
263
302
 
@@ -275,6 +314,12 @@ The server imports the same TypeScript modules as the CLI directly, so there's n
275
314
 
276
315
  `storybloq_session_report` · `storybloq_register_subprocess` · `storybloq_unregister_subprocess` surface session health to the Mac app.
277
316
 
317
+ ### Storybloq Bus (feature-gated)
318
+
319
+ `storybloq_bus_send` · `storybloq_bus_poll` · `storybloq_bus_ack` · `storybloq_bus_thread_get` · `storybloq_bus_thread_update`
320
+
321
+ Every call requires a stable endpoint id and the current validated client task id. Poll and thread outputs mark peer content as advisory authority. `storybloq_bus_poll` and `storybloq_bus_thread_get` are read-only with respect to canonical tracked project state; poll may reconcile gitignored `.story/bus/` runtime metadata. The other three retain normal MCP write approvals.
322
+
278
323
  ### Federation (orchestrator projects)
279
324
 
280
325
  `storybloq_node_init` bootstraps `.story/` in a node repo from the orchestrator context.
@@ -287,16 +332,16 @@ The server imports the same TypeScript modules as the CLI directly, so there's n
287
332
 
288
333
  ## Hooks
289
334
 
290
- ### PreCompact (Claude-only auto-snapshot, set up by setup)
335
+ ### PreCompact (compaction preparation, set up by setup)
291
336
 
292
- Runs `storybloq snapshot --quiet` before context compaction so `recap` always reflects the latest state. Manually:
337
+ Runs `storybloq session compact-prepare` before context compaction so snapshots and resume breadcrumbs stay current where the client supports PreCompact hooks. Codex setup uses `storybloq session compact-prepare --client codex` with a `manual|auto` matcher so a Codex hook cannot compact a Claude-owned session; Claude Code setup leaves the matcher empty.
293
338
 
294
339
  ```json
295
340
  {
296
341
  "hooks": {
297
342
  "PreCompact": [{
298
- "matcher": "",
299
- "hooks": [{ "type": "command", "command": "storybloq snapshot --quiet" }]
343
+ "matcher": "manual|auto",
344
+ "hooks": [{ "type": "command", "command": "storybloq session compact-prepare" }]
300
345
  }]
301
346
  }
302
347
  }
@@ -304,21 +349,23 @@ Runs `storybloq snapshot --quiet` before context compaction so `recap` always re
304
349
 
305
350
  Skip with `storybloq setup --client all --skip-hooks`.
306
351
 
307
- ### SessionStart (optional recap injection)
352
+ ### SessionStart (resume prompt injection)
308
353
 
309
- Auto-inject what changed since last snapshot:
354
+ Injects a compact-aware resume prompt. Codex setup uses the same command with `--codex-hook-json` and matcher `startup|resume|clear|compact`; its hook JSON also carries the current task id so same-task COMPACT recovery can continue without a copy/pasted Resume token. Hook trust cannot be verified by setup, so check `/hooks` in Codex after installation.
310
355
 
311
356
  ```json
312
357
  {
313
358
  "hooks": {
314
359
  "SessionStart": [{
315
- "matcher": "",
316
- "hooks": [{ "type": "command", "command": "storybloq recap --format md" }]
360
+ "matcher": "compact",
361
+ "hooks": [{ "type": "command", "command": "storybloq session resume-prompt" }]
317
362
  }]
318
363
  }
319
364
  }
320
365
  ```
321
366
 
367
+ `storybloq bus hooks enable` is a separate project opt-in. It adds endpoint metadata and pending counts to SessionStart, and permits the synchronous Stop hook to block once for each new mailbox cursor. Peer payload bytes never appear in hook output. Claude's shared hook structure is upgraded once and remains guarded by project-local policy; Codex uses `storybloq hook-status --client codex`.
368
+
322
369
  ## Library usage
323
370
 
324
371
  ```typescript
@@ -364,6 +411,15 @@ Full type definitions ship with the package (`exports.types`).
364
411
  "components": ["mac-app"],
365
412
  "impact": "Dragging tickets on trackpad requires multiple tries.",
366
413
  "location": ["macos/Views/KanbanCard.swift:42"],
414
+ "sourceRefs": [{
415
+ "path": "macos/Views/KanbanCard.swift",
416
+ "startLine": 42,
417
+ "revision": "5ac37f94f7023b18f72d8e3fcf43dd64f54c11d7",
418
+ "contentHash": "f5b1b1b65dca3d9d86adf7c5d49082aa4dc09e7903ab46ce50e8cc6b4812e4cf",
419
+ "reviewId": "review-2026-04-15"
420
+ }],
421
+ "dedupeKey": "review-2026-04-15:finding-3",
422
+ "createdBy": "external-reviewer",
367
423
  "discoveredDate": "2026-04-15",
368
424
  "resolvedDate": null,
369
425
  "relatedTickets": []
@@ -374,8 +430,16 @@ Each record is its own file. IDs are sequential within type (`T-001`, `T-002`, .
374
430
 
375
431
  Create operations are safe to run in parallel. ID assignment and the create write happen together under a project lock, so concurrent creators are serialized and each receives a distinct sequential ID. A create can never silently overwrite an existing record; under heavy simultaneous contention a creator fails loudly with an error rather than colliding.
376
432
 
433
+ Issue `sourceRefs` preserve review evidence independently of mutable `path:line` display strings. Storybloq hashes only the normalized referenced line range and never stores source excerpts. A supplied revision is resolved to a Git commit; otherwise Storybloq captures the working-tree range and records HEAD only when those bytes match. `storybloq validate` reports an error when original evidence cannot be resolved, a warning when valid historical evidence moved or changed at HEAD, and no finding when it still matches.
434
+
435
+ Use `storybloq validate --integrity-only` when damaged `config.json` or `roadmap.json` prevents normal loading. This read-only preflight scans every `.story/**/*.json` file in one pass, reports parser positions where available, and separates critical singleton failures from skippable item and auxiliary-file failures. It never rewrites damaged files.
436
+
437
+ Confirmed manual or external review findings should be filed directly as open issues. Search first, pass reviewer attribution in `createdBy`, attach the review ID and revision through `sourceRefs`, and use a stable `dedupeKey` such as `<review-id>:<finding-id>` so retries are idempotent. Keep uncertain design questions as notes or owner questions; the implementing agent owns issue status and resolution.
438
+
377
439
  Ticket and issue records preserve unknown JSON fields. Use `storybloq ticket meta` and `storybloq issue meta` to read or mutate those custom passthrough fields without touching core Storybloq fields. Values are JSON, and dot paths address nested objects, for example `storybloq ticket meta set T-001 integration.linear '"ABC-123"'`.
378
440
 
441
+ Autonomous plan-review depth can be seeded per ticket with `reviewRisk` metadata (`low`, `medium`, or `high`). For example, `storybloq ticket meta set T-001 reviewRisk '"high"'` requires at least three plan-review rounds. Legacy `risk` metadata is also recognized, but `reviewRisk` is the canonical key. This setting changes review depth only; it never skips a review stage.
442
+
379
443
  ## Example workflow
380
444
 
381
445
  ```bash
@@ -389,14 +453,14 @@ storybloq phase create --id bootstrap --name "Bootstrap" --label "PHASE 1" \
389
453
  # Add a ticket
390
454
  storybloq ticket create --title "Scaffold Next.js" --type task --phase bootstrap
391
455
 
392
- # Start Claude Code, type /story, then work on it
393
- # (or go autonomous: /story auto T-001)
456
+ # Start Claude Code and type /story, or invoke $story in Codex, then work on it
457
+ # (or go autonomous: /story auto T-001 / $story auto T-001)
394
458
 
395
459
  # At the end of a session, commit your changes including .story/
396
460
  git add .
397
461
  git commit -m "T-001: scaffold Next.js"
398
462
 
399
- # Session ends. Next session starts with /story and picks up with full context.
463
+ # Session ends. Next session starts with /story or $story and picks up with full context.
400
464
  ```
401
465
 
402
466
  ## Team mode
@@ -489,7 +553,7 @@ For team-mode projects, add CI validation to catch duplicate displayIds and stal
489
553
  ## Related projects
490
554
 
491
555
  - **[@storybloq/lenses](https://github.com/Storybloq/lenses)** - multi-lens code review MCP server and library. 9 specialized reviewers run in parallel and return structured verdicts; the storybloq autonomous lens backend consumes it directly.
492
- - **[Storybloq for Mac](https://apps.apple.com/us/app/storybloq/id6761348691)** - native macOS app that watches `.story/` and updates live while Claude works. Free on the Mac App Store.
556
+ - **[Storybloq for Mac](https://apps.apple.com/us/app/storybloq/id6761348691)** - native macOS app that watches `.story/` and updates live while your AI client works. Free on the Mac App Store.
493
557
 
494
558
  ## Contributing
495
559