opencode-hive 1.0.5 → 1.0.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-hive",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "type": "module",
5
5
  "description": "OpenCode plugin for Agent Hive - from vibe coding to hive coding",
6
6
  "license": "MIT WITH Commons-Clause",
@@ -11,6 +11,19 @@ When you have multiple unrelated failures (different test files, different subsy
11
11
 
12
12
  **Core principle:** Dispatch one agent per independent problem domain. Let them work concurrently.
13
13
 
14
+ ## Prerequisite: Check Runnable Tasks
15
+
16
+ Before dispatching, use `hive_status()` to get the **runnable** list — tasks whose dependencies are all satisfied.
17
+
18
+ **Only dispatch tasks that are runnable.** Never start tasks with unmet dependencies.
19
+
20
+ Only `done` satisfies dependencies (not `blocked`, `failed`, `partial`, `cancelled`).
21
+
22
+ **Ask the operator first:**
23
+ - Use `question()`: "These tasks are runnable and independent: [list]. Execute in parallel?"
24
+ - Record the decision with `hive_context_write({ name: "execution-decisions", content: "..." })`
25
+ - Proceed only after operator approval
26
+
14
27
  ## When to Use
15
28
 
16
29
  ```dot
@@ -71,6 +84,13 @@ hive_exec_start({ task: "03-fix-race-condition-tests" })
71
84
  // All three run concurrently in isolated worktrees
72
85
  ```
73
86
 
87
+ Parallelize by issuing multiple task() calls in the same assistant message.
88
+
89
+ ```typescript
90
+ task({ subagent_type: 'scout-researcher', prompt: 'Investigate failure A' })
91
+ task({ subagent_type: 'scout-researcher', prompt: 'Investigate failure B' })
92
+ ```
93
+
74
94
  ### 4. Review and Integrate
75
95
 
76
96
  When agents return:
@@ -21,28 +21,39 @@ Load plan, review critically, execute tasks in batches, report for review betwee
21
21
  3. If concerns: Raise them with your human partner before starting
22
22
  4. If no concerns: Create TodoWrite and proceed
23
23
 
24
- ### Step 2: Execute Batch
25
- **Default: First 3 tasks**
24
+ ### Step 2: Identify Runnable Tasks
26
25
 
27
- For each task:
28
- 1. Mark as in_progress
26
+ Use `hive_status()` to get the **runnable** list — tasks with all dependencies satisfied.
27
+
28
+ Only `done` satisfies dependencies (not `blocked`, `failed`, `partial`, `cancelled`).
29
+
30
+ **When 2+ tasks are runnable:**
31
+ - **Ask the operator** via `question()`: "Multiple tasks are runnable: [list]. Run in parallel, sequential, or a specific subset?"
32
+ - Record the decision with `hive_context_write({ name: "execution-decisions", content: "..." })` for future reference
33
+
34
+ **When 1 task is runnable:** Proceed directly.
35
+
36
+ ### Step 3: Execute Batch
37
+
38
+ For each task in the batch:
39
+ 1. Mark as in_progress via `hive_exec_start()`
29
40
  2. Follow each step exactly (plan has bite-sized steps)
30
41
  3. Run verifications as specified
31
42
  4. Mark as completed
32
43
 
33
- ### Step 3: Report
44
+ ### Step 4: Report
34
45
  When batch complete:
35
46
  - Show what was implemented
36
47
  - Show verification output
37
48
  - Say: "Ready for feedback."
38
49
 
39
- ### Step 4: Continue
50
+ ### Step 5: Continue
40
51
  Based on feedback:
41
52
  - Apply changes if needed
42
53
  - Execute next batch
43
54
  - Repeat until complete
44
55
 
45
- ### Step 5: Complete Development
56
+ ### Step 6: Complete Development
46
57
 
47
58
  After all tasks complete and verified:
48
59
  - Announce: "I'm using the finishing-a-development-branch skill to complete this work."
@@ -1,20 +1,24 @@
1
1
  ---
2
2
  name: parallel-exploration
3
- description: Use when you need parallel, read-only exploration via hive_hive_background_task (Scout fan-out)
3
+ description: Use when you need parallel, read-only exploration with hive_background_* or task() (Scout fan-out)
4
4
  ---
5
5
 
6
- # Parallel Exploration (Background Scout Fan-Out)
6
+ # Parallel Exploration (Scout Fan-Out)
7
7
 
8
8
  ## Overview
9
9
 
10
10
  When you need to answer "where/how does X work?" across multiple domains (codebase, tests, docs, OSS), investigating sequentially wastes time. Each investigation is independent and can happen in parallel.
11
11
 
12
- **Core principle:** Decompose into independent sub-questions, spawn one `hive_hive_background_task` per sub-question, collect results asynchronously.
12
+ **Core principle:** Decompose into independent sub-questions, spawn one task per sub-question, collect results asynchronously.
13
13
 
14
14
  **Safe in Planning mode:** This is read-only exploration. It is OK to use during exploratory research even when there is no feature, no plan, and no approved tasks.
15
15
 
16
16
  **This skill is for read-only research.** For parallel implementation work, use `hive_skill("dispatching-parallel-agents")` with `hive_exec_start`.
17
17
 
18
+ **Two valid execution paths:**
19
+ - **Path A (Hive background tools):** Use `hive_background_task`, `hive_background_output`, `hive_background_cancel` when available.
20
+ - **Path B (Task mode):** Use native `task()` for delegation when background tools are not registered.
21
+
18
22
  ## When to Use
19
23
 
20
24
  **Default to this skill when:**
@@ -57,6 +61,7 @@ Split your investigation into 2-4 independent sub-questions. Good decomposition:
57
61
  Launch all tasks before waiting for any results:
58
62
 
59
63
  ```typescript
64
+ // Path A: Hive background tools (when available)
60
65
  // Fan-out: spawn all tasks first
61
66
  hive_background_task({
62
67
  agent: "scout-researcher",
@@ -89,6 +94,37 @@ hive_background_task({
89
94
  })
90
95
  ```
91
96
 
97
+ ```typescript
98
+ // Path B: Task mode (native task tool)
99
+ // Parallelize by issuing multiple task() calls in the same assistant message.
100
+ task({
101
+ subagent_type: 'scout-researcher',
102
+ description: 'Find hive_background_task implementation',
103
+ prompt: `Where is hive_background_task implemented and registered?
104
+ - Find the tool definition
105
+ - Find the plugin registration
106
+ - Return file paths with line numbers`,
107
+ });
108
+
109
+ task({
110
+ subagent_type: 'scout-researcher',
111
+ description: 'Analyze background task concurrency',
112
+ prompt: `How does background task concurrency/queueing work?
113
+ - Find the manager/scheduler code
114
+ - Document the concurrency model
115
+ - Return file paths with evidence`,
116
+ });
117
+
118
+ task({
119
+ subagent_type: 'scout-researcher',
120
+ description: 'Find parent notification mechanism',
121
+ prompt: `How does parent notification work for background tasks?
122
+ - Where is the notification built?
123
+ - How is it sent to the parent session?
124
+ - Return file paths with evidence`,
125
+ });
126
+ ```
127
+
92
128
  **Key points:**
93
129
  - Use `agent: "scout-researcher"` for read-only exploration
94
130
  - Use `sync: false` to return immediately (non-blocking)
@@ -109,6 +145,7 @@ You'll receive a `<system-reminder>` notification when each task completes.
109
145
  When notified of completion, retrieve results:
110
146
 
111
147
  ```typescript
148
+ // Path A: Hive background tools
112
149
  // Get output from completed task
113
150
  hive_background_output({
114
151
  task_id: "task-abc123",
@@ -147,6 +184,7 @@ Combine results from all tasks:
147
184
  Cancel tasks that are no longer needed:
148
185
 
149
186
  ```typescript
187
+ // Path A: Hive background tools
150
188
  // Cancel specific task
151
189
  hive_background_cancel({ task_id: "task-abc123" })
152
190
 
@@ -209,6 +247,7 @@ Return:
209
247
 
210
248
  **Fan-out:**
211
249
  ```typescript
250
+ // Path A: Hive background tools
212
251
  // Task 1: Implementation
213
252
  hive_background_task({
214
253
  agent: "scout-researcher",
@@ -234,6 +273,28 @@ hive_background_task({
234
273
  })
235
274
  ```
236
275
 
276
+ ```typescript
277
+ // Path B: Task mode (native task tool)
278
+ // Parallelize by issuing multiple task() calls in the same assistant message.
279
+ task({
280
+ subagent_type: 'scout-researcher',
281
+ description: 'Find hive_background_task implementation',
282
+ prompt: 'Where is hive_background_task implemented? Find tool definition and registration.',
283
+ });
284
+
285
+ task({
286
+ subagent_type: 'scout-researcher',
287
+ description: 'Analyze concurrency model',
288
+ prompt: 'How does background task concurrency work? Find the manager/scheduler.',
289
+ });
290
+
291
+ task({
292
+ subagent_type: 'scout-researcher',
293
+ description: 'Find notification mechanism',
294
+ prompt: 'How are parent sessions notified of task completion?',
295
+ });
296
+ ```
297
+
237
298
  **Results:**
238
299
  - Task 1: Found `background-tools.ts` (tool definition), `index.ts` (registration)
239
300
  - Task 2: Found `manager.ts` with concurrency=3 default, queue-based scheduling
@@ -258,6 +319,13 @@ hive_background_task({ ..., sync: false }) // Returns immediately
258
319
  // ... later, collect results with hive_background_output
259
320
  ```
260
321
 
322
+ ```typescript
323
+ // GOOD (task mode): Spawn all in the same assistant message
324
+ task({ ... });
325
+ task({ ... });
326
+ task({ ... });
327
+ ```
328
+
261
329
  **Too many tasks (diminishing returns):**
262
330
  - 2-4 tasks: Good parallelization
263
331
  - 5+ tasks: Overhead exceeds benefit, harder to synthesize
@@ -281,6 +349,7 @@ hive_background_task({ ..., sync: false }) // Returns immediately
281
349
 
282
350
  After using this pattern, verify:
283
351
  - [ ] All tasks spawned before collecting any results (true fan-out)
284
- - [ ] Received notifications for completed tasks
285
- - [ ] Successfully retrieved output with `hive_background_output`
352
+ - [ ] Received notifications for completed tasks (Path A)
353
+ - [ ] Successfully retrieved output with `hive_background_output` (Path A)
354
+ - [ ] Verified `task()` fan-out pattern used when in task mode (Path B)
286
355
  - [ ] Synthesized findings into coherent answer