# darrenhinde/openagentscontrol architecture

> Architecture diagram of the GitHub repository darrenhinde/openagentscontrol, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/darrenhinde/openagentscontrol
- Repository: https://github.com/darrenhinde/openagentscontrol

## Overview

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: [`.opencode/agent/core`](https://github.com/darrenhinde/openagentscontrol/blob/main/.opencode/agent/core) (Core Agents), [`packages/cli`](https://github.com/darrenhinde/openagentscontrol/tree/main/packages/cli) (CLI), [`evals/framework`](https://github.com/darrenhinde/openagentscontrol/tree/main/evals/framework) (Eval Framework), [`.opencode/context/core`](https://github.com/darrenhinde/openagentscontrol/blob/main/.opencode/context/core) (Core Context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_content["Content & Context"]
  node_agents_core["Core Agents<br/>agent specs<br/>[core]"]
  node_agents_sub["Subagents<br/>worker specs<br/>[subagents]"]
  node_commands["Commands<br/>command specs<br/>[command]"]
  node_context_core["Core Context<br/>knowledge base<br/>[core]"]
  node_context_domains["Domain Context<br/>knowledge base<br/>[development]"]
  node_context_repo["Repo Context<br/>repository knowledge<br/>[openagents-repo]"]
  node_profiles["Profiles<br/>profile set<br/>[profiles]"]
  node_prompts["Prompts<br/>prompt library<br/>[prompts]"]
  node_skills["Skills<br/>skill library<br/>[skills]"]
  node_context_skill["Context Skill<br/>[context-manager]"]
  node_task_skill["Task Skill<br/>[task-management]"]
  node_project_skill["Proj Orchestr.<br/>skill"]
end

subgraph group_runtime["Runtime & Orchestration"]
  node_plugin_abilities["Abilities<br/>plugin runtime"]
  node_opencode_plugin["OAC Plugin<br/>plugin runtime<br/>[plugin]"]
end

subgraph group_integration["Integrations & Distribution"]
  node_bin_oac["oac.js<br/>CLI entrypoint<br/>[oac.js]"]
  node_cli["CLI<br/>distribution package"]
  node_compat["Compat Layer<br/>interop package"]
  node_claude_plugin["Claude Plugin<br/>plugin distribution"]
end

subgraph group_verification["Evaluation & Validation"]
  node_eval_framework["Eval Framework<br/>test harness"]
  node_eval_agents["Eval Suites<br/>test suites"]
end

subgraph group_automation["Automation & Docs"]
  node_scripts["Scripts<br/>automation tools"]
  node_github_wf["GitHub Actions<br/>ci workflows<br/>[workflows]"]
  node_docs["Docs<br/>documentation"]
end

node_bin_oac -->|"launches"| node_cli
node_cli -->|"migrate/convert"| node_compat
node_cli -.->|"uses"| node_scripts
node_cli -.->|"validated by"| node_github_wf
node_claude_plugin -->|"bundles"| node_agents_core
node_claude_plugin -->|"bundles"| node_commands
node_claude_plugin -->|"bundles"| node_skills
node_opencode_plugin -->|"hosts"| node_plugin_abilities
node_plugin_abilities -.->|"loads"| node_context_core
node_agents_core -->|"resolves"| node_context_core
node_agents_core -->|"delegates to"| node_agents_sub
node_agents_core -->|"invoked by"| node_commands
node_agents_core -.->|"uses"| node_prompts
node_agents_core -.->|"adapts via"| node_profiles
node_agents_sub -.->|"supports"| node_skills
node_context_core -->|"specializes into"| node_context_domains
node_context_core -->|"extends into"| node_context_repo
node_project_skill -->|"coordinates"| node_context_skill
node_eval_framework -->|"runs"| node_eval_agents
node_eval_framework -.->|"measures"| node_agents_core
node_eval_framework -.->|"checks"| node_plugin_abilities
node_scripts -.->|"mirrors"| node_github_wf
node_docs -.->|"documents"| node_context_repo
node_docs -.->|"explains"| node_eval_framework

click node_bin_oac "https://github.com/darrenhinde/openagentscontrol/blob/main/bin/oac.js"
click node_cli "https://github.com/darrenhinde/openagentscontrol/tree/main/packages/cli"
click node_compat "https://github.com/darrenhinde/openagentscontrol/tree/main/packages/compatibility-layer"
click node_plugin_abilities "https://github.com/darrenhinde/openagentscontrol/tree/main/packages/plugin-abilities"
click node_opencode_plugin "https://github.com/darrenhinde/openagentscontrol/blob/main/.opencode/plugin"
click node_claude_plugin "https://github.com/darrenhinde/openagentscontrol/tree/main/plugins/claude-code"
click node_agents_core "https://github.com/darrenhinde/openagentscontrol/blob/main/.opencode/agent/core"
click node_agents_sub "https://github.com/darrenhinde/openagentscontrol/blob/main/.opencode/agent/subagents"
click node_commands "https://github.com/darrenhinde/openagentscontrol/blob/main/.opencode/command"
click node_context_core "https://github.com/darrenhinde/openagentscontrol/blob/main/.opencode/context/core"
click node_context_domains "https://github.com/darrenhinde/openagentscontrol/blob/main/.opencode/context/development"
click node_context_repo "https://github.com/darrenhinde/openagentscontrol/blob/main/.opencode/context/openagents-repo"
click node_profiles "https://github.com/darrenhinde/openagentscontrol/blob/main/.opencode/profiles"
click node_prompts "https://github.com/darrenhinde/openagentscontrol/blob/main/.opencode/prompts"
click node_skills "https://github.com/darrenhinde/openagentscontrol/blob/main/.opencode/skills"
click node_context_skill "https://github.com/darrenhinde/openagentscontrol/blob/main/.opencode/skills/context-manager"
click node_task_skill "https://github.com/darrenhinde/openagentscontrol/blob/main/.opencode/skills/task-management"
click node_project_skill "https://github.com/darrenhinde/openagentscontrol/blob/main/.opencode/skill/project-orchestration"
click node_eval_framework "https://github.com/darrenhinde/openagentscontrol/tree/main/evals/framework"
click node_eval_agents "https://github.com/darrenhinde/openagentscontrol/tree/main/evals/agents"
click node_scripts "https://github.com/darrenhinde/openagentscontrol/tree/main/scripts"
click node_github_wf "https://github.com/darrenhinde/openagentscontrol/blob/main/.github/workflows"
click node_docs "https://github.com/darrenhinde/openagentscontrol/tree/main/docs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_agents_core,node_agents_sub,node_commands,node_context_core,node_context_domains,node_context_repo,node_profiles,node_prompts,node_skills,node_context_skill,node_task_skill,node_project_skill toneBlue
class node_plugin_abilities,node_opencode_plugin toneAmber
class node_bin_oac,node_cli,node_compat,node_claude_plugin toneMint
class node_eval_framework,node_eval_agents toneRose
class node_scripts,node_github_wf,node_docs toneIndigo
```

## Components

### Content & Context

Editable agent, prompt, skill, and context assets that define behavior.

- [Core Agents](https://github.com/darrenhinde/openagentscontrol/blob/main/.opencode/agent/core): agent specs · Top-level orchestration agents such as OpenAgent, OpenCoder, and SystemBuilder. · `.opencode/agent/core`
- [Subagents](https://github.com/darrenhinde/openagentscontrol/blob/main/.opencode/agent/subagents): worker specs · Specialized delegated workers for code, context, planning, system-building, and utilities. · `.opencode/agent/subagents`
- [Commands](https://github.com/darrenhinde/openagentscontrol/blob/main/.opencode/command): command specs · Slash-style command definitions and operational entrypoints for workflows. · `.opencode/command`
- [Core Context](https://github.com/darrenhinde/openagentscontrol/blob/main/.opencode/context/core): knowledge base · Standards, workflows, and context-system guidance for general orchestration. · `.opencode/context/core`
- [Domain Context](https://github.com/darrenhinde/openagentscontrol/blob/main/.opencode/context/development): knowledge base · Domain-specific context bundles for development, UI, backend, integration, and project intelligence. · `.opencode/context/development`
- [Repo Context](https://github.com/darrenhinde/openagentscontrol/blob/main/.opencode/context/openagents-repo): repository knowledge · OpenAgents-specific concepts, guides, plugins, skills, and quality references. · `.opencode/context/openagents-repo`
- [Profiles](https://github.com/darrenhinde/openagentscontrol/blob/main/.opencode/profiles): profile set · Behavior and capability presets for different operating modes. · `.opencode/profiles`
- [Prompts](https://github.com/darrenhinde/openagentscontrol/blob/main/.opencode/prompts): prompt library · Model- and role-specific prompt templates for core and specialized agents. · `.opencode/prompts`
- [Skills](https://github.com/darrenhinde/openagentscontrol/blob/main/.opencode/skills): skill library · Reusable task-oriented behaviors and routing scripts. · `.opencode/skills`
- [Context Skill](https://github.com/darrenhinde/openagentscontrol/blob/main/.opencode/skills/context-manager): skill · Context management and retrieval behavior used by orchestration flows. · `.opencode/skills/context-manager`
- [Task Skill](https://github.com/darrenhinde/openagentscontrol/blob/main/.opencode/skills/task-management): skill · Task management and task CLI behavior for orchestration. · `.opencode/skills/task-management`
- [Proj Orchestr.](https://github.com/darrenhinde/openagentscontrol/blob/main/.opencode/skill/project-orchestration): skill · Project orchestration workflow and stage management logic. · `.opencode/skill/project-orchestration`

### Runtime & Orchestration

Core execution, delegation, and compatibility boundaries.

- [Abilities](https://github.com/darrenhinde/openagentscontrol/tree/main/packages/plugin-abilities): plugin runtime · Discovery, loading, execution, and permission enforcement for abilities. · `packages/plugin-abilities`
- [OAC Plugin](https://github.com/darrenhinde/openagentscontrol/blob/main/.opencode/plugin): plugin runtime · OpenCode-side plugin package and SDK surface for abilities integration. · `.opencode/plugin`

### Integrations & Distribution

CLI, plugin packaging, and external runtime bridges.

- [oac.js](https://github.com/darrenhinde/openagentscontrol/blob/main/bin/oac.js): CLI entrypoint · Top-level wrapper that launches the CLI distribution. · `bin/oac.js`
- [CLI](https://github.com/darrenhinde/openagentscontrol/tree/main/packages/cli): distribution package · End-user management surface for install, update, status, and registry operations. · `packages/cli`
- [Compat Layer](https://github.com/darrenhinde/openagentscontrol/tree/main/packages/compatibility-layer): interop package · Translates agents, permissions, tools, models, and context across ecosystems. · `packages/compatibility-layer`
- [Claude Plugin](https://github.com/darrenhinde/openagentscontrol/tree/main/plugins/claude-code): plugin distribution · 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](https://github.com/darrenhinde/openagentscontrol/tree/main/evals/framework): test harness · Session capture, evaluators, runners, and SDK for behavior validation. · `evals/framework`
- [Eval Suites](https://github.com/darrenhinde/openagentscontrol/tree/main/evals/agents): test suites · Agent-specific evaluation scenarios and regression suites. · `evals/agents`

### Automation & Docs

Release automation, scripts, and supporting documentation.

- [Scripts](https://github.com/darrenhinde/openagentscontrol/tree/main/scripts): automation tools · Maintenance, registry, testing, validation, and bridge scripts. · `scripts`
- [GitHub Actions](https://github.com/darrenhinde/openagentscontrol/blob/main/.github/workflows): ci workflows · Release, registry, installer, validation, and eval workflows. · `.github/workflows`
- [Docs](https://github.com/darrenhinde/openagentscontrol/tree/main/docs): documentation · User guides, architecture notes, features, and planning materials. · `docs`

## Connections

- 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.
