# rv-01/ecc architecture

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

- Interactive diagram: https://gitdiagram.com/rv-01/ecc
- Repository: https://github.com/rv-01/ecc

## Overview

1. **What this repository is**
   ECC is a distribution and control surface for agentic developer workflows, not a single application. Its main job is to package reusable behavior — agents, skills, commands, hooks, rules, and MCP config — and install that behavior into multiple AI harnesses such as Claude Code, Cursor, OpenCode, Codex, Zed, Gemini, and Copilot.

2. **The top-level architecture boundary**
   The repo is split between:
   - **source-of-truth content**: `agents/`, `skills/`, `commands/`, `rules/`, `hooks/`, `mcp-configs/`
   - **installer/runtime plumbing**: `scripts/`, `manifests/`, `schemas/`, `install.sh`, `install.ps1`, `package.json`
   - **tool-specific adapters**: `.claude/`, `.cursor/`, `.codex/`, `.opencode/`, `.zed/`, `.gemini/`, `.codebuddy/`, `.trae/`
   - **documentation and validation**: `docs/`, `tests/`, CI workflows

3. **Primary functional surface: skills**
   Skills are the main workflow abstraction in ECC. They encode reusable procedures for things like TDD, review, security, research, content generation, and domain-specific stacks. They are meant to be invoked directly or auto-selected by the harness, and many have companion files for specific agents or harness formats.

4. **Secondary surface: agents**
   Agents are specialized subagents that handle bounded tasks such as planning, reviewing, build repair, and language- or domain-specific analysis. In the Claude/OpenCode/Cursor world they are mostly markdown-defined prompts; in Codex they also have structured agent configs under `.agents/skills/*/agents/openai.yaml` and `.codex/agents/*.toml`.

5. **Command compatibility layer**
   `commands/` preserves slash-command entry points like `/plan`, `/code-review`, `/build-fix`, `/quality-gate`, `/go-test`, and `/python-review`. `legacy-command-shims/` holds retired aliases such as `/tdd` and `/eval`. Architecturally, commands are a compatibility layer over the skills-first model.

6. **Rules as always-on policy**
   `rules/` contains the always-follow guidance installed into user or project rule directories. The structure is intentionally layered: `common/` plus language-specific packs such as TypeScript, Python, Go, Swift, PHP, and ArkTS. These rules act as guardrails for style, security, testing, performance, and workflow behavior.

7. **Hook-driven runtime enforcement**
   The `hooks/` and `scripts/hooks/` trees implement event-based automation. They cover session start/end, file edit reactions, pre-submit checks, prompt inspection, compact suggestions, and quality gates. The important architectural idea is that enforcement is done at the harness event layer, so behavior can be reactive without requiring manual commands.

8. **Installer and selective deployment pipeline**
   The repo supports selective installation rather than a monolithic copy. `manifests/`, `schemas/`, and `scripts/lib/install-*` drive component selection, profile resolution, target detection, and apply-state tracking. This is how ECC can install only a minimal profile, only rules, only hooks, or a full bundle depending on the target harness and user choice.

9. **State and lifecycle management**
   Installations are tracked with a state store, and runtime session behavior is tracked separately. The Node-side utilities under `scripts/lib/state-store` and `scripts/lib/session-*` support install history, session adapters, alias handling, and orchestration metadata. This makes uninstall, repair, sync, and status commands possible without blindly touching unrelated files.

10. **Cross-harness adapter layer**
   The repo contains explicit adapters for each supported environment:
   - Claude Code via `.claude/` and plugin manifests
   - Cursor via `.cursor/` and hook adapter translation
   - OpenCode via `.opencode/`
   - Codex via `.codex/` and `AGENTS.md`
   - Zed, Gemini, Trae, CodeBuddy, Antigravity via their own local surfaces
   This is a key boundary: the repo keeps one canonical content model, then fans it out into harness-specific config formats.

11. **Control-plane and dashboard work**
   `ecc2/` is a separate Rust control-plane prototype. It has its own session manager, daemon, worktree, observability, notifications, and TUI dashboard modules, plus a Tkinter dashboard entry point at `ecc_dashboard.py`. This is an alpha subsystem distinct from the main packaging/runtime pipeline and is aimed at interactive operator status and session control.

12. **Verification and CI**
   `tests/` plus GitHub Actions validate the repo’s surface area, install manifests, hook behavior, command registry, security checks, and cross-harness compatibility. The test suite is important architecturally because the repo’s value depends on keeping many generated surfaces aligned: docs, manifests, commands, agents, skills, hooks, and tool-specific adapters.

13. **External services and integrations**
   The repo integrates with Claude Code plugins, GitHub Marketplace, MCP servers, AgentShield security scanning, and several harness-specific model/runtime ecosystems. These are not core business logic, but they materially shape the architecture because the repo’s artifacts are meant to be installed into and executed by those external environments.

14. **High-level data flow**
   A typical flow is: user selects a profile or command → installer resolves target/components from manifests → files are copied or generated into the harness-specific surface → hooks execute at runtime events → session/state data is persisted or summarized → optional learning, review, or dashboard commands read that state back out. That closed loop — content definition, installation, runtime enforcement, and feedback into state — is the central architecture of ECC.

Main entry points: [`scripts/lib/install-targets`](https://github.com/rv-01/ecc/tree/main/scripts/lib/install-targets) (Targets), [`scripts`](https://github.com/rv-01/ecc/tree/main/scripts) (Scripts), [`hooks`](https://github.com/rv-01/ecc/tree/main/hooks) (Hooks), [`scripts/install-apply.js`](https://github.com/rv-01/ecc/blob/main/scripts/install-apply.js) (Installer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_content["Canonical content"]
  node_skills["Skills<br/>workflow packs"]
  node_agents["Agents<br/>specialist prompts"]
  node_commands["Commands<br/>slash-command layer"]
  node_rules["Rules<br/>always-on policy"]
  node_hooks["Hooks<br/>event automation"]
  node_mcp[("MCP configs<br/>server registry")]
end

subgraph group_runtime["Installer runtime"]
  node_manifests["Manifests<br/>selection model"]
  node_schemas["Schemas<br/>validation contracts"]
  node_scripts["Scripts<br/>installer orchestration"]
  node_state[("State store<br/>install/session state")]
  node_session["Session adapters<br/>runtime adapters"]
  node_installer["Installer<br/>apply pipeline<br/>[install-apply.js]"]
end

subgraph group_adapters["Harness adapters"]
  node_targets["Targets<br/>platform detectors"]
  node_claude["Claude<br/>harness adapter<br/>[.claude]"]
  node_cursor["Cursor<br/>harness adapter<br/>[.cursor]"]
  node_opencode["OpenCode<br/>harness adapter<br/>[.opencode]"]
  node_codex["Codex<br/>harness adapter<br/>[.codex]"]
  node_zed["Zed<br/>harness adapter<br/>[.zed]"]
  node_gemini["Gemini<br/>harness adapter<br/>[.gemini]"]
  node_codebuddy["CodeBuddy<br/>harness adapter<br/>[.codebuddy]"]
end

subgraph group_validation["Validation"]
  node_docs["Docs"]
  node_tests["Tests<br/>repo verification"]
  node_ci["CI workflows<br/>automation checks<br/>[workflows]"]
end

subgraph group_control["Control plane"]
  node_ecc2["ECC2<br/>rust control plane"]
  node_dashboard(("Dashboard<br/>tui/gui entry<br/>[ecc_dashboard.py]"))
end

node_skills -->|"invoked by"| node_commands
node_skills -->|"uses"| node_agents
node_rules -->|"enforced by"| node_hooks
node_hooks -->|"implemented in"| node_scripts
node_manifests -->|"drives"| node_installer
node_schemas -->|"validates"| node_manifests
node_scripts -->|"orchestrates"| node_installer
node_scripts -->|"persists"| node_state
node_scripts -->|"bridges"| node_session
node_installer -->|"selects"| node_targets
node_targets -->|"maps to"| node_claude
node_targets -->|"maps to"| node_cursor
node_targets -->|"maps to"| node_opencode
node_targets -->|"maps to"| node_codex
node_targets -->|"maps to"| node_zed
node_targets -->|"maps to"| node_gemini
node_targets -->|"maps to"| node_codebuddy
node_docs -->|"documented by"| node_tests
node_tests -->|"run in"| node_ci
node_ecc2 -->|"exposes"| node_dashboard
node_ecc2 -.->|"manages"| node_session
node_scripts -.->|"described in"| node_docs
node_commands -.->|"reflected in"| node_docs
node_hooks -.->|"verified by"| node_tests

click node_skills "https://github.com/rv-01/ecc/tree/main/skills"
click node_agents "https://github.com/rv-01/ecc/tree/main/agents"
click node_commands "https://github.com/rv-01/ecc/tree/main/commands"
click node_rules "https://github.com/rv-01/ecc/tree/main/rules"
click node_hooks "https://github.com/rv-01/ecc/tree/main/hooks"
click node_mcp "https://github.com/rv-01/ecc/tree/main/mcp-configs"
click node_manifests "https://github.com/rv-01/ecc/tree/main/manifests"
click node_schemas "https://github.com/rv-01/ecc/tree/main/schemas"
click node_scripts "https://github.com/rv-01/ecc/tree/main/scripts"
click node_state "https://github.com/rv-01/ecc/tree/main/scripts/lib/state-store"
click node_session "https://github.com/rv-01/ecc/tree/main/scripts/lib/session-adapters"
click node_installer "https://github.com/rv-01/ecc/blob/main/scripts/install-apply.js"
click node_targets "https://github.com/rv-01/ecc/tree/main/scripts/lib/install-targets"
click node_claude "https://github.com/rv-01/ecc/blob/main/.claude"
click node_cursor "https://github.com/rv-01/ecc/blob/main/.cursor"
click node_opencode "https://github.com/rv-01/ecc/blob/main/.opencode"
click node_codex "https://github.com/rv-01/ecc/blob/main/.codex"
click node_zed "https://github.com/rv-01/ecc/blob/main/.zed"
click node_gemini "https://github.com/rv-01/ecc/blob/main/.gemini"
click node_codebuddy "https://github.com/rv-01/ecc/blob/main/.codebuddy"
click node_docs "https://github.com/rv-01/ecc/tree/main/docs"
click node_tests "https://github.com/rv-01/ecc/tree/main/tests"
click node_ci "https://github.com/rv-01/ecc/blob/main/.github/workflows"
click node_ecc2 "https://github.com/rv-01/ecc/tree/main/ecc2"
click node_dashboard "https://github.com/rv-01/ecc/blob/main/ecc_dashboard.py"

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_skills,node_agents,node_commands,node_rules,node_hooks,node_mcp toneBlue
class node_manifests,node_schemas,node_scripts,node_state,node_session,node_installer toneAmber
class node_targets,node_claude,node_cursor,node_opencode,node_codex,node_zed,node_gemini,node_codebuddy toneMint
class node_docs,node_tests,node_ci toneRose
class node_ecc2,node_dashboard toneIndigo
```

## Components

### Canonical content

Source-of-truth workflow definitions installed into harnesses.

- [Skills](https://github.com/rv-01/ecc/tree/main/skills): workflow packs · Primary reusable procedures and capability packs. · `skills`
- [Agents](https://github.com/rv-01/ecc/tree/main/agents): specialist prompts · Bounded-task subagents for planning, review, repair, and analysis. · `agents`
- [Commands](https://github.com/rv-01/ecc/tree/main/commands): slash-command layer · Compatibility entry points over the skills-first model. · `commands`
- [Rules](https://github.com/rv-01/ecc/tree/main/rules): always-on policy · Installed guardrails for style, security, testing, and workflow behavior. · `rules`
- [Hooks](https://github.com/rv-01/ecc/tree/main/hooks): event automation · Reactive runtime enforcement triggered by harness events. · `hooks`
- [MCP configs](https://github.com/rv-01/ecc/tree/main/mcp-configs): server registry · Model context protocol server definitions and integration config. · `mcp-configs`

### Installer runtime

Selective install, state tracking, and session orchestration.

- [Manifests](https://github.com/rv-01/ecc/tree/main/manifests): selection model · Profiles, modules, and component manifests for selective deployment. · `manifests`
- [Schemas](https://github.com/rv-01/ecc/tree/main/schemas): validation contracts · JSON schemas for install, plugin, hook, and state data. · `schemas`
- [Scripts](https://github.com/rv-01/ecc/tree/main/scripts): installer orchestration · Core CLI, CI, hook, and adapter plumbing. · `scripts`
- [State store](https://github.com/rv-01/ecc/tree/main/scripts/lib/state-store): install/session state · Persistence for install history, lifecycle metadata, and session records. · `scripts/lib/state-store`
- [Session adapters](https://github.com/rv-01/ecc/tree/main/scripts/lib/session-adapters): runtime adapters · Canonical session bridging across harness-specific histories and aliases. · `scripts/lib/session-adapters`
- [Installer](https://github.com/rv-01/ecc/blob/main/scripts/install-apply.js): apply pipeline · Resolves profiles, targets, and applies files into harness surfaces. · `scripts/install-apply.js`

### Harness adapters

Tool-specific surfaces and translation layers.

- [Targets](https://github.com/rv-01/ecc/tree/main/scripts/lib/install-targets): platform detectors · Harness-specific install destinations and surface mappings. · `scripts/lib/install-targets`
- [Claude](https://github.com/rv-01/ecc/blob/main/.claude): harness adapter · Claude Code adapter surface and plugin packaging. · `.claude`
- [Cursor](https://github.com/rv-01/ecc/blob/main/.cursor): harness adapter · Cursor hooks, rules, and skill translation surface. · `.cursor`
- [OpenCode](https://github.com/rv-01/ecc/blob/main/.opencode): harness adapter · OpenCode commands, prompts, plugins, and hook integration. · `.opencode`
- [Codex](https://github.com/rv-01/ecc/blob/main/.codex): harness adapter · Codex agent configs, AGENTS.md, and plugin packaging. · `.codex`
- [Zed](https://github.com/rv-01/ecc/blob/main/.zed): harness adapter · Zed settings surface for installing ECC behavior. · `.zed`
- [Gemini](https://github.com/rv-01/ecc/blob/main/.gemini): harness adapter · Gemini-specific local surface and adaptation layer. · `.gemini`
- [CodeBuddy](https://github.com/rv-01/ecc/blob/main/.codebuddy): harness adapter · CodeBuddy installer and uninstall surface. · `.codebuddy`

### Validation

Docs, tests, and CI that keep generated surfaces aligned.

- [Docs](https://github.com/rv-01/ecc/tree/main/docs): architecture docs · Guides, architecture notes, and release references. · `docs`
- [Tests](https://github.com/rv-01/ecc/tree/main/tests): repo verification · Cross-surface regression tests for manifests, hooks, commands, and adapters. · `tests`
- [CI workflows](https://github.com/rv-01/ecc/blob/main/.github/workflows): automation checks · GitHub Actions validating compatibility and release surfaces. · `.github/workflows`

### Control plane

Separate operator dashboard and session control prototype.

- [ECC2](https://github.com/rv-01/ecc/tree/main/ecc2): rust control plane · Prototype operator dashboard, daemon, session, and worktree control. · `ecc2`
- [Dashboard](https://github.com/rv-01/ecc/blob/main/ecc_dashboard.py): tui/gui entry · Tkinter and TUI entry points for operator status and control. · `ecc_dashboard.py`

## Connections

- Skills → Commands: invoked by · Commands wrap or dispatch into skills.
- Skills → Agents: uses · Skills may call specialized subagents.
- Rules → Hooks: enforced by · Rules are operationalized through runtime hooks.
- Hooks → Scripts: implemented in · Hook behavior is mostly scripted plumbing.
- Manifests → Installer: drives · Profiles and modules determine what gets installed.
- Schemas → Manifests: validates · Schemas constrain manifest and install data.
- Scripts → Installer: orchestrates · Installer scripts resolve targets and apply content.
- Scripts → State store: persists · Install and session lifecycle data is stored.
- Scripts → Session adapters: bridges · Session adapters normalize harness history and metadata.
- Installer → Targets: selects · Installer chooses harness-specific destinations.
- Targets → Claude: maps to · Claude project/home surfaces receive content.
- Targets → Cursor: maps to · Cursor project surfaces and hook translation.
- Targets → OpenCode: maps to · OpenCode local surface receives generated config.
- Targets → Codex: maps to · Codex home/project layout is populated.
- Targets → Zed: maps to · Zed receives settings and local configuration.
- Targets → Gemini: maps to · Gemini-specific adaptation is applied.
- Targets → CodeBuddy: maps to · CodeBuddy install scripts provide a harness surface.
- Docs → Tests: documented by · Docs and examples are covered by regression tests.
- Tests → CI workflows: run in · CI executes validation suites and surface checks.
- ECC2 → Dashboard: exposes · ECC2 presents operator status through a dashboard.
- ECC2 → Session adapters: manages · Control-plane session logic is separate but related.
- Scripts → Docs: described in · Installer and adapter behavior is documented.
- Commands → Docs: reflected in · Command registry and guides are kept in sync.
- Hooks → Tests: verified by · Hook behavior is regression-tested.
