spec-driven-with-beads 1.1.5 → 2.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
@@ -1,24 +1,29 @@
1
1
  # spec-driven-with-beads
2
2
 
3
- OpenSpec custom schema that uses [Beads](https://github.com/gastownhall/beads) (`bd`) for task tracking, execution, and **durable knowledge retention** across sessions.
3
+ OpenSpec custom schema that uses [Beads](https://github.com/gastownhall/beads) molecules for task tracking, execution, and durable knowledge retention across sessions.
4
4
 
5
5
  ```
6
- proposal → specs → design → tasks+beads → apply (via Beads) → consolidate
6
+ proposal → specs → design → tasks+beads → apply (via molecule) → consolidate
7
7
  ```
8
8
 
9
9
  ## What makes this different
10
10
 
11
11
  Other spec-driven schemas end at `archive` — move files, update specs, done. Knowledge dies with the session.
12
12
 
13
- This schema adds **`consolidate`** a fourth action that closes the learning loop:
13
+ This schema uses Beads' **formula + molecule** system. One `bd pour` command creates the entire dependency graph:
14
14
 
15
- | Phase | What happens |
16
- |-------|-------------|
17
- | `tasks` | Writes `tasks.md` AND seeds Beads via `bd create` + `bd dep add` |
18
- | `apply` | Drives work through `bd ready` → `bd update --claim` → code → `bd close` |
19
- | **`consolidate`** | `bd close` remaining → **`bd compact`** → **`bd remember`** → `openspec archive` |
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.
20
25
 
21
- The key: **`bd remember`** persists lessons, decisions, and edge cases as durable memories. Every future `bd prime` call injects them into the agent's context. Next session, the agent knows what the last change taught you — no context loss, no rediscovery.
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.
22
27
 
23
28
  No other OpenSpec schema does this. No task tracker (Linear, GitHub Issues, Jira) has a `bd remember` equivalent.
24
29
 
@@ -46,11 +51,13 @@ schema: spec-driven-with-beads
46
51
 
47
52
  Then use standard OpenSpec commands:
48
53
  - `/opsx:propose "my feature"`
49
- - `/opsx:apply`
50
- - `/opsx:consolidate` — closes issues, compacts, remembers, archives
54
+ - `/opsx:apply` — driven by molecule step order
55
+ - `/opsx:consolidate` — remember, compact, archive
51
56
 
52
57
  ## Links
53
58
 
54
59
  - [OpenSpec](https://github.com/Fission-AI/OpenSpec)
55
60
  - [Beads](https://github.com/gastownhall/beads)
61
+ - [Beads Formula docs](https://gastownhall.github.io/beads/workflows/formulas)
62
+ - [Beads Molecule docs](https://gastownhall.github.io/beads/workflows/molecules)
56
63
  - [Community schema catalog](https://github.com/intent-driven-dev/openspec-schemas)
@@ -1,39 +1,69 @@
1
1
  # spec-driven-with-beads
2
2
 
3
- OpenSpec workflow that uses Beads (`bd`) for task tracking and execution instead of flat task lists.
3
+ OpenSpec custom schema that uses [Beads](https://github.com/gastownhall/beads) molecules for task tracking, execution, and durable knowledge retention across sessions.
4
4
 
5
5
  ## Workflow
6
6
 
7
7
  ```
8
- proposal → specs → design → tasks+beads → apply (via Beads) → consolidate
8
+ proposal → specs → design → tasks+beads → apply (via molecule) → consolidate
9
9
  ```
10
10
 
11
- | Phase | Artifact | Beads interaction |
12
- |-------|----------|-------------------|
13
- | `propose` | `proposal.md` | None |
14
- | `specs` | `specs/**/*.md` | None |
15
- | `design` | `design.md` | None |
16
- | `tasks` | `tasks.md` + seeds Beads | `bd create` for each task, `bd dep add` for dependencies |
17
- | `apply` | (tracks via Beads) | `bd ready` → `bd update --claim` → code → `bd close` |
18
- | `consolidate` | (wraps up) | `bd close` remaining → `bd compact` → `bd remember` learnings → `openspec archive` |
11
+ ## What makes this different
19
12
 
20
- ## Why Beads?
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.
21
14
 
22
- - **Context efficiency** agent queries `bd ready` for next task instead of re-reading tasks.md
23
- - **Dependency tracking** — `bd dep add` makes blockers explicit
24
- - **Persistence** — survive across sessions, no context loss
25
- - **Progress visibility** `bd stats`, `bd dep tree` show real status
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
+ ## Molecule structure
22
+
23
+ ```
24
+ 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)
30
+ ```
31
+
32
+ No manual `bd create` × N or `bd dep add` × N — the formula defines the graph.
26
33
 
27
34
  ## Requirements
28
35
 
29
36
  - [Beads](https://github.com/gastownhall/beads) installed (`bd` on PATH)
30
- - `bd init` run in the project
31
- - Beads MCP server optional but recommended for richer integration
37
+ - `bd init` run in your project
38
+ - OpenSpec installed (`npm install -g @fission-ai/openspec`)
39
+
40
+ ## Install
32
41
 
33
- ## Activation
42
+ ```bash
43
+ npm install -g spec-driven-with-beads
44
+ ```
45
+
46
+ This copies the schema into OpenSpec's global schemas.
47
+
48
+ ## Usage
34
49
 
35
50
  In `openspec/config.yaml`:
36
51
 
37
52
  ```yaml
38
53
  schema: spec-driven-with-beads
39
54
  ```
55
+
56
+ Then standard OpenSpec commands, but with Beads molecule awareness:
57
+ - `/opsx:propose "my feature"`
58
+ - `/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
62
+
63
+ ## Links
64
+
65
+ - [OpenSpec](https://github.com/Fission-AI/OpenSpec)
66
+ - [Beads](https://github.com/gastownhall/beads)
67
+ - [Beads Formula docs](https://gastownhall.github.io/beads/workflows/formulas)
68
+ - [Beads Molecule docs](https://gastownhall.github.io/beads/workflows/molecules)
69
+ - [Community schema catalog](https://github.com/intent-driven-dev/openspec-schemas)
@@ -1,5 +1,5 @@
1
1
  name: spec-driven-with-beads
2
- version: 1
2
+ version: 2
3
3
  description: >
4
4
  OpenSpec workflow powered by Beads issue tracking.
5
5
  proposal -> specs -> design -> tasks+beads -> apply (via Beads) -> consolidate.
@@ -79,27 +79,6 @@ artifacts:
79
79
  Common pitfall: Using MODIFIED with partial content loses detail at archive time.
80
80
  If adding new concerns without changing existing behavior, use ADDED instead.
81
81
 
82
- Example:
83
-
84
- ```
85
- ## ADDED Requirements
86
-
87
- ### Requirement: User can export data
88
-
89
- The system SHALL allow users to export their data in CSV format.
90
-
91
- #### Scenario: Successful export
92
-
93
- - **WHEN** user clicks "Export" button
94
- - **THEN** system downloads a CSV file with all user data
95
-
96
- ## REMOVED Requirements
97
-
98
- ### Requirement: Legacy export
99
-
100
- **Reason**: Replaced by new export system
101
- **Migration**: Use new export endpoint at /api/v2/export
102
- ```
103
82
 
104
83
  Specs should be testable — each scenario is a potential test case.
105
84
  requires:
@@ -135,63 +114,63 @@ artifacts:
135
114
 
136
115
  - id: tasks
137
116
  generates: tasks.md
138
- description: Implementation checklist with trackable tasks. Also seeds Beads issues.
117
+ description: >
118
+ Implementation checklist. Seeds Beads molecule via formula pour —
119
+ one command creates the entire dependency graph.
139
120
  template: tasks.md
140
121
  instruction: >
141
- Create the task list that breaks down the implementation work AND seed
142
- corresponding issues in Beads.
122
+ Create the task list AND seed Beads using the formula + molecule system.
143
123
 
144
124
 
145
- **IMPORTANT: Follow the template below exactly.**
125
+ **1. Ensure the spec-driven-change formula exists**
146
126
 
127
+ If `.beads/formulas/spec-driven-change.formula.toml` does not exist,
128
+ create it from the template at
129
+ `openspec/schemas/spec-driven-with-beads/templates/spec-driven-change.formula.toml`.
147
130
 
148
- Guidelines:
149
131
 
150
- - Group related tasks under ## numbered headings
132
+ **2. Pour the molecule**
151
133
 
152
- - Each task MUST be a checkbox: `- [ ] X.Y Task description`
153
-
154
- - Tasks should be small enough to complete in one session
155
-
156
- - Order tasks by dependency (what must be done first?)
157
-
158
-
159
- Example:
134
+ Run:
160
135
 
136
+ ```
137
+ bd pour spec-driven-change --var name=<change-name>
161
138
  ```
162
139
 
163
- ## 1. Setup
164
-
165
- - [ ] 1.1 Create new module structure
166
-
167
- - [ ] 1.2 Add dependencies to package.json
168
-
169
- ## 2. Core Implementation
170
-
171
- - [ ] 2.1 Implement data export function
172
-
173
- - [ ] 2.2 Add CSV formatting utilities
140
+ This creates a molecule (parent epic + 5 child steps) with proper
141
+ `needs` dependencies:
174
142
 
143
+ ```
144
+ 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)
175
150
  ```
176
151
 
152
+ The dependency chain is built into the formula — no manual `bd dep add` needed.
177
153
 
178
- Reference specs for what needs to be built, design for how to build it.
179
154
 
180
- Each task should be verifiable — you know when it's done.
155
+ **3. Label the molecule**
181
156
 
157
+ ```
158
+ bd label add bd-xyz change:<change-name>
159
+ bd label add bd-xyz schema:spec-driven-with-beads
160
+ ```
182
161
 
183
- **After writing tasks.md, seed Beads:**
184
162
 
185
- Run `bd create "Spec-driven Change: <change-name>" -t epic -p 1` for the
186
- parent epic, then for each task run:
163
+ **4. Set acceptance criteria for the implement step**
187
164
 
188
165
  ```
189
- bd create "X.Y Task description" -t task -p 1
166
+ bd update bd-xyz.4 --acceptance "All spec scenarios pass. Tests added."
190
167
  ```
191
168
 
192
- Then link dependencies using `bd dep add <child> <parent>`.
193
169
 
194
- Use `bd ready` to verify the task list is properly seeded.
170
+ **5. Write tasks.md**
171
+
172
+ Write the standard OpenSpec tasks.md for human readability.
173
+ The molecule is the source of truth; tasks.md is a view.
195
174
  requires:
196
175
  - specs
197
176
  - design
@@ -201,30 +180,52 @@ apply:
201
180
  - tasks
202
181
  tracks: tasks.md
203
182
  instruction: |
204
- Use Beads to drive implementation, not tasks.md directly.
183
+ Drive implementation through the molecule. The dependency graph
184
+ enforces order automatically.
205
185
 
206
186
  Workflow:
207
- 1. Run `bd ready` to see the next unblocked task.
208
- 2. Pick the highest priority task and run `bd update <id> --claim`.
209
- 3. Read specs/design for context, implement the code.
210
- 4. Run `bd close <id> --reason "Implemented"`.
211
- 5. Repeat from step 1 until `bd ready` returns nothing.
187
+ 1. Run `bd mol list --json` to find the molecule for this change.
188
+ 2. Run `bd dep tree <mol-id>` to see the step hierarchy.
189
+ 3. Run `bd ready` only shows steps whose needs are met.
190
+ 4. For the next ready step, claim it:
191
+ ```
192
+ bd update <mol-id>.N --claim
193
+ ```
194
+ 5. Read specs/design for context, implement the code.
195
+ 6. Run acceptance criteria check if applicable:
196
+ ```
197
+ bd show <mol-id>.N # view acceptance criteria
198
+ ```
199
+ 7. Close the step:
200
+ ```
201
+ bd close <mol-id>.N --reason "Implemented"
202
+ ```
203
+ 8. Run `bd ready` again — next step in the chain becomes available.
204
+ 9. Repeat until all steps are closed.
212
205
 
213
- Mark tasks.md checkboxes as you go for a human-readable view, but
214
- Beads is the source of truth for task state. Do not skip `bd close`.
206
+ Tips:
207
+ - `bd blocked` shows steps waiting on dependencies.
208
+ - `bd stats` shows molecule progress.
209
+ - Mark tasks.md checkboxes for human readability, but the molecule
210
+ is the source of truth.
215
211
 
216
- Pause if you hit blockers or need clarification. Use `bd show <id>` to
217
- inspect task details, and `bd update <id>` to add notes.
212
+ Pause if you hit blockers or need clarification.
218
213
 
219
214
  consolidate:
220
215
  requires:
221
216
  - apply
222
217
  instruction: |
223
- All tasks are complete. Run consolidate to close the loop:
218
+ Close the molecule and persist learnings.
224
219
 
225
- 1. Close any remaining open Beads issues: `bd close <id1> <id2> ...`
226
- 2. Compact old closed issues: `bd compact`
227
- 3. Distill learnings from this change and persist them:
220
+ 1. Verify all steps are closed:
221
+ ```
222
+ bd mol show <mol-id>
223
+ ```
224
+ 2. Run molecule compaction:
225
+ ```
226
+ bd compact
227
+ ```
228
+ 3. Distill learnings from this change:
228
229
  ```
229
230
  bd remember --key spec-driven-beads-<change-name> "Lessons from this change:
230
231
  - What unexpected problems did you encounter?
@@ -232,6 +233,14 @@ consolidate:
232
233
  - Any surprising edge cases or constraints?
233
234
  - What should the next similar change do differently?"
234
235
  ```
235
- 4. Run the OpenSpec archive command: `openspec archive` (moves change folder, updates source specs)
236
+ 4. Label the molecule as consolidated:
237
+ ```
238
+ bd label add <mol-id> status:consolidated
239
+ ```
240
+ 5. Run the OpenSpec archive command:
241
+ ```
242
+ openspec archive
243
+ ```
236
244
 
237
- This ensures knowledge persists across sessions — future `bd prime` calls will inject these learnings.
245
+ Future `bd prime` calls will inject the learnings into every session.
246
+ The labeled molecule remains searchable: `bd list --label status:consolidated`.
@@ -0,0 +1,49 @@
1
+ formula = "spec-driven-change"
2
+ description = "OpenSpec spec-driven change with Beads"
3
+ version = 1
4
+ type = "workflow"
5
+
6
+ [vars.name]
7
+ description = "Change name (kebab-case)"
8
+ required = true
9
+
10
+ [vars.capabilities]
11
+ description = "Comma-separated list of capability names"
12
+ required = false
13
+
14
+ # Phases mirror the OpenSpec schema:
15
+ # proposal -> specs -> design -> apply -> consolidate
16
+ #
17
+ # Human steps for proposal/specs/design require agent review.
18
+ # Gate steps for consolidate ensure learnings are captured.
19
+
20
+ [[steps]]
21
+ id = "proposal"
22
+ title = "Review proposal for {{name}}"
23
+ type = "human"
24
+ description = "Review the proposal document at openspec/changes/{{name}}/proposal.md"
25
+
26
+ [[steps]]
27
+ id = "specs"
28
+ title = "Write specs for {{name}}"
29
+ needs = ["proposal"]
30
+ description = "Create spec files under openspec/changes/{{name}}/specs/"
31
+
32
+ [[steps]]
33
+ id = "design"
34
+ title = "Design {{name}}"
35
+ needs = ["specs"]
36
+ description = "Write design document at openspec/changes/{{name}}/design.md"
37
+
38
+ [[steps]]
39
+ id = "implement"
40
+ title = "Implement {{name}}"
41
+ needs = ["design"]
42
+ description = "Implement the change per specs and design"
43
+
44
+ [[steps]]
45
+ id = "consolidate"
46
+ title = "Consolidate {{name}}"
47
+ needs = ["implement"]
48
+ type = "human"
49
+ description = "Close issues, compact, remember learnings, archive"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spec-driven-with-beads",
3
- "version": "1.1.5",
3
+ "version": "2.0.0",
4
4
  "description": "OpenSpec custom schema using Beads (bd) for task tracking, execution, and knowledge consolidation",
5
5
  "keywords": ["openspec", "beads", "spec-driven-development", "schema", "sdd"],
6
6
  "license": "MIT",