spec-driven-with-beads 2.0.0 → 3.0.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/README.md CHANGED
@@ -8,24 +8,18 @@ proposal → specs → design → tasks+beads → apply (via molecule) → conso
8
8
 
9
9
  ## What makes this different
10
10
 
11
- Other spec-driven schemas end at `archive` — move files, update specs, done. Knowledge dies with the session.
11
+ Other spec-driven schemas end at `archive` — move files, done. Knowledge dies with the session.
12
12
 
13
- This schema uses Beads' **formula + molecule** system. One `bd pour` command creates the entire dependency graph:
13
+ This schema uses Beads' **formula + molecule** system. One `bd pour` creates the entire dependency graph with mandatory `needs:` dependencies, then **consolidate** closes the learning loop — `bd remember` persists lessons as durable memories, `bd mol distill` extracts reusable formulas from completed work.
14
14
 
15
- ```
16
- bd-xyz (epic: Spec-driven Change: my-feature)
17
- ├── bd-xyz.1 proposal (human)
18
- ├── bd-xyz.2 specs (needs: proposal)
19
- ├── bd-xyz.3 design (needs: specs)
20
- ├── bd-xyz.4 implement (needs: design)
21
- └── bd-xyz.5 consolidate (human, needs: implement)
22
- ```
23
-
24
- No manual `bd create` × N. No manual `bd dep add` × N. The formula defines the graph.
15
+ ### Key features
25
16
 
26
- Then **`consolidate`** closes the loop `bd remember` persists lessons as durable memories that `bd prime` injects into every future session. No context loss, no rediscovery.
27
-
28
- No other OpenSpec schema does this. No task tracker (Linear, GitHub Issues, Jira) has a `bd remember` equivalent.
17
+ - **Mandatory dependency graph**the formula defines `needs:` between every step. `bd ready` only shows unblocked work. No manual `bd dep add`.
18
+ - **Spec-compliance aspect** — auto-injects a "Verify specs pass" step before consolidate. No config needed.
19
+ - **Bond points for optional behavior** parallel multi-agent execution, async gates (human approval/CI/timers). Bond a formula to unlock; bond nothing = sequential.
20
+ - **`bd mol squash`** — compresses completed molecules into lightweight digests. Clean issue graph.
21
+ - **`bd mol distill`** — extracts reusable formulas from completed changes. The schema teaches itself.
22
+ - **`bd remember`** — persists learnings that `bd prime` injects into every future session.
29
23
 
30
24
  ## Requirements
31
25
 
@@ -39,20 +33,18 @@ No other OpenSpec schema does this. No task tracker (Linear, GitHub Issues, Jira
39
33
  npm install -g spec-driven-with-beads
40
34
  ```
41
35
 
42
- This copies the schema into OpenSpec's global schemas, making it available in any project.
43
-
44
36
  ## Usage
45
37
 
46
- In your project's `openspec/config.yaml`:
38
+ In `openspec/config.yaml`:
47
39
 
48
40
  ```yaml
49
41
  schema: spec-driven-with-beads
50
42
  ```
51
43
 
52
- Then use standard OpenSpec commands:
44
+ Then:
53
45
  - `/opsx:propose "my feature"`
54
46
  - `/opsx:apply` — driven by molecule step order
55
- - `/opsx:consolidate` — remember, compact, archive
47
+ - `/opsx:consolidate` — lint, squash, remember, distill, archive
56
48
 
57
49
  ## Links
58
50
 
@@ -8,28 +8,48 @@ OpenSpec custom schema that uses [Beads](https://github.com/gastownhall/beads) m
8
8
  proposal → specs → design → tasks+beads → apply (via molecule) → consolidate
9
9
  ```
10
10
 
11
- ## What makes this different
12
-
13
- Other schemas end at `archive` — move files, done. This one uses Beads' **formula + molecule** system: one `bd pour` command creates the entire dependency graph as a Beads molecule.
14
-
15
- | Phase | What happens |
16
- |-------|-------------|
17
- | `tasks` | Writes `tasks.md` + **pours a molecule** via `bd pour spec-driven-change --var name=<change>` — creates epic + 5 steps with auto-dependency chain |
18
- | `apply` | Works through molecule steps: `bd ready` → `bd update --claim` → code → `bd close`. Dependencies enforced by the molecule |
19
- | `consolidate` | Closes molecule, `bd compact`, **`bd remember`** learnings, `openspec archive`. Knowledge persists via `bd prime` |
20
-
21
11
  ## Molecule structure
22
12
 
23
13
  ```
24
14
  bd-xyz (epic: Spec-driven Change: my-feature)
25
- ├── bd-xyz.1 proposal (human)
26
- ├── bd-xyz.2 specs (needs: proposal)
27
- ├── bd-xyz.3 design (needs: specs)
28
- ├── bd-xyz.4 implement (needs: design)
29
- └── bd-xyz.5 consolidate (human, needs: implement)
15
+ ├── bd-xyz.1 proposal (human, needs: —)
16
+ ├── bd-xyz.2 specs (needs: proposal)
17
+ ├── bd-xyz.3 design (needs: specs)
18
+ ├── bd-xyz.4 implement (needs: design)
19
+ ├── bd-xyz.5 verify-specs-consolidate (auto-injected by spec-compliance aspect)
20
+ └── bd-xyz.6 consolidate (human, needs: implement, verify-specs)
30
21
  ```
31
22
 
32
- No manual `bd create` × N or `bd dep add` × N — the formula defines the graph.
23
+ One `bd pour` creates the entire graph. No manual `bd create` × N.
24
+
25
+ ## What makes this different
26
+
27
+ Other schemas end at `archive` — knowledge dies with the session. This one closes the learning loop via `bd remember` + `bd mol distill`.
28
+
29
+ ### Key features
30
+
31
+ | Feature | Description | Default |
32
+ |---------|-------------|---------|
33
+ | Mandatory deps | `needs:` in formula — `bd ready` only shows unblocked steps | Always on |
34
+ | Spec-compliance aspect | Auto-injects "Verify specs pass" before consolidate | Always on |
35
+ | Bond points | Compose additional behavior without forking the schema | Opt-in |
36
+ | `bd pin` | Pin steps to specific agents for parallel work | Opt-in (bond) |
37
+ | Async gates | Human approval, timers, CI checks | Opt-in (bond) |
38
+ | `bd lint` | Structural validation in consolidate | Always on |
39
+ | `bd mol squash` | Compress completed molecule to lightweight digest | Always on |
40
+ | `bd mol distill` | Extract reusable formula from completed change | Agent discretion |
41
+ | `bd remember` | Persist learnings across sessions via `bd prime` | Always on |
42
+
43
+ ### Bond points
44
+
45
+ The formula defines three bond points where optional formulas attach:
46
+
47
+ | Bond point | Position | Optional behavior |
48
+ |---|---|---|
49
+ | `parallel-execution` | After implement | Split implement into parallel sub-steps, one per capability, each pinned to a different agent. Uses `waits_for` (fan-in) to rejoin before consolidate |
50
+ | `async-gates` | Before implement | Add human approval gates, timer delays, or GitHub CI checks. Blocks step progression until conditions are met |
51
+
52
+ Bond nothing → sequential, no extra config. Bond a formula → unlock the feature.
33
53
 
34
54
  ## Requirements
35
55
 
@@ -43,8 +63,6 @@ No manual `bd create` × N or `bd dep add` × N — the formula defines the grap
43
63
  npm install -g spec-driven-with-beads
44
64
  ```
45
65
 
46
- This copies the schema into OpenSpec's global schemas.
47
-
48
66
  ## Usage
49
67
 
50
68
  In `openspec/config.yaml`:
@@ -53,12 +71,10 @@ In `openspec/config.yaml`:
53
71
  schema: spec-driven-with-beads
54
72
  ```
55
73
 
56
- Then standard OpenSpec commands, but with Beads molecule awareness:
74
+ Then:
57
75
  - `/opsx:propose "my feature"`
58
76
  - `/opsx:apply` — driven by molecule step order
59
- - `/opsx:consolidate` — remember, compact, archive
60
- - `bd label list --label change:my-feature` — find past changes
61
- - `bd list --label status:consolidated` — search consolidated work
77
+ - `/opsx:consolidate` — lint, squash, remember, distill, archive
62
78
 
63
79
  ## Links
64
80
 
@@ -66,4 +82,5 @@ Then standard OpenSpec commands, but with Beads molecule awareness:
66
82
  - [Beads](https://github.com/gastownhall/beads)
67
83
  - [Beads Formula docs](https://gastownhall.github.io/beads/workflows/formulas)
68
84
  - [Beads Molecule docs](https://gastownhall.github.io/beads/workflows/molecules)
85
+ - [Beads Aspect docs](https://gastownhall.github.io/beads/workflows/formulas#aspects-cross-cutting)
69
86
  - [Community schema catalog](https://github.com/intent-driven-dev/openspec-schemas)
@@ -1,5 +1,5 @@
1
1
  name: spec-driven-with-beads
2
- version: 2
2
+ version: 3
3
3
  description: >
4
4
  OpenSpec workflow powered by Beads issue tracking.
5
5
  proposal -> specs -> design -> tasks+beads -> apply (via Beads) -> consolidate.
@@ -128,6 +128,14 @@ artifacts:
128
128
  create it from the template at
129
129
  `openspec/schemas/spec-driven-with-beads/templates/spec-driven-change.formula.toml`.
130
130
 
131
+ Also copy the spec-compliance aspect:
132
+ ```
133
+ cp openspec/schemas/spec-driven-with-beads/templates/spec-compliance.aspect.toml .beads/formulas/spec-compliance.aspect.toml
134
+ ```
135
+
136
+ The aspect auto-injects a "Verify spec scenarios pass" step before
137
+ consolidate — no further action needed.
138
+
131
139
 
132
140
  **2. Pour the molecule**
133
141
 
@@ -142,28 +150,53 @@ artifacts:
142
150
 
143
151
  ```
144
152
  bd-xyz (epic: Spec-driven Change: <change-name>)
145
- ├── bd-xyz.1 proposal (human, needs: —)
146
- ├── bd-xyz.2 specs (needs: proposal)
147
- ├── bd-xyz.3 design (needs: specs)
148
- ├── bd-xyz.4 implement (needs: design)
149
- └── bd-xyz.5 consolidate (human, needs: implement)
153
+ ├── bd-xyz.1 proposal (human, needs: —)
154
+ ├── bd-xyz.2 specs (needs: proposal)
155
+ ├── bd-xyz.3 design (needs: specs)
156
+ ├── bd-xyz.4 implement (needs: design)
157
+ └── [on_complete → bd ready]
158
+ ├── bd-xyz.5 verify-specs-consolidate (auto-injected by aspect)
159
+ └── bd-xyz.6 consolidate (human, needs: implement, verify-specs)
150
160
  ```
151
161
 
152
162
  The dependency chain is built into the formula — no manual `bd dep add` needed.
153
163
 
164
+ **Optional — parallel capability implementation (multi-agent):**
165
+ If the change has multiple capabilities and you have multiple agents,
166
+ bond a multi-agent formula at the `parallel-execution` bond point:
167
+ ```
168
+ bd mol bond mol-parallel-execution <mol-id> --ref parallel-execution
169
+ ```
170
+ This splits the implement step into N sub-steps (one per capability),
171
+ each pinned to a different agent with `bd pin`. All sub-steps use
172
+ `waits_for` (fan-in) to rejoin before consolidate.
173
+
174
+ **Optional — async gates (human approval, CI checks):**
175
+ Bond a gated formula at the `async-gates` bond point:
176
+ ```
177
+ bd mol bond mol-gated-approval <mol-id> --ref async-gates
178
+ ```
179
+ This adds human approval gates before implementation, timer delays,
180
+ or GitHub CI checks.
181
+
182
+ If you don't bond anything, the molecule runs sequential —
183
+ no extra configuration needed.
184
+
154
185
 
155
186
  **3. Label the molecule**
156
187
 
157
188
  ```
158
- bd label add bd-xyz change:<change-name>
159
- bd label add bd-xyz schema:spec-driven-with-beads
189
+ bd label add <mol-id> change:<change-name>
190
+ bd label add <mol-id> schema:spec-driven-with-beads
191
+ bd label add <mol-id> mode:sequential
160
192
  ```
193
+ Use `mode:parallel` if you bonded a multi-agent formula.
161
194
 
162
195
 
163
196
  **4. Set acceptance criteria for the implement step**
164
197
 
165
198
  ```
166
- bd update bd-xyz.4 --acceptance "All spec scenarios pass. Tests added."
199
+ bd update <mol-id>.4 --acceptance "All spec scenarios pass. Tests added."
167
200
  ```
168
201
 
169
202
 
@@ -183,7 +216,7 @@ apply:
183
216
  Drive implementation through the molecule. The dependency graph
184
217
  enforces order automatically.
185
218
 
186
- Workflow:
219
+ Sequential (default — no bonding needed):
187
220
  1. Run `bd mol list --json` to find the molecule for this change.
188
221
  2. Run `bd dep tree <mol-id>` to see the step hierarchy.
189
222
  3. Run `bd ready` — only shows steps whose needs are met.
@@ -201,11 +234,27 @@ apply:
201
234
  bd close <mol-id>.N --reason "Implemented"
202
235
  ```
203
236
  8. Run `bd ready` again — next step in the chain becomes available.
237
+ The `on_complete` hook on the implement step runs `bd ready` automatically.
204
238
  9. Repeat until all steps are closed.
205
239
 
240
+ Parallel (if bonded at parallel-execution bond point):
241
+ 1. Run `bd dep tree <mol-id>` to see the sub-step hierarchy.
242
+ 2. Each sub-step is pinned to an agent via `bd pin`.
243
+ 3. Each agent claims, implements, and closes their sub-step independently.
244
+ 4. The consolidate step waits for ALL sub-steps via `waits_for` (fan-in).
245
+ 5. Use `bd blocked` to check if any sub-step is blocking the fan-in.
246
+
247
+ Async (if bonded at async-gates bond point):
248
+ 1. Run `bd show <mol-id>.N` to check gate state.
249
+ 2. For human gates: wait for approval via `bd gate approve`.
250
+ 3. For timer gates: `bd show` shows remaining duration.
251
+ 4. For GitHub gates: `bd show` shows CI/PR status.
252
+ 5. Emergency override: `bd gate skip <mol-id>.N --reason "..."`.
253
+
206
254
  Tips:
207
255
  - `bd blocked` shows steps waiting on dependencies.
208
256
  - `bd stats` shows molecule progress.
257
+ - `bd show <mol-id>.N --json | jq '.gate'` shows gate details.
209
258
  - Mark tasks.md checkboxes for human readability, but the molecule
210
259
  is the source of truth.
211
260
 
@@ -221,11 +270,19 @@ consolidate:
221
270
  ```
222
271
  bd mol show <mol-id>
223
272
  ```
224
- 2. Run molecule compaction:
273
+
274
+ 2. Run structural validation:
275
+ ```
276
+ bd lint
277
+ ```
278
+ All issues MUST pass lint. If any fail, fix them before proceeding.
279
+
280
+ 3. Run molecule compaction:
225
281
  ```
226
282
  bd compact
227
283
  ```
228
- 3. Distill learnings from this change:
284
+
285
+ 4. Distill learnings from this change:
229
286
  ```
230
287
  bd remember --key spec-driven-beads-<change-name> "Lessons from this change:
231
288
  - What unexpected problems did you encounter?
@@ -233,14 +290,27 @@ consolidate:
233
290
  - Any surprising edge cases or constraints?
234
291
  - What should the next similar change do differently?"
235
292
  ```
236
- 4. Label the molecule as consolidated:
293
+
294
+ 5. Squash the molecule into a digest issue:
295
+ ```
296
+ bd mol squash <mol-id> --summary "Spec-driven change: <change-name>"
237
297
  ```
238
- bd label add <mol-id> status:consolidated
298
+ This compresses the 5 child steps into a single lightweight record.
299
+ The molecule remains searchable but no longer clutters the issue graph.
300
+
301
+ 6. Optionally extract a reusable formula (if this change
302
+ represents a repeatable pattern):
239
303
  ```
240
- 5. Run the OpenSpec archive command:
304
+ bd mol distill <mol-id> my-pattern
241
305
  ```
306
+ This creates `.beads/formulas/my-pattern.formula.toml` from the
307
+ completed change. Future projects can `bd pour my-pattern`.
308
+
309
+ 7. Label and archive:
310
+ ```
311
+ bd label add <mol-id> status:consolidated
242
312
  openspec archive
243
313
  ```
244
314
 
245
315
  Future `bd prime` calls will inject the learnings into every session.
246
- The labeled molecule remains searchable: `bd list --label status:consolidated`.
316
+ The squashed digest and distilled formulas persist beyond the change.
@@ -0,0 +1,21 @@
1
+ formula = "spec-compliance"
2
+ description = "Auto-inject spec compliance verification before consolidate"
3
+ version = 1
4
+ type = "aspect"
5
+
6
+ # This aspect targets any step named "consolidate" and injects a
7
+ # spec-verification pre-step. Applied automatically when the aspect file
8
+ # exists in .beads/formulas/.
9
+
10
+ [[advice]]
11
+ target = "*.consolidate"
12
+
13
+ [advice.before]
14
+ id = "verify-specs-{step.id}"
15
+ title = "Verify spec scenarios pass for {step.title}"
16
+ needs = ["implement"]
17
+ type = "task"
18
+ description = >
19
+ Read the spec files at openspec/changes/{{name}}/specs/ and verify
20
+ every scenario passes against the implementation. If any scenario
21
+ fails, block consolidate until the issue is resolved.
@@ -1,6 +1,6 @@
1
1
  formula = "spec-driven-change"
2
2
  description = "OpenSpec spec-driven change with Beads"
3
- version = 1
3
+ version = 2
4
4
  type = "workflow"
5
5
 
6
6
  [vars.name]
@@ -11,11 +11,35 @@ required = true
11
11
  description = "Comma-separated list of capability names"
12
12
  required = false
13
13
 
14
- # Phases mirror the OpenSpec schema:
15
- # proposal -> specs -> design -> apply -> consolidate
14
+ # Base dependency chain: proposal -> specs -> design -> implement -> consolidate
16
15
  #
17
- # Human steps for proposal/specs/design require agent review.
18
- # Gate steps for consolidate ensure learnings are captured.
16
+ # Bond points for optional composition:
17
+ # parallel-execution (after implement) split implement into parallel sub-steps
18
+ # Bond a multi-agent formula here for parallel capability implementation.
19
+ # Each sub-step gets its own bd pin for agent assignment.
20
+ # Uses waits_for (fan-in) to rejoin before consolidate.
21
+ #
22
+ # async-gates (before implement) — add gates for async coordination
23
+ # Bond a gated formula here for human approval gates, CI checks, or timers.
24
+ # Gates block step progression until conditions are met.
25
+ #
26
+ # spec-compliance (before consolidate) — auto-injected by aspect
27
+ # The spec-compliance.aspect.toml injects "Verify specs pass" here.
28
+ # Applied automatically when the aspect is installed in .beads/formulas/.
29
+
30
+ [[compose.bond_points]]
31
+ id = "parallel-execution"
32
+ step = "implement"
33
+ position = "after"
34
+ description = "Bond a multi-agent formula here to split implement into parallel sub-steps per capability"
35
+
36
+ [[compose.bond_points]]
37
+ id = "async-gates"
38
+ step = "implement"
39
+ position = "before"
40
+ description = "Bond a gated formula here for human approval, CI checks, or timer gates"
41
+
42
+ # Base steps
19
43
 
20
44
  [[steps]]
21
45
  id = "proposal"
@@ -40,10 +64,12 @@ id = "implement"
40
64
  title = "Implement {{name}}"
41
65
  needs = ["design"]
42
66
  description = "Implement the change per specs and design"
67
+ [steps.on_complete]
68
+ run = "bd ready"
43
69
 
44
70
  [[steps]]
45
71
  id = "consolidate"
46
72
  title = "Consolidate {{name}}"
47
73
  needs = ["implement"]
48
74
  type = "human"
49
- description = "Close issues, compact, remember learnings, archive"
75
+ description = "Lint, squash, remember learnings, archive"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "spec-driven-with-beads",
3
- "version": "2.0.0",
4
- "description": "OpenSpec custom schema using Beads (bd) for task tracking, execution, and knowledge consolidation",
3
+ "version": "3.0.0",
4
+ "description": "OpenSpec custom schema using Beads molecules with bond points, aspects, and distill for spec-driven development",
5
5
  "keywords": ["openspec", "beads", "spec-driven-development", "schema", "sdd"],
6
6
  "license": "MIT",
7
7
  "author": "yoinks-yoinks",