Skip to content
This repository was archived by the owner on Nov 10, 2026. It is now read-only.
Sh3rmPublic archive

About

πŸβš’οΈ Meta-agent that forges production-ready agent swarms for Claude Code, sized to the work. You describe the swarm; HiveSmith researches, architects, writes and verifies it.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

26 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸβš’οΈ HiveSmith

You describe the swarm. HiveSmith forges it.

Archived on 2026-11-10. HiveSmith is complete and no longer maintained. v1.3.0 is the final release, verified against Claude Code v2.1.296; later Claude Code and model releases are not tracked, so check the generated files against the current documentation before relying on them. Much of what HiveSmith automated can now be done with Claude Code's built-in sub-agents and dynamic workflows. The code stays available under the Apache 2.0 license.

License Powered by Verified against Agents

A meta-agent system that designs and generates production-ready agent swarms, sized to the work: from a single well-tooled agent to an orchestrator with specialised workers. Built for the Claude Code CLI ecosystem.

You describe what you need. HiveSmith researches the domain, architects the agent hierarchy, writes every prompt and config file, validates the topology, and delivers a working swarm β€” ready to run with claude.

HiveSmith β€” the smith that forges hives. Sister project of SwarmForge (the Gemini/Antigravity edition): same lineage, rebuilt from the ground up on Claude Code's native primitives: sub-agents, auto-loaded rules, and project MCP config. HiveSmith has since moved to a leaner pipeline with fewer agents.

How It Works

HiveSmith is itself a swarm. An orchestrator (CLAUDE.md) coordinates 15 specialized sub-agents β€” each a real Claude Code sub-agent with its own isolated context window, tool allowlist, and model tier β€” through a clarifying step plus six working steps:

0. Clarify                   β€” Ask about missing constraints that change the design (skipped when the request is explicit)
1. Research                  β€” Launch only the researchers the request needs, in parallel; save their reports as files
2. Architecture              β€” Read the raw reports, resolve conflicts, design the blueprint (roster, tiers, state, hooks)
3. Infrastructure & Safety   β€” Safety rules + guard hooks; MCP config and custom tools only when the blueprint needs them
4. Persona Generation        β€” Write CLAUDE.md, .claude/agents/*.md, rules, settings and the operator README to disk
5. Verification              β€” Fresh-context evaluators audit prompts, schemas, dependencies and the DAG in parallel
6. Delivery                  β€” Hand the verified swarm tree to the user

If verification finds issues, the orchestrator routes each one back to the agent that wrote the file and re-verifies what changed, for at most three rounds; anything left is delivered as a named risk. The user's request travels verbatim to every worker; research reports travel as file paths, never as compressed summaries.

Key Design Decisions

  • Fewest Agents the Work Justifies. Multi-agent systems typically spend 3-10x the tokens of a single agent on the same task, and splitting one body of work into sequential phases loses context at every handoff. So every agent in a generated swarm must stand on a stated ground β€” context isolation, genuinely parallel work, or a specialization threshold β€” and there is no target roster size; a single well-tooled agent with rules and hooks is a valid result. Generated instruction files keep only what the model cannot infer on its own, without stacked CRITICAL/MUST emphasis or role inflation (Rule 09).

  • Native Claude Code Sub-Agents. Every worker persona is a .claude/agents/<name>.md file with the official frontmatter schema (name, description, tools, model, plus advanced keys β€” effort, maxTurns, memory β€” where the role justifies them). The orchestrator delegates through Claude Code's Agent tool, so each worker runs in an isolated context window with a least-privilege tool allowlist enforced by the harness itself β€” researchers can search but not write, and validators get no write tools (for the two that keep persistent memory, qa-validator and prompt-evaluator, Claude Code adds file tools for that memory, so their read-only scope rests on their instructions).

  • Deterministic Guard Hooks. The Destructive Action Barrier is not just prose: a PreToolUse hook (.claude/hooks/block-destructive.py, on the Bash and PowerShell tools) deterministically blocks rm -rf, mkfs, force-pushes, SQL DROPs, and cloud resource deletions before they run, including forms hidden in bash -c, eval, subshells or a quoted command name, and it fails closed (onFailure: block) if it cannot run. Generated swarms ship the same layers β€” a rules file for context, a domain-tailored guard hook, and permission deny and ask rules β€” plus scoped credentials and, where agents run commands on untrusted content, Claude Code's sandbox, because a pattern guard is a tripwire against mistakes, not a security boundary.

  • Tier-Based Model Routing with a Budget. HiveSmith assigns models using Claude aliases (fable, opus, sonnet, haiku) based on cognitive load. In a generated swarm, heavy reasoning and architecture can get fable (Fable 5.1), orchestration and complex coding get opus (Opus 5.5), research and most workers get sonnet (Sonnet 5.5), and fast lookups and scanning get haiku (Haiku 5.5). When Anthropic ships new models, the aliases resolve to the latest versions automatically. Generated swarms run on your subscription, so they follow a hard tier budget: an opus orchestrator, sonnet workers by default, haiku for mechanical roles, opus workers only with benchmark evidence, at most one fable agent, and never effort: max β€” the QA gate rejects rosters that break it. Effort is left at each model's official default unless the blueprint sets one (Opus 5.5, Sonnet 5.5 and Haiku 5.5 default to medium, so verification and research roles in a generated swarm carry effort: high on every tier, and mechanical haiku roles carry effort: low; a generated settings.json may carry effortLevel: high when the domain justifies it, and you can cap everything with maxEffortLevel). You can always edit the generated settings.json and agent frontmatter by hand afterwards. Operators can still re-route everything at launch with CLAUDE_CODE_SUBAGENT_MODEL (default for agents without a model) plus CLAUDE_CODE_SUBAGENT_MODEL_FORCE=1 (makes it override every definition).

  • Research Before Architecture. Every generated swarm can research its own domain, through dedicated researcher agents or, in a single-agent design, the orchestrator's own search tools. HiveSmith never relies on pre-trained knowledge for domain-specific decisions. It searches the web first, every time β€” via Claude Code's native WebSearch/WebFetch tools, with an optional tokenless duckduckgo-mcp-server fallback in .mcp.json.

  • Strict, Fresh-Context Verification. The qa-validator checks the generated frontmatter schemas against Claude Code's real spec (and rejects foreign fields), enforces the tier budget, confirms every hook script and state file exists, runs dependency pre-flights (uv, npx), and validates directory structure; prompt-evaluator audits the prompts for measured anti-patterns and outdated prompting; dag-validator checks the delegation graph. None of them sees the authors' reasoning.

Agent Roster

All 15 sub-agents live in .claude/agents/:

Agent Role Default Tier
domain-architect Reconciles the research and designs the blueprint: roster, tiers, shared state, hooks Fable
persona-engineer Writes all system prompts (CLAUDE.md, .claude/agents/*.md) Fable
prompt-evaluator Simulates edge cases and audits generated prompts for anti-patterns Fable
safety-engineer Generates domain-specific safety rules Fable
tool-smith Builds custom scripts when standard MCP tools aren't enough Fable
mcp-integrator Generates the project-root .mcp.json for the target swarm Opus
dag-validator Validates swarm topology β€” detects cycles, orphan agents, broken links Opus
researcher-google-cloud Google Cloud, Gemini best practices Opus
researcher-anthropic-openai Anthropic & OpenAI multi-agent patterns Opus
researcher-tech-stack Version verification, deprecation checks Opus
researcher-security OWASP, HITL, guardrail best practices Opus
researcher-academic-independent arXiv, independent AI research blogs Opus
researcher-vcs-github Mines GitHub/GitLab for existing agent configs Opus
repo-analyzer-worker Concurrent read-only scanning of cloned repos or your existing codebase Sonnet
qa-validator Schema validation, dependency checks, pass/fail reporting Sonnet

"Default Tier" is set in each agent's model: frontmatter and applied automatically by Claude Code. HiveSmith's own roster is deliberately generously tiered β€” it is a creator, and the quality of what it forges is worth the tokens. The haiku tier remains part of the routing doctrine for the swarms HiveSmith generates.

πŸš€ Quick Start

HiveSmith is powered by Claude Code.

1. Prerequisites:

  • Claude Code CLI β€” installed and authenticated (claude command available). Version 2.1.296 is recommended, since the doctrine is verified against it (per-call effort needs 2.1.292, the autoCompactWindow key 2.1.296); 2.1.280 is the floor for the core features (the opus alias resolving to Opus 5.5, the omitClaudeMd frontmatter key, maxEffortLevel, partial maxTurns results, SubagentStop hooks, the experimental.cacheTtl key, and the project-settings defaultMode behaviour the QA gate checks). The sonnet alias resolves to Sonnet 5.5 only on 2.1.284 or newer and on the Anthropic API (older versions and other providers resolve an earlier Sonnet), and the haiku alias resolves to Haiku 5.5 only on 2.1.293 or newer and on the Anthropic API (elsewhere it resolves to Haiku 4.5, which has no effort support, so a haiku agent's effort key has no effect there). The fail-closed guard (onFailure: block) needs 2.1.295 or newer; on older versions the setting is not available and a guard that cannot start lets the command through. HiveSmith was verified against v2.1.296.
  • Python 3, reachable as python3 on PATH β€” runs the block-destructive.py guard hook. Without it, every Bash and PowerShell command is blocked (fail-closed).
  • uv β€” optional, only for the uvx DuckDuckGo MCP fallback (pinned to a reviewed version in .mcp.json)

2. Clone this repository:

git clone https://github.com/Sh3rm/HiveSmith.git
cd HiveSmith

3. Boot the swarm:

claude "Build me a Kubernetes monitoring swarm with Prometheus and Grafana integration"

That's it. HiveSmith will research the domain, architect the agent hierarchy, write every prompt and config file, validate the output, and deliver a working swarm into your target directory.

Model configuration is automatic. The default model is set in .claude/settings.json, and each sub-agent's model: frontmatter uses Claude aliases (fable, opus, sonnet, haiku) that automatically resolve to the latest available versions (currently Fable 5.1, Opus 5.5, Sonnet 5.5, Haiku 5.5 on the Anthropic API; other providers may resolve earlier versions). You don't need to edit model names manually. Doctrine last verified against Claude Code v2.1.296 and its changelog (2026-10-12).

Optional check after hand edits. On Claude Code 2.1.283 or newer, /doctor prompt-audit audits CLAUDE.md, agents, skills and commands for prompt patterns written for older models β€” useful after you customise HiveSmith or a generated swarm.

File access is native. Claude Code's built-in Read/Write/Edit/Bash tools (governed by its permission system) handle all filesystem work β€” no filesystem MCP server is needed or used.

Project Structure

HiveSmith/
β”œβ”€β”€ CLAUDE.md                          # Orchestrator system prompt (plain markdown)
β”œβ”€β”€ README.md
β”œβ”€β”€ LICENSE
β”œβ”€β”€ .gitignore
β”œβ”€β”€ .mcp.json                          # Project-scoped MCP servers (optional search fallback)
β”œβ”€β”€ research-archive/                  # Frozen research corpus from past generation runs (not live config)
└── .claude/
    β”œβ”€β”€ settings.json                  # Default model, MCP allowlist + guard-hook wiring
    β”œβ”€β”€ hooks/
    β”‚   └── block-destructive.py       # PreToolUse guard: deterministic Destructive Action Barrier
    β”œβ”€β”€ rules/                         # Auto-loaded global rules
    β”‚   β”œβ”€β”€ 01-web-search-mandatory.md
    β”‚   β”œβ”€β”€ 02-destructive-action-barrier.md
    β”‚   β”œβ”€β”€ 03-agent-as-code-standard.md
    β”‚   β”œβ”€β”€ 04-prompt-injection-shield.md
    β”‚   β”œβ”€β”€ 05-idempotency-and-state.md
    β”‚   β”œβ”€β”€ 06-human-in-the-loop.md
    β”‚   β”œβ”€β”€ 07-conflict-resolution.md
    β”‚   β”œβ”€β”€ 08-blueprint-schema.md
    β”‚   └── 09-swarm-quality-doctrine.md
    └── agents/                        # 15 sub-agent definitions
        β”œβ”€β”€ dag-validator.md
        β”œβ”€β”€ domain-architect.md
        β”œβ”€β”€ mcp-integrator.md
        β”œβ”€β”€ persona-engineer.md
        β”œβ”€β”€ prompt-evaluator.md
        β”œβ”€β”€ qa-validator.md
        β”œβ”€β”€ repo-analyzer-worker.md
        β”œβ”€β”€ researcher-academic-independent.md
        β”œβ”€β”€ researcher-anthropic-openai.md
        β”œβ”€β”€ researcher-google-cloud.md
        β”œβ”€β”€ researcher-security.md
        β”œβ”€β”€ researcher-tech-stack.md
        β”œβ”€β”€ researcher-vcs-github.md
        β”œβ”€β”€ safety-engineer.md
        └── tool-smith.md

Generated swarms follow the same layout: a plain-markdown CLAUDE.md orchestrator, sub-agents in .claude/agents/, auto-loaded rules in .claude/rules/, model config in .claude/settings.json, and β€” only when external capabilities are needed β€” a project-root .mcp.json. When a swarm's core job is a repeatable fan-out with cross-verification, it can also ship a saved dynamic workflow in .claude/workflows/.

Global Rules

All agents (both HiveSmith's own and any it generates) operate under 9 global rules:

  1. Web Search Mandatory β€” No hallucinated packages, versions, or configs
  2. Destructive Action Barrier β€” No rm -rf, DROP TABLE, or cloud deletions without human approval; enforced by a fail-closed PreToolUse guard hook and permission rules, with scoped credentials and the sandbox as the real bound
  3. Agent-as-Code Standard β€” The canonical Claude Code schema: file formats, frontmatter keys, context inheritance, hooks doctrine, coordination mechanisms (hub-and-spoke by allowlist, agent teams, dynamic workflows), model routing and the generated-swarm tier budget β€” single source of truth for the whole workspace
  4. Prompt Injection Shield β€” All external inputs treated as untrusted; no generated agent combines untrusted input, private data and an outbound or state-changing tool (the Rule of Two); memory never stores unverified instructions
  5. Idempotency & State Safety β€” Operations must be safe to re-run
  6. Human-in-the-Loop β€” Agents pause and ask when facing critical ambiguity
  7. Conflict Resolution β€” Orchestrator resolves inter-agent disagreements; safety wins by default
  8. Blueprint Schema β€” Enforced JSON structure for all swarm blueprints, including per-agent decomposition justification, shared-state and hook sections
  9. Swarm Quality Doctrine β€” Anthropic's guidance and published research encoded as hard checks: single-agent justification, context-boundary (not phase) decomposition, ~200-line prompt budgets, verifier hardening, just-in-time context, instruction files written for current models

Contributing

Contributions are welcome. If you have ideas for new agent types, improved safety rules, or better research strategies, feel free to open an issue or submit a pull request.

License

Apache 2.0 β€” See LICENSE for details.

About

πŸβš’οΈ Meta-agent that forges production-ready agent swarms for Claude Code, sized to the work. You describe the swarm; HiveSmith researches, architects, writes and verifies it.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages