opencode-beads 0.4.0 → 0.5.1

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
@@ -26,7 +26,7 @@ Optionally, pin to a specific version for stability:
26
26
 
27
27
  ```json
28
28
  {
29
- "plugin": ["opencode-beads@0.4.0"]
29
+ "plugin": ["opencode-beads@0.5.1"]
30
30
  }
31
31
  ```
32
32
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-beads",
3
- "version": "0.4.0",
3
+ "version": "0.5.1",
4
4
  "type": "module",
5
5
  "description": "A plugin for OpenCode that provides integration with the beads issue tracker.",
6
6
  "author": "Josh Thomas <josh@joshthomas.dev>",
@@ -5,7 +5,7 @@ argument-hint: [title] [type] [priority]
5
5
 
6
6
  Create a new beads issue. If arguments are provided:
7
7
  - $1: Issue title
8
- - $2: Issue type (bug, feature, task, epic, chore)
8
+ - $2: Issue type (bug, feature, task, epic, chore, decision)
9
9
  - $3: Priority (0-4, where 0=critical, 4=backlog)
10
10
 
11
11
  If arguments are missing, ask the user for:
@@ -0,0 +1,111 @@
1
+ ---
2
+ description: Record, list, and manage project decisions with rationale tracking
3
+ argument-hint: record|list|show|supersede
4
+ ---
5
+
6
+ Record and track project decisions as beads issues with structured rationale, alternatives considered, and links to affected work.
7
+
8
+ Decisions use `--type decision`. The description field holds the structured decision record.
9
+
10
+ ## Record a Decision
11
+
12
+ When the user wants to record a decision (or you invoke `bd decision record`):
13
+
14
+ 1. Gather the following (ask if not provided):
15
+ - **Title**: Short summary of what was decided (required)
16
+ - **Rationale**: Why this was chosen (required)
17
+ - **Alternatives**: What else was considered (optional but encouraged)
18
+ - **Affects**: Issue IDs this decision impacts (optional)
19
+ - **Priority**: How important (default P2)
20
+
21
+ 2. Create the issue with structured description:
22
+
23
+ ```bash
24
+ bd create "<title>" --type decision \
25
+ --description "$(cat <<'EOF'
26
+ ## Decision
27
+
28
+ <one-sentence summary of what was decided>
29
+
30
+ ## Rationale
31
+
32
+ <why this was chosen>
33
+
34
+ ## Alternatives Considered
35
+
36
+ - **<alt 1>**: <why rejected>
37
+ - **<alt 2>**: <why rejected>
38
+
39
+ ## Affects
40
+
41
+ - <issue IDs or area descriptions>
42
+ EOF
43
+ )"
44
+ ```
45
+
46
+ 3. If `--affects` issue IDs were provided, link them:
47
+ ```bash
48
+ bd dep add <decision-id> <affected-id> --type related
49
+ ```
50
+
51
+ 4. Show the created decision to the user.
52
+
53
+ ## List Decisions
54
+
55
+ ```bash
56
+ bd list --type decision
57
+ ```
58
+
59
+ To see all decisions including closed/superseded:
60
+ ```bash
61
+ bd list --type decision --all
62
+ ```
63
+
64
+ ## Show a Decision
65
+
66
+ ```bash
67
+ bd show <decision-id>
68
+ ```
69
+
70
+ Include comments for discussion history:
71
+ ```bash
72
+ bd comments <decision-id>
73
+ ```
74
+
75
+ ## Supersede a Decision
76
+
77
+ When a decision is replaced by a new one:
78
+
79
+ 1. Record the new decision (as above)
80
+ 2. Link the new decision to the old one:
81
+ ```bash
82
+ bd dep add <new-id> <old-id> --type related
83
+ ```
84
+ 3. Add a comment on the old decision:
85
+ ```bash
86
+ bd comments add <old-id> "Superseded by <new-id>: <brief reason>"
87
+ ```
88
+ 4. Close the old decision:
89
+ ```bash
90
+ bd close <old-id> --reason "Superseded by <new-id>"
91
+ ```
92
+
93
+ ## Add Context to an Existing Decision
94
+
95
+ Use comments to append discussion, implementation notes, or revisit rationale:
96
+ ```bash
97
+ bd comments add <decision-id> "Implementation note: ..."
98
+ ```
99
+
100
+ ## Search Decisions
101
+
102
+ ```bash
103
+ bd search "keyword" --type decision
104
+ ```
105
+
106
+ ## Conventions
107
+
108
+ - **Status**: `open` = active decision, `closed` = superseded or reversed
109
+ - **Description format**: Use the structured template above for consistency
110
+ - **Linking**: Use `related` dependency type to connect decisions to affected issues
111
+ - **Labels**: Use labels for categorizing decisions (e.g., `architecture`, `tooling`, `process`)
@@ -9,7 +9,7 @@ List beads issues with optional filtering.
9
9
 
10
10
  - **--status, -s**: Filter by status (open, in_progress, blocked, closed)
11
11
  - **--priority, -p**: Filter by priority (0-4: 0=critical, 1=high, 2=medium, 3=low, 4=backlog)
12
- - **--type, -t**: Filter by type (bug, feature, task, epic, chore)
12
+ - **--type, -t**: Filter by type (bug, feature, task, epic, chore, decision)
13
13
  - **--assignee, -a**: Filter by assignee
14
14
  - **--label, -l**: Filter by labels (comma-separated, must have ALL labels)
15
15
  - **--label-any**: Filter by labels (OR semantics, must have AT LEAST ONE)
@@ -29,7 +29,7 @@ Unlike `bd list`, which requires you to specify which field to search, `bd searc
29
29
 
30
30
  - **--status, -s**: Filter by status (open, in_progress, blocked, closed)
31
31
  - **--assignee, -a**: Filter by assignee
32
- - **--type, -t**: Filter by type (bug, feature, task, epic, chore)
32
+ - **--type, -t**: Filter by type (bug, feature, task, epic, chore, decision)
33
33
  - **--label, -l**: Filter by labels (must have ALL specified labels)
34
34
  - **--label-any**: Filter by labels (must have AT LEAST ONE)
35
35
  - **--limit, -n**: Limit number of results (default: 50)
@@ -1,58 +0,0 @@
1
- ---
2
- description: Manage background sync daemon
3
- argument-hint: [start] [stop] [status]
4
- ---
5
-
6
- Manage the per-project background daemon that handles database connections and syncs with git.
7
-
8
- ## Per-Project Daemon (LSP Model)
9
-
10
- Each project runs its own daemon at `.beads/bd.sock` for complete database isolation.
11
-
12
- > On Windows this file stores the daemon's loopback TCP endpoint metadata—leave it in place so bd can reconnect.
13
-
14
- **Why per-project daemons?**
15
- - Complete database isolation between projects
16
- - No cross-project pollution or git worktree conflicts
17
- - Simpler mental model: one project = one database = one daemon
18
- - Follows LSP (Language Server Protocol) architecture
19
-
20
- **Note:** Global daemon support was removed in v0.16.0. The `--global` flag is no longer functional.
21
-
22
- ## When to Use Daemon Mode
23
-
24
- **✅ You SHOULD use daemon mode if:**
25
- - Working in a team with git remote sync
26
- - Want automatic commit/push of issue changes
27
- - Need background auto-sync (5-second debounce)
28
- - Making frequent bd commands (performance benefit from connection pooling)
29
-
30
- **❌ You DON'T need daemon mode if:**
31
- - Solo developer with local-only tracking
32
- - Working in git worktrees (use --no-daemon to avoid conflicts)
33
- - Running one-off commands or scripts
34
- - Debugging database issues (direct mode is simpler)
35
-
36
- **Local-only users:** Direct mode (default without daemon) is perfectly fine. The daemon mainly helps with git sync automation. You can still use `bd sync` manually when needed.
37
-
38
- **Performance note:** For most operations, the daemon provides minimal performance benefit. The main value is automatic JSONL export (5s debounce) and optional git sync (--auto-commit, --auto-push).
39
-
40
- ## Common Operations
41
-
42
- - **Start**: `bd daemon start` (or auto-starts on first `bd` command)
43
- - **Stop**: `bd daemon stop`
44
- - **Status**: `bd daemon status`
45
- - **Health**: `bd daemon status --all` - shows uptime, cache stats, performance metrics
46
- - **Metrics**: `bd daemon --metrics` - detailed operational telemetry
47
-
48
- ## Sync Options
49
-
50
- - **--auto-commit**: Automatically commit JSONL changes
51
- - **--auto-push**: Automatically push commits to remote
52
- - **--interval**: Sync check interval (default: 5m)
53
-
54
- The daemon provides:
55
- - Connection pooling and caching
56
- - Better performance for frequent operations
57
- - Automatic JSONL sync (5-second debounce)
58
- - Optional git sync
@@ -1,242 +0,0 @@
1
- # bd daemons - Daemon Management
2
-
3
- Manage bd daemon processes across all repositories and worktrees.
4
-
5
- ## Synopsis
6
-
7
- ```bash
8
- bd daemons <subcommand> [flags]
9
- ```
10
-
11
- ## Description
12
-
13
- The `bd daemons` command provides tools for discovering, monitoring, and managing multiple bd daemon processes across your system. This is useful when working with multiple repositories or git worktrees.
14
-
15
- ## Subcommands
16
-
17
- ### list
18
-
19
- List all running bd daemons with metadata.
20
-
21
- ```bash
22
- bd daemons list [--search DIRS] [--json] [--no-cleanup]
23
- ```
24
-
25
- **Flags:**
26
- - `--search` - Directories to search for daemons (default: home, /tmp, cwd)
27
- - `--json` - Output in JSON format
28
- - `--no-cleanup` - Skip auto-cleanup of stale sockets
29
-
30
- **Example:**
31
- ```bash
32
- bd daemons list
33
- bd daemons list --search /Users/me/projects --json
34
- ```
35
-
36
- ### health
37
-
38
- Check health of all bd daemons and report issues.
39
-
40
- ```bash
41
- bd daemons health [--search DIRS] [--json]
42
- ```
43
-
44
- Reports:
45
- - Stale sockets (dead processes)
46
- - Version mismatches between daemon and CLI
47
- - Unresponsive daemons
48
-
49
- **Flags:**
50
- - `--search` - Directories to search for daemons
51
- - `--json` - Output in JSON format
52
-
53
- **Example:**
54
- ```bash
55
- bd daemons health
56
- bd daemons health --json
57
- ```
58
-
59
- ### stop
60
-
61
- Stop a specific daemon gracefully.
62
-
63
- ```bash
64
- bd daemons stop <workspace-path|pid> [--json]
65
- ```
66
-
67
- **Arguments:**
68
- - `<workspace-path|pid>` - Workspace path or PID of daemon to stop
69
-
70
- **Flags:**
71
- - `--json` - Output in JSON format
72
-
73
- **Example:**
74
- ```bash
75
- bd daemons stop /Users/me/projects/myapp
76
- bd daemons stop 12345
77
- bd daemons stop /Users/me/projects/myapp --json
78
- ```
79
-
80
- ### restart
81
-
82
- Restart a specific daemon gracefully.
83
-
84
- ```bash
85
- bd daemons restart <workspace-path|pid> [--search DIRS] [--json]
86
- ```
87
-
88
- Stops the daemon gracefully, then starts a new one in its place. Useful after upgrading bd or when a daemon needs to be refreshed.
89
-
90
- **Arguments:**
91
- - `<workspace-path|pid>` - Workspace path or PID of daemon to restart
92
-
93
- **Flags:**
94
- - `--search` - Directories to search for daemons
95
- - `--json` - Output in JSON format
96
-
97
- **Example:**
98
- ```bash
99
- bd daemons restart /Users/me/projects/myapp
100
- bd daemons restart 12345
101
- bd daemons restart /Users/me/projects/myapp --json
102
- ```
103
-
104
- ### logs
105
-
106
- View logs for a specific daemon.
107
-
108
- ```bash
109
- bd daemons logs <workspace-path|pid> [-f] [-n LINES] [--json]
110
- ```
111
-
112
- **Arguments:**
113
- - `<workspace-path|pid>` - Workspace path or PID of daemon
114
-
115
- **Flags:**
116
- - `-f, --follow` - Follow log output (like tail -f)
117
- - `-n, --lines INT` - Number of lines to show from end (default: 50)
118
- - `--json` - Output in JSON format
119
-
120
- **Example:**
121
- ```bash
122
- bd daemons logs /Users/me/projects/myapp
123
- bd daemons logs 12345 -n 100
124
- bd daemons logs /Users/me/projects/myapp -f
125
- bd daemons logs 12345 --json
126
- ```
127
-
128
- ### killall
129
-
130
- Stop all running bd daemons.
131
-
132
- ```bash
133
- bd daemons killall [--search DIRS] [--force] [--json]
134
- ```
135
-
136
- Uses escalating shutdown strategy:
137
- 1. RPC shutdown (2 second timeout)
138
- 2. SIGTERM (3 second timeout)
139
- 3. SIGKILL (1 second timeout)
140
-
141
- **Flags:**
142
- - `--search` - Directories to search for daemons
143
- - `--force` - Use SIGKILL immediately if graceful shutdown fails
144
- - `--json` - Output in JSON format
145
-
146
- **Example:**
147
- ```bash
148
- bd daemons killall
149
- bd daemons killall --force
150
- bd daemons killall --json
151
- ```
152
-
153
- ## Common Use Cases
154
-
155
- ### Version Upgrade
156
-
157
- After upgrading bd, restart all daemons to use the new version:
158
-
159
- ```bash
160
- bd daemons health # Check for version mismatches
161
- bd daemons killall # Stop all old daemons
162
- # Daemons will auto-start with new version on next bd command
163
-
164
- # Or restart a specific daemon
165
- bd daemons restart /path/to/workspace
166
- ```
167
-
168
- ### Debugging
169
-
170
- Check daemon status and view logs:
171
-
172
- ```bash
173
- bd daemons list
174
- bd daemons health
175
- bd daemons logs /path/to/workspace -n 100
176
- ```
177
-
178
- ### Cleanup
179
-
180
- Remove stale daemon sockets:
181
-
182
- ```bash
183
- bd daemons list # Auto-cleanup happens by default
184
- bd daemons list --no-cleanup # Skip cleanup
185
- ```
186
-
187
- ### Multi-Workspace Management
188
-
189
- Discover daemons in specific directories:
190
-
191
- ```bash
192
- bd daemons list --search /Users/me/projects
193
- bd daemons health --search /Users/me/work
194
- ```
195
-
196
- ## Troubleshooting
197
-
198
- ### Stale Sockets
199
-
200
- If you see stale sockets (dead process but socket file exists):
201
-
202
- ```bash
203
- bd daemons list # Auto-cleanup removes stale sockets
204
- ```
205
-
206
- ### Version Mismatch
207
-
208
- If daemon version != CLI version:
209
-
210
- ```bash
211
- bd daemons health # Identify mismatched daemons
212
- bd daemons killall # Stop all daemons
213
- # Next bd command will auto-start new version
214
- ```
215
-
216
- ### Daemon Won't Stop
217
-
218
- If graceful shutdown fails:
219
-
220
- ```bash
221
- bd daemons killall --force # Force kill with SIGKILL
222
- ```
223
-
224
- ### Can't Find Daemon
225
-
226
- If daemon isn't discovered:
227
-
228
- ```bash
229
- bd daemons list --search /path/to/workspace
230
- ```
231
-
232
- Or check the socket manually:
233
-
234
- ```bash
235
- ls -la /path/to/workspace/.beads/bd.sock
236
- ```
237
-
238
- ## See Also
239
-
240
- - [bd daemon](daemon.md) - Start a daemon manually
241
- - [AGENTS.md](../AGENTS.md) - Agent workflow guide
242
- - [README.md](../README.md) - Main documentation