agentleFS
rretsiemrretsiem/opencode-hive/AGENTS.md

opencode-hive

AGENTS.md39 starsChanged 4 months agoMITView on GitHub

A multi-agent architecture for OpenCode. This is a template -- not a project to develop, but a system to install into other projects. When a user asks you to "set this up", "install this", or "configure my project": Categorize into three tiers: - SUB: Subscription models -- for routing, planning, review, wiki - MID: Pay-per-token coding models -- for implementation specialists - PREMIUM: Frontier models -- never assign as default, manual override only Ask before overwriting any existing files. Every…

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 35,337 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

The file

Show its rules and text

We split this AGENTS.md into the rules it gives an agent

13 rules. About 0 are common, 5 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When a user asks you to "set this up", "install this", or "configure my project":

    line 15
  2. Very specific:

    Run opencode models and present the output.

    line 18
  3. Distinctive:

    Ask the user for the target project path, then scan it:

    line 28
  4. Very specific:

    Every replacement must be a complete OpenCode model ID in provider/model-id format.

    line 49
  5. Very specific:

    Do not install _project-dev-template.md under that name.

    line 60
  6. Very specific:

    Add each implementation agent to <target>/.opencode/agents/orchestrator.md under permission.task (e.g., "frontend-dev": allow).

    line 72
  7. Very specific:

    Use project/agents/_project-dev-template.md as starting point:

    line 79
  8. Distinctive:

    Add to the project-local orchestrator's task permissions

    line 83
  9. Very specific:

    If it needs review coverage, create a separate <project-name>-reviewer.md with edit: deny and add only that reviewer to review-lead

    line 84
  10. Very specific:

    Keep the built-in explore and scout permissions

    line 94
  11. Very specific:

    Add every installed specialist to permission.task (e.g., "my-specialist": allow)

    line 95
  12. Distinctive:

    Add every new project-specific agent the same way

    line 96
  13. Distinctive:

    Keep the global orchestrator limited to globally installed agents

    line 97

≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

OpenCode Hive

A multi-agent architecture for OpenCode. This is a template -- not a project to develop, but a system to install into other projects.

Directory Structure

  • global/ -- Files to install at ~/.config/opencode/ (agents, tools, scripts, rules, skills)
  • project/ -- Files to install at .opencode/ in the target project
  • examples/ -- Optional specialist agents to pick based on project stack
  • docs/ -- Guides for model selection, adding specialists, architecture

AI Setup Instructions

When a user asks you to "set this up", "install this", or "configure my project":

Step 1: Discover Available Models

Run opencode models and present the output. Ask the user:

  • "Which of these providers are subscription/free (no per-token cost)?"
  • "Which provider/model do you want for code generation?"

Categorize into three tiers:

  • SUB: Subscription models -- for routing, planning, review, wiki
  • MID: Pay-per-token coding models -- for implementation specialists
  • PREMIUM: Frontier models -- never assign as default, manual override only

Step 2: Detect Target Project Stack

Ask the user for the target project path, then scan it:

ls <target>/*.py <target>/*.ts <target>/*.go <target>/*.rs 2>/dev/null | head -20
ls <target>/package.json <target>/pyproject.toml <target>/go.mod <target>/Cargo.toml 2>/dev/null
ls <target>/Dockerfile <target>/docker-compose* 2>/dev/null

Step 3: Install Global Files

Copy each global/ folder to ~/.config/opencode/:

  • agents/*.md, tools/*.ts, scripts/*, skills/*/, rules/*.md
  • Merge opencode.json — don't overwrite existing MCP, LSP, or plugin config

Ask before overwriting any existing files.

Step 4: Replace Model Placeholders

In all copied files, replace these four placeholders with real model IDs:

  • YOUR_ROUTING_MODEL -> fast, reliable model for routing
  • YOUR_ANALYSIS_MODEL -> strong model for planning and review
  • YOUR_FAST_MODEL -> inexpensive model for titles and summaries
  • YOUR_CODE_MODEL -> strongest available code-generation model

Every replacement must be a complete OpenCode model ID in provider/model-id format. These role names do not require a particular provider or billing model.

Step 5: Install Project Files

Copy project/ contents to <target>/.opencode/:

  • project/agents/orchestrator.md -> <target>/.opencode/agents/orchestrator.md
  • project/agents/review-lead.md -> <target>/.opencode/agents/review-lead.md
  • project/rules/*.md -> <target>/.opencode/rules/
  • project/wiki/WIKI_SCHEMA.md -> <target>/.opencode/wiki/WIKI_SCHEMA.md

Do not install _project-dev-template.md under that name; Step 7 turns it into a real, project-named agent.

Step 6: Select Example Specialists

Based on detected stack, copy matching agents from examples/specialists/:

  • Python -> python-pro already global
  • Go -> go-pro already global
  • JS/TS -> copy frontend-dev.md and frontend-reviewer.md
  • Backend -> copy backend-dev.md and backend-reviewer.md
  • Docker/K8s -> copy devops-engineer.md and devops-reviewer.md
  • SQL -> copy database-dev.md and database-reviewer.md

Add each implementation agent to <target>/.opencode/agents/orchestrator.md under permission.task (e.g., "frontend-dev": allow). Add its read-only reviewer to <target>/.opencode/agents/review-lead.md. Never allow an edit-capable implementation agent from review-lead. Do not add project-only agents to the global orchestrator.

Step 7: Create Project-Specific Agent

Use project/agents/_project-dev-template.md as starting point:

  1. Scan target project structure
  2. Fill in project layout, conventions, dev commands, key files
  3. Save as <target>/.opencode/agents/<project-name>-dev.md
  4. Add to the project-local orchestrator's task permissions
  5. If it needs review coverage, create a separate <project-name>-reviewer.md with edit: deny and add only that reviewer to review-lead

Step 8: Customize Review Lead

Edit <target>/.opencode/agents/review-lead.md:

  • Fill in the domain routing table with actual file patterns from the project
  • Allow only matching *-reviewer agents in permission.task

Step 9: Update Project Orchestrator Permissions

Edit <target>/.opencode/agents/orchestrator.md:

  • Keep the built-in explore and scout permissions
  • Add every installed specialist to permission.task (e.g., "my-specialist": allow)
  • Add every new project-specific agent the same way
  • Keep the global orchestrator limited to globally installed agents
  • Without these project-local permissions, the orchestrator cannot delegate to your agents

Step 10: Verify Setup

opencode models  # Confirm model IDs resolve
ls ~/.config/opencode/agents/  # Global agents present
ls <target>/.opencode/agents/  # Project agents present

Report the final agent inventory with models and cost tiers.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.