opencode-hive 1.0.5 → 1.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-hive",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
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
@@ -13,9 +13,9 @@ Assume they are a skilled developer, but know almost nothing about our toolset o
13
13
 
14
14
  **Announce at start:** "I'm using the writing-plans skill to create the implementation plan."
15
15
 
16
- **Context:** This should be run in a dedicated worktree (created by brainstorming skill).
16
+ **Context:** Planning is read-only. Use `hive_feature_create` + `hive_plan_write` and avoid worktrees during planning.
17
17
 
18
- **Save plans to:** `docs/plans/YYYY-MM-DD-<feature-name>.md`
18
+ **Save plans to:** `hive_plan_write` (writes to `.hive/features/<feature>/plan.md`)
19
19
 
20
20
  ## Bite-Sized Task Granularity
21
21
 
@@ -26,66 +26,92 @@ Assume they are a skilled developer, but know almost nothing about our toolset o
26
26
  - "Run the tests and make sure they pass" - step
27
27
  - "Commit" - step
28
28
 
29
- ## Plan Document Header
29
+ ## Plan Structure
30
30
 
31
- **Every plan MUST start with this header:**
31
+ **Every plan MUST follow this structure:**
32
32
 
33
- ```markdown
34
- # [Feature Name] Implementation Plan
33
+ ````markdown
34
+ # [Feature Name]
35
35
 
36
- > **For Claude:** REQUIRED SUB-SKILL: Use hive_skill:executing-plans to implement this plan task-by-task.
36
+ ## Discovery
37
37
 
38
- **Goal:** [One sentence describing what this builds]
38
+ ### Original Request
39
+ - "{User's exact words}"
39
40
 
40
- **Architecture:** [2-3 sentences about approach]
41
+ ### Interview Summary
42
+ - {Point}: {Decision}
41
43
 
42
- **Tech Stack:** [Key technologies/libraries]
44
+ ### Research Findings
45
+ - `{file:lines}`: {Finding}
43
46
 
44
47
  ---
45
- ```
46
48
 
47
- ## Task Structure
49
+ ## Non-Goals (What we're NOT building)
50
+ - {Explicit exclusion}
48
51
 
49
- ```markdown
50
- ### Task N: [Component Name]
52
+ ---
51
53
 
52
- **Files:**
53
- - Create: `exact/path/to/file.py`
54
- - Modify: `exact/path/to/existing.py:123-145`
55
- - Test: `tests/exact/path/to/test.py`
54
+ ## Tasks
56
55
 
57
- **Step 1: Write the failing test**
56
+ ### 1. Task Name
58
57
 
59
- ```python
60
- def test_specific_behavior():
61
- result = function(input)
62
- assert result == expected
63
- ```
58
+ Use the Task Structure template below for every task.
59
+ ````
64
60
 
65
- **Step 2: Run test to verify it fails**
66
61
 
67
- Run: `pytest tests/path/test.py::test_name -v`
68
- Expected: FAIL with "function not defined"
62
+ ## Task Structure
69
63
 
70
- **Step 3: Write minimal implementation**
64
+ The **Depends on** annotation declares task execution order:
65
+ - **Depends on**: none — No dependencies; can run immediately or in parallel
66
+ - **Depends on**: 1 — Depends on task 1
67
+ - **Depends on**: 1, 3 — Depends on tasks 1 and 3
71
68
 
72
- ```python
73
- def function(input):
74
- return expected
75
- ```
69
+ Always include **Depends on** for each task. Use `none` to enable parallel starts.
76
70
 
77
- **Step 4: Run test to verify it passes**
71
+ ````markdown
72
+ ### N. Task Name
78
73
 
79
- Run: `pytest tests/path/test.py::test_name -v`
80
- Expected: PASS
74
+ **Depends on**: none
81
75
 
82
- **Step 5: Commit**
76
+ **Files:**
77
+ - Create: `exact/path/to/file.py`
78
+ - Modify: `exact/path/to/existing.py:123-145`
79
+ - Test: `tests/exact/path/to/test.py`
83
80
 
84
- ```bash
85
- git add tests/path/test.py src/path/file.py
86
- git commit -m "feat: add specific feature"
87
- ```
88
- ```
81
+ **What to do**:
82
+ - Step 1: Write the failing test
83
+ ```python
84
+ def test_specific_behavior():
85
+ result = function(input)
86
+ assert result == expected
87
+ ```
88
+ - Step 2: Run test to verify it fails
89
+ - Run: `pytest tests/path/test.py::test_name -v`
90
+ - Expected: FAIL with "function not defined"
91
+ - Step 3: Write minimal implementation
92
+ ```python
93
+ def function(input):
94
+ return expected
95
+ ```
96
+ - Step 4: Run test to verify it passes
97
+ - Run: `pytest tests/path/test.py::test_name -v`
98
+ - Expected: PASS
99
+ - Step 5: Commit
100
+ ```bash
101
+ git add tests/path/test.py src/path/file.py
102
+ git commit -m "feat: add specific feature"
103
+ ```
104
+
105
+ **Must NOT do**:
106
+ - {Task guardrail}
107
+
108
+ **References**:
109
+ - `{file:lines}` — {Why this reference matters}
110
+
111
+ **Verify**:
112
+ - [ ] Run: `{command}` → {expected}
113
+ - [ ] {Additional acceptance criteria}
114
+ ````
89
115
 
90
116
  ## Remember
91
117
  - Exact file paths always
@@ -96,18 +122,17 @@ git commit -m "feat: add specific feature"
96
122
 
97
123
  ## Execution Handoff
98
124
 
99
- After saving the plan, offer execution choice:
100
-
101
- **"Plan complete and saved to `docs/plans/<filename>.md`. Two execution options:**
125
+ After saving the plan, ask whether to consult Hygienic (Consultant/Reviewer/Debugger) before offering execution choice.
102
126
 
103
- **1. Subagent-Driven (this session)** - I dispatch fresh subagent per task, review between tasks, fast iteration
127
+ Plan complete and saved to `.hive/features/<feature>/plan.md`.
104
128
 
105
- **2. Parallel Session (separate)** - Open new session with executing-plans, batch execution with checkpoints
129
+ Two execution options:
130
+ 1. Subagent-Driven (this session) - I dispatch fresh subagent per task, review between tasks, fast iteration
131
+ 2. Parallel Session (separate) - Open new session with executing-plans, batch execution with checkpoints
106
132
 
107
- **Which approach?"**
133
+ Which approach?
108
134
 
109
135
  **If Subagent-Driven chosen:**
110
- - **REQUIRED SUB-SKILL:** Use hive_skill:subagent-driven-development
111
136
  - Stay in this session
112
137
  - Fresh subagent per task + code review
113
138