opencode-hive 0.8.2 → 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/agents/hive.d.ts +30 -0
- package/dist/index.js +1463 -603
- package/dist/skills/builtin.d.ts +26 -0
- package/dist/skills/index.d.ts +7 -0
- package/dist/skills/registry.generated.d.ts +14 -0
- package/dist/skills/types.d.ts +29 -0
- package/dist/utils/agent-selector.d.ts +29 -0
- package/dist/utils/worker-prompt.d.ts +42 -0
- package/package.json +8 -3
- package/skills/hive-execution/SKILL.md +60 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builtin Skills for Hive
|
|
3
|
+
*
|
|
4
|
+
* Following OMO-Slim pattern - skills are loaded from generated registry.
|
|
5
|
+
* This file provides the infrastructure to load builtin skills.
|
|
6
|
+
*/
|
|
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 };
|
|
10
|
+
/**
|
|
11
|
+
* Type for builtin skill names.
|
|
12
|
+
*/
|
|
13
|
+
export type BuiltinSkillName = typeof BUILTIN_SKILL_NAMES[number];
|
|
14
|
+
/**
|
|
15
|
+
* Load a builtin skill by name.
|
|
16
|
+
*/
|
|
17
|
+
export declare function loadBuiltinSkill(name: string): SkillLoadResult;
|
|
18
|
+
/**
|
|
19
|
+
* Get all builtin skills.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getBuiltinSkills(): SkillDefinition[];
|
|
22
|
+
/**
|
|
23
|
+
* Get skill metadata for tool description (XML format).
|
|
24
|
+
* Uses (hive - Skill) prefix for consistency with formatSkillsXml in index.ts.
|
|
25
|
+
*/
|
|
26
|
+
export declare function getBuiltinSkillsXml(): string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hive Skills System
|
|
3
|
+
*
|
|
4
|
+
* Export skill infrastructure for use in hive_skill tool.
|
|
5
|
+
*/
|
|
6
|
+
export type { SkillDefinition, SkillLoadResult } from './types.js';
|
|
7
|
+
export { BUILTIN_SKILLS, loadBuiltinSkill, getBuiltinSkills, getBuiltinSkillsXml, type BuiltinSkillName } from './builtin.js';
|
|
@@ -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[];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hive Skill System Types
|
|
3
|
+
*
|
|
4
|
+
* Following OMO-Slim pattern for skill definitions.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Definition of a skill that can be loaded by agents.
|
|
8
|
+
*/
|
|
9
|
+
export interface SkillDefinition {
|
|
10
|
+
/** Unique identifier for the skill */
|
|
11
|
+
name: string;
|
|
12
|
+
/** Brief description shown in available_skills list */
|
|
13
|
+
description: string;
|
|
14
|
+
/** Markdown content with detailed instructions */
|
|
15
|
+
template: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Result returned when loading a skill.
|
|
19
|
+
*/
|
|
20
|
+
export interface SkillLoadResult {
|
|
21
|
+
/** Whether the skill was found */
|
|
22
|
+
found: boolean;
|
|
23
|
+
/** The loaded skill definition if found */
|
|
24
|
+
skill?: SkillDefinition;
|
|
25
|
+
/** Error message if not found */
|
|
26
|
+
error?: string;
|
|
27
|
+
/** Source of the skill (builtin or file path) */
|
|
28
|
+
source?: 'builtin' | string;
|
|
29
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent selection for OMO-Slim delegation.
|
|
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
|
|
12
|
+
*/
|
|
13
|
+
export type OmoSlimAgent = 'fixer' | 'explorer' | 'librarian' | 'oracle' | 'designer';
|
|
14
|
+
/**
|
|
15
|
+
* Select the best OMO-Slim agent for a task based on content analysis.
|
|
16
|
+
*
|
|
17
|
+
* @param taskName - The task name/title
|
|
18
|
+
* @param spec - The task specification/description
|
|
19
|
+
* @returns The selected agent type
|
|
20
|
+
*/
|
|
21
|
+
export declare function selectAgent(taskName: string, spec: string): OmoSlimAgent;
|
|
22
|
+
/**
|
|
23
|
+
* Get a human-readable description of an agent's purpose.
|
|
24
|
+
*/
|
|
25
|
+
export declare function getAgentDescription(agent: OmoSlimAgent): string;
|
|
26
|
+
/**
|
|
27
|
+
* Get all available agent types.
|
|
28
|
+
*/
|
|
29
|
+
export declare function getAvailableAgents(): OmoSlimAgent[];
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Worker prompt builder for Hive delegated execution.
|
|
3
|
+
* Builds context-rich prompts for worker agents with all Hive context.
|
|
4
|
+
*/
|
|
5
|
+
export interface ContextFile {
|
|
6
|
+
name: string;
|
|
7
|
+
content: string;
|
|
8
|
+
}
|
|
9
|
+
export interface CompletedTask {
|
|
10
|
+
name: string;
|
|
11
|
+
summary: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ContinueFromBlocked {
|
|
14
|
+
status: 'blocked';
|
|
15
|
+
previousSummary: string;
|
|
16
|
+
decision: string;
|
|
17
|
+
}
|
|
18
|
+
export interface WorkerPromptParams {
|
|
19
|
+
feature: string;
|
|
20
|
+
task: string;
|
|
21
|
+
taskOrder: number;
|
|
22
|
+
worktreePath: string;
|
|
23
|
+
branch: string;
|
|
24
|
+
plan: string;
|
|
25
|
+
contextFiles: ContextFile[];
|
|
26
|
+
spec: string;
|
|
27
|
+
previousTasks?: CompletedTask[];
|
|
28
|
+
continueFrom?: ContinueFromBlocked;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Build a context-rich prompt for a worker agent.
|
|
32
|
+
*
|
|
33
|
+
* Includes:
|
|
34
|
+
* - Assignment details (feature, task, worktree, branch)
|
|
35
|
+
* - Plan context
|
|
36
|
+
* - Context files (royal jelly)
|
|
37
|
+
* - Previous task summaries
|
|
38
|
+
* - Mission (spec)
|
|
39
|
+
* - Blocker protocol (NOT question tool)
|
|
40
|
+
* - Completion protocol
|
|
41
|
+
*/
|
|
42
|
+
export declare function buildWorkerPrompt(params: WorkerPromptParams): string;
|
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
|
},
|
|
@@ -45,5 +46,9 @@
|
|
|
45
46
|
"@types/node": "^20.0.0",
|
|
46
47
|
"typescript": "^5.0.0"
|
|
47
48
|
},
|
|
48
|
-
"files": [
|
|
49
|
+
"files": [
|
|
50
|
+
"dist/",
|
|
51
|
+
"skills/",
|
|
52
|
+
"README.md"
|
|
53
|
+
]
|
|
49
54
|
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: hive-execution
|
|
3
|
+
description: Execute Hive feature tasks with worktree isolation, parallel orchestration, and clean git history. Use when running synced Hive tasks.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Hive Execution
|
|
7
|
+
|
|
8
|
+
Quick reference for executing Hive tasks.
|
|
9
|
+
|
|
10
|
+
## Workflow Summary
|
|
11
|
+
|
|
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
|
|
19
|
+
|
|
20
|
+
## Gates
|
|
21
|
+
|
|
22
|
+
| Tool | Gate | Error |
|
|
23
|
+
|------|------|-------|
|
|
24
|
+
| hive_plan_write | ## Discovery section | "BLOCKED: Discovery required" |
|
|
25
|
+
| hive_exec_complete | Verification in summary | "BLOCKED: No verification" |
|
|
26
|
+
|
|
27
|
+
## Task Lifecycle
|
|
28
|
+
|
|
29
|
+
```
|
|
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
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Quick Reference
|
|
40
|
+
|
|
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 |
|
|
48
|
+
|
|
49
|
+
## Error Recovery
|
|
50
|
+
|
|
51
|
+
### Task Failed
|
|
52
|
+
```
|
|
53
|
+
hive_exec_abort(task) # Discards changes
|
|
54
|
+
hive_exec_start(task) # Fresh start
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Merge Conflicts
|
|
58
|
+
1. Resolve conflicts in worktree
|
|
59
|
+
2. Commit resolution
|
|
60
|
+
3. Run hive_merge again
|