본문으로 건너뛰기
cccskills
무료GitHub에 공개

hivemind

Delegate research, coding, and testing from Claude Code to opencode workers. Run independent tasks in parallel with separate Git working directories, combine findings, track token use, and compare solo execution with coordinated workers.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

Orchestrate free opencode workers from Claude Code to cut token costs. Use when delegating grunt work to a single worker or a parallel swarm (scout/coder/tester) with worktree isolation, benchmarking against opencode, or when the user says "spawn a worker", "swarm", "delegate to opencode", or "/oc".

설치 방법 보기

이럴 때 유용합니다

  • Delegate a small task to one opencode worker
  • Implement independent changes in parallel
  • Review a diff from four perspectives
  • Compare token use across execution approaches

포함된 파일(18)

  • SKILL.md9.6 KB
  • .gitignore27 B
  • assets/agents/coder.md628 B
  • assets/agents/scout.md613 B
  • assets/agents/tester.md700 B
  • assets/commands/hive.md2.1 KB
  • assets/commands/migration.md1.4 KB
  • assets/commands/oc.md728 B
  • assets/commands/research-sweep.md1.2 KB
  • assets/commands/review-panel.md1.4 KB
  • assets/commands/swarm.md1.9 KB
  • assets/commands/test-fleet.md1.3 KB
  • LICENSE.txt11.1 KB
  • scripts/bench/grader-prompt.md1.3 KB
  • scripts/bench/run-bench.mjs6.7 KB
  • scripts/oc-aggregate.mjs2.7 KB
  • scripts/oc-status.mjs2.2 KB
  • scripts/oc-worker.mjs7.7 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

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:

RequirementNotes
Node.js >= 18The scripts use fetch and node:timers/promises.
opencode CLI on PATHnpm i -g opencode-ai (or the installer opencode documents).
An authenticated opencode accountopencode auth login. Workers run as your account.
Default model opencode/mimo-v2.5-freeA 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_PATHPoint at C:\Program Files\Git\bin\bash.exe, set persistently.

Nothing here calls the Anthropic API on the worker side; worker traffic goes to opencode's endpoints. Do not delegate secrets or private code you would not send there.

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.mjsONLY sanctioned way to invoke a worker. Hardened join point.
scripts/oc-status.mjsFleet progress from run logs (oc-status.mjs <run-id>)
scripts/oc-aggregate.mjsDedupe/synthesize N worker outputs; consensus findings first
scripts/bench/run-bench.mjsBenchmark configs A (claude solo), B (opencode solo), C (orchestrated swarm)
scripts/bench/grader-prompt.mdBlind grading rubric (max 12 pts + PASS/FAIL gate)
assets/commands/Slash-command entry points to copy into ~/.claude/commands/
assets/agents/scout / coder / tester 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>] "TASK TEXT"

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

On failure: { ok:false, stage:"args"|"exec"|"api"|"parse"|"empty", error } with stderr capped at 300 chars.

--run <id> + --label <name> append lifecycle events (start/done/fail) to .runs/<id>.jsonl inside this skill dir. Use them for EVERY swarm worker so progress is recoverable via oc-status.mjs even after orchestrator context loss.

The script auto-manages the shared server: health-checks 127.0.0.1:4096, spawns opencode serve if dead, waits 5s, falls back to cold start. Workers are idempotent against their --dir; re-run once on ok:false before giving up.

HIVEMIND_SERVER_URL overrides that address (default http://127.0.0.1:4096). It must be a valid URL with a numeric port; anything else fails fast with a single stage:"args" JSON line rather than reaching the spawned process.

Golden Rule (non-negotiable)

Raw opencode NDJSON streams must NEVER enter your context. All output arrives via the script's single JSON line. Never pipe opencode run --format json directly into this conversation; never re-implement what the script does.

Single worker flow (/oc)

For one read-only question or small delegation: run oc-worker.mjs without worktrees. Read-only tasks may omit --agent/--dir. Summarize result for the user. If files were written: show git diff before letting the user commit.

Swarm flow (multi-worker)

  1. Decompose task into 2-5 INDEPENDENT subtasks (no shared files).
  2. Writing workers get isolated worktrees FIRST: git worktree add ../<repo>-wt-N -b swarm/N.
  3. Issue ALL worker invocations as PARALLEL Bash tool calls in ONE message.
  4. Review every diff yourself (git diff main...swarm/N). YOU are the only merger.
  5. Merge approved branches, remove worktrees, run tests.
  6. Report table: subtask | agent | tokens | outcome + total worker tokens.

HARD RULES: workers never share directories; never delegate merging/reviewing; escalate to your own Sonnet only when a free-model worker demonstrably fails twice.

Benchmarking

node scripts\bench\run-bench.mjs --repo <project> [--configs a,b,c] [--task 1-5]

Appends JSONL records (ts, config, tokens, cost, duration) to bench-results.jsonl. Grade artifacts blind with grader-prompt.md (grader sees only task spec + output). Configs: A=claude solo baseline, B=opencode solo, C=claude orchestrating 2 workers.

Fallback ladder (all flows)

  1. Worker ok:false -> re-invoke once against the same dir.
  2. Still failing -> orchestrator performs that subtask inline, marks it [orchestrator-sourced].
  3. opencode entirely down (exec/api twice) -> announce, abandon workers, do the task directly. Never let a swarm fail a task that Claude could have done itself.

Fleet patterns

Four reusable topologies ship as slash commands (see table above). Shared invariants: parallel spawns in one message; --run/--label on every worker; aggregation via oc-aggregate.mjs when 3+ workers produce findings; consensus beats single-lens claims; worktree isolation whenever any worker writes.

Windows notes (hard-won)

  • Requires OPENCODE_GIT_BASH_PATH=C:\Program Files\Git\bin\bash.exe (set persistently).
  • The script resolves the REAL opencode.exe by parsing the npm .cmd shim — Node's EINVAL policy blocks spawning .cmd directly. Do not "simplify" resolver back to where.exe first-line.
  • Free models: opencode/mimo-v2.5-free, opencode/nemotron-3.5-lightning-free, opencode/hy3-free. NOTE: opencode-go/* models require workspace billing — avoid.

Known limits

  • Free-tier rate limits can 429 under heavy swarms; space out retries.
  • Worker quality varies; always review diffs. Scout answers are evidence-cited.
  • Bench config C consumes real Claude tokens for orchestration (~1-2k/task).

Anti-patterns

Anti-patternWhy it breaksDo this instead
Piping opencode run --format json straight into the orchestratorRaw NDJSON floods context — the exact cost the skill exists to avoidAlways go through scripts/oc-worker.mjs, which returns one compact JSON line
Two writing workers in one directoryConcurrent edits corrupt each other's diffsOne git worktree per writing worker, created before the spawn
Letting a worker merge, review, or approve its own branchFree-tier workers are the least reliable judges of their own outputThe orchestrator is the only merger and the only reviewer
Spawning workers sequentially, one per messageLoses the entire wall-clock benefit of a swarmIssue every worker invocation as parallel calls in ONE message
Retrying a failing worker indefinitelyBurns rate limit and stalls the taskRetry once, then do the subtask inline and mark it [orchestrator-sourced]
Delegating secrets, credentials, or private codeWorker traffic leaves for opencode's endpointsKeep sensitive context in the orchestrator; send workers only what is safe to share
Trusting cost_usd: 0 as a permanent guaranteeThe free tier belongs to opencode and can changeRe-check pricing before relying on zero cost for bulk work

Cross-references

  • engineering/llm-cost-optimizer — decide whether a task is worth delegating before Hivemind decides how
  • engineering/agent-harness — harness patterns for the orchestrator side of the loop
  • engineering/workflow-builder — for deterministic pipelines that do not need independent worker judgment
  • engineering/skills and engineering/write-a-skill — authoring conventions used by the worker agent definitions in assets/agents/

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Audit web applications for accessibility issues against WCAG 2.2 Level A and AA, the web accessibility standards. Get framework-specific code fixes, contrast checks, verification steps, and reports, with options for automated checks in development pipelines.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Audit a web application before release
  • Fix contrast and keyboard navigation issues
  • Prepare accessibility reports for stakeholders
alirezarezvani/claude-skills2.8만2026년 8월 30일 업데이트

Plan A/B tests that compare page variations, from headlines to pricing layouts. Define a hypothesis, choose success metrics, calculate sample size and duration, and prepare launch checks and results reports to support decisions.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Comparing landing page headlines
  • Testing signup button changes
  • Planning pricing page experiments
alirezarezvani/claude-skills2.8만2026년 8월 30일 업데이트

Create paid ad headlines and body copy tailored to each platform's character limits. Use existing performance data to develop variations, explore new messaging angles, and check copy for length, quality, and potential rejection risks.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Creating Google RSA headlines
  • Writing Meta and LinkedIn ad copy
  • Developing variations of successful ads
alirezarezvani/claude-skills2.8만2026년 8월 30일 업데이트

Review code changes from three critical perspectives: production failures, maintainability, and security. Get a consolidated report that ranks findings by severity and provides merge guidance, helping examine assumptions that an ordinary self-review may overlook.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Reviewing a pull request before merging
  • Getting a second opinion on AI-written code
  • Checking authentication or data access code
alirezarezvani/claude-skills2.8만2026년 8월 30일 업데이트

aeo

무료

Audit and improve content intended for citation in AI answers. Review evidence, author information, and structure, generate revised content and structured metadata, and keep a local record of observed citations across AI services.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Audit existing articles for evidence and credibility gaps
  • Revise article structure and references for AI answers
  • Record citations observed across AI services
alirezarezvani/claude-skills2.8만2026년 8월 30일 업데이트

Create signed records for consequential agent actions such as deployments, deletions, and payments. Decide which actions need evidence, record the agent, action, target, and policy, then verify the resulting certificate offline to detect later changes.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Creating signed records for production deployments
  • Preserving evidence of deletions and payments
  • Recording access grants for later review
alirezarezvani/claude-skills2.8만2026년 8월 30일 업데이트

alirezarezvani의 스킬 모두 보기

이 스킬의 문제 신고