How darrenhinde/openagentscontrol works
1. Repository shape
This is a monorepo for OpenAgents Control, with a split between:
- runtime/distribution code in packages/, bin/, scripts/, and plugins/
- agent/context content in .opencode/ and plugins/claude-code/
- testing/evaluation infrastructure in evals/
- docs and planning assets in docs/, dev/, and top-level markdown files
2. Core product boundary
OAC is not a single app; it is a control layer over AI coding workflows built on OpenCode. The main boundary is between:
- orchestration logic: agent selection, context loading, approval flow, delegation
- content/configuration: markdown agents, context bundles, prompts, profiles, skills
- execution environments: OpenCode CLI and Claude Code plugin integration
3. Agent/content system
The primary behavior of the system lives in markdown and JSON files under .opencode/ and plugins/claude-code/. These define:
- agents and subagents
- skills and commands
- context navigation and standards
- profiles and prompt variants
- plugin metadata and marketplace info
This means the “application logic” is largely data-driven, not compiled into a single binary.
4. Context architecture
.opencode/context/ is the knowledge layer. It is organized by domain:
- core/ for standards, workflows, guides, and the context-system itself
- development/, ui/, backend/, integration/, project-intelligence/, etc. for domain-specific guidance
- openagents-repo/ for repo-specific concepts, migration guides, and plugin architecture
The README describes this as a local-first, lazy-loaded context system: agents resolve relevant context files, then load only the minimum needed information.
5. Agent execution flow
The intended runtime flow is:
- user enters a task in OpenCode or Claude Code
- a top-level agent such as OpenAgent, OpenCoder, or SystemBuilder is selected
- ContextScout discovers relevant context
- the agent proposes a plan
- the user approves before execution
- task-oriented subagents are delegated to for coding, testing, review, docs, or external research
This creates a clear separation between planning, approval, execution, and validation.
6. Specialized subagent mesh
The repo has a broad subagent catalog under .opencode/agent/subagents/ and plugins/claude-code/agents/. These include:
- code-focused roles: coder, reviewer, test engineer, build agent
- core workflow roles: task manager, context manager/retriever, stage orchestrator
- system-builder roles: domain analyzer, workflow designer, command creator
- utility roles: external scout, image specialist
Architecturally, these are narrow workers that receive delegated slices of the task rather than owning the full workflow.
7. CLI and installer boundary
packages/cli/ is the main end-user management surface. It handles commands like add, init, update, status, doctor, apply, and list, plus supporting logic for:
- installer/update behavior
- registry lookup and manifest handling
- versioning
- IDE detection
The top-level bin/oac.js is the entrypoint wrapper for the CLI. This package is the distribution and local setup layer.
8. Compatibility layer
packages/compatibility-layer/ is a translation boundary between agent ecosystems. It contains:
- adapters for Claude, Cursor, and Windsurf
- mapping for context, permissions, tools, and models
- migration/convert/validate CLI commands
- capability matrix and translation engine
This package exists to normalize different agent formats into OAC’s structure, so it is the interop and migration subsystem.
9. Plugin/abilities subsystem
packages/plugin-abilities/ and .opencode/plugin/ implement a plugin-oriented runtime for abilities:
- ability discovery and loading
- execution manager
- validation and permission enforcement
- SDK and plugin entrypoints
This is the repo’s extensibility layer, where reusable capabilities can be packaged, validated, and executed with policy checks.
10. Claude Code integration
plugins/claude-code/ is a complete plugin distribution with:
- plugin manifest files
- agent definitions
- command files
- hooks
- install scripts
- settings and local settings
It bridges OAC into Claude Code’s plugin model, while .claude-plugin/marketplace.json supports marketplace registration. This is a separate distribution path from the OpenCode-native flow.
11. Evaluation and validation pipeline
evals/framework/ is a full testing harness for agent behavior. It includes:
- session/log collection
- timeline building and message parsing
- evaluators for approval gates, context loading, delegation, tool usage, stop-on-failure, etc.
- SDK utilities for running suites and saving results
Agent test suites live under evals/agents/, organized by agent family and scenario type. This subsystem is the quality gate for behavior correctness, not application runtime.
12. Automation and release infrastructure
The repo relies heavily on automation:
- GitHub Actions for validation, release, registry updates, installer checks, and evals
- shell and TypeScript scripts under scripts/ for registry maintenance, testing, validation, cleanup, and versioning
- install/update scripts at the root (install.sh, update.sh)
These workflows keep the distributable assets, registry, and test suites consistent.
13. Supporting assets and examples
dev/ contains example projects and internal notes, while docs/ contains user-facing guides, planning, and feature documentation. These are not core runtime components, but they document the architecture and provide reference implementations for different use cases.
14. Overall system diagram mental model
The most accurate architecture view is:
- content/config layer: markdown agents, prompts, context, profiles, skills
- orchestration layer: OpenCode/OpenAgent/OpenCoder/SystemBuilder, delegation, approval, context discovery
- integration layer: CLI, Claude Code plugin, compatibility adapters, plugin abilities
- verification layer: eval framework, test suites, CI workflows
The central design principle is that behavior is editable, context-driven, and validated, rather than hard-coded.
Main entry points: agent/core Core Agents · cli CLI · framework Eval Framework · context/core Core Context
Components 23
Content & Context
Editable agent, prompt, skill, and context assets that define behavior.
- Core Agents · Top-level orchestration agents such as OpenAgent, OpenCoder, and SystemBuilder.
.opencode/agent/core - Subagents · Specialized delegated workers for code, context, planning, system-building, and utilities.
.opencode/agent/subagents - Commands · Slash-style command definitions and operational entrypoints for workflows.
.opencode/command - Core Context · Standards, workflows, and context-system guidance for general orchestration.
.opencode/context/core - Domain Context · Domain-specific context bundles for development, UI, backend, integration, and project intelligence.
.opencode/context/development - Repo Context · OpenAgents-specific concepts, guides, plugins, skills, and quality references.
.opencode/context/openagents-repo - Profiles · Behavior and capability presets for different operating modes.
.opencode/profiles - Prompts · Model- and role-specific prompt templates for core and specialized agents.
.opencode/prompts - Skills · Reusable task-oriented behaviors and routing scripts.
.opencode/skills - Context Skill · Context management and retrieval behavior used by orchestration flows.
.opencode/skills/context-manager - Task Skill · Task management and task CLI behavior for orchestration.
.opencode/skills/task-management - Proj Orchestr. · Project orchestration workflow and stage management logic.
.opencode/skill/project-orchestration
Runtime & Orchestration
Core execution, delegation, and compatibility boundaries.
- Abilities · Discovery, loading, execution, and permission enforcement for abilities.
packages/plugin-abilities - OAC Plugin · OpenCode-side plugin package and SDK surface for abilities integration.
.opencode/plugin
Integrations & Distribution
CLI, plugin packaging, and external runtime bridges.
- oac.js · Top-level wrapper that launches the CLI distribution.
bin/oac.js - CLI · End-user management surface for install, update, status, and registry operations.
packages/cli - Compat Layer · Translates agents, permissions, tools, models, and context across ecosystems.
packages/compatibility-layer - Claude Plugin · Claude Code plugin bundle with agents, commands, hooks, settings, and install assets.
plugins/claude-code
Evaluation & Validation
Behavioral testing, eval suites, and quality gates.
- Eval Framework · Session capture, evaluators, runners, and SDK for behavior validation.
evals/framework - Eval Suites · Agent-specific evaluation scenarios and regression suites.
evals/agents
Automation & Docs
Release automation, scripts, and supporting documentation.
- Scripts · Maintenance, registry, testing, validation, and bridge scripts.
scripts - GitHub Actions · Release, registry, installer, validation, and eval workflows.
.github/workflows - Docs · User guides, architecture notes, features, and planning materials.
docs
Connections 24
- oac.js → CLI: launches · Entry wrapper invokes the CLI package.
- CLI → Compat Layer: migrate/convert · CLI exposes interop and migration flows.
- CLI → Scripts: uses · Installer and registry maintenance rely on repo scripts.
- CLI → GitHub Actions: validated by · Release and install behavior are checked in CI.
- Claude Plugin → Core Agents: bundles · Plugin distribution ships agent definitions.
- Claude Plugin → Commands: bundles · Plugin distribution ships command files.
- Claude Plugin → Skills: bundles · Plugin distribution includes skill assets.
- OAC Plugin → Abilities: hosts · OpenCode plugin surface executes abilities runtime.
- Abilities → Core Context: loads · Abilities may resolve context before execution.
- Core Agents → Core Context: resolves · Top-level agents load core standards and workflows.
- Core Agents → Subagents: delegates to · Core agents hand off slices of work to specialists.
- Core Agents → Commands: invoked by · Commands trigger orchestration entrypoints.
- Core Agents → Prompts: uses · Agents rely on prompt variants for model-specific behavior.
- Core Agents → Profiles: adapts via · Profiles tune agent behavior and capability presets.
- Subagents → Skills: supports · Subagents are often paired with reusable task skills.
- Core Context → Domain Context: specializes into · Core context branches into domain-specific guidance.
- Core Context → Repo Context: extends into · Repo-specific context captures architecture and patterns.
- Proj Orchestr. → Context Skill: coordinates · Project orchestration uses context management as a core dependency.
- Eval Framework → Eval Suites: runs · Framework executes agent suites and scenarios.
- Eval Framework → Core Agents: measures · Core workflows are validated against behavior expectations.
- Eval Framework → Abilities: checks · Ability execution and permission behavior are exercised in evals.
- Scripts → GitHub Actions: mirrors · Automation scripts complement CI workflows.
- Docs → Repo Context: documents · Docs capture the repo architecture and operating model.
- Docs → Eval Framework: explains · Docs describe the evaluation harness and contributing flow.