@snarkipus/opencode-beads 1.0.2 → 1.1.0-beta.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/README.md CHANGED
@@ -7,23 +7,31 @@
7
7
 
8
8
  [Beads](https://github.com/gastownhall/beads) issue tracker integration for [OpenCode](https://opencode.ai).
9
9
 
10
- `@snarkipus/opencode-beads` is a maintained OpenCode adapter that gives OpenCode 2 the integration `bd setup claude` gives Claude Code: `bd prime` workflow context on every request, refreshed after compaction and when a session resumes, plus a bounded task agent that completes one Bead per invocation. It does not replace Beads: the installed `bd` CLI remains authoritative for issues, project initialization, skills, migrations, backups, and Dolt synchronization.
10
+ `@snarkipus/opencode-beads` is a maintained OpenCode adapter that gives OpenCode 2 the integration `bd setup claude` gives Claude Code: `bd prime` workflow context on every request, refreshed after compaction and when a session resumes, plus a bounded task agent. Published 1.0.2 completes one Bead per invocation; the published beta/next release follows the authorized scope. It does not replace Beads: the installed `bd` CLI remains authoritative for issues, project initialization, skills, migrations, backups, and Dolt synchronization.
11
11
 
12
12
  This is an independent project maintained by Matt Jackson under the MIT license. It began as a fork of [Josh Thomas's `opencode-beads`](https://github.com/joshuadavidthomas/opencode-beads), and the original work remains credited to its author. 1.0 rebuilt the plugin for OpenCode 2, and development now continues here independently. It vendors nothing from upstream Beads; instead, every Beads release is checked against the `bd` behavior the plugin relies on (see [Tracking upstream Beads](#tracking-upstream-beads)).
13
13
 
14
+ This release is **1.1.0-beta.2**, an opt-in beta targeting npm dist-tag `next`; its integration diagnostic command is `oc-beads:diagnostics`. Beta.1 used `oc-beads:status`; the rename is documented below. The beta's normal public entrypoint enables the eleven qualified operations in the native `beads` code-mode namespace on supported hosts: find, get, edges, memories, recall, claim, note, selected-field update, close, create and remember. No wrapper, internal dependency injection, manual skill copy or activation setting is needed. The opt-in is selecting the beta artifact. The published stable 1.0.2 package is unchanged.
15
+
16
+ Beta.2 registers 29 `oc-beads:<stem>` workflows plus `oc-beads:diagnostics` through ordinary native command registration and owns its packaged `oc-beads` skill at the installed path, with all 15 corpus resources plus CODE_MODE and ADR (17 links). User configuration/file commands retain native precedence on load and rebuild; removing an override restores the package definition. Other plugin conflicts follow native ordering. Diagnostics reports observed registration and name/description mismatches; identical-description overrides and public owner identity remain unobservable.
17
+
18
+ Typed registration requires the host tool, permission and session interfaces. The integration diagnostic command reports unavailable interfaces honestly; actual request capabilities, catalog discovery and per-operation permissions determine which operations can run. Native shell remains direct-only and cannot be called inside execute. Structured results preserve partial, failed and uncertain outcomes, and writes retain the actual session-and-agent Beads actor. Read [CODE_MODE.md](assets/oc-beads/resources/CODE_MODE.md) for composition and recovery.
19
+
20
+ All 16 implementation tasks have parent acceptance on exact OpenCode 2.1.1 / Beads 1.3.1. The [final acceptance record](docs/code-mode-final-acceptance-vuy9.md) and [bounded installed/model evaluation](docs/opencode-installed-model-continuation-vuy9.md) retain their historical candidates and probes; the published beta adds the public entrypoint and release-channel wiring. **Known limitation:** plain decline of a nested permission request does not stop the entire composition; a later independent operation can ask again. Use explicit Stop/Cancel to stop the composition. No token-saving, cross-provider checkpoint portability or multi-hour reliability claim is made.
21
+
14
22
  ## Design
15
23
 
16
- The plugin's primary design is **context-preserving atomic delegation**:
24
+ The published beta/next release uses scope-bounded task execution:
17
25
 
18
26
  - The primary OpenCode thread retains planning context, decisions, and control.
19
- - `beads-task-agent` processes exactly one Bead per invocation, then closes, blocks, or returns.
20
- - Without an external orchestrator, this intentionally trades broad autonomy for Bead atomicity and context preservation.
21
- - An orchestrator may repeat `select → delegate one Bead → verify → select next`, but should not weaken the worker boundary.
27
+ - An exact assignment or explicit one-bead mode stops with that item; read-only graph requests never authorize claims or writes.
28
+ - An already-authorized batch or goal may continue within scope, with an atomic claim, append checkpoints, validation and acceptance evidence for each Bead. Discovery does not expand that authority.
29
+ - Direct work or normal blocking delegation is chosen for the task. The actual executor actor follows claims, updates and heartbeats; handoffs are deliberate. Parent-owned acceptance and closure remain with the parent.
30
+ - Denied authority, cancellation, permission waits, blockers and incomplete acceptance remain visible stops. Child results do not restart work. The [current bounded semantic evidence](docs/opencode-installed-model-continuation-vuy9.md) measures these outcomes, with failed validation and partial work preserved; broader model quality and multi-hour reliability remain unmeasured.
22
31
 
23
32
  ## Installation
24
33
 
25
- This plugin requires OpenCode 2 and `bd` 1.3.0 or later.
26
-
34
+ The beta requires OpenCode `>=2.1.1 <2.2` and `bd` 1.3.1 or later. Exact OpenCode 2.1.1 has bounded native, Stop and installed/model evidence; other admitted 2.1 patches are not inferred qualified. The external `bd` CLI and project initialization remain prerequisites; the plugin does not install or upgrade them. Stable 1.0.2 remains separately qualified against OpenCode 2.0.26.
27
35
  1. Install the [`bd` CLI](https://github.com/gastownhall/beads/blob/main/docs/getting-started/installation.md) once on the host, then initialize each project:
28
36
 
29
37
  ```bash
@@ -31,19 +39,21 @@ This plugin requires OpenCode 2 and `bd` 1.3.0 or later.
31
39
  bd init
32
40
  ```
33
41
 
34
- `bd init` owns project initialization and creates the canonical shared Beads skill at `.agents/skills/beads`, which OpenCode discovers. It also writes a minimal Beads section to `AGENTS.md` that points to `bd prime`, the same pointer Beads gives Claude Code in `CLAUDE.md`. This plugin has no separate skill lifecycle and does not write startup files.
42
+ `bd init` owns project initialization and creates the canonical shared Beads skill at `.agents/skills/beads`, which OpenCode discovers. It also writes a minimal Beads section to `AGENTS.md` that points to `bd prime`, the same pointer Beads gives Claude Code in `CLAUDE.md`. The published stable package relies on that shared skill. The beta additionally owns its packaged `oc-beads` skill; it does not write startup files or change `.agents/skills/beads/SKILL.md`.
35
43
 
36
- 2. Add the version-pinned plugin to `~/.config/opencode/opencode.json` for every project, or to a project's `.opencode/opencode.json`:
44
+ 2. Add the published, version-pinned plugin to `~/.config/opencode/opencode.json` for every project, or to a project's `.opencode/opencode.json`:
37
45
 
38
46
  ```json
39
47
  {
40
- "plugins": ["@snarkipus/opencode-beads@1.0.2"]
48
+ "plugins": ["@snarkipus/opencode-beads@1.1.0-beta.2"]
41
49
  }
42
50
  ```
43
51
 
52
+ To follow the published beta channel, use `"plugins": ["@snarkipus/opencode-beads@next"]` instead. To stay on stable, use `"plugins": ["@snarkipus/opencode-beads@latest"]` (currently 1.0.2); do not select the beta. Stable promotion requires separate approval.
53
+
44
54
  OpenCode loads configuration changes automatically. Update the pin explicitly when upgrading; an unpinned package entry is less reproducible. OpenCode 1.x plugins are not supported; use 0.10.x or earlier there.
45
55
 
46
- 3. Check the install: `opencode debug agents` lists `beads-task-agent`.
56
+ 3. Check the beta.2 install: `opencode debug agents` lists `beads-task-agent`; `/oc-beads:diagnostics` reports native registration and observed capabilities. Discover `beads` through execute on a host/agent with the required permissions. An installation still pinned to beta.1 continues to use `/oc-beads:status` until explicitly upgraded.
47
57
 
48
58
  ### Plugin options
49
59
 
@@ -53,7 +63,7 @@ Plugin options use the object form:
53
63
  {
54
64
  "plugins": [
55
65
  {
56
- "package": "@snarkipus/opencode-beads@1.0.2",
66
+ "package": "@snarkipus/opencode-beads@1.1.0-beta.2",
57
67
  "options": { "luna": true, "autoMigrate": false }
58
68
  }
59
69
  ]
@@ -64,7 +74,7 @@ Plugin options use the object form:
64
74
  | --- | --- | --- |
65
75
  | `luna` | `false` | Also register the `beads-task-agent-luna` profile. |
66
76
  | `stealth` | `false` | Add `--stealth` to `bd prime` (no git operations in the session-close protocol), like `bd setup claude --stealth`. `bd config set no-git-ops true` is the project-level equivalent. |
67
- | `taskAgentSteps` | `100` | Hard cap on task-agent steps per invocation, a backstop for "one bead, then return". `0` removes the cap. |
77
+ | `taskAgentSteps` | `100` | Interruption cap on task-agent steps per invocation. `0` removes the cap; neither value changes authorized scope or establishes completion. |
68
78
  | `refreshAfterIdleMinutes` | `30` | Re-run `bd prime` when a session resumes after this much inactivity, as Claude Code does on resume. `0` disables idle refresh. |
69
79
  | `autoMigrate` | `false` | Let automatic `bd prime` open a store that may need a schema migration. See [Schema migration guard](#schema-migration-guard). |
70
80
 
@@ -89,25 +99,37 @@ The [Claude Code parity matrix](docs/claude-code-parity.md) records every `bd se
89
99
 
90
100
  ## Context injection
91
101
 
92
- The plugin runs `bd prime --full` in the project directory and attaches its output to each model request through OpenCode's session context hook. The output is cached per session, so prime runs once per session rather than per request. It runs again after compaction (automatic or manual), when a session resumes after `refreshAfterIdleMinutes` of inactivity, and when the plugin reloads, mirroring the `startup`, `resume`, `clear`, and `compact` sources of Claude Code's `SessionStart` hook. Steady work keeps the same text, which keeps provider prompt caches warm. Attached context is not stored in the conversation, so compaction cannot drop it. `--full` matters: without it, `bd` switches to brief MCP reminders whenever Claude Code's settings list a Beads MCP server, and OpenCode has no Beads MCP tool. Prime supplies the canonical current workflow, command guidance, and persistent memories; the plugin adds only compact OpenCode-specific safety and delegation guidance.
102
+ The plugin runs `bd prime --full` in the project directory and attaches its output to each model request through OpenCode's session context hook. Guarded prime is cached per session, while actual actor and request-capability guidance is rendered for each request. Prime runs once per session rather than per request. It runs again after compaction (automatic or manual), when a session resumes after `refreshAfterIdleMinutes` of inactivity, and when the plugin reloads, mirroring the `startup`, `resume`, `clear`, and `compact` sources of Claude Code's `SessionStart` hook. Steady work keeps the same text, which keeps provider prompt caches warm. Attached context is not stored in the conversation, so compaction cannot drop it. `--full` matters: without it, `bd` switches to brief MCP reminders whenever Claude Code's settings list a Beads MCP server, and OpenCode has no Beads MCP tool. Prime supplies the canonical current workflow, command guidance, and persistent memories; the plugin adds only compact OpenCode-specific safety and delegation guidance.
93
103
 
94
104
  While prime is attached, two bd-managed `AGENTS.md` blocks only repeat it: the full-profile section `bd setup opencode` writes, and the Codex section `bd init` writes. The plugin replaces those marked blocks in the outgoing request with a one-line pointer, matching the minimal `CLAUDE.md` pointer Beads uses for Claude Code. `bd init`'s minimal section is left as is. Your `AGENTS.md` file and any text outside those markers are not changed, and nothing is replaced when prime is withheld or unavailable.
95
105
 
96
106
  Known regular subagents remain excluded, including `explore` and `general`, while `beads-task-agent` and `beads-task-agent-luna` remain eligible. If agent lookup fails, context injection fails open to preserve compatibility with unknown custom primary agents.
97
107
 
98
- If `bd` is unavailable or the project is uninitialized, nothing is added. If `bd prime` fails or times out, the agent gets a short `<beads-notice>` saying context is unavailable and to run `bd prime`, as Beads' Codex hooks report refresh failures. Either way the plugin retries after 30 seconds, and failures are also logged as `[opencode-beads]` warnings. The task agent retains a bounded standalone quick reference for `ready`, `show`, atomic claim, discovered follow-up, validate before closure, and close.
108
+ If `bd` is unavailable or the project is uninitialized, nothing is added. If `bd prime` fails or times out, the agent gets a short `<beads-notice>` saying context is unavailable and to run `bd prime`, as Beads' Codex hooks report refresh failures. Either way the plugin retries after 30 seconds, and failures are also logged as `[opencode-beads]` warnings. The task agent retains standalone guidance for authorized scope, atomic claim, append checkpoints, validate before closure, and partial handoff under the caller's acceptance authority.
99
109
 
100
110
  ## Schema migration guard
101
111
 
102
112
  Beads 1.3 migrates an embedded store in place, irreversibly, the first time any command opens it, and `bd --readonly` does not prevent that. Because this plugin runs `bd prime` automatically, it would otherwise be the unattended first command after you upgrade `bd`.
103
113
 
104
- Before running prime, the plugin checks `bd version` and `bd where --json`, which never open the store, and reads `.beads/.local_version`. If the installed `bd` is older than 1.3.0, or the store was last opened by an older `bd`, the plugin withholds prime and gives the agent a notice telling it not to run `bd` and to ask you to act. To proceed, back up the `.beads` directory and run `bd migrate schema`; the plugin picks up the change on its next retry. Setting the `autoMigrate` option skips the store-version check.
114
+ Before running prime, the plugin checks `bd version` and the configuration-only `bd context --json` probe, which do not open the store, and reads `.beads/.local_version`. If the installed `bd` is older than 1.3.1, or the store was last opened by an older `bd`, the plugin withholds prime and gives the agent a notice telling it not to run `bd` and to ask you to act. To proceed, back up the `.beads` directory and run `bd migrate schema`; the plugin picks up the change on its next retry. Setting the `autoMigrate` option skips the store-version check.
105
115
 
106
116
  `bd prime` itself does not update `.beads/.local_version`. A store migrated only by prime keeps the old marker until you run `bd migrate schema` (or any ordinary `bd` command), which is safe and idempotent.
107
117
 
108
118
  ## Beads workflows
109
119
 
110
- The plugin registers no slash commands; `bd setup claude` installs none either. Ask the agent to work with Beads, have it load the canonical `beads` skill that `bd init` installs at `.agents/skills/beads` (OpenCode lists it and loads it with its `skill` tool), or use the `bd` CLI and the generated [Beads CLI reference](https://beads.gascity.com/cli-reference/index) directly. Versions before 1.0.0 shipped `/beads:*` commands adapted from upstream's Claude Code plugin; they duplicated `bd prime` and the skill.
120
+ Published stable 1.0.2 registers no slash commands; `bd setup claude` installs none either. Ask the agent to work with Beads, have it load the canonical `beads` skill that `bd init` installs at `.agents/skills/beads` (OpenCode lists it and loads it with its `skill` tool), or use the `bd` CLI and the generated [Beads CLI reference](https://beads.gascity.com/cli-reference/index) directly. Versions before 1.0.0 shipped `/beads:*` commands adapted from upstream's Claude Code plugin; they duplicated `bd prime` and the skill.
121
+
122
+ The commands are workflow prompts, not exact CLI aliases. In particular, init guides human onboarding, prime reuses context or requests a guarded refresh, version reports installed versions and qualification limits, decision records rationale, template discovers formulas, and workflow guides authorized work and recovery. These purposes do not imply native `bd decision`, `bd template` or `bd workflow` commands.
123
+
124
+ Starting with beta.2, the package-owned `oc-beads:status` is removed without an alias. Use `oc-beads:diagnostics` for integration health and `oc-beads:stats` for the issue-database overview via `bd status` (alias `bd stats`). User-defined old status overrides are untouched and are not migrated; the package does not edit configuration.
125
+
126
+ `oc-beads:compact` guides semantic issue compaction with `bd admin compact`; `bd compact` squashes Dolt history and is a different operation. Neither is conversation compaction. A bare invocation explains the workflow; action requires explicit operation and authority. See the packaged [compact guidance](assets/oc-beads/resources/TROUBLESHOOTING.md) for mode/actor boundaries and upstream help uncertainty. `oc-beads:restore` retrieves pre-compaction issue content, displaying it by default; `--apply` requires explicit authority to write it back and does not mean database backup recovery. Quickstart uses installed help and authorized context; sync guides Dolt-remote synchronization, distinct from `bd federation sync`.
127
+
128
+ ## Removal and customization
129
+
130
+ Remove the plugin's `plugins` entry to unload it. Cleanup aborts owned context/process work and its event observer, then awaits the scoped agent, skill, tool and hook disposers. It is idempotent and reports disposal failures. It never promises a final checkpoint after interruption. Reload starts with fresh session/location state. Package updates/removal belong to OpenCode's package lifecycle; this plugin has no installer or recursive asset watcher.
131
+
132
+ Existing `oc-beads` skill IDs or names are checked and diagnosed in each rebuilt candidate; removing a customization allows the packaged skill to return. There is no permanent setup-time skill gate. Ordinary user configuration/file commands retain their later native precedence; same-name other-plugin conflicts follow native order rather than universal collision prevention. Disposing a registration removes only the package's transform; it does not delete user command/skill bodies, shared Beads skills, project data, startup files or global settings. Do not delete those files as plugin cleanup. Installed resource reads still require normal host permissions; bounded native external-directory ask/deny and actual model-use evidence is recorded in the acceptance reports. Missing/unreadable packaged guidance is diagnosed and its skill is withheld.
111
133
 
112
134
  ## Agent configuration
113
135
 
@@ -115,9 +137,9 @@ Entries under `agents` in OpenCode configuration override the plugin's task-agen
115
137
 
116
138
  ## Task agent
117
139
 
118
- `beads-task-agent` supports read-only status and graph analysis or one-Bead completion. Analysis requests never mutate Beads. Completion requests inspect and process one caller-selected or highest-priority ready Bead, quarantine work discovered during that invocation, validate before closure, and return after closing or blocking the selected Bead.
140
+ The beta/next `beads-task-agent` supports read-only status and graph analysis or execution within an assigned task, batch or goal. Analysis requests never mutate Beads. Exact assignments stop without substitution. Authorized batches may continue only within scope, with an explicit executor actor, atomic claim/readback, append checkpoints and relevant validation for each Bead. Discoveries do not authorize their execution; unresolved acceptance remains incomplete, and parent-owned closure stays with the parent.
119
141
 
120
- Its prompt and description are owned by this project. Upstream Beads ships a task agent only in its Claude Code marketplace plugin, as an autonomous multi-task loop; this adapter deliberately keeps the bounded one-Bead contract instead.
142
+ Its prompt and description are owned by this project. Direct work and normal blocking delegation depend on the task, without a command-count threshold. The worker returns scope, actor/session, attempts, rationale, validation, durable references, blockers and next action. The caller reconciles acceptance; NO_TEXT, failure, cancellation, late results and step-cap interruption do not establish completion or authorize a restart.
121
143
 
122
144
  OpenCode lets the plugin enforce parts of that contract, beyond what Claude Code's hooks can do:
123
145
 
@@ -128,7 +150,7 @@ OpenCode lets the plugin enforce parts of that contract, beyond what Claude Code
128
150
 
129
151
  ### Opt-in Luna Max profile
130
152
 
131
- The default `beads-task-agent` leaves its model unset, so a subagent inherits the parent session's model. Set the plugin option `"luna": true` to also register `beads-task-agent-luna`, which uses `openai/gpt-6-luna#max` with exactly the same prompt, subagent mode, step cap, and permissions. Per-agent overrides remain independent: customizations to `beads-task-agent` are not copied to Luna. Both profiles receive full prime context and retain the same exact-one-Bead workflow.
153
+ The default `beads-task-agent` leaves its model unset, so a subagent inherits the parent session's model. Set the plugin option `"luna": true` to also register `beads-task-agent-luna`, which uses `openai/gpt-6-luna#max` with exactly the same prompt, subagent mode, step cap, and permissions. Per-agent overrides remain independent: customizations to `beads-task-agent` are not copied to Luna. Both profiles receive full prime context and use the same scope and acceptance boundaries, including explicit one-bead mode when assigned. The profile makes no model-quality guarantee.
132
154
 
133
155
  Ask the primary agent to delegate to `beads-task-agent-luna` by name through the `subagent` tool. Default delegation guidance still names `beads-task-agent`; enabling Luna does not reroute existing calls or change the primary agent's model. Remove the option to unregister the profile.
134
156
 
@@ -144,17 +166,18 @@ The package vendors nothing from upstream. It depends on the installed `bd` CLI
144
166
 
145
167
  | Component | Expected range | Validated baseline |
146
168
  | --- | --- | --- |
147
- | OpenCode | 2.0.26 through 2.x | 2.0.26 |
148
- | `bd` CLI | 1.3.0 through 1.x | 1.3.1 |
169
+ | OpenCode (beta/next candidate) | `>=2.1.1 <2.2` | 2.1.1 (bounded accepted evidence) |
170
+ | OpenCode (stable 1.0.2 historical) | 2.0.26 | 2.0.26 |
171
+ | `bd` CLI | 1.3.1 through 1.x | 1.3.1 |
149
172
  | Bun (OpenCode host runtime) | >=1.3.14 | 1.4.2 |
150
173
 
151
- The adapter type-checks against `@opencode/plugin` 2.0.26 and declares it as an optional peer from 2.0.26 through 2.x; the import is type-only, so OpenCode's own runtime is used. See the [OpenCode V2 contract](docs/opencode-sdk-contract.md). The `bd` baseline was reviewed against Beads v1.3.1 (commit `c1c4b642ac1c08d8c828007a1c2f96e47e43ef7c`).
174
+ The beta/next candidate type-checks against `@opencode/plugin` 2.1.1 and declares an optional peer range of `>=2.1.1 <2.2`. It checks `ctx.app.version` at startup and reports an unsupported-host diagnostic before registering Beads agents or hooks. This source guard does not qualify the entire host range; exact 2.1.1 has bounded accepted evidence, and future 2.1 patches are admitted candidates rather than tested versions. The stable 1.0.2 qualification on 2.0.26 is historical. See the [OpenCode V2 contract](docs/opencode-sdk-contract.md). The `bd` baseline was reviewed against Beads v1.3.1 (commit `c1c4b642ac1c08d8c828007a1c2f96e47e43ef7c`).
152
175
 
153
176
  ## Troubleshooting
154
177
 
155
178
  - **No Beads context:** Run `bd prime`. Install `bd` if missing or run `bd init` if the project has no Beads workspace.
156
179
  - **Agent reports that `bd prime` failed or timed out:** Run `bd prime` in the project to see the error; the plugin retries every 30 seconds.
157
- - **Agent reports a Beads notice instead of context:** The schema migration guard withheld prime. Back up `.beads`, run `bd migrate schema`, and continue; or upgrade `bd` if the notice says it is older than 1.3.0.
180
+ - **Agent reports a Beads notice instead of context:** The schema migration guard withheld prime. Back up `.beads`, run `bd migrate schema`, and continue; or upgrade `bd` if the notice says it is older than 1.3.1.
158
181
  - **Canonical skill missing:** For a new workspace, run `bd init`. For an existing workspace, follow current upstream Beads guidance; this plugin does not install or repair skills.
159
182
  - **Task agent asks before committing or pushing:** This is intentional; see [Task agent](#task-agent). Approve the command, or set the agent's `permissions` in OpenCode configuration.
160
183
  - **Unexpected definition:** Check OpenCode configuration for a colliding `beads-task-agent` definition. Explicit configuration wins.
@@ -0,0 +1,168 @@
1
+ ---
2
+ name: oc-beads
3
+ description: >
4
+ Use Beads when work needs durable tracking across sessions, has dependencies or
5
+ blockers, needs a meaningful progress checkpoint, or must be resumed with its
6
+ prior attempts and decisions. Also use when searching or updating reusable
7
+ project knowledge. Follow the current project's instructions and the installed
8
+ bd CLI for supported operations.
9
+ ---
10
+
11
+ # Beads work in OpenCode
12
+
13
+ > Adapted from [Beads marketplace-main `SKILL.md` at commit `4a67d0d0288c1b4ee23e17fc896f47616931ba2d`](https://github.com/gastownhall/beads/blob/4a67d0d0288c1b4ee23e17fc896f47616931ba2d/plugins/beads/skills/beads/SKILL.md).
14
+
15
+ Beads is the external issue and execution record. The installed `bd` CLI owns its
16
+ commands and data. Repository and user instructions set the authority for each
17
+ operation. The project's specification system (for example OpenSpec, when used)
18
+ records intended behavior; project documents retain detailed rationale and
19
+ evidence; Beads records execution, assignment, and acceptance.
20
+
21
+ Use the current Beads context when the host provides it. If it is absent, retrieve
22
+ current workflow context through the permissioned CLI only when that operation is
23
+ authorized and no hold is active. Distinguish context that is missing, failed to
24
+ load, or deliberately withheld. A migration or permission hold is a stop signal;
25
+ do not bypass it by manually running `bd prime`. If execute is unavailable, use direct shell only when separately available and
26
+ authorized. Native shell is direct-only and cannot be called inside execute. Do
27
+ not assume an unstated tool name, approval, or setup step.
28
+
29
+ When typed composition is available, discover current signatures through native
30
+ `search({namespace: "beads"})`; each leaf retains its own permission checks.
31
+ Follow [code-mode composition](resources/CODE_MODE.md) for bounded reads,
32
+ projection, ordered writes, completeness, uncertainty and decline/Stop semantics.
33
+
34
+ ## Command purposes
35
+
36
+ The package's commands are workflow prompts, not exact CLI aliases. Use
37
+ `oc-beads:diagnostics` for integration discovery, compatibility and context health
38
+ without opening a store; use `oc-beads:stats` for the issue-database overview via
39
+ `bd status` (alias `bd stats`). The old package status name has no alias; user-owned
40
+ old-name overrides remain untouched without migration.
41
+
42
+ Broader workflows retain their purposes: init guides human onboarding, prime uses
43
+ current context or a guarded refresh, version reports installed versions and
44
+ qualification limits, decision records rationale, template discovers formulas,
45
+ and workflow guides authorized work/recovery. They do not invent absent native
46
+ commands. Quickstart uses installed `bd quickstart` help and authorized context.
47
+ Compact targets semantic `bd admin compact`, not Dolt-history `bd compact` or
48
+ conversation compaction; restore retrieves pre-compaction issue content, displaying
49
+ it by default and requiring explicit write authority for `--apply`. Sync means
50
+ Dolt-remote synchronization, distinct from `bd federation sync`. Follow the linked
51
+ CLI reference, troubleshooting, resumability and worktree guidance before action.
52
+
53
+ ## Work within the assigned scope
54
+
55
+ - Read the relevant issue and its dependencies before changing tracked state.
56
+ - An assignment to one specific item is an exact assignment: finish that item,
57
+ report the outcome, and stop. Continue across a batch only when the user or
58
+ repository instructions explicitly authorize that batch or goal. Discovering
59
+ more work can justify reporting or recording a finding when authorized; it
60
+ does not expand the work you may perform.
61
+ - For an authorized tracked task, claim atomically with the actual executor
62
+ actor. Keep that actor on every agent-authored Beads write and heartbeat:
63
+
64
+ ```sh
65
+ bd update '<id>' --claim --actor='<executor-actor>' --sandbox --json
66
+ bd heartbeat '<id>' --actor='<executor-actor>' --sandbox --json
67
+ ```
68
+
69
+ Use the host-rendered actor derived from your actual request session and agent,
70
+ matching typed write results. If unavailable, refuse writes until the host
71
+ supplies it; never copy a sample or impersonate another executor. Use a
72
+ readable, unambiguous identity, not the human Git identity or a model name.
73
+ Give delegated instructions the delegate's real actor and have the
74
+ executing worker claim its own authorized work. A deliberate handoff changes
75
+ ownership; parent review does not.
76
+ - Read back `created_by` (audit author), `owner` (record/account ownership), and
77
+ `assignee` (executor) separately. Leave new work unassigned unless assignment
78
+ is intentional. Preserve historical authorship; document provenance
79
+ corrections in notes instead of rewriting it.
80
+ - Direct work is suitable for small, clear tasks. Delegate when separate work
81
+ benefits from another executor or independent review, and state the scope,
82
+ evidence expected, actor, and stop condition. There is no required
83
+ command-count threshold or one-issue-per-invocation loop.
84
+
85
+ ## Keep useful progress
86
+
87
+ At a meaningful change in direction, record what was attempted, what happened,
88
+ why the next step follows, any blocker, and the concrete next action. Append to
89
+ the issue's notes so useful earlier learning remains available:
90
+
91
+ ```sh
92
+ bd update '<id>' --append-notes="Tried …; result …; because …; blocker …; next …" --actor='<executor-actor>' --sandbox --json
93
+ ```
94
+
95
+ Use `--append-notes` for checkpoints. Replacing notes is a deliberate edit, not
96
+ the routine checkpoint path. Keep records concise and evidence-based; do not
97
+ store credentials, raw dumps, or guesses as facts. Do not write just to meet a
98
+ count or frequency target when nothing material changed. If a write fails or its
99
+ result is uncertain, report that state and inspect before retrying.
100
+
101
+ ## Separate task notes from reusable knowledge
102
+
103
+ Attempts, issue-specific test results, decisions, and the next action belong on
104
+ the issue. Use persistent Beads memory only for validated project knowledge that
105
+ will likely help beyond this issue. Search for existing knowledge first, then
106
+ update it deliberately with scope and evidence; a temporary failure usually
107
+ belongs in the task record rather than global memory. Recall before updating an
108
+ existing stable key: writing the same key replaces its content in place.
109
+
110
+ ```sh
111
+ bd memories '<keyword>'
112
+ bd recall '<known-key>'
113
+ bd remember "Validated learning, where it applies, and supporting evidence" --key='<stable-key>' --actor='<executor-actor>' --sandbox
114
+ ```
115
+
116
+ Do not dump all memories into every handoff or delete old knowledge as routine
117
+ cleanup. Use the current CLI help for exact memory options.
118
+
119
+ Do not initialize or reroute a store, synchronize it, change permissions, or enable automation as a side effect.
120
+ Those separate administrative operations require explicit authorization.
121
+ Examples assume a project policy prohibiting automatic remote updates and include
122
+ `--sandbox`; it only suppresses Dolt auto-push and provides no migration safety.
123
+
124
+ ## Validation, handoff, and stopping
125
+
126
+ Before marking work complete, compare the result with its acceptance criteria and
127
+ run the relevant authorized validation. Keep failed or unrun checks explicit.
128
+ Close an issue only when closure is within your authority and its own acceptance
129
+ is met. If a parent, owner, or human controls acceptance, return evidence and
130
+ leave that decision to them. A discovered issue does not become authorized work
131
+ just because it is linked.
132
+
133
+ For a handoff, provide the current state, material attempts and outcomes,
134
+ rationale, validation evidence, blockers, next action, and useful issue or memory
135
+ references. Preserve enough context to continue without replaying a failed
136
+ approach. Stop when the exact assignment is done, authority is absent, a hold is
137
+ active, or a required guarantee cannot be established.
138
+
139
+ ## Supporting guidance
140
+
141
+ These resources are separate so advanced or reference material can be opened
142
+ only when relevant. Every selected support file is linked explicitly because a
143
+ host may display only a limited automatic file list.
144
+
145
+ ### Daily work
146
+
147
+ - [Boundaries: durable tracking and short-lived work](resources/BOUNDARIES.md)
148
+ - [Current CLI reference sources](resources/CLI_REFERENCE.md)
149
+ - [Dependency direction and provenance](resources/DEPENDENCIES.md)
150
+ - [Issue creation and useful fields](resources/ISSUE_CREATION.md)
151
+ - [Common execution patterns](resources/PATTERNS.md)
152
+ - [Resumability and recovery notes](resources/RESUMABILITY.md)
153
+ - [Meaningful workflows and checkpoints](resources/WORKFLOWS.md)
154
+ - [OpenCode and Beads integration patterns](resources/INTEGRATION_PATTERNS.md)
155
+ - [Current troubleshooting and stop conditions](resources/TROUBLESHOOTING.md)
156
+
157
+ ### Advanced, on demand
158
+
159
+ - [Agent beads, executor identity, and unsupported slot APIs](resources/AGENTS.md)
160
+ - [Asynchronous gates](resources/ASYNC_GATES.md)
161
+ - [Molecule and wisp patterns](resources/CHEMISTRY_PATTERNS.md)
162
+ - [Molecule and formula reference](resources/MOLECULES.md)
163
+ - [Static reference data](resources/STATIC_DATA.md)
164
+ - [Worktree routing](resources/WORKTREES.md)
165
+
166
+ ### Rationale
167
+
168
+ - [ADR-0001: keep exact CLI syntax dynamic](adr/0001-bd-prime-as-source-of-truth.md)
@@ -0,0 +1,40 @@
1
+ # ADR-0001: Keep exact CLI syntax dynamic
2
+
3
+ ## Status
4
+
5
+ Accepted for this guidance corpus.
6
+
7
+ ## Context
8
+
9
+ The upstream Beads skill and its resources have useful decision guidance, but
10
+ they are not a generated reference for every installed `bd` release. Copying
11
+ flags and command forms throughout prose lets examples age independently of the
12
+ CLI. A successful `bd prime` or command exit is also not proof that a particular
13
+ record was found, a memory was returned, or a write was acknowledged.
14
+
15
+ ## Decision
16
+
17
+ - Keep cognitive and workflow guidance in `SKILL.md` and its on-demand resources.
18
+ - Use `bd prime` for current workflow context and `bd '<command>' --help` for
19
+ exact syntax. Do not duplicate a broad CLI reference here.
20
+ - Respect an explicit context, permission, or migration hold. A manual prime is
21
+ not a fallback around a hold.
22
+ - Keep examples limited to supported CLI forms verified against the installed
23
+ help. When an operation is unavailable, say what supported path or limitation
24
+ applies instead of inventing a flag or tool.
25
+ - Treat host registration, package inclusion, installed resource access, and
26
+ behavioral qualification as separate evidence. The presence of these source
27
+ assets does not establish those outcomes.
28
+
29
+ ## Consequences
30
+
31
+ This keeps the startup guidance short and moves depth to linked resources. CLI
32
+ help can still be incomplete or ambiguous, so examples and compatibility claims
33
+ need review against their relevant Beads release. No claim that drift is
34
+ impossible is made. Advanced features remain opt-in and do not enable automation,
35
+ store initialization, synchronization, or permission changes by themselves.
36
+
37
+ ## Source attribution
38
+
39
+ Adapted from [Beads marketplace-main ADR-0001 at commit
40
+ `4a67d0d0288c1b4ee23e17fc896f47616931ba2d`](https://github.com/gastownhall/beads/blob/4a67d0d0288c1b4ee23e17fc896f47616931ba2d/plugins/beads/skills/beads/adr/0001-bd-prime-as-source-of-truth.md).
@@ -0,0 +1,43 @@
1
+ # Agent beads and executor identity
2
+
3
+ > Adapted from [Beads marketplace-main `AGENTS.md`](https://github.com/gastownhall/beads/blob/4a67d0d0288c1b4ee23e17fc896f47616931ba2d/plugins/beads/skills/beads/resources/AGENTS.md).
4
+
5
+ ## Keep the concepts separate
6
+
7
+ Beads executor attribution, issue assignment, and specialized agent/role beads
8
+ serve different purposes. For ordinary delegated work, use the authorized issue
9
+ and assign or claim it for the actual executor. Supply that executor's explicit
10
+ actor on each Beads write and heartbeat. Do not substitute the parent, human Git
11
+ identity, or model name for the worker identity.
12
+
13
+ Read `created_by`, `owner`, and `assignee` as separate fields. `created_by` is
14
+ audit authorship, `owner` identifies the record/account owner, and `assignee`
15
+ identifies the executor. A claim does not rewrite historical authorship. Record
16
+ known provenance corrections in append-style notes.
17
+
18
+ ## Specialized agent/role beads are optional
19
+
20
+ The upstream resource describes a richer agent state machine and named slots.
21
+ In the inspected Beads 1.3.1 CLI, `bd agent --help` and `bd slot --help` both
22
+ return unknown-command errors. The installed CLI does support ordinary issue
23
+ assignment, atomic task claims, and `bd heartbeat` for a claimed issue lease.
24
+ Those are useful executor conventions, not a one-to-one implementation of
25
+ agent/role beads, their state machine, or slot queries.
26
+
27
+ The upstream model describes lifecycle labels such as idle, spawning,
28
+ running/working, done, stuck, stopped, and dead, and slots such as a current-work
29
+ hook or a role. Treat these as design concepts from the source material, not
30
+ states or slot records this CLI can create or query.
31
+
32
+ Do not assume `bd agent` or `bd slot` is available and do not invent replacement
33
+ flags. Workflows that require those specialized APIs must stop or use a separately
34
+ approved, documented system. Routine Beads work does not need agent beads,
35
+ Witness, a slot service, or a new orchestration layer.
36
+
37
+ ## When a separate agent record could help
38
+
39
+ Only consider specialized agent records when a project already has a supported
40
+ coordination design that needs durable role capabilities, liveness, or multiple
41
+ named assignments. Establish who owns those records and how they are retired
42
+ before writing any. A heartbeat on an assigned issue refreshes that issue's
43
+ claim lease; it is not a general process monitor.
@@ -0,0 +1,63 @@
1
+ # Asynchronous gates
2
+
3
+ > Adapted from [Beads marketplace-main `ASYNC_GATES.md`](https://github.com/gastownhall/beads/blob/4a67d0d0288c1b4ee23e17fc896f47616931ba2d/plugins/beads/skills/beads/resources/ASYNC_GATES.md).
4
+
5
+ An async gate models a wait condition that blocks a later step. It does not do
6
+ the work, grant permission, or make a human decision. Use one only when an
7
+ authorized workflow needs a durable wait relationship; ordinary blockers can
8
+ remain issue dependencies.
9
+
10
+ ## Gate kinds
11
+
12
+ The pinned guidance distinguishes a human decision from a condition that can
13
+ be checked:
14
+
15
+ | Kind | Successful condition | Failure or timeout behavior |
16
+ | --- | --- | --- |
17
+ | `human` | Explicit human decision, recorded by manual resolution. | A `--timeout` can be stored as metadata but is not enforced by `bd gate check`; silence is not consent. |
18
+ | `timer` | The timeout has elapsed when an authorized executor runs `bd gate check --type=timer --actor='<executor-actor>' --sandbox --json`. | Otherwise it remains pending. |
19
+ | `gh:run` | Run is completed with success (the pinned guidance also treats skipped as resolved). | Completed failure or cancellation escalates; the gate remains open for a decision. |
20
+ | `gh:pr` | Pull request is merged. | Closed without merge escalates; the gate remains open for a decision. |
21
+ | `bead` | The referenced issue is closed, when supported by the installed create path. | An open target remains pending. |
22
+
23
+ The installed `bd gate check --help` confirms timer evaluation and GitHub
24
+ success/failure conditions. The pinned source says a human gate's stored timeout
25
+ is not enforced by `check`. The installed `bd gate create --help` lists human,
26
+ timer, `gh:run`, and `gh:pr`; it does not list `bead` as a create type. Check
27
+ current help before relying on a gate type; this guidance does not qualify host
28
+ behavior.
29
+
30
+ ## Inspect and resolve deliberately
31
+
32
+ Use `bd gate --help` and `bd gate '<subcommand>' --help` for current syntax. The
33
+ installed help supports this deliberate human-decision flow:
34
+
35
+ ```sh
36
+ # An authorized executor creates the wait condition.
37
+ bd gate create --type=human --blocks='<issue-id>' \
38
+ --reason="Needs owner review" --actor='<executor-actor>' --sandbox --json
39
+ bd gate list --json
40
+ bd gate show '<gate-id>'
41
+
42
+ # The actual human runs this command only after making the decision.
43
+ bd gate resolve '<gate-id>' --reason="Reviewed; decision recorded" \
44
+ --actor='<actual-human-actor>' --sandbox --json
45
+ ```
46
+
47
+ Read both the gate and blocked issue before changing either. An agent must never
48
+ supply a human actor or resolve a human gate on the human's behalf. Never infer
49
+ consent from silence. A failed CI run or unmerged closed pull request is a failure
50
+ to investigate, not a successful gate. If an authorized executor runs a check, keep its actor explicit and
51
+ inspect the resulting state before continuing.
52
+
53
+ Do not create gates automatically for every handoff, approval, test, or issue.
54
+ Do not add polling, watchers, or approval automation as a side effect of reading
55
+ this resource. Gates and issue dependencies are distinct: use a gate for a
56
+ documented async condition, and an issue dependency for work ordering.
57
+
58
+ ## Stop conditions
59
+
60
+ Stop if the gate cannot be read, its referenced event cannot be verified, a
61
+ human decision is required, or the current CLI lacks the required gate action.
62
+ Report the gate ID, observed state, evidence, and the decision needed. Never
63
+ route around a permission denial by calling a different interface.
@@ -0,0 +1,57 @@
1
+ # Boundaries: durable tracking and short-lived work
2
+
3
+ > Adapted from [Beads marketplace-main `BOUNDARIES.md`](https://github.com/gastownhall/beads/blob/4a67d0d0288c1b4ee23e17fc896f47616931ba2d/plugins/beads/skills/beads/resources/BOUNDARIES.md).
4
+
5
+ Use Beads for work whose ownership, dependencies, blocker, history, or next
6
+ session matters to the project. Keep a short linear breakdown in the current
7
+ conversation when it is only an execution aid and no repository rule requires a
8
+ durable issue. Do not make a second Markdown task list the durable project record.
9
+
10
+ ## Choose the right record
11
+
12
+ | Situation | Record | Why |
13
+ | --- | --- | --- |
14
+ | Short, linear steps that will finish in this session | Conversation checklist, if useful | Keeps execution visible without creating durable issue noise. |
15
+ | Work needs an owner, blocker, dependency, acceptance, or later resume | Existing or authorized Bead | Preserves execution history and handoff context. |
16
+ | Validated learning is likely to help on future issues | Relevant Beads memory | Reusable knowledge is separate from a task's attempts. |
17
+ | Intended behavior and acceptance contract | Project's specification system (for example OpenSpec, when used) | Keeps the project specification authoritative. |
18
+ | Detailed rationale, source evidence, or qualification result | Project documentation | Gives durable evidence a stable home. |
19
+ | Temporary command output | Current session; summarize only if it changes a decision | Avoids storing noise. |
20
+ | Host explicitly exposes experimental todo support and the user/project opts in | Host-owned transient checklist | Optional convenience only; it is not installed or enabled here. |
21
+
22
+ OpenCode 2.1 experimental todo support is opt-in and host-owned. Do not require
23
+ it, turn it on, or assume Claude's `TodoWrite` exists in every host. If no
24
+ session checklist is available, keep a brief checklist in the conversation or
25
+ use an authorized Bead when the work is durable.
26
+
27
+ Do not create a new Bead for every command, transient retry, small nit, or
28
+ document. Create or update a record when the work is genuinely durable and you
29
+ have authority to do so. Existing assignment and project policy take priority
30
+ over any general heuristic here.
31
+
32
+ Ask: “Could I resume this after two weeks away?” If the answer needs context
33
+ that would otherwise be lost, preserve it in the appropriate authorized record.
34
+
35
+ ## Transition when the work grows
36
+
37
+ It is reasonable to begin with a transient checklist for “update the retry
38
+ message and run its focused test.” If the test uncovers an independent data-loss
39
+ case, a prerequisite, or work that must continue next session, stop treating the
40
+ checklist as the durable record. If authorized, create or update the appropriate
41
+ Bead with the attempted fix, test evidence, discovered blocker, acceptance, and
42
+ next step; link new work to its source where useful. Keep the checklist only for
43
+ the remaining steps in this session. Without authority to create or change a
44
+ Bead, preserve the discovery in the assigned record if permitted, then report
45
+ and stop at the scope boundary.
46
+
47
+ ## Preserve the authority boundary
48
+
49
+ A ready issue is available work, not permission. A single-item assignment ends
50
+ after that item; continue only inside an explicitly authorized batch or goal.
51
+ Finding related work does not authorize acting on it. Link or report discoveries
52
+ only within the authority already granted.
53
+
54
+ For a tracked item, preserve its execution identity and history. Claim
55
+ atomically when authorized, use an explicit actor on writes, and append material
56
+ progress rather than replacing previous notes. A task record does not own the
57
+ Beads database or authorize sync, setup, permission changes, or Git operations.
@@ -0,0 +1,44 @@
1
+ # Molecule and wisp patterns
2
+
3
+ > Adapted from [Beads marketplace-main `CHEMISTRY_PATTERNS.md`](https://github.com/gastownhall/beads/blob/4a67d0d0288c1b4ee23e17fc896f47616931ba2d/plugins/beads/skills/beads/resources/CHEMISTRY_PATTERNS.md).
4
+
5
+ Molecules and wisps are advanced ways to organize repeated or temporary work.
6
+ They are optional. A normal issue and its dependencies are usually enough for
7
+ one task. Do not introduce a molecule workflow simply because it is available.
8
+
9
+ ## Choose by phase and lifetime
10
+
11
+ | Need | Record | Lifetime |
12
+ | --- | --- | --- |
13
+ | One-off owned work with no reusable workflow | Normal issue and dependencies | Durable issue history. |
14
+ | Repeated multi-step work whose children and audit trail should persist | Formula/proto instantiated as a persistent molecule | Reusable source, then durable execution records. |
15
+ | Authorized short-lived research, review, triage, or operations with low audit value | Wisp from an existing formula/proto | Ephemeral; useful findings must be promoted before cleanup. |
16
+
17
+ Treat formulas/protos as reusable workflow sources, molecules as instantiated
18
+ work, and wisps as the temporary phase. Do not use a wisp when the full trail
19
+ must persist or assume that a formula will stay inside the exact assignment.
20
+
21
+ Before using a formula, inspect the available formula and its steps. Decide what
22
+ evidence should survive and who owns each child. Do not let a template silently
23
+ expand an exact assignment into unrelated work.
24
+
25
+ An approved one-time review can use an existing review formula: capture evidence
26
+ and uncertainty in its wisp, promote validated actionable findings to a durable
27
+ record, then discard only noise with no future value. A bounded research spike
28
+ can preserve sources, rejected hypotheses, and a conclusion the same way. These
29
+ are optional work patterns, not authority to create a formula, spawn workers, or
30
+ start a background patrol.
31
+
32
+ ## Preserve useful results
33
+
34
+ At the end of a wisp, retain validated findings, rejected hypotheses, sources,
35
+ and resulting authorized work in the appropriate durable record. Discard only
36
+ noise that has no future value. A digest should not turn unverified notes into
37
+ facts. `bd mol squash` creates a durable digest; `bd mol burn` deletes a wisp
38
+ without a digest. Use either only when that lifecycle is authorized and current
39
+ help confirms the operation.
40
+
41
+ Use `bd mol --help`, `bd formula --help`, and relevant subcommand help for exact
42
+ syntax. Creating a proto, molecule, wisp, or child issue is a Beads write and
43
+ requires the actual executor actor. These features do not start workers, set
44
+ permissions, or enable background automation by themselves.