panopticon-cli 0.4.5 → 0.4.7

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.
Files changed (169) hide show
  1. package/README.md +84 -2695
  2. package/dist/{agents-B5NRTVHK.js → agents-54LDKMHR.js} +8 -3
  3. package/dist/chunk-44EOY2ZL.js +58 -0
  4. package/dist/chunk-44EOY2ZL.js.map +1 -0
  5. package/dist/chunk-BWGFN44T.js +224 -0
  6. package/dist/chunk-BWGFN44T.js.map +1 -0
  7. package/dist/chunk-F7NQZD6H.js +49 -0
  8. package/dist/chunk-F7NQZD6H.js.map +1 -0
  9. package/dist/chunk-HCTJFIJJ.js +159 -0
  10. package/dist/chunk-HCTJFIJJ.js.map +1 -0
  11. package/dist/chunk-JM6V62LT.js +650 -0
  12. package/dist/chunk-JM6V62LT.js.map +1 -0
  13. package/dist/chunk-K45YD6A3.js +254 -0
  14. package/dist/chunk-K45YD6A3.js.map +1 -0
  15. package/dist/chunk-KGPRXDMX.js +137 -0
  16. package/dist/chunk-KGPRXDMX.js.map +1 -0
  17. package/dist/chunk-KQAEUOML.js +278 -0
  18. package/dist/chunk-KQAEUOML.js.map +1 -0
  19. package/dist/chunk-NYVQC3D7.js +90 -0
  20. package/dist/chunk-NYVQC3D7.js.map +1 -0
  21. package/dist/chunk-PUR532O7.js +1556 -0
  22. package/dist/chunk-PUR532O7.js.map +1 -0
  23. package/dist/chunk-VTDDVLCK.js +1977 -0
  24. package/dist/chunk-VTDDVLCK.js.map +1 -0
  25. package/dist/chunk-Z24TY3XN.js +916 -0
  26. package/dist/chunk-Z24TY3XN.js.map +1 -0
  27. package/dist/chunk-ZHC57RCV.js +44 -0
  28. package/dist/chunk-ZHC57RCV.js.map +1 -0
  29. package/dist/{chunk-ITI4IC5A.js → chunk-ZZ3477GY.js} +69 -100
  30. package/dist/chunk-ZZ3477GY.js.map +1 -0
  31. package/dist/cli/index.js +4664 -2912
  32. package/dist/cli/index.js.map +1 -1
  33. package/dist/dashboard/public/assets/index-CRqsEkmn.css +32 -0
  34. package/dist/dashboard/public/assets/index-DPSUbu4A.js +645 -0
  35. package/dist/dashboard/public/index.html +15 -3
  36. package/dist/dashboard/server.js +45663 -17860
  37. package/dist/dns-L3L2BB27.js +30 -0
  38. package/dist/dns-L3L2BB27.js.map +1 -0
  39. package/dist/index.d.ts +63 -3
  40. package/dist/index.js +42 -18
  41. package/dist/index.js.map +1 -1
  42. package/dist/projects-ESIB34QQ.js +43 -0
  43. package/dist/projects-ESIB34QQ.js.map +1 -0
  44. package/dist/remote-agents-Z3R2A5BN.js +25 -0
  45. package/dist/remote-agents-Z3R2A5BN.js.map +1 -0
  46. package/dist/remote-workspace-HI4VML6H.js +179 -0
  47. package/dist/remote-workspace-HI4VML6H.js.map +1 -0
  48. package/dist/specialist-context-SNCJ7O7G.js +256 -0
  49. package/dist/specialist-context-SNCJ7O7G.js.map +1 -0
  50. package/dist/specialist-logs-A7ODEK2T.js +43 -0
  51. package/dist/specialist-logs-A7ODEK2T.js.map +1 -0
  52. package/dist/specialists-C7XLNSXQ.js +121 -0
  53. package/dist/specialists-C7XLNSXQ.js.map +1 -0
  54. package/dist/traefik-WI3KSRGG.js +12 -0
  55. package/dist/traefik-WI3KSRGG.js.map +1 -0
  56. package/package.json +2 -1
  57. package/skills/beads/README.md +120 -0
  58. package/skills/beads/SKILL.md +214 -0
  59. package/skills/beads/adr/0001-bd-prime-as-source-of-truth.md +59 -0
  60. package/skills/beads/resources/AGENTS.md +62 -0
  61. package/skills/beads/resources/ASYNC_GATES.md +168 -0
  62. package/skills/beads/resources/BOUNDARIES.md +469 -0
  63. package/skills/beads/resources/CHEMISTRY_PATTERNS.md +197 -0
  64. package/skills/beads/resources/CLI_REFERENCE.md +558 -0
  65. package/skills/beads/resources/DEPENDENCIES.md +747 -0
  66. package/skills/beads/resources/INTEGRATION_PATTERNS.md +407 -0
  67. package/skills/beads/resources/ISSUE_CREATION.md +139 -0
  68. package/skills/beads/resources/MOLECULES.md +354 -0
  69. package/skills/beads/resources/PATTERNS.md +341 -0
  70. package/skills/beads/resources/RESUMABILITY.md +207 -0
  71. package/skills/beads/resources/STATIC_DATA.md +54 -0
  72. package/skills/beads/resources/TROUBLESHOOTING.md +489 -0
  73. package/skills/beads/resources/WORKFLOWS.md +623 -0
  74. package/skills/beads/resources/WORKTREES.md +94 -0
  75. package/skills/beads-completion-check/SKILL.md +90 -0
  76. package/skills/beads-panopticon-guide/SKILL.md +171 -0
  77. package/skills/bug-fix/SKILL.md +32 -0
  78. package/skills/clear-writing/SKILL.md +105 -0
  79. package/skills/clear-writing/references/elements-of-style/01-introductory.md +3 -0
  80. package/skills/clear-writing/references/elements-of-style/02-elementary-rules-of-usage.md +214 -0
  81. package/skills/clear-writing/references/elements-of-style/03-elementary-principles-of-composition.md +398 -0
  82. package/skills/clear-writing/references/elements-of-style/04-a-few-matters-of-form.md +89 -0
  83. package/skills/clear-writing/references/elements-of-style/05-words-and-expressions-commonly-misused.md +342 -0
  84. package/skills/clear-writing/references/signs-of-ai-writing.md +901 -0
  85. package/skills/code-review/SKILL.md +37 -0
  86. package/skills/code-review-performance/SKILL.md +53 -0
  87. package/skills/code-review-security/SKILL.md +35 -0
  88. package/skills/dependency-update/SKILL.md +30 -0
  89. package/skills/feature-work/SKILL.md +39 -0
  90. package/skills/incident-response/SKILL.md +32 -0
  91. package/skills/knowledge-capture/SKILL.md +463 -0
  92. package/skills/onboard-codebase/SKILL.md +34 -0
  93. package/skills/opus-plan/SKILL.md +400 -0
  94. package/skills/pan-approve/SKILL.md +136 -0
  95. package/skills/pan-code-review/SKILL.md +249 -0
  96. package/skills/pan-config/SKILL.md +164 -0
  97. package/skills/pan-convoy-synthesis/SKILL.md +249 -0
  98. package/skills/pan-diagnose/SKILL.md +360 -0
  99. package/skills/pan-docker/SKILL.md +279 -0
  100. package/skills/pan-docs/SKILL.md +113 -0
  101. package/skills/pan-down/SKILL.md +434 -0
  102. package/skills/pan-health/SKILL.md +240 -0
  103. package/skills/pan-help/SKILL.md +237 -0
  104. package/skills/pan-install/SKILL.md +339 -0
  105. package/skills/pan-issue/SKILL.md +596 -0
  106. package/skills/pan-kill/SKILL.md +172 -0
  107. package/skills/pan-logs/SKILL.md +255 -0
  108. package/skills/pan-network/SKILL.md +320 -0
  109. package/skills/pan-oversee/SKILL.md +290 -0
  110. package/skills/pan-plan/SKILL.md +521 -0
  111. package/skills/pan-projects/SKILL.md +239 -0
  112. package/skills/pan-quickstart/SKILL.md +440 -0
  113. package/skills/pan-reload/SKILL.md +44 -0
  114. package/skills/pan-rescue/SKILL.md +271 -0
  115. package/skills/pan-restart/SKILL.md +53 -0
  116. package/skills/pan-setup/SKILL.md +478 -0
  117. package/skills/pan-skill-creator/SKILL.md +168 -0
  118. package/skills/pan-skill-creator/references/output-patterns.md +141 -0
  119. package/skills/pan-skill-creator/references/workflows.md +90 -0
  120. package/skills/pan-skill-creator/scripts/init_skill.py +176 -0
  121. package/skills/pan-status/SKILL.md +493 -0
  122. package/skills/pan-subagent-creator/SKILL.md +295 -0
  123. package/skills/pan-subagent-creator/assets/validate-readonly-query.sh +35 -0
  124. package/skills/pan-subagent-creator/references/example-agents.md +308 -0
  125. package/skills/pan-subagent-creator/scripts/init_agent.py +126 -0
  126. package/skills/pan-sync/SKILL.md +272 -0
  127. package/skills/pan-tell/SKILL.md +157 -0
  128. package/skills/pan-test-config/SKILL.md +208 -0
  129. package/skills/pan-tracker/SKILL.md +288 -0
  130. package/skills/pan-up/SKILL.md +458 -0
  131. package/skills/pan-workspace-config/SKILL.md +303 -0
  132. package/skills/refactor/SKILL.md +30 -0
  133. package/skills/refactor-radar/SKILL.md +475 -0
  134. package/skills/release/SKILL.md +25 -0
  135. package/skills/send-feedback-to-agent/SKILL.md +98 -0
  136. package/skills/session-health/SKILL.md +76 -0
  137. package/skills/session-health/scripts/check_sessions.py +166 -0
  138. package/skills/skill-creator/SKILL.md +92 -0
  139. package/skills/skill-creator/scripts/init_skill.py +152 -0
  140. package/skills/skill-creator/scripts/package_skill.py +123 -0
  141. package/skills/stitch-design-md/README.md +34 -0
  142. package/skills/stitch-design-md/SKILL.md +172 -0
  143. package/skills/stitch-design-md/examples/DESIGN.md +154 -0
  144. package/skills/stitch-react-components/README.md +36 -0
  145. package/skills/stitch-react-components/SKILL.md +47 -0
  146. package/skills/stitch-react-components/examples/gold-standard-card.tsx +80 -0
  147. package/skills/stitch-react-components/package-lock.json +231 -0
  148. package/skills/stitch-react-components/package.json +16 -0
  149. package/skills/stitch-react-components/resources/architecture-checklist.md +15 -0
  150. package/skills/stitch-react-components/resources/component-template.tsx +37 -0
  151. package/skills/stitch-react-components/resources/stitch-api-reference.md +14 -0
  152. package/skills/stitch-react-components/resources/style-guide.json +27 -0
  153. package/skills/stitch-react-components/scripts/fetch-stitch.sh +30 -0
  154. package/skills/stitch-react-components/scripts/validate.js +68 -0
  155. package/skills/stitch-setup/SKILL.md +94 -0
  156. package/skills/web-design-guidelines/SKILL.md +39 -0
  157. package/skills/work-complete/SKILL.md +79 -0
  158. package/templates/traefik/docker-compose.yml +1 -1
  159. package/templates/traefik/dynamic/panopticon.yml.template +41 -0
  160. package/templates/traefik/traefik.yml +8 -0
  161. package/dist/chunk-7HHDVXBM.js +0 -349
  162. package/dist/chunk-7HHDVXBM.js.map +0 -1
  163. package/dist/chunk-H45CLB7E.js +0 -2044
  164. package/dist/chunk-H45CLB7E.js.map +0 -1
  165. package/dist/chunk-ITI4IC5A.js.map +0 -1
  166. package/dist/dashboard/public/assets/index-BDd8hGYb.css +0 -32
  167. package/dist/dashboard/public/assets/index-sFwLPko-.js +0 -556
  168. package/templates/traefik/dynamic/panopticon.yml +0 -51
  169. /package/dist/{agents-B5NRTVHK.js.map → agents-54LDKMHR.js.map} +0 -0
@@ -0,0 +1,354 @@
1
+ # Molecules and Wisps Reference
2
+
3
+ This reference covers bd's molecular chemistry system for reusable work templates and ephemeral workflows.
4
+
5
+ ## The Chemistry Metaphor
6
+
7
+ bd v0.34.0 introduces a chemistry-inspired workflow system:
8
+
9
+ | Phase | Name | Storage | Synced? | Use Case |
10
+ |-------|------|---------|---------|----------|
11
+ | **Solid** | Proto | `.beads/` | Yes | Reusable template (epic with `template` label) |
12
+ | **Liquid** | Mol | `.beads/` | Yes | Persistent instance (real issues from template) |
13
+ | **Vapor** | Wisp | `.beads-wisp/` | No | Ephemeral instance (operational work, no audit trail) |
14
+
15
+ **Phase transitions:**
16
+ - `spawn` / `pour`: Solid (proto) → Liquid (mol)
17
+ - `wisp create`: Solid (proto) → Vapor (wisp)
18
+ - `squash`: Vapor (wisp) → Digest (permanent summary)
19
+ - `burn`: Vapor (wisp) → Nothing (deleted, no trace)
20
+ - `distill`: Liquid (ad-hoc epic) → Solid (proto)
21
+
22
+ ## When to Use Molecules
23
+
24
+ ### Use Protos/Mols When:
25
+ - **Repeatable patterns** - Same workflow structure used multiple times (releases, reviews, onboarding)
26
+ - **Team knowledge capture** - Encoding tribal knowledge as executable templates
27
+ - **Audit trail matters** - Work that needs to be tracked and reviewed later
28
+ - **Cross-session persistence** - Work spanning multiple days/sessions
29
+
30
+ ### Use Wisps When:
31
+ - **Operational loops** - Patrol cycles, health checks, routine monitoring
32
+ - **One-shot orchestration** - Temporary coordination that shouldn't clutter history
33
+ - **Diagnostic runs** - Debugging workflows with no archival value
34
+ - **High-frequency ephemeral work** - Would create noise in permanent database
35
+
36
+ **Key insight:** Wisps prevent database bloat from routine operations while still providing structure during execution.
37
+
38
+ ---
39
+
40
+ ## Proto Management
41
+
42
+ ### Creating a Proto
43
+
44
+ Protos are epics with the `template` label. Create manually or distill from existing work:
45
+
46
+ ```bash
47
+ # Manual creation
48
+ bd create "Release Workflow" --type epic --label template
49
+ bd create "Run tests for {{component}}" --type task
50
+ bd dep add task-id epic-id --type parent-child
51
+
52
+ # Distill from ad-hoc work (extracts template from existing epic)
53
+ bd mol distill bd-abc123 --as "Release Workflow" --var version=1.0.0
54
+ ```
55
+
56
+ **Proto naming convention:** Use `mol-` prefix for clarity (e.g., `mol-release`, `mol-patrol`).
57
+
58
+ ### Listing Formulas
59
+
60
+ ```bash
61
+ bd formula list # List all formulas (protos)
62
+ bd formula list --json # Machine-readable
63
+ ```
64
+
65
+ ### Viewing Proto Structure
66
+
67
+ ```bash
68
+ bd mol show mol-release # Show template structure and variables
69
+ bd mol show mol-release --json # Machine-readable
70
+ ```
71
+
72
+ ---
73
+
74
+ ## Spawning Molecules
75
+
76
+ ### Basic Spawn (Creates Wisp by Default)
77
+
78
+ ```bash
79
+ bd mol spawn mol-patrol # Creates wisp (ephemeral)
80
+ bd mol spawn mol-feature --pour # Creates mol (persistent)
81
+ bd mol spawn mol-release --var version=2.0 # With variable substitution
82
+ ```
83
+
84
+ **Chemistry shortcuts:**
85
+ ```bash
86
+ bd mol pour mol-feature # Shortcut for spawn --pour
87
+ bd mol wisp mol-patrol # Explicit wisp creation
88
+ ```
89
+
90
+ ### Spawn with Immediate Execution
91
+
92
+ ```bash
93
+ bd mol run mol-release --var version=2.0
94
+ ```
95
+
96
+ `bd mol run` does three things:
97
+ 1. Spawns the molecule (persistent)
98
+ 2. Assigns root issue to caller
99
+ 3. Pins root issue for session recovery
100
+
101
+ **Use `mol run` when:** Starting durable work that should survive crashes. The pin ensures `bd ready` shows the work after restart.
102
+
103
+ ### Spawn with Attachments
104
+
105
+ Attach additional protos in a single command:
106
+
107
+ ```bash
108
+ bd mol spawn mol-feature --attach mol-testing --var name=auth
109
+ # Spawns mol-feature, then spawns mol-testing and bonds them
110
+ ```
111
+
112
+ **Attach types:**
113
+ - `sequential` (default) - Attached runs after primary completes
114
+ - `parallel` - Attached runs alongside primary
115
+ - `conditional` - Attached runs only if primary fails
116
+
117
+ ```bash
118
+ bd mol spawn mol-deploy --attach mol-rollback --attach-type conditional
119
+ ```
120
+
121
+ ---
122
+
123
+ ## Bonding Molecules
124
+
125
+ ### Bond Types
126
+
127
+ ```bash
128
+ bd mol bond A B # Sequential: B runs after A
129
+ bd mol bond A B --type parallel # Parallel: B runs alongside A
130
+ bd mol bond A B --type conditional # Conditional: B runs if A fails
131
+ ```
132
+
133
+ ### Operand Combinations
134
+
135
+ | A | B | Result |
136
+ |---|---|--------|
137
+ | proto | proto | Compound proto (reusable template) |
138
+ | proto | mol | Spawn proto, attach to molecule |
139
+ | mol | proto | Spawn proto, attach to molecule |
140
+ | mol | mol | Join into compound molecule |
141
+
142
+ ### Phase Control in Bonds
143
+
144
+ By default, spawned protos inherit target's phase. Override with flags:
145
+
146
+ ```bash
147
+ # Found bug during wisp patrol? Persist it:
148
+ bd mol bond mol-critical-bug wisp-patrol --pour
149
+
150
+ # Need ephemeral diagnostic on persistent feature?
151
+ bd mol bond mol-temp-check bd-feature --wisp
152
+ ```
153
+
154
+ ### Custom Compound Names
155
+
156
+ ```bash
157
+ bd mol bond mol-feature mol-deploy --as "Feature with Deploy"
158
+ ```
159
+
160
+ ---
161
+
162
+ ## Wisp Lifecycle
163
+
164
+ ### Creating Wisps
165
+
166
+ ```bash
167
+ bd mol wisp mol-patrol # From proto
168
+ bd mol spawn mol-patrol # Same (spawn defaults to wisp)
169
+ bd mol spawn mol-check --var target=db # With variables
170
+ ```
171
+
172
+ ### Listing Wisps
173
+
174
+ ```bash
175
+ bd mol wisp list # List all wisps
176
+ bd mol wisp list --json # Machine-readable
177
+ ```
178
+
179
+ ### Ending Wisps
180
+
181
+ **Option 1: Squash (compress to digest)**
182
+ ```bash
183
+ bd mol squash wisp-abc123 # Auto-generate summary
184
+ bd mol squash wisp-abc123 --summary "Completed patrol" # Agent-provided summary
185
+ bd mol squash wisp-abc123 --keep-children # Keep children, just create digest
186
+ bd mol squash wisp-abc123 --dry-run # Preview
187
+ ```
188
+
189
+ Squash creates a permanent digest issue summarizing the wisp's work, then deletes the wisp children.
190
+
191
+ **Option 2: Burn (delete without trace)**
192
+ ```bash
193
+ bd mol burn wisp-abc123 # Delete wisp, no digest
194
+ ```
195
+
196
+ Use burn for routine work with no archival value.
197
+
198
+ ### Garbage Collection
199
+
200
+ ```bash
201
+ bd mol wisp gc # Clean up orphaned wisps
202
+ ```
203
+
204
+ ---
205
+
206
+ ## Distilling Protos
207
+
208
+ Extract a reusable template from ad-hoc work:
209
+
210
+ ```bash
211
+ bd mol distill bd-o5xe --as "Release Workflow"
212
+ bd mol distill bd-abc --var feature_name=auth-refactor --var version=1.0.0
213
+ ```
214
+
215
+ **What distill does:**
216
+ 1. Loads existing epic and all children
217
+ 2. Clones structure as new proto (adds `template` label)
218
+ 3. Replaces concrete values with `{{variable}}` placeholders
219
+
220
+ **Variable syntax (both work):**
221
+ ```bash
222
+ --var branch=feature-auth # variable=value (recommended)
223
+ --var feature-auth=branch # value=variable (auto-detected)
224
+ ```
225
+
226
+ **Use cases:**
227
+ - Team develops good workflow organically, wants to reuse it
228
+ - Capture tribal knowledge as executable templates
229
+ - Create starting point for similar future work
230
+
231
+ ---
232
+
233
+ ## Cross-Project Dependencies
234
+
235
+ ### Concept
236
+
237
+ Projects can depend on capabilities shipped by other projects:
238
+
239
+ ```bash
240
+ # Project A ships a capability
241
+ bd ship auth-api # Marks capability as available
242
+
243
+ # Project B depends on it
244
+ bd dep add bd-123 external:project-a:auth-api
245
+ ```
246
+
247
+ ### Shipping Capabilities
248
+
249
+ ```bash
250
+ bd ship <capability> # Ship capability (requires closed issue)
251
+ bd ship <capability> --force # Ship even if issue not closed
252
+ bd ship <capability> --dry-run # Preview
253
+ ```
254
+
255
+ **How it works:**
256
+ 1. Find issue with `export:<capability>` label
257
+ 2. Validate issue is closed
258
+ 3. Add `provides:<capability>` label
259
+
260
+ ### Depending on External Capabilities
261
+
262
+ ```bash
263
+ bd dep add <issue> external:<project>:<capability>
264
+ ```
265
+
266
+ The dependency is satisfied when the external project has a closed issue with `provides:<capability>` label.
267
+
268
+ **`bd ready` respects external deps:** Issues blocked by unsatisfied external dependencies won't appear in ready list.
269
+
270
+ ---
271
+
272
+ ## Common Patterns
273
+
274
+ ### Pattern: Weekly Review Proto
275
+
276
+ ```bash
277
+ # Create proto
278
+ bd create "Weekly Review" --type epic --label template
279
+ bd create "Review open issues" --type task
280
+ bd create "Update priorities" --type task
281
+ bd create "Archive stale work" --type task
282
+ # Link as children...
283
+
284
+ # Use each week
285
+ bd mol spawn mol-weekly-review --pour
286
+ ```
287
+
288
+ ### Pattern: Ephemeral Patrol Cycle
289
+
290
+ ```bash
291
+ # Patrol proto exists
292
+ bd mol wisp mol-patrol
293
+
294
+ # Execute patrol work...
295
+
296
+ # End patrol
297
+ bd mol squash wisp-abc123 --summary "Patrol complete: 3 issues found, 2 resolved"
298
+ ```
299
+
300
+ ### Pattern: Feature with Rollback
301
+
302
+ ```bash
303
+ bd mol spawn mol-deploy --attach mol-rollback --attach-type conditional
304
+ # If deploy fails, rollback automatically becomes unblocked
305
+ ```
306
+
307
+ ### Pattern: Capture Tribal Knowledge
308
+
309
+ ```bash
310
+ # After completing a good workflow organically
311
+ bd mol distill bd-release-epic --as "Release Process" --var version=X.Y.Z
312
+ # Now team can: bd mol spawn mol-release-process --var version=2.0.0
313
+ ```
314
+
315
+ ---
316
+
317
+ ## CLI Quick Reference
318
+
319
+ | Command | Purpose |
320
+ |---------|---------|
321
+ | `bd formula list` | List available formulas/protos |
322
+ | `bd mol show <id>` | Show proto/mol structure |
323
+ | `bd mol spawn <proto>` | Create wisp from proto (default) |
324
+ | `bd mol spawn <proto> --pour` | Create persistent mol from proto |
325
+ | `bd mol run <proto>` | Spawn + assign + pin (durable execution) |
326
+ | `bd mol bond <A> <B>` | Combine protos or molecules |
327
+ | `bd mol distill <epic>` | Extract proto from ad-hoc work |
328
+ | `bd mol squash <mol>` | Compress wisp children to digest |
329
+ | `bd mol burn <wisp>` | Delete wisp without trace |
330
+ | `bd mol pour <proto>` | Shortcut for `spawn --pour` |
331
+ | `bd mol wisp <proto>` | Create ephemeral wisp |
332
+ | `bd mol wisp list` | List all wisps |
333
+ | `bd mol wisp gc` | Garbage collect orphaned wisps |
334
+ | `bd ship <capability>` | Publish capability for cross-project deps |
335
+
336
+ ---
337
+
338
+ ## Troubleshooting
339
+
340
+ **"Proto not found"**
341
+ - Check `bd formula list` for available formulas/protos
342
+ - Protos need `template` label on the epic
343
+
344
+ **"Variable not substituted"**
345
+ - Use `--var key=value` syntax
346
+ - Check proto for `{{key}}` placeholders with `bd mol show`
347
+
348
+ **"Wisp commands fail"**
349
+ - Wisps stored in `.beads-wisp/` (separate from `.beads/`)
350
+ - Check `bd mol wisp list` for active wisps
351
+
352
+ **"External dependency not satisfied"**
353
+ - Target project must have closed issue with `provides:<capability>` label
354
+ - Use `bd ship <capability>` in target project first
@@ -0,0 +1,341 @@
1
+ # Common Usage Patterns
2
+
3
+ Practical patterns for using bd effectively across different scenarios.
4
+
5
+ ## Contents
6
+
7
+ - [Knowledge Work Session](#knowledge-work-session) - Resume long-running research or writing tasks
8
+ - [Side Quest Handling](#side-quest-handling) - Capture discovered work without losing context
9
+ - [Multi-Session Project Resume](#multi-session-project-resume) - Pick up work after time away
10
+ - [Status Transitions](#status-transitions) - When to change issue status
11
+ - [Compaction Recovery](#compaction-recovery) - Resume after conversation history is lost
12
+ - [Issue Closure](#issue-closure) - Documenting completion properly
13
+
14
+ ---
15
+
16
+ ## Knowledge Work Session
17
+
18
+ **Scenario**: User asks "Help me write a proposal for expanding the analytics platform"
19
+
20
+ **What you see**:
21
+ ```bash
22
+ $ bd ready
23
+ # Returns: bd-42 "Research analytics platform expansion proposal" (in_progress)
24
+
25
+ $ bd show bd-42
26
+ Notes: "COMPLETED: Reviewed current stack (Mixpanel, Amplitude)
27
+ IN PROGRESS: Drafting cost-benefit analysis section
28
+ NEXT: Need user input on budget constraints before finalizing recommendations"
29
+ ```
30
+
31
+ **What you do**:
32
+ 1. Read notes to understand current state
33
+ 2. Create TodoWrite for immediate work:
34
+ ```
35
+ - [ ] Draft cost-benefit analysis
36
+ - [ ] Ask user about budget constraints
37
+ - [ ] Finalize recommendations
38
+ ```
39
+ 3. Work on tasks, mark TodoWrite items completed
40
+ 4. At milestone, update bd notes:
41
+ ```bash
42
+ bd update bd-42 --notes "COMPLETED: Cost-benefit analysis drafted.
43
+ KEY DECISION: User confirmed $50k budget cap - ruled out enterprise options.
44
+ IN PROGRESS: Finalizing recommendations (Posthog + custom ETL).
45
+ NEXT: Get user review of draft before closing issue."
46
+ ```
47
+
48
+ **Outcome**: TodoWrite disappears at session end, but bd notes preserve context for next session.
49
+
50
+ **Key insight**: Notes field captures the "why" and context, TodoWrite tracks the "doing" right now.
51
+
52
+ ---
53
+
54
+ ## Side Quest Handling
55
+
56
+ **Scenario**: During main task, discover a problem that needs attention.
57
+
58
+ **Pattern**:
59
+ 1. Create issue immediately: `bd create "Found: inventory system needs refactoring"`
60
+ 2. Link provenance: `bd dep add main-task new-issue --type discovered-from`
61
+ 3. Assess urgency: blocker or can defer?
62
+ 4. **If blocker**:
63
+ - `bd update main-task --status blocked`
64
+ - `bd update new-issue --status in_progress`
65
+ - Work on the blocker
66
+ 5. **If deferrable**:
67
+ - Note in new issue's design field
68
+ - Continue main task
69
+ - New issue persists for later
70
+
71
+ **Why this works**: Captures context immediately (before forgetting), preserves relationship to main work, allows flexible prioritization.
72
+
73
+ **Example (with MCP):**
74
+
75
+ Working on "Implement checkout flow" (checkout-1), discover payment validation security hole:
76
+
77
+ 1. Create bug issue: `mcp__plugin_beads_beads__create` with `{title: "Fix: payment validation bypasses card expiry check", type: "bug", priority: 0}`
78
+ 2. Link discovery: `mcp__plugin_beads_beads__dep` with `{from_issue: "checkout-1", to_issue: "payment-bug-2", type: "discovered-from"}`
79
+ 3. Block current work: `mcp__plugin_beads_beads__update` with `{issue_id: "checkout-1", status: "blocked", notes: "Blocked by payment-bug-2: security hole in validation"}`
80
+ 4. Start new work: `mcp__plugin_beads_beads__update` with `{issue_id: "payment-bug-2", status: "in_progress"}`
81
+
82
+ (CLI: `bd create "Fix: payment validation..." -t bug -p 0` then `bd dep add` and `bd update` commands)
83
+
84
+ ---
85
+
86
+ ## Multi-Session Project Resume
87
+
88
+ **Scenario**: Starting work after days or weeks away from a project.
89
+
90
+ **Pattern (with MCP)**:
91
+ 1. **Check what's ready**: Use `mcp__plugin_beads_beads__ready` to see available work
92
+ 2. **Check what's stuck**: Use `mcp__plugin_beads_beads__blocked` to understand blockers
93
+ 3. **Check recent progress**: Use `mcp__plugin_beads_beads__list` with `status:"closed"` to see completions
94
+ 4. **Read detailed context**: Use `mcp__plugin_beads_beads__show` for the issue you'll work on
95
+ 5. **Update status**: Use `mcp__plugin_beads_beads__update` with `status:"in_progress"`
96
+ 6. **Begin work**: Create TodoWrite from notes field's NEXT section
97
+
98
+ (CLI: `bd ready`, `bd blocked`, `bd list --status closed`, `bd show <id>`, `bd update <id> --status in_progress`)
99
+
100
+ **Example**:
101
+ ```bash
102
+ $ bd ready
103
+ Ready to work on (3):
104
+ auth-5: "Add OAuth refresh token rotation" (priority: 0)
105
+ api-12: "Document REST API endpoints" (priority: 1)
106
+ test-8: "Add integration tests for payment flow" (priority: 2)
107
+
108
+ $ bd show auth-5
109
+ Title: Add OAuth refresh token rotation
110
+ Status: open
111
+ Priority: 0 (critical)
112
+
113
+ Notes:
114
+ COMPLETED: Basic JWT auth working
115
+ IN PROGRESS: Need to add token refresh
116
+ NEXT: Implement rotation per OWASP guidelines (7-day refresh tokens)
117
+ BLOCKER: None - ready to proceed
118
+
119
+ $ bd update auth-5 --status in_progress
120
+ # Now create TodoWrite based on NEXT section
121
+ ```
122
+
123
+ **For complete session start workflow with checklist, see:** [WORKFLOWS.md](WORKFLOWS.md#session-start)
124
+
125
+ ---
126
+
127
+ ## Status Transitions
128
+
129
+ Understanding when to change issue status.
130
+
131
+ ### Status Lifecycle
132
+
133
+ ```
134
+ open → in_progress → closed
135
+ ↓ ↓
136
+ blocked blocked
137
+ ```
138
+
139
+ ### When to Use Each Status
140
+
141
+ **open** (default):
142
+ - Issue created but not started
143
+ - Waiting for dependencies to clear
144
+ - Planned work not yet begun
145
+ - **Command**: Issues start as `open` by default
146
+
147
+ **in_progress**:
148
+ - Actively working on this issue right now
149
+ - Has been read and understood
150
+ - Making commits or changes related to this
151
+ - **Command**: `bd update issue-id --status in_progress`
152
+ - **When**: Start of work session on this issue
153
+
154
+ **blocked**:
155
+ - Cannot proceed due to external blocker
156
+ - Waiting for user input/decision
157
+ - Dependency not completed
158
+ - Technical blocker discovered
159
+ - **Command**: `bd update issue-id --status blocked`
160
+ - **When**: Hit a blocker, capture what blocks you in notes
161
+ - **Note**: Document blocker in notes field: "BLOCKER: Waiting for API key from ops team"
162
+
163
+ **closed**:
164
+ - Work completed and verified
165
+ - Tests passing
166
+ - Acceptance criteria met
167
+ - **Command**: `bd close issue-id --reason "Implemented with tests passing"`
168
+ - **When**: All work done, ready to move on
169
+ - **Note**: Issues remain in database, just marked complete
170
+
171
+ ### Transition Examples
172
+
173
+ **Starting work**:
174
+ ```bash
175
+ bd ready # See what's available
176
+ bd update auth-5 --status in_progress
177
+ # Begin working
178
+ ```
179
+
180
+ **Hit a blocker**:
181
+ ```bash
182
+ bd update auth-5 --status blocked --notes "BLOCKER: Need OAuth client ID from product team. Emailed Jane on 2025-10-23."
183
+ # Switch to different issue or create new work
184
+ ```
185
+
186
+ **Unblocking**:
187
+ ```bash
188
+ # Once blocker resolved
189
+ bd update auth-5 --status in_progress --notes "UNBLOCKED: Received OAuth credentials. Resuming implementation."
190
+ ```
191
+
192
+ **Completing**:
193
+ ```bash
194
+ bd close auth-5 --reason "Implemented OAuth refresh with 7-day rotation. Tests passing. PR #42 merged."
195
+ ```
196
+
197
+ ---
198
+
199
+ ## Compaction Recovery
200
+
201
+ **Scenario**: Conversation history has been compacted. You need to resume work with zero conversation context.
202
+
203
+ **What survives compaction**:
204
+ - All bd issues and notes
205
+ - Complete work history
206
+ - Dependencies and relationships
207
+
208
+ **What's lost**:
209
+ - Conversation history
210
+ - TodoWrite lists
211
+ - Recent discussion
212
+
213
+ ### Recovery Pattern
214
+
215
+ 1. **Check in-progress work**:
216
+ ```bash
217
+ bd list --status in_progress
218
+ ```
219
+
220
+ 2. **Read notes for context**:
221
+ ```bash
222
+ bd show issue-id
223
+ # Read notes field - should explain current state
224
+ ```
225
+
226
+ 3. **Reconstruct TodoWrite from notes**:
227
+ - COMPLETED section: Done, skip
228
+ - IN PROGRESS section: Current state
229
+ - NEXT section: **This becomes your TodoWrite list**
230
+
231
+ 4. **Report to user**:
232
+ ```
233
+ "From bd notes: [summary of COMPLETED]. Currently [IN PROGRESS].
234
+ Next steps: [from NEXT]. Should I continue with that?"
235
+ ```
236
+
237
+ ### Example Recovery
238
+
239
+ **bd show returns**:
240
+ ```
241
+ Issue: bd-42 "OAuth refresh token implementation"
242
+ Status: in_progress
243
+ Notes:
244
+ COMPLETED: Basic JWT validation working (RS256, 1hr access tokens)
245
+ KEY DECISION: 7-day refresh tokens per security review
246
+ IN PROGRESS: Implementing token rotation endpoint
247
+ NEXT: Add rate limiting (5 refresh attempts per 15min), then write tests
248
+ BLOCKER: None
249
+ ```
250
+
251
+ **Recovery actions**:
252
+ 1. Read notes, understand context
253
+ 2. Create TodoWrite:
254
+ ```
255
+ - [ ] Implement rate limiting on refresh endpoint
256
+ - [ ] Write tests for token rotation
257
+ - [ ] Verify security guidelines met
258
+ ```
259
+ 3. Report: "From notes: JWT validation is done with 7-day refresh tokens. Currently implementing rotation endpoint. Next: add rate limiting and tests. Should I continue?"
260
+ 4. Resume work based on user response
261
+
262
+ **For complete compaction survival workflow, see:** [WORKFLOWS.md](WORKFLOWS.md#compaction-survival)
263
+
264
+ ---
265
+
266
+ ## Issue Closure
267
+
268
+ **Scenario**: Work is complete. How to close properly?
269
+
270
+ ### Closure Checklist
271
+
272
+ Before closing, verify:
273
+ - [ ] **Acceptance criteria met**: All items checked off
274
+ - [ ] **Tests passing**: If applicable
275
+ - [ ] **Documentation updated**: If needed
276
+ - [ ] **Follow-up work filed**: New issues created for discovered work
277
+ - [ ] **Key decisions documented**: In notes field
278
+
279
+ ### Closure Pattern
280
+
281
+ **Minimal closure** (simple tasks):
282
+ ```bash
283
+ bd close task-123 --reason "Implemented feature X"
284
+ ```
285
+
286
+ **Detailed closure** (complex work):
287
+ ```bash
288
+ # Update notes with final state
289
+ bd update task-123 --notes "COMPLETED: OAuth refresh with 7-day rotation
290
+ KEY DECISION: RS256 over HS256 per security review
291
+ TESTS: 12 tests passing (auth, rotation, expiry, errors)
292
+ FOLLOW-UP: Filed perf-99 for token cleanup job"
293
+
294
+ # Close with summary
295
+ bd close task-123 --reason "Implemented OAuth refresh token rotation with rate limiting. All security guidelines met. Tests passing."
296
+ ```
297
+
298
+ ### Documenting Resolution (Outcome vs Design)
299
+
300
+ For issues where the outcome differed from initial design, use `--notes` to document what actually happened:
301
+
302
+ ```bash
303
+ # Initial design was hypothesis - document actual outcome in notes
304
+ bd update bug-456 --notes "RESOLUTION: Not a bug - behavior is correct per OAuth spec. Documentation was unclear. Filed docs-789 to clarify auth flow in user guide."
305
+
306
+ bd close bug-456 --reason "Resolved: documentation issue, not bug"
307
+ ```
308
+
309
+ **Pattern**: Design field = initial approach. Notes field = what actually happened (prefix with RESOLUTION: for clarity).
310
+
311
+ ### Discovering Follow-up Work
312
+
313
+ When closing reveals new work:
314
+
315
+ ```bash
316
+ # While closing auth feature, realize performance needs work
317
+ bd create "Optimize token lookup query" -t task -p 2
318
+
319
+ # Link the provenance
320
+ bd dep add auth-5 perf-99 --type discovered-from
321
+
322
+ # Now close original
323
+ bd close auth-5 --reason "OAuth refresh implemented. Discovered perf optimization needed (filed perf-99)."
324
+ ```
325
+
326
+ **Why link with discovered-from**: Preserves the context of how you found the new work. Future you will appreciate knowing it came from the auth implementation.
327
+
328
+ ---
329
+
330
+ ## Pattern Summary
331
+
332
+ | Pattern | When to Use | Key Command | Preserves |
333
+ |---------|-------------|-------------|-----------|
334
+ | **Knowledge Work** | Long-running research, writing | `bd update --notes` | Context across sessions |
335
+ | **Side Quest** | Discovered during other work | `bd dep add --type discovered-from` | Relationship to original |
336
+ | **Multi-Session Resume** | Returning after time away | `bd ready`, `bd show` | Full project state |
337
+ | **Status Transitions** | Tracking work state | `bd update --status` | Current state |
338
+ | **Compaction Recovery** | History lost | Read notes field | All context in notes |
339
+ | **Issue Closure** | Completing work | `bd close --reason` | Decisions and outcomes |
340
+
341
+ **For detailed workflows with step-by-step checklists, see:** [WORKFLOWS.md](WORKFLOWS.md)