Chuyển đến nội dung
Skillpedia
Agent29k · #9561

hivemind

Skill này làm gì

Skill này gửi các tác vụ thường ngày đến các agent worker opencode riêng biệt, có thể chạy song song. Skill dành cho lập trình viên muốn tiết kiệm lượt dùng AI chính cho công việc đơn giản và đã dùng opencode.

Khi nào nên dùng

  • ✓Khi bạn muốn giao các tác vụ lập trình thường ngày cho worker miễn phí thay vì trợ lý chính.
  • ✓Khi bạn muốn một nhóm gồm scout, coder và tester làm việc song song trên các bản sao mã riêng.
  • ✓Khi bạn yêu cầu tạo một worker hoặc giao việc cho opencode.

Liên kết skill

https://github.com/alirezarezvani/claude-skills/blob/main/engineering/hivemind/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/alirezarezvani/claude-skills/blob/main/engineering/hivemind/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tôi muốn tạo một worker để dọn các import không dùng trong thư mục này.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent chính lên kế hoạch và xem lại công việc, còn các worker opencode thực hiện tác vụ. Worker có thể chạy trong các worktree git riêng, và mô hình mặc định chạy trên dịch vụ được host của opencode.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Hivemind: Claude Code as Orchestrator, opencode as Free Worker Swarm

Claude Code = brain (plans, reviews, merges). opencode = disposable workers on free models (opencode/mimo-v2.5-free default; verified $0.00 per run).

Prerequisites (external dependency)

This skill is a thin orchestration layer over opencode, a third-party CLI. It is not bundled — install and authenticate it yourself first:

Requirement Notes
Node.js >= 18 The scripts use fetch and node:timers/promises.
opencode CLI on PATH npm i -g opencode-ai (or the installer opencode documents).
An authenticated opencode account opencode auth login. Workers run as your account.
Default model opencode/mimo-v2.5-free A free tier offered by opencode, not by Anthropic. Availability, rate limits, and pricing are opencode's to change — override with --model at any time.
Windows only: OPENCODE_GIT_BASH_PATH Point at C:\Program Files\Git\bin\bash.exe, set persistently.

Data flow (read before installing)

Hivemind is opt-in and ships outside every domain bundle. By default your code leaves your machine: the default model, opencode/mimo-v2.5-free, runs on opencode's hosted service, so each worker sends its prompt, plus any files or diffs you give it, to opencode's endpoints. Nothing on the worker side calls the Anthropic API.

To keep code local, point --model at a model served on your own machine (for example an Ollama or LM Studio provider configured in your opencode config). With a hosted model, delegate only code you are allowed to send to that provider, and never delegate secrets.

Setup

  1. Put this skill folder wherever your agent loads skills from (e.g. ~/.claude/skills/hivemind).
  2. Export HIVEMIND_HOME pointing at that folder — the bundled slash commands use it:
    export HIVEMIND_HOME="$HOME/.claude/skills/hivemind"
    
  3. Copy the bundled assets into place:
    • assets/commands/*.md -> ~/.claude/commands/ (the /hive, /oc, /swarm, ... entry points)
    • assets/agents/*.md -> ~/.config/opencode/agent/ (the scout / coder / tester worker personas)

Both copies are optional: everything the commands do can be driven by invoking scripts/oc-worker.mjs directly, and any opencode agent name works with --agent.

Runtime state (.runs/*.jsonl) is written inside this folder and is gitignored.

Components

Path (relative to this skill dir) Purpose
scripts/oc-worker.mjs ONLY sanctioned way to invoke a worker. Hardened join point.
scripts/oc-status.mjs Fleet progress from run logs (oc-status.mjs <run-id>)
scripts/oc-aggregate.mjs Dedupe/synthesize N worker outputs; consensus findings first
scripts/bench/run-bench.mjs Benchmark configs A (claude solo), B (opencode solo), C (orchestrated swarm)
scripts/bench/grader-prompt.md Blind grading rubric (max 12 pts + PASS/FAIL gate)
scripts/oc-verify.mjs Fan a worker's claims to a verifier on a DIFFERENT model; returns counts + needs_review
assets/commands/ Slash-command entry points to copy into ~/.claude/commands/
assets/agents/ scout / coder / tester / verifier agent definitions for opencode

Slash commands (ship in assets/commands/, copy to ~/.claude/commands/):

  • /hive <task> - AUTO-ROUTER. Classifies task -> single worker, generic swarm, or template. Default entry point; prefer this over manual routing.
  • /oc <task> - single worker delegation
  • /swarm <task> - generic parallel swarm
  • /review-panel <diff> - 4-lens parallel review (correctness/security/performance/style) + consensus aggregation
  • /research-sweep <question> - 3-5 parallel research angles, synthesized
  • /migration <task> - batched per-worktree migration workers + sequenced merge
  • /test-fleet <target> - partitioned parallel test runs with safety checks

Worker agents (ship in assets/agents/, copy to ~/.config/opencode/agent/):

  • scout - read-only research (no write/edit/bash)
  • coder - implements one subtask in its worktree
  • tester - runs tests only, never edits source

Invocation contract

node "<skill-dir>\scripts\oc-worker.mjs" [--agent scout|coder|tester] [--dir <path>] [--model <p/m>] [--timeout 900] [--run <id> --label <name>] [--json] "TASK TEXT"

Returns exactly ONE compact JSON line: { ok, result, tokens:{total,input,output,cache}, cost_usd, duration_ms, label, agent, model }

Câu hỏi thường gặp

Mã của tôi có rời khỏi máy không?

Có, theo mặc định. Mô hình mặc định chạy trên dịch vụ được host của opencode, nên prompt và tệp gửi cho worker sẽ được gửi đến đó.

Tôi cần chuẩn bị gì trước khi dùng?

Node.js, công cụ dòng lệnh opencode nằm trên PATH, và một tài khoản opencode mà bạn đã đăng nhập.

Tôi có thể dùng mô hình khác không?

Có. Bạn có thể ghi đè mô hình mặc định bằng một cờ bất cứ lúc nào.

Chi tiết

Mô tả gốc của tác giả

Use when delegating grunt work to free opencode workers instead of spending Claude tokens: one worker or a scout, coder and tester swarm in worktrees. Triggers on 'spawn a worker', 'swarm', 'delegate to opencode' or /oc.

repo: alirezarezvani/claude-skills

Độ phổ biến

Sao GitHub
29k
Vị trí xếp hạng
#9561
Giấy phép
MIT
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự