opencode-hive 0.8.3 → 0.9.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/dist/index.js +634 -139
- package/dist/skills/builtin.d.ts +6 -5
- package/dist/skills/registry.generated.d.ts +14 -0
- package/dist/utils/agent-selector.d.ts +9 -1
- package/package.json +3 -2
- package/skills/hive-execution/SKILL.md +37 -270
package/dist/skills/builtin.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Builtin Skills for Hive
|
|
3
3
|
*
|
|
4
|
-
* Following OMO-Slim pattern - skills are loaded from
|
|
4
|
+
* Following OMO-Slim pattern - skills are loaded from generated registry.
|
|
5
5
|
* This file provides the infrastructure to load builtin skills.
|
|
6
6
|
*/
|
|
7
7
|
import type { SkillDefinition, SkillLoadResult } from './types.js';
|
|
8
|
+
import { BUILTIN_SKILL_NAMES, BUILTIN_SKILLS } from './registry.generated.js';
|
|
9
|
+
export { BUILTIN_SKILL_NAMES, BUILTIN_SKILLS };
|
|
8
10
|
/**
|
|
9
|
-
*
|
|
10
|
-
* These are loaded from packages/hive-core/templates/skills/
|
|
11
|
+
* Type for builtin skill names.
|
|
11
12
|
*/
|
|
12
|
-
export
|
|
13
|
-
export type BuiltinSkillName = typeof BUILTIN_SKILLS[number];
|
|
13
|
+
export type BuiltinSkillName = typeof BUILTIN_SKILL_NAMES[number];
|
|
14
14
|
/**
|
|
15
15
|
* Load a builtin skill by name.
|
|
16
16
|
*/
|
|
@@ -21,5 +21,6 @@ export declare function loadBuiltinSkill(name: string): SkillLoadResult;
|
|
|
21
21
|
export declare function getBuiltinSkills(): SkillDefinition[];
|
|
22
22
|
/**
|
|
23
23
|
* Get skill metadata for tool description (XML format).
|
|
24
|
+
* Uses (hive - Skill) prefix for consistency with formatSkillsXml in index.ts.
|
|
24
25
|
*/
|
|
25
26
|
export declare function getBuiltinSkillsXml(): string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AUTO-GENERATED FILE - DO NOT EDIT
|
|
3
|
+
* Generated by: scripts/generate-skills.ts
|
|
4
|
+
* Run: bun run scripts/generate-skills.ts
|
|
5
|
+
*/
|
|
6
|
+
import type { SkillDefinition } from './types.js';
|
|
7
|
+
/**
|
|
8
|
+
* List of builtin skill names.
|
|
9
|
+
*/
|
|
10
|
+
export declare const BUILTIN_SKILL_NAMES: readonly ["hive", "hive-execution"];
|
|
11
|
+
/**
|
|
12
|
+
* All builtin skill definitions.
|
|
13
|
+
*/
|
|
14
|
+
export declare const BUILTIN_SKILLS: SkillDefinition[];
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Agent selection for OMO-Slim delegation.
|
|
3
3
|
* Maps task content patterns to specialized agent types.
|
|
4
|
+
*
|
|
5
|
+
* Available agents in OMO-Slim config:
|
|
6
|
+
* - orchestrator: Main orchestrator (not for delegation)
|
|
7
|
+
* - oracle: Architecture decisions, complex debugging, code review
|
|
8
|
+
* - librarian: External docs, library research, GitHub examples
|
|
9
|
+
* - explorer: Fast codebase search, pattern matching
|
|
10
|
+
* - designer: UI/UX, styling, component architecture
|
|
11
|
+
* - fixer: Fast implementation, receives context and executes
|
|
4
12
|
*/
|
|
5
|
-
export type OmoSlimAgent = '
|
|
13
|
+
export type OmoSlimAgent = 'fixer' | 'explorer' | 'librarian' | 'oracle' | 'designer';
|
|
6
14
|
/**
|
|
7
15
|
* Select the best OMO-Slim agent for a task based on content analysis.
|
|
8
16
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-hive",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
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",
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
"types": "./dist/index.d.ts",
|
|
28
28
|
"scripts": {
|
|
29
29
|
"clean": "rm -rf dist",
|
|
30
|
-
"
|
|
30
|
+
"generate-skills": "bun run scripts/generate-skills.ts",
|
|
31
|
+
"build": "npm run clean && npm run generate-skills && bun build src/index.ts --outdir dist --target node --format esm --packages=bundle && tsc --emitDeclarationOnly",
|
|
31
32
|
"dev": "opencode plugin dev",
|
|
32
33
|
"test": "bun test"
|
|
33
34
|
},
|
|
@@ -3,291 +3,58 @@ name: hive-execution
|
|
|
3
3
|
description: Execute Hive feature tasks with worktree isolation, parallel orchestration, and clean git history. Use when running synced Hive tasks.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Hive Execution
|
|
6
|
+
# Hive Execution
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Quick reference for executing Hive tasks.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## Workflow Summary
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
1. **Feature create** → Discovery guide injected
|
|
13
|
+
2. **Discovery** → Q&A documented in plan.md
|
|
14
|
+
3. **Plan write** → GATE: requires ## Discovery section
|
|
15
|
+
4. **Approval** → User reviews in VS Code
|
|
16
|
+
5. **Exec start** → Delegation guide (Master), TDD+debugging (Worker)
|
|
17
|
+
6. **Complete** → GATE: requires verification mention
|
|
18
|
+
7. **Merge** → Squash into feature branch
|
|
16
19
|
|
|
17
|
-
##
|
|
20
|
+
## Gates
|
|
18
21
|
|
|
19
|
-
|
|
22
|
+
| Tool | Gate | Error |
|
|
23
|
+
|------|------|-------|
|
|
24
|
+
| hive_plan_write | ## Discovery section | "BLOCKED: Discovery required" |
|
|
25
|
+
| hive_exec_complete | Verification in summary | "BLOCKED: No verification" |
|
|
20
26
|
|
|
21
|
-
|
|
22
|
-
2. **Plan approved**: Feature status is `approved` or `executing`
|
|
23
|
-
3. **Tasks synced**: `hive_session_open(feature)` shows task list
|
|
24
|
-
4. **Base branch clean**: No uncommitted changes in main worktree
|
|
27
|
+
## Task Lifecycle
|
|
25
28
|
|
|
26
|
-
## Execution Models
|
|
27
|
-
|
|
28
|
-
### Sequential Execution (Single Executor)
|
|
29
|
-
|
|
30
|
-
When running with a single executor, process tasks in order:
|
|
31
|
-
|
|
32
|
-
```
|
|
33
|
-
Task 01 → complete → merge
|
|
34
|
-
Task 02 → complete → merge
|
|
35
|
-
Task 03 → complete → merge
|
|
36
|
-
...
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
Follow task numbering order unless dependencies require otherwise.
|
|
40
|
-
|
|
41
|
-
### Parallel Execution (Multiple Executors - Optional)
|
|
42
|
-
|
|
43
|
-
If your environment supports multiple parallel executors, tasks can be organized into **phases** based on dependencies:
|
|
44
|
-
|
|
45
|
-
```
|
|
46
|
-
Phase 0 (start immediately, parallel):
|
|
47
|
-
- Executor A: Task that creates shared infrastructure (BLOCKER)
|
|
48
|
-
- Executor B: Independent task (no dependencies)
|
|
49
|
-
- Executor C: Independent task (no dependencies)
|
|
50
|
-
|
|
51
|
-
Phase 1 (after Phase 0 blockers merged, parallel):
|
|
52
|
-
- Executor A: Task depending on Phase 0 blocker
|
|
53
|
-
- Executor B: Another dependent task
|
|
54
|
-
- Executor C: Another dependent task
|
|
55
|
-
|
|
56
|
-
Phase 2 (final gate):
|
|
57
|
-
- Any executor: Verification/integration task
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
### Dependency Rules
|
|
61
|
-
|
|
62
|
-
When determining execution order (sequential or parallel):
|
|
63
|
-
|
|
64
|
-
| Dependency Type | Action |
|
|
65
|
-
|-----------------|--------|
|
|
66
|
-
| **Blocker task** | Must be merged before dependents start |
|
|
67
|
-
| **Shared files** | Tasks touching same files = sequential |
|
|
68
|
-
| **Independent** | Can run in parallel (if supported) or in any order |
|
|
69
|
-
|
|
70
|
-
## Task Execution Lifecycle
|
|
71
|
-
|
|
72
|
-
For EACH task, follow this exact sequence:
|
|
73
|
-
|
|
74
|
-
### 1. Start Task (creates isolated worktree)
|
|
75
|
-
|
|
76
|
-
```
|
|
77
|
-
hive_exec_start(task="<task-folder-name>")
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
This:
|
|
81
|
-
- Creates a git worktree from current base branch
|
|
82
|
-
- Sets task status to `in_progress`
|
|
83
|
-
- Generates `spec.md` with context from completed tasks
|
|
84
|
-
|
|
85
|
-
### 2. Implement in Worktree
|
|
86
|
-
|
|
87
|
-
Work ONLY within the task's worktree directory. The worktree path is returned by `hive_exec_start`.
|
|
88
|
-
|
|
89
|
-
- Read `spec.md` for task context and acceptance criteria
|
|
90
|
-
- Implement changes
|
|
91
|
-
- Verify against acceptance criteria
|
|
92
|
-
- Run tests/build if applicable
|
|
93
|
-
|
|
94
|
-
### 3. Complete Task (commits to task branch)
|
|
95
|
-
|
|
96
|
-
```
|
|
97
|
-
hive_exec_complete(task="<task-folder-name>", summary="<what-was-done>")
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
This:
|
|
101
|
-
- Commits all changes to the task branch
|
|
102
|
-
- Generates `report.md` with diff stats
|
|
103
|
-
- Sets task status to `done`
|
|
104
|
-
- **Does NOT merge** - worktree preserved
|
|
105
|
-
|
|
106
|
-
### 4. Merge to Main (squash for clean history)
|
|
107
|
-
|
|
108
|
-
```
|
|
109
|
-
hive_merge(task="<task-folder-name>", strategy="squash")
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
This:
|
|
113
|
-
- Squash-merges task branch into current branch
|
|
114
|
-
- Results in exactly ONE commit per task on main
|
|
115
|
-
- Commit message follows format: `hive(<task>): <summary>`
|
|
116
|
-
|
|
117
|
-
### 5. Cleanup (optional, recommended)
|
|
118
|
-
|
|
119
|
-
After successful merge, the worktree can be removed via git:
|
|
120
|
-
|
|
121
|
-
```bash
|
|
122
|
-
git worktree remove .hive/worktrees/<feature>/<task>
|
|
123
|
-
git branch -d hive/<feature>/<task>
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
## Scheduling Strategy
|
|
127
|
-
|
|
128
|
-
### Single Executor (Default)
|
|
129
|
-
|
|
130
|
-
Execute tasks sequentially in numerical order:
|
|
131
|
-
|
|
132
|
-
```
|
|
133
|
-
1. hive_exec_start → implement → hive_exec_complete → hive_merge
|
|
134
|
-
2. Move to next task
|
|
135
|
-
3. Repeat until all tasks done
|
|
136
29
|
```
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
1. **Identify blockers**: Tasks that create shared resources others depend on
|
|
145
|
-
2. **Group by phase**: Tasks that can run in parallel within each phase
|
|
146
|
-
3. **Assign to executors**: Balance workload across available executors
|
|
147
|
-
4. **Minimize conflicts**: Avoid assigning tasks touching same files to same phase
|
|
148
|
-
|
|
149
|
-
#### Example Schedule (3 Executors)
|
|
150
|
-
|
|
151
|
-
```markdown
|
|
152
|
-
## Scheduling (3 executors)
|
|
153
|
-
|
|
154
|
-
### Phase 0 (start immediately, parallel)
|
|
155
|
-
- Executor A: 02-create-shared-helpers (BLOCKER - others depend on this)
|
|
156
|
-
- Executor B: 01-update-documentation (independent)
|
|
157
|
-
- Executor C: 08-fix-config-issue (independent)
|
|
158
|
-
|
|
159
|
-
### Phase 1 (after Task 02 merged, parallel)
|
|
160
|
-
- Executor A: 06-feature-using-helpers, then 03-another-feature
|
|
161
|
-
- Executor B: 04-related-feature
|
|
162
|
-
- Executor C: 07-different-feature
|
|
163
|
-
|
|
164
|
-
### Phase 2 (final gate)
|
|
165
|
-
- Any executor: 09-final-verification
|
|
30
|
+
hive_exec_start(task) # Creates worktree
|
|
31
|
+
↓
|
|
32
|
+
[implement in worktree]
|
|
33
|
+
↓
|
|
34
|
+
hive_exec_complete(task, summary) # Commits to branch
|
|
35
|
+
↓
|
|
36
|
+
hive_merge(task, strategy: "squash") # Integrates to main
|
|
166
37
|
```
|
|
167
38
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
## Tool Quick Reference
|
|
171
|
-
|
|
172
|
-
| Phase | Tool | Purpose |
|
|
173
|
-
|-------|------|---------|
|
|
174
|
-
| Start | `hive_exec_start(task)` | Create worktree, begin work |
|
|
175
|
-
| Work | `hive_subtask_create(task, name, type)` | Break into TDD subtasks |
|
|
176
|
-
| Progress | `hive_subtask_update(task, subtask, status)` | Track subtask completion |
|
|
177
|
-
| Complete | `hive_exec_complete(task, summary)` | Commit changes to branch |
|
|
178
|
-
| Integrate | `hive_merge(task, strategy="squash")` | Merge to main with single commit |
|
|
179
|
-
| Abort | `hive_exec_abort(task)` | Discard changes, reset status |
|
|
180
|
-
| Status | `hive_worktree_list()` | See all active worktrees |
|
|
181
|
-
|
|
182
|
-
## Commit Discipline
|
|
39
|
+
## Quick Reference
|
|
183
40
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
```
|
|
193
|
-
hive(<task-folder>): <concise summary of change>
|
|
194
|
-
|
|
195
|
-
<optional body explaining why this change was needed>
|
|
196
|
-
```
|
|
41
|
+
| Tool | Purpose |
|
|
42
|
+
|------|---------|
|
|
43
|
+
| hive_status | Check overall progress |
|
|
44
|
+
| hive_worker_status | Check delegated workers |
|
|
45
|
+
| hive_exec_abort | Discard changes, restart |
|
|
46
|
+
| hive_merge | Integrate completed task |
|
|
47
|
+
| hive_worktree_list | See active worktrees |
|
|
197
48
|
|
|
198
49
|
## Error Recovery
|
|
199
50
|
|
|
200
|
-
### Task Failed
|
|
201
|
-
|
|
51
|
+
### Task Failed
|
|
202
52
|
```
|
|
203
|
-
hive_exec_abort(task
|
|
204
|
-
hive_exec_start(task
|
|
53
|
+
hive_exec_abort(task) # Discards changes
|
|
54
|
+
hive_exec_start(task) # Fresh start
|
|
205
55
|
```
|
|
206
56
|
|
|
207
57
|
### Merge Conflicts
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
1. Resolve conflicts in the worktree
|
|
212
|
-
2. Commit the resolution
|
|
213
|
-
3. Run `hive_merge` again OR merge manually
|
|
214
|
-
|
|
215
|
-
### Blocker Task Failed
|
|
216
|
-
|
|
217
|
-
If a Phase 0 blocker fails:
|
|
218
|
-
|
|
219
|
-
1. Do NOT start Phase 1 tasks
|
|
220
|
-
2. Fix the blocker
|
|
221
|
-
3. Complete and merge blocker
|
|
222
|
-
4. THEN start Phase 1
|
|
223
|
-
|
|
224
|
-
## Verification Gate
|
|
225
|
-
|
|
226
|
-
Before marking feature complete:
|
|
227
|
-
|
|
228
|
-
- [ ] All tasks show status `done`
|
|
229
|
-
- [ ] All task branches merged to main
|
|
230
|
-
- [ ] No orphaned worktrees (`hive_worktree_list` empty or cleaned)
|
|
231
|
-
- [ ] Final verification task passed
|
|
232
|
-
- [ ] Build passes on main branch
|
|
233
|
-
|
|
234
|
-
## Example: Full Execution Flow
|
|
235
|
-
|
|
236
|
-
### Sequential (Single Executor)
|
|
237
|
-
|
|
238
|
-
```
|
|
239
|
-
# 1. Open session to see current state
|
|
240
|
-
hive_session_open(feature="my-feature")
|
|
241
|
-
|
|
242
|
-
# 2. Execute tasks in order
|
|
243
|
-
hive_exec_start(task="01-first-task")
|
|
244
|
-
# ... implement ...
|
|
245
|
-
hive_exec_complete(task="01-first-task", summary="Completed first task")
|
|
246
|
-
hive_merge(task="01-first-task", strategy="squash")
|
|
247
|
-
|
|
248
|
-
hive_exec_start(task="02-second-task")
|
|
249
|
-
# ... implement ...
|
|
250
|
-
hive_exec_complete(task="02-second-task", summary="Completed second task")
|
|
251
|
-
hive_merge(task="02-second-task", strategy="squash")
|
|
252
|
-
|
|
253
|
-
# Continue for remaining tasks...
|
|
254
|
-
|
|
255
|
-
# 3. Complete feature
|
|
256
|
-
hive_feature_complete(feature="my-feature")
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
### Parallel (Multiple Executors - Optional)
|
|
260
|
-
|
|
261
|
-
```
|
|
262
|
-
# 1. Open session to see current state
|
|
263
|
-
hive_session_open(feature="my-feature")
|
|
264
|
-
|
|
265
|
-
# 2. Phase 0 - Start parallel tasks
|
|
266
|
-
# Executor A:
|
|
267
|
-
hive_exec_start(task="02-shared-helpers")
|
|
268
|
-
# ... implement ...
|
|
269
|
-
hive_exec_complete(task="02-shared-helpers", summary="Added shared test helpers module")
|
|
270
|
-
hive_merge(task="02-shared-helpers", strategy="squash")
|
|
271
|
-
|
|
272
|
-
# Executor B (parallel):
|
|
273
|
-
hive_exec_start(task="01-update-docs")
|
|
274
|
-
# ... implement ...
|
|
275
|
-
hive_exec_complete(task="01-update-docs", summary="Updated README with new metrics")
|
|
276
|
-
hive_merge(task="01-update-docs", strategy="squash")
|
|
277
|
-
|
|
278
|
-
# 3. Phase 1 - After blocker merged
|
|
279
|
-
# Executor A:
|
|
280
|
-
hive_exec_start(task="06-use-helpers")
|
|
281
|
-
# ... implement using the helpers from task 02 ...
|
|
282
|
-
hive_exec_complete(task="06-use-helpers", summary="Integrated shared helpers in tests")
|
|
283
|
-
hive_merge(task="06-use-helpers", strategy="squash")
|
|
284
|
-
|
|
285
|
-
# 4. Final verification
|
|
286
|
-
hive_exec_start(task="09-final-check")
|
|
287
|
-
# ... run full test suite, verify everything works ...
|
|
288
|
-
hive_exec_complete(task="09-final-check", summary="All tests pass, CI green")
|
|
289
|
-
hive_merge(task="09-final-check", strategy="squash")
|
|
290
|
-
|
|
291
|
-
# 5. Complete feature
|
|
292
|
-
hive_feature_complete(feature="my-feature")
|
|
293
|
-
```
|
|
58
|
+
1. Resolve conflicts in worktree
|
|
59
|
+
2. Commit resolution
|
|
60
|
+
3. Run hive_merge again
|