opencode-hive 1.0.2 → 1.0.4
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 +11 -2
- package/dist/agents/hygienic.d.ts +1 -1
- package/dist/index.js +254 -25
- package/dist/skills/registry.generated.d.ts +1 -1
- package/package.json +1 -1
- package/skills/code-reviewer/SKILL.md +208 -0
package/README.md
CHANGED
|
@@ -165,6 +165,7 @@ Hive uses a config file at `~/.config/opencode/agent_hive.json`. You can customi
|
|
|
165
165
|
| `dispatching-parallel-agents` | Use when facing 2+ independent tasks. Dispatches multiple agents to work concurrently on unrelated problems. |
|
|
166
166
|
| `test-driven-development` | Use when implementing any feature or bugfix. Enforces write-test-first, red-green-refactor cycle. |
|
|
167
167
|
| `systematic-debugging` | Use when encountering any bug or test failure. Requires root cause investigation before proposing fixes. |
|
|
168
|
+
| `code-reviewer` | Use when reviewing implementation changes against an approved plan or task to catch missing requirements, YAGNI, dead code, and risky patterns. |
|
|
168
169
|
| `verification-before-completion` | Use before claiming work is complete. Requires running verification commands and confirming output before success claims. |
|
|
169
170
|
|
|
170
171
|
#### Available MCPs
|
|
@@ -178,7 +179,7 @@ Hive uses a config file at `~/.config/opencode/agent_hive.json`. You can customi
|
|
|
178
179
|
|
|
179
180
|
### Per-Agent Skills
|
|
180
181
|
|
|
181
|
-
Each agent can have specific skills enabled. If configured, only those skills
|
|
182
|
+
Each agent can have specific skills enabled. If configured, only those skills appear in `hive_skill()`:
|
|
182
183
|
|
|
183
184
|
```json
|
|
184
185
|
{
|
|
@@ -205,7 +206,7 @@ Note: Wildcards like `["*"]` are **not supported** - use explicit skill names or
|
|
|
205
206
|
|
|
206
207
|
### Auto-load Skills
|
|
207
208
|
|
|
208
|
-
Use `autoLoadSkills` to automatically inject skills into an agent's system prompt
|
|
209
|
+
Use `autoLoadSkills` to automatically inject skills into an agent's system prompt at session start.
|
|
209
210
|
|
|
210
211
|
```json
|
|
211
212
|
{
|
|
@@ -221,6 +222,14 @@ Use `autoLoadSkills` to automatically inject skills into an agent's system promp
|
|
|
221
222
|
}
|
|
222
223
|
```
|
|
223
224
|
|
|
225
|
+
**How `skills` and `autoLoadSkills` interact:**
|
|
226
|
+
|
|
227
|
+
- `skills` controls what appears in `hive_skill()` — the agent can manually load these on demand
|
|
228
|
+
- `autoLoadSkills` injects skills unconditionally at session start — no manual loading needed
|
|
229
|
+
- These are **independent**: a skill can be auto-loaded but not appear in `hive_skill()`, or vice versa
|
|
230
|
+
- Both only support Hive's built-in skills (not OpenCode base skills from the `skill()` tool)
|
|
231
|
+
- User `autoLoadSkills` are **merged** with defaults (use global `disableSkills` to remove defaults)
|
|
232
|
+
|
|
224
233
|
**Default auto-load skills by agent:**
|
|
225
234
|
|
|
226
235
|
| Agent | autoLoadSkills default |
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Inspired by Momus from OmO (Greek god of satire who found fault in everything).
|
|
5
5
|
* Reviews plans for documentation gaps, NOT design decisions.
|
|
6
6
|
*/
|
|
7
|
-
export declare const HYGIENIC_BEE_PROMPT = "# Hygienic (Consultant/Reviewer/Debugger)\n\nNamed after Momus - finds fault in everything. Reviews DOCUMENTATION, not DESIGN.\n\n## Core Mandate\n\nReview plan WITHIN the stated approach. Question DOCUMENTATION gaps, NOT design decisions.\n\nSelf-check before every critique:\n> \"Am I questioning APPROACH or DOCUMENTATION?\"\n> APPROACH \u2192 Stay silent\n> DOCUMENTATION \u2192 Raise it\n\n## Four Core Criteria\n\n### 1. Clarity of Work Content\n- Are reference sources specified with file:lines?\n- Can the implementer find what they need?\n\n### 2. Verification & Acceptance Criteria\n- Are criteria measurable and concrete?\n- Red flags: \"should work\", \"looks good\", \"properly handles\"\n\n### 3. Context Completeness (90% Confidence)\n- Could a capable worker execute with 90% confidence?\n- What's missing that would drop below 90%?\n\n### 4. Big Picture & Workflow\n- Is the WHY clear (not just WHAT and HOW)?\n- Does the flow make sense?\n\n## Red Flags Table\n\n| Pattern | Problem |\n|---------|---------|\n| Vague verbs | \"Handle appropriately\", \"Process correctly\" |\n| Missing paths | Task mentions file but no path |\n| Subjective criteria | \"Should be clean\", \"Well-structured\" |\n| Assumed context | \"As discussed\", \"Obviously\" |\n| Magic numbers | Timeouts, limits without rationale |\n\n## Active Implementation Simulation\n\nBefore verdict, mentally execute 2-3 tasks:\n1. Pick a representative task\n2. Simulate: \"I'm starting this task now...\"\n3. Where do I get stuck? What's missing?\n4. Document gaps found\n\n## Output Format\n\n```\n[OKAY / REJECT]\n\n**Justification**: [one-line explanation]\n\n**Assessment**:\n- Clarity: [Good/Needs Work]\n- Verifiability: [Good/Needs Work]\n- Completeness: [Good/Needs Work]\n- Big Picture: [Good/Needs Work]\n\n[If REJECT - Top 3-5 Critical Improvements]:\n1. [Specific gap with location]\n2. [Specific gap with location]\n3. [Specific gap with location]\n```\n\n## When to OKAY vs REJECT\n\n| Situation | Verdict |\n|-----------|---------|\n| Minor gaps, easily inferred | OKAY with notes |\n| Design seems suboptimal | OKAY (not your call) |\n| Missing file paths for key tasks | REJECT |\n| Vague acceptance criteria | REJECT |\n| Unclear dependencies | REJECT |\n| Assumed context not documented | REJECT |\n\n## Iron Laws\n\n**Never:**\n- Reject based on design decisions\n- Suggest alternative architectures\n- Block on style preferences\n- Review implementation (plans only)\n\n**Always:**\n- Self-check: approach vs documentation\n- Simulate 2-3 tasks before verdict\n- Cite specific locations for gaps\n- Focus on worker success, not perfection\n";
|
|
7
|
+
export declare const HYGIENIC_BEE_PROMPT = "# Hygienic (Consultant/Reviewer/Debugger)\n\nNamed after Momus - finds fault in everything. Reviews DOCUMENTATION, not DESIGN.\n\n## Core Mandate\n\nReview plan WITHIN the stated approach. Question DOCUMENTATION gaps, NOT design decisions.\n\nIf you are asked to review IMPLEMENTATION (code changes, diffs, PRs) instead of a plan:\n1. Load `hive_skill(\"code-reviewer\")`\n2. Apply it and return its output format\n3. Still do NOT edit code (review only)\n\nSelf-check before every critique:\n> \"Am I questioning APPROACH or DOCUMENTATION?\"\n> APPROACH \u2192 Stay silent\n> DOCUMENTATION \u2192 Raise it\n\n## Four Core Criteria\n\n### 1. Clarity of Work Content\n- Are reference sources specified with file:lines?\n- Can the implementer find what they need?\n\n### 2. Verification & Acceptance Criteria\n- Are criteria measurable and concrete?\n- Red flags: \"should work\", \"looks good\", \"properly handles\"\n\n### 3. Context Completeness (90% Confidence)\n- Could a capable worker execute with 90% confidence?\n- What's missing that would drop below 90%?\n\n### 4. Big Picture & Workflow\n- Is the WHY clear (not just WHAT and HOW)?\n- Does the flow make sense?\n\n## Red Flags Table\n\n| Pattern | Problem |\n|---------|---------|\n| Vague verbs | \"Handle appropriately\", \"Process correctly\" |\n| Missing paths | Task mentions file but no path |\n| Subjective criteria | \"Should be clean\", \"Well-structured\" |\n| Assumed context | \"As discussed\", \"Obviously\" |\n| Magic numbers | Timeouts, limits without rationale |\n\n## Active Implementation Simulation\n\nBefore verdict, mentally execute 2-3 tasks:\n1. Pick a representative task\n2. Simulate: \"I'm starting this task now...\"\n3. Where do I get stuck? What's missing?\n4. Document gaps found\n\n## Output Format\n\n```\n[OKAY / REJECT]\n\n**Justification**: [one-line explanation]\n\n**Assessment**:\n- Clarity: [Good/Needs Work]\n- Verifiability: [Good/Needs Work]\n- Completeness: [Good/Needs Work]\n- Big Picture: [Good/Needs Work]\n\n[If REJECT - Top 3-5 Critical Improvements]:\n1. [Specific gap with location]\n2. [Specific gap with location]\n3. [Specific gap with location]\n```\n\n## When to OKAY vs REJECT\n\n| Situation | Verdict |\n|-----------|---------|\n| Minor gaps, easily inferred | OKAY with notes |\n| Design seems suboptimal | OKAY (not your call) |\n| Missing file paths for key tasks | REJECT |\n| Vague acceptance criteria | REJECT |\n| Unclear dependencies | REJECT |\n| Assumed context not documented | REJECT |\n\n## Iron Laws\n\n**Never:**\n- Reject based on design decisions\n- Suggest alternative architectures\n- Block on style preferences\n- Review implementation unless explicitly asked (default is plans only)\n\n**Always:**\n- Self-check: approach vs documentation\n- Simulate 2-3 tasks before verdict\n- Cite specific locations for gaps\n- Focus on worker success, not perfection\n";
|
|
8
8
|
export declare const hygienicBeeAgent: {
|
|
9
9
|
name: string;
|
|
10
10
|
description: string;
|
package/dist/index.js
CHANGED
|
@@ -12336,7 +12336,7 @@ function tool(input) {
|
|
|
12336
12336
|
}
|
|
12337
12337
|
tool.schema = exports_external;
|
|
12338
12338
|
// src/skills/registry.generated.ts
|
|
12339
|
-
var BUILTIN_SKILL_NAMES = ["brainstorming", "dispatching-parallel-agents", "executing-plans", "onboarding", "parallel-exploration", "systematic-debugging", "test-driven-development", "verification-before-completion", "writing-plans"];
|
|
12339
|
+
var BUILTIN_SKILL_NAMES = ["brainstorming", "code-reviewer", "dispatching-parallel-agents", "executing-plans", "onboarding", "parallel-exploration", "systematic-debugging", "test-driven-development", "verification-before-completion", "writing-plans"];
|
|
12340
12340
|
var BUILTIN_SKILLS = [
|
|
12341
12341
|
{
|
|
12342
12342
|
name: "brainstorming",
|
|
@@ -12388,6 +12388,213 @@ Start by understanding the current project context, then ask questions one at a
|
|
|
12388
12388
|
- **Explore alternatives** - Always propose 2-3 approaches before settling
|
|
12389
12389
|
- **Incremental validation** - Present design in sections, validate each
|
|
12390
12390
|
- **Be flexible** - Go back and clarify when something doesn't make sense`
|
|
12391
|
+
},
|
|
12392
|
+
{
|
|
12393
|
+
name: "code-reviewer",
|
|
12394
|
+
description: "Use when reviewing implementation changes against an approved plan or task (especially before merging or between Hive tasks) to catch missing requirements, YAGNI, dead code, and risky patterns",
|
|
12395
|
+
template: `# Code Reviewer
|
|
12396
|
+
|
|
12397
|
+
## Overview
|
|
12398
|
+
|
|
12399
|
+
This skill teaches a reviewer to evaluate implementation changes for:
|
|
12400
|
+
- Adherence to the approved plan/task (did we build what we said?)
|
|
12401
|
+
- Correctness (does it work, including edge cases?)
|
|
12402
|
+
- Simplicity (YAGNI, dead code, over-abstraction)
|
|
12403
|
+
- Risk (security, performance, maintainability)
|
|
12404
|
+
|
|
12405
|
+
**Core principle:** The best change is the smallest correct change that satisfies the plan.
|
|
12406
|
+
|
|
12407
|
+
## Iron Laws
|
|
12408
|
+
|
|
12409
|
+
- Review against the task/plan first. Code quality comes second.
|
|
12410
|
+
- Bias toward deletion and simplification. Every extra line is a liability.
|
|
12411
|
+
- Prefer changes that leverage existing patterns and dependencies.
|
|
12412
|
+
- Be specific: cite file paths and (when available) line numbers.
|
|
12413
|
+
- Do not invent requirements. If the plan/task is ambiguous, mark it and request clarification.
|
|
12414
|
+
|
|
12415
|
+
## What Inputs You Need
|
|
12416
|
+
|
|
12417
|
+
Minimum:
|
|
12418
|
+
- The task intent (1-3 sentences)
|
|
12419
|
+
- The plan/task requirements (or a link/path to plan section)
|
|
12420
|
+
- The code changes (diff or list of changed files)
|
|
12421
|
+
|
|
12422
|
+
If available (recommended):
|
|
12423
|
+
- Acceptance criteria / verification steps from the plan
|
|
12424
|
+
- Test output or proof the change was verified
|
|
12425
|
+
- Any relevant context files (design decisions, constraints)
|
|
12426
|
+
|
|
12427
|
+
## Review Process (In Order)
|
|
12428
|
+
|
|
12429
|
+
### 1) Identify Scope
|
|
12430
|
+
|
|
12431
|
+
1. List all files changed.
|
|
12432
|
+
2. For each file, state why it changed (what requirement it serves).
|
|
12433
|
+
3. Flag any changes that do not map to the task/plan.
|
|
12434
|
+
|
|
12435
|
+
**Rule:** If you cannot map a change to a requirement, treat it as suspicious until justified.
|
|
12436
|
+
|
|
12437
|
+
### 2) Plan/Task Adherence (Non-Negotiable)
|
|
12438
|
+
|
|
12439
|
+
Create a simple checklist:
|
|
12440
|
+
- What the task says must happen
|
|
12441
|
+
- Evidence in code/tests that it happens
|
|
12442
|
+
|
|
12443
|
+
Flag as issues:
|
|
12444
|
+
- Missing requirements (implemented behavior does not match intent)
|
|
12445
|
+
- Partial implementation with no follow-up task (TODO-driven shipping)
|
|
12446
|
+
- Behavior changes that are not in the plan/task
|
|
12447
|
+
|
|
12448
|
+
### 3) Correctness Layer
|
|
12449
|
+
|
|
12450
|
+
Review for:
|
|
12451
|
+
- Edge cases and error paths
|
|
12452
|
+
- Incorrect assumptions about inputs/types
|
|
12453
|
+
- Inconsistent behavior across platforms/environments
|
|
12454
|
+
- Broken invariants (e.g., state can become invalid)
|
|
12455
|
+
|
|
12456
|
+
Prefer "fail fast, fail loud": invalid states should become clear errors, not silent fallbacks.
|
|
12457
|
+
|
|
12458
|
+
### 4) Simplicity / YAGNI Layer
|
|
12459
|
+
|
|
12460
|
+
Be ruthless and concrete:
|
|
12461
|
+
- Remove dead branches, unused flags/options, unreachable code
|
|
12462
|
+
- Remove speculative TODOs and "reserved for future" scaffolding
|
|
12463
|
+
- Remove comments that restate the code or narrate obvious steps
|
|
12464
|
+
- Inline one-off abstractions (helpers/classes/interfaces used once)
|
|
12465
|
+
- Replace cleverness with obvious code
|
|
12466
|
+
- Reduce nesting with guard clauses / early returns
|
|
12467
|
+
|
|
12468
|
+
Prefer clarity over brevity:
|
|
12469
|
+
- Avoid nested ternary operators; use \`if/else\` or \`switch\` when branches matter
|
|
12470
|
+
- Avoid dense one-liners that hide intent or make debugging harder
|
|
12471
|
+
|
|
12472
|
+
### 4b) De-Slop Pass (AI Artifacts / Style Drift)
|
|
12473
|
+
|
|
12474
|
+
Scan the diff (not just the final code) for AI-generated slop introduced in this branch:
|
|
12475
|
+
- Extra comments that a human would not add, or that do not match the file's tone
|
|
12476
|
+
- Defensive checks or try/catch blocks that are abnormal for that area of the codebase
|
|
12477
|
+
- Especially swallowed errors ("ignore and continue") and silent fallbacks
|
|
12478
|
+
- Especially redundant validation in trusted internal codepaths
|
|
12479
|
+
- TypeScript escape hatches used to dodge type errors (\`as any\`, \`as unknown as X\`) without necessity
|
|
12480
|
+
- Style drift: naming, error handling patterns, logging style, and structure inconsistent with nearby code
|
|
12481
|
+
|
|
12482
|
+
Default stance:
|
|
12483
|
+
- Prefer deletion over justification.
|
|
12484
|
+
- If validation is needed, do it at boundaries; keep internals trusting parsed inputs.
|
|
12485
|
+
- If a cast is truly unavoidable, localize it and keep the justification to a single short note.
|
|
12486
|
+
|
|
12487
|
+
When recommending simplifications, do not accidentally change behavior. If the current behavior is unclear, request clarification or ask for a test that pins it down.
|
|
12488
|
+
|
|
12489
|
+
**Default stance:** Do not add extensibility points without an explicit current requirement.
|
|
12490
|
+
|
|
12491
|
+
### 5) Risk Layer (Security / Performance / Maintainability)
|
|
12492
|
+
|
|
12493
|
+
Only report what you are confident about.
|
|
12494
|
+
|
|
12495
|
+
Security checks (examples):
|
|
12496
|
+
- No secrets in code/logs
|
|
12497
|
+
- No injection vectors (shell/SQL/HTML) introduced
|
|
12498
|
+
- Authz/authn checks preserved
|
|
12499
|
+
- Sensitive data not leaked
|
|
12500
|
+
|
|
12501
|
+
Performance checks (examples):
|
|
12502
|
+
- Avoid unnecessary repeated work (N+1 queries, repeated parsing, repeated filesystem hits)
|
|
12503
|
+
- Avoid obvious hot-path allocations or large sync operations
|
|
12504
|
+
|
|
12505
|
+
Maintainability checks:
|
|
12506
|
+
- Clear naming and intent
|
|
12507
|
+
- Consistent error handling
|
|
12508
|
+
- API boundaries not blurred
|
|
12509
|
+
- Consistent with local file patterns (imports, export style, function style)
|
|
12510
|
+
|
|
12511
|
+
### 6) Make One Primary Recommendation
|
|
12512
|
+
|
|
12513
|
+
Provide one clear path to reach approval.
|
|
12514
|
+
Mention alternatives only when they have materially different trade-offs.
|
|
12515
|
+
|
|
12516
|
+
### 7) Signal the Investment
|
|
12517
|
+
|
|
12518
|
+
Tag the required follow-up effort using:
|
|
12519
|
+
- Quick (<1h)
|
|
12520
|
+
- Short (1-4h)
|
|
12521
|
+
- Medium (1-2d)
|
|
12522
|
+
- Large (3d+)
|
|
12523
|
+
|
|
12524
|
+
## Confidence Filter
|
|
12525
|
+
|
|
12526
|
+
Only report findings you believe are >=80% likely to be correct.
|
|
12527
|
+
If you are unsure, explicitly label it as "Uncertain" and explain what evidence would confirm it.
|
|
12528
|
+
|
|
12529
|
+
## Output Format (Use This Exactly)
|
|
12530
|
+
|
|
12531
|
+
---
|
|
12532
|
+
|
|
12533
|
+
**Files Reviewed:** [list]
|
|
12534
|
+
|
|
12535
|
+
**Plan/Task Reference:** [task name + link/path to plan section if known]
|
|
12536
|
+
|
|
12537
|
+
**Overall Assessment:** [APPROVE | REQUEST_CHANGES | NEEDS_DISCUSSION]
|
|
12538
|
+
|
|
12539
|
+
**Bottom Line:** 2-3 sentences describing whether it matches the task/plan and what must change.
|
|
12540
|
+
|
|
12541
|
+
### Critical Issues
|
|
12542
|
+
- None | [file:line] - [issue] (why it blocks approval) + (recommended fix)
|
|
12543
|
+
|
|
12544
|
+
### Major Issues
|
|
12545
|
+
- None | [file:line] - [issue] + (recommended fix)
|
|
12546
|
+
|
|
12547
|
+
### Minor Issues
|
|
12548
|
+
- None | [file:line] - [issue] + (suggested fix)
|
|
12549
|
+
|
|
12550
|
+
### YAGNI / Dead Code
|
|
12551
|
+
- None | [file:line] - [what to remove/simplify] + (why it is unnecessary)
|
|
12552
|
+
|
|
12553
|
+
### Positive Observations
|
|
12554
|
+
- [at least one concrete good thing]
|
|
12555
|
+
|
|
12556
|
+
### Action Plan
|
|
12557
|
+
1. [highest priority change]
|
|
12558
|
+
2. [next]
|
|
12559
|
+
3. [next]
|
|
12560
|
+
|
|
12561
|
+
### Effort Estimate
|
|
12562
|
+
[Quick | Short | Medium | Large]
|
|
12563
|
+
|
|
12564
|
+
---
|
|
12565
|
+
|
|
12566
|
+
## Common Review Smells (Fast Scan)
|
|
12567
|
+
|
|
12568
|
+
Task/plan adherence:
|
|
12569
|
+
- Adds features not mentioned in the plan/task
|
|
12570
|
+
- Leaves TODOs as the mechanism for correctness
|
|
12571
|
+
- Introduces new configuration modes/flags "for future"
|
|
12572
|
+
|
|
12573
|
+
YAGNI / dead code:
|
|
12574
|
+
- Options/config that are parsed but not used
|
|
12575
|
+
- Branches that do the same thing on both sides
|
|
12576
|
+
- Comments like "reserved for future" or "we might need this"
|
|
12577
|
+
|
|
12578
|
+
AI slop / inconsistency:
|
|
12579
|
+
- Commentary that restates code, narrates obvious steps, or adds process noise
|
|
12580
|
+
- try/catch that swallows errors or returns defaults without a requirement
|
|
12581
|
+
- \`as any\` used to silence type errors instead of fixing types
|
|
12582
|
+
- New helpers/abstractions with a single call site
|
|
12583
|
+
|
|
12584
|
+
Correctness:
|
|
12585
|
+
- Silent fallbacks to defaults on error when the task expects a hard failure
|
|
12586
|
+
- Unhandled error paths, missing cleanup, missing returns
|
|
12587
|
+
|
|
12588
|
+
Maintainability:
|
|
12589
|
+
- Abstractions used once
|
|
12590
|
+
- Unclear naming, "utility" grab-bags
|
|
12591
|
+
|
|
12592
|
+
## When to Escalate
|
|
12593
|
+
|
|
12594
|
+
Use NEEDS_DISCUSSION (instead of REQUEST_CHANGES) when:
|
|
12595
|
+
- The plan/task is ambiguous and multiple implementations could be correct
|
|
12596
|
+
- The change implies a product/architecture decision not documented
|
|
12597
|
+
- Fixing issues requires changing scope, dependencies, or public API`
|
|
12391
12598
|
},
|
|
12392
12599
|
{
|
|
12393
12600
|
name: "dispatching-parallel-agents",
|
|
@@ -14535,6 +14742,11 @@ Named after Momus - finds fault in everything. Reviews DOCUMENTATION, not DESIGN
|
|
|
14535
14742
|
|
|
14536
14743
|
Review plan WITHIN the stated approach. Question DOCUMENTATION gaps, NOT design decisions.
|
|
14537
14744
|
|
|
14745
|
+
If you are asked to review IMPLEMENTATION (code changes, diffs, PRs) instead of a plan:
|
|
14746
|
+
1. Load \`hive_skill("code-reviewer")\`
|
|
14747
|
+
2. Apply it and return its output format
|
|
14748
|
+
3. Still do NOT edit code (review only)
|
|
14749
|
+
|
|
14538
14750
|
Self-check before every critique:
|
|
14539
14751
|
> "Am I questioning APPROACH or DOCUMENTATION?"
|
|
14540
14752
|
> APPROACH → Stay silent
|
|
@@ -14612,7 +14824,7 @@ Before verdict, mentally execute 2-3 tasks:
|
|
|
14612
14824
|
- Reject based on design decisions
|
|
14613
14825
|
- Suggest alternative architectures
|
|
14614
14826
|
- Block on style preferences
|
|
14615
|
-
- Review implementation (plans only)
|
|
14827
|
+
- Review implementation unless explicitly asked (default is plans only)
|
|
14616
14828
|
|
|
14617
14829
|
**Always:**
|
|
14618
14830
|
- Self-check: approach vs documentation
|
|
@@ -15556,7 +15768,7 @@ var DEFAULT_HIVE_CONFIG = {
|
|
|
15556
15768
|
"hygienic-reviewer": {
|
|
15557
15769
|
model: DEFAULT_AGENT_MODELS["hygienic-reviewer"],
|
|
15558
15770
|
temperature: 0.3,
|
|
15559
|
-
skills: ["systematic-debugging"],
|
|
15771
|
+
skills: ["systematic-debugging", "code-reviewer"],
|
|
15560
15772
|
autoLoadSkills: []
|
|
15561
15773
|
}
|
|
15562
15774
|
}
|
|
@@ -22891,6 +23103,30 @@ function formatSkillsXml(skills) {
|
|
|
22891
23103
|
${skillsXml}
|
|
22892
23104
|
</available_skills>`;
|
|
22893
23105
|
}
|
|
23106
|
+
function buildAutoLoadedSkillsContent(agentName, configService) {
|
|
23107
|
+
const agentConfig = configService.getAgentConfig(agentName);
|
|
23108
|
+
const autoLoadSkills = agentConfig.autoLoadSkills ?? [];
|
|
23109
|
+
if (autoLoadSkills.length === 0) {
|
|
23110
|
+
return "";
|
|
23111
|
+
}
|
|
23112
|
+
const skillTemplates = [];
|
|
23113
|
+
for (const skillId of autoLoadSkills) {
|
|
23114
|
+
const skill = BUILTIN_SKILLS.find((entry) => entry.name === skillId);
|
|
23115
|
+
if (!skill) {
|
|
23116
|
+
console.warn(`[hive] Unknown skill id "${skillId}" for agent "${agentName}"`);
|
|
23117
|
+
continue;
|
|
23118
|
+
}
|
|
23119
|
+
skillTemplates.push(skill.template);
|
|
23120
|
+
}
|
|
23121
|
+
if (skillTemplates.length === 0) {
|
|
23122
|
+
return "";
|
|
23123
|
+
}
|
|
23124
|
+
return `
|
|
23125
|
+
|
|
23126
|
+
` + skillTemplates.join(`
|
|
23127
|
+
|
|
23128
|
+
`);
|
|
23129
|
+
}
|
|
22894
23130
|
function createHiveSkillTool(filteredSkills) {
|
|
22895
23131
|
const base = `Load a Hive skill to get detailed instructions for a specific workflow.
|
|
22896
23132
|
|
|
@@ -23072,22 +23308,6 @@ To unblock: Remove .hive/features/${feature}/BLOCKED`;
|
|
|
23072
23308
|
return {
|
|
23073
23309
|
"experimental.chat.system.transform": async (input, output) => {
|
|
23074
23310
|
output.system.push(HIVE_SYSTEM_PROMPT);
|
|
23075
|
-
const agentInput = input;
|
|
23076
|
-
const agentName = agentInput?.agent;
|
|
23077
|
-
if (agentName && isHiveAgent(agentName)) {
|
|
23078
|
-
const agentConfig = configService.getAgentConfig(agentName);
|
|
23079
|
-
const autoLoadSkills = agentConfig.autoLoadSkills ?? [];
|
|
23080
|
-
if (autoLoadSkills.length > 0) {
|
|
23081
|
-
for (const skillId of autoLoadSkills) {
|
|
23082
|
-
const skill = BUILTIN_SKILLS.find((entry) => entry.name === skillId);
|
|
23083
|
-
if (!skill) {
|
|
23084
|
-
console.warn("Unknown skill id", skillId);
|
|
23085
|
-
continue;
|
|
23086
|
-
}
|
|
23087
|
-
output.system.push(skill.template);
|
|
23088
|
-
}
|
|
23089
|
-
}
|
|
23090
|
-
}
|
|
23091
23311
|
const activeFeature = resolveFeature();
|
|
23092
23312
|
if (activeFeature) {
|
|
23093
23313
|
const info = featureService.getInfo(activeFeature);
|
|
@@ -24042,11 +24262,12 @@ Make the requested changes, then call hive_request_review again.`;
|
|
|
24042
24262
|
config: async (opencodeConfig) => {
|
|
24043
24263
|
configService.init();
|
|
24044
24264
|
const hiveUserConfig = configService.getAgentConfig("hive-master");
|
|
24265
|
+
const hiveAutoLoadedSkills = buildAutoLoadedSkillsContent("hive-master", configService);
|
|
24045
24266
|
const hiveConfig = {
|
|
24046
24267
|
model: hiveUserConfig.model,
|
|
24047
24268
|
temperature: hiveUserConfig.temperature ?? 0.5,
|
|
24048
24269
|
description: "Hive (Hybrid) - Plans + orchestrates. Detects phase, loads skills on-demand.",
|
|
24049
|
-
prompt: QUEEN_BEE_PROMPT,
|
|
24270
|
+
prompt: QUEEN_BEE_PROMPT + hiveAutoLoadedSkills,
|
|
24050
24271
|
permission: {
|
|
24051
24272
|
question: "allow",
|
|
24052
24273
|
skill: "allow",
|
|
@@ -24058,11 +24279,12 @@ Make the requested changes, then call hive_request_review again.`;
|
|
|
24058
24279
|
}
|
|
24059
24280
|
};
|
|
24060
24281
|
const architectUserConfig = configService.getAgentConfig("architect-planner");
|
|
24282
|
+
const architectAutoLoadedSkills = buildAutoLoadedSkillsContent("architect-planner", configService);
|
|
24061
24283
|
const architectConfig = {
|
|
24062
24284
|
model: architectUserConfig.model,
|
|
24063
24285
|
temperature: architectUserConfig.temperature ?? 0.7,
|
|
24064
24286
|
description: "Architect (Planner) - Plans features, interviews, writes plans. NEVER executes.",
|
|
24065
|
-
prompt: ARCHITECT_BEE_PROMPT,
|
|
24287
|
+
prompt: ARCHITECT_BEE_PROMPT + architectAutoLoadedSkills,
|
|
24066
24288
|
permission: {
|
|
24067
24289
|
edit: "deny",
|
|
24068
24290
|
task: "deny",
|
|
@@ -24077,11 +24299,12 @@ Make the requested changes, then call hive_request_review again.`;
|
|
|
24077
24299
|
}
|
|
24078
24300
|
};
|
|
24079
24301
|
const swarmUserConfig = configService.getAgentConfig("swarm-orchestrator");
|
|
24302
|
+
const swarmAutoLoadedSkills = buildAutoLoadedSkillsContent("swarm-orchestrator", configService);
|
|
24080
24303
|
const swarmConfig = {
|
|
24081
24304
|
model: swarmUserConfig.model,
|
|
24082
24305
|
temperature: swarmUserConfig.temperature ?? 0.5,
|
|
24083
24306
|
description: "Swarm (Orchestrator) - Orchestrates execution. Delegates, spawns workers, verifies, merges.",
|
|
24084
|
-
prompt: SWARM_BEE_PROMPT,
|
|
24307
|
+
prompt: SWARM_BEE_PROMPT + swarmAutoLoadedSkills,
|
|
24085
24308
|
permission: {
|
|
24086
24309
|
question: "allow",
|
|
24087
24310
|
skill: "allow",
|
|
@@ -24093,12 +24316,13 @@ Make the requested changes, then call hive_request_review again.`;
|
|
|
24093
24316
|
}
|
|
24094
24317
|
};
|
|
24095
24318
|
const scoutUserConfig = configService.getAgentConfig("scout-researcher");
|
|
24319
|
+
const scoutAutoLoadedSkills = buildAutoLoadedSkillsContent("scout-researcher", configService);
|
|
24096
24320
|
const scoutConfig = {
|
|
24097
24321
|
model: scoutUserConfig.model,
|
|
24098
24322
|
temperature: scoutUserConfig.temperature ?? 0.5,
|
|
24099
24323
|
mode: "subagent",
|
|
24100
24324
|
description: "Scout (Explorer/Researcher/Retrieval) - Researches codebase + external docs/data.",
|
|
24101
|
-
prompt: SCOUT_BEE_PROMPT,
|
|
24325
|
+
prompt: SCOUT_BEE_PROMPT + scoutAutoLoadedSkills,
|
|
24102
24326
|
permission: {
|
|
24103
24327
|
edit: "deny",
|
|
24104
24328
|
skill: "allow",
|
|
@@ -24106,23 +24330,25 @@ Make the requested changes, then call hive_request_review again.`;
|
|
|
24106
24330
|
}
|
|
24107
24331
|
};
|
|
24108
24332
|
const foragerUserConfig = configService.getAgentConfig("forager-worker");
|
|
24333
|
+
const foragerAutoLoadedSkills = buildAutoLoadedSkillsContent("forager-worker", configService);
|
|
24109
24334
|
const foragerConfig = {
|
|
24110
24335
|
model: foragerUserConfig.model,
|
|
24111
24336
|
temperature: foragerUserConfig.temperature ?? 0.3,
|
|
24112
24337
|
mode: "subagent",
|
|
24113
24338
|
description: "Forager (Worker/Coder) - Executes tasks directly in isolated worktrees. Never delegates.",
|
|
24114
|
-
prompt: FORAGER_BEE_PROMPT,
|
|
24339
|
+
prompt: FORAGER_BEE_PROMPT + foragerAutoLoadedSkills,
|
|
24115
24340
|
permission: {
|
|
24116
24341
|
skill: "allow"
|
|
24117
24342
|
}
|
|
24118
24343
|
};
|
|
24119
24344
|
const hygienicUserConfig = configService.getAgentConfig("hygienic-reviewer");
|
|
24345
|
+
const hygienicAutoLoadedSkills = buildAutoLoadedSkillsContent("hygienic-reviewer", configService);
|
|
24120
24346
|
const hygienicConfig = {
|
|
24121
24347
|
model: hygienicUserConfig.model,
|
|
24122
24348
|
temperature: hygienicUserConfig.temperature ?? 0.3,
|
|
24123
24349
|
mode: "subagent",
|
|
24124
24350
|
description: "Hygienic (Consultant/Reviewer/Debugger) - Reviews plan documentation quality. OKAY/REJECT verdict.",
|
|
24125
|
-
prompt: HYGIENIC_BEE_PROMPT,
|
|
24351
|
+
prompt: HYGIENIC_BEE_PROMPT + hygienicAutoLoadedSkills,
|
|
24126
24352
|
permission: {
|
|
24127
24353
|
edit: "deny",
|
|
24128
24354
|
skill: "allow"
|
|
@@ -24133,6 +24359,9 @@ Make the requested changes, then call hive_request_review again.`;
|
|
|
24133
24359
|
const allAgents = {};
|
|
24134
24360
|
if (agentMode === "unified") {
|
|
24135
24361
|
allAgents["hive-master"] = hiveConfig;
|
|
24362
|
+
allAgents["scout-researcher"] = scoutConfig;
|
|
24363
|
+
allAgents["forager-worker"] = foragerConfig;
|
|
24364
|
+
allAgents["hygienic-reviewer"] = hygienicConfig;
|
|
24136
24365
|
} else {
|
|
24137
24366
|
allAgents["architect-planner"] = architectConfig;
|
|
24138
24367
|
allAgents["swarm-orchestrator"] = swarmConfig;
|
|
@@ -7,7 +7,7 @@ import type { SkillDefinition } from './types.js';
|
|
|
7
7
|
/**
|
|
8
8
|
* List of builtin skill names.
|
|
9
9
|
*/
|
|
10
|
-
export declare const BUILTIN_SKILL_NAMES: readonly ["brainstorming", "dispatching-parallel-agents", "executing-plans", "onboarding", "parallel-exploration", "systematic-debugging", "test-driven-development", "verification-before-completion", "writing-plans"];
|
|
10
|
+
export declare const BUILTIN_SKILL_NAMES: readonly ["brainstorming", "code-reviewer", "dispatching-parallel-agents", "executing-plans", "onboarding", "parallel-exploration", "systematic-debugging", "test-driven-development", "verification-before-completion", "writing-plans"];
|
|
11
11
|
/**
|
|
12
12
|
* All builtin skill definitions.
|
|
13
13
|
*/
|
package/package.json
CHANGED
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-reviewer
|
|
3
|
+
description: Use when reviewing implementation changes against an approved plan or task (especially before merging or between Hive tasks) to catch missing requirements, YAGNI, dead code, and risky patterns
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Code Reviewer
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
This skill teaches a reviewer to evaluate implementation changes for:
|
|
11
|
+
- Adherence to the approved plan/task (did we build what we said?)
|
|
12
|
+
- Correctness (does it work, including edge cases?)
|
|
13
|
+
- Simplicity (YAGNI, dead code, over-abstraction)
|
|
14
|
+
- Risk (security, performance, maintainability)
|
|
15
|
+
|
|
16
|
+
**Core principle:** The best change is the smallest correct change that satisfies the plan.
|
|
17
|
+
|
|
18
|
+
## Iron Laws
|
|
19
|
+
|
|
20
|
+
- Review against the task/plan first. Code quality comes second.
|
|
21
|
+
- Bias toward deletion and simplification. Every extra line is a liability.
|
|
22
|
+
- Prefer changes that leverage existing patterns and dependencies.
|
|
23
|
+
- Be specific: cite file paths and (when available) line numbers.
|
|
24
|
+
- Do not invent requirements. If the plan/task is ambiguous, mark it and request clarification.
|
|
25
|
+
|
|
26
|
+
## What Inputs You Need
|
|
27
|
+
|
|
28
|
+
Minimum:
|
|
29
|
+
- The task intent (1-3 sentences)
|
|
30
|
+
- The plan/task requirements (or a link/path to plan section)
|
|
31
|
+
- The code changes (diff or list of changed files)
|
|
32
|
+
|
|
33
|
+
If available (recommended):
|
|
34
|
+
- Acceptance criteria / verification steps from the plan
|
|
35
|
+
- Test output or proof the change was verified
|
|
36
|
+
- Any relevant context files (design decisions, constraints)
|
|
37
|
+
|
|
38
|
+
## Review Process (In Order)
|
|
39
|
+
|
|
40
|
+
### 1) Identify Scope
|
|
41
|
+
|
|
42
|
+
1. List all files changed.
|
|
43
|
+
2. For each file, state why it changed (what requirement it serves).
|
|
44
|
+
3. Flag any changes that do not map to the task/plan.
|
|
45
|
+
|
|
46
|
+
**Rule:** If you cannot map a change to a requirement, treat it as suspicious until justified.
|
|
47
|
+
|
|
48
|
+
### 2) Plan/Task Adherence (Non-Negotiable)
|
|
49
|
+
|
|
50
|
+
Create a simple checklist:
|
|
51
|
+
- What the task says must happen
|
|
52
|
+
- Evidence in code/tests that it happens
|
|
53
|
+
|
|
54
|
+
Flag as issues:
|
|
55
|
+
- Missing requirements (implemented behavior does not match intent)
|
|
56
|
+
- Partial implementation with no follow-up task (TODO-driven shipping)
|
|
57
|
+
- Behavior changes that are not in the plan/task
|
|
58
|
+
|
|
59
|
+
### 3) Correctness Layer
|
|
60
|
+
|
|
61
|
+
Review for:
|
|
62
|
+
- Edge cases and error paths
|
|
63
|
+
- Incorrect assumptions about inputs/types
|
|
64
|
+
- Inconsistent behavior across platforms/environments
|
|
65
|
+
- Broken invariants (e.g., state can become invalid)
|
|
66
|
+
|
|
67
|
+
Prefer "fail fast, fail loud": invalid states should become clear errors, not silent fallbacks.
|
|
68
|
+
|
|
69
|
+
### 4) Simplicity / YAGNI Layer
|
|
70
|
+
|
|
71
|
+
Be ruthless and concrete:
|
|
72
|
+
- Remove dead branches, unused flags/options, unreachable code
|
|
73
|
+
- Remove speculative TODOs and "reserved for future" scaffolding
|
|
74
|
+
- Remove comments that restate the code or narrate obvious steps
|
|
75
|
+
- Inline one-off abstractions (helpers/classes/interfaces used once)
|
|
76
|
+
- Replace cleverness with obvious code
|
|
77
|
+
- Reduce nesting with guard clauses / early returns
|
|
78
|
+
|
|
79
|
+
Prefer clarity over brevity:
|
|
80
|
+
- Avoid nested ternary operators; use `if/else` or `switch` when branches matter
|
|
81
|
+
- Avoid dense one-liners that hide intent or make debugging harder
|
|
82
|
+
|
|
83
|
+
### 4b) De-Slop Pass (AI Artifacts / Style Drift)
|
|
84
|
+
|
|
85
|
+
Scan the diff (not just the final code) for AI-generated slop introduced in this branch:
|
|
86
|
+
- Extra comments that a human would not add, or that do not match the file's tone
|
|
87
|
+
- Defensive checks or try/catch blocks that are abnormal for that area of the codebase
|
|
88
|
+
- Especially swallowed errors ("ignore and continue") and silent fallbacks
|
|
89
|
+
- Especially redundant validation in trusted internal codepaths
|
|
90
|
+
- TypeScript escape hatches used to dodge type errors (`as any`, `as unknown as X`) without necessity
|
|
91
|
+
- Style drift: naming, error handling patterns, logging style, and structure inconsistent with nearby code
|
|
92
|
+
|
|
93
|
+
Default stance:
|
|
94
|
+
- Prefer deletion over justification.
|
|
95
|
+
- If validation is needed, do it at boundaries; keep internals trusting parsed inputs.
|
|
96
|
+
- If a cast is truly unavoidable, localize it and keep the justification to a single short note.
|
|
97
|
+
|
|
98
|
+
When recommending simplifications, do not accidentally change behavior. If the current behavior is unclear, request clarification or ask for a test that pins it down.
|
|
99
|
+
|
|
100
|
+
**Default stance:** Do not add extensibility points without an explicit current requirement.
|
|
101
|
+
|
|
102
|
+
### 5) Risk Layer (Security / Performance / Maintainability)
|
|
103
|
+
|
|
104
|
+
Only report what you are confident about.
|
|
105
|
+
|
|
106
|
+
Security checks (examples):
|
|
107
|
+
- No secrets in code/logs
|
|
108
|
+
- No injection vectors (shell/SQL/HTML) introduced
|
|
109
|
+
- Authz/authn checks preserved
|
|
110
|
+
- Sensitive data not leaked
|
|
111
|
+
|
|
112
|
+
Performance checks (examples):
|
|
113
|
+
- Avoid unnecessary repeated work (N+1 queries, repeated parsing, repeated filesystem hits)
|
|
114
|
+
- Avoid obvious hot-path allocations or large sync operations
|
|
115
|
+
|
|
116
|
+
Maintainability checks:
|
|
117
|
+
- Clear naming and intent
|
|
118
|
+
- Consistent error handling
|
|
119
|
+
- API boundaries not blurred
|
|
120
|
+
- Consistent with local file patterns (imports, export style, function style)
|
|
121
|
+
|
|
122
|
+
### 6) Make One Primary Recommendation
|
|
123
|
+
|
|
124
|
+
Provide one clear path to reach approval.
|
|
125
|
+
Mention alternatives only when they have materially different trade-offs.
|
|
126
|
+
|
|
127
|
+
### 7) Signal the Investment
|
|
128
|
+
|
|
129
|
+
Tag the required follow-up effort using:
|
|
130
|
+
- Quick (<1h)
|
|
131
|
+
- Short (1-4h)
|
|
132
|
+
- Medium (1-2d)
|
|
133
|
+
- Large (3d+)
|
|
134
|
+
|
|
135
|
+
## Confidence Filter
|
|
136
|
+
|
|
137
|
+
Only report findings you believe are >=80% likely to be correct.
|
|
138
|
+
If you are unsure, explicitly label it as "Uncertain" and explain what evidence would confirm it.
|
|
139
|
+
|
|
140
|
+
## Output Format (Use This Exactly)
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
**Files Reviewed:** [list]
|
|
145
|
+
|
|
146
|
+
**Plan/Task Reference:** [task name + link/path to plan section if known]
|
|
147
|
+
|
|
148
|
+
**Overall Assessment:** [APPROVE | REQUEST_CHANGES | NEEDS_DISCUSSION]
|
|
149
|
+
|
|
150
|
+
**Bottom Line:** 2-3 sentences describing whether it matches the task/plan and what must change.
|
|
151
|
+
|
|
152
|
+
### Critical Issues
|
|
153
|
+
- None | [file:line] - [issue] (why it blocks approval) + (recommended fix)
|
|
154
|
+
|
|
155
|
+
### Major Issues
|
|
156
|
+
- None | [file:line] - [issue] + (recommended fix)
|
|
157
|
+
|
|
158
|
+
### Minor Issues
|
|
159
|
+
- None | [file:line] - [issue] + (suggested fix)
|
|
160
|
+
|
|
161
|
+
### YAGNI / Dead Code
|
|
162
|
+
- None | [file:line] - [what to remove/simplify] + (why it is unnecessary)
|
|
163
|
+
|
|
164
|
+
### Positive Observations
|
|
165
|
+
- [at least one concrete good thing]
|
|
166
|
+
|
|
167
|
+
### Action Plan
|
|
168
|
+
1. [highest priority change]
|
|
169
|
+
2. [next]
|
|
170
|
+
3. [next]
|
|
171
|
+
|
|
172
|
+
### Effort Estimate
|
|
173
|
+
[Quick | Short | Medium | Large]
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## Common Review Smells (Fast Scan)
|
|
178
|
+
|
|
179
|
+
Task/plan adherence:
|
|
180
|
+
- Adds features not mentioned in the plan/task
|
|
181
|
+
- Leaves TODOs as the mechanism for correctness
|
|
182
|
+
- Introduces new configuration modes/flags "for future"
|
|
183
|
+
|
|
184
|
+
YAGNI / dead code:
|
|
185
|
+
- Options/config that are parsed but not used
|
|
186
|
+
- Branches that do the same thing on both sides
|
|
187
|
+
- Comments like "reserved for future" or "we might need this"
|
|
188
|
+
|
|
189
|
+
AI slop / inconsistency:
|
|
190
|
+
- Commentary that restates code, narrates obvious steps, or adds process noise
|
|
191
|
+
- try/catch that swallows errors or returns defaults without a requirement
|
|
192
|
+
- `as any` used to silence type errors instead of fixing types
|
|
193
|
+
- New helpers/abstractions with a single call site
|
|
194
|
+
|
|
195
|
+
Correctness:
|
|
196
|
+
- Silent fallbacks to defaults on error when the task expects a hard failure
|
|
197
|
+
- Unhandled error paths, missing cleanup, missing returns
|
|
198
|
+
|
|
199
|
+
Maintainability:
|
|
200
|
+
- Abstractions used once
|
|
201
|
+
- Unclear naming, "utility" grab-bags
|
|
202
|
+
|
|
203
|
+
## When to Escalate
|
|
204
|
+
|
|
205
|
+
Use NEEDS_DISCUSSION (instead of REQUEST_CHANGES) when:
|
|
206
|
+
- The plan/task is ambiguous and multiple implementations could be correct
|
|
207
|
+
- The change implies a product/architecture decision not documented
|
|
208
|
+
- Fixing issues requires changing scope, dependencies, or public API
|