# merchantlee99/vibebuilder architecture

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

- Interactive diagram: https://gitdiagram.com/merchantlee99/vibebuilder
- Repository: https://github.com/merchantlee99/vibebuilder

## Overview

1. This repository is a **pack registry**, not a single application. It contains two parallel harness templates: `vb-pack-claude-harness` and `vb-pack-codex-harness`. The top-level README frames them as copyable starting points for different agent runtimes, with shared goals around durable context, validation loops, review discipline, learning logs, and skill evolution.

2. The **main architectural boundary** is the split between the two packs:
   - **Claude pack**: optimized for Claude Code, with strong reliance on hooks and sealed prompts.
   - **Codex pack**: optimized for Codex app, with subagents, automations, modes, and worktree/browser/computer-use primitives.
   This means the repo is not one generic harness; it is two runtime-specific operating systems for agent work.

3. Both packs share a similar high-level layering:
   - **Policy/config layer**: manifests and routing rules that decide what actions are allowed.
   - **Runtime interception layer**: hooks or adapters that observe or block actions.
   - **Operational playbooks**: human-readable workflows for planning, review, automation, and recovery.
   - **Prompt/template layer**: reusable document templates and sealed prompts.
   - **Execution scripts**: Python utilities that enforce policy, manage state, and generate artifacts.
   - **Tests/self-checks**: validation for the harness itself.

4. In the **Claude harness**, `.claude/hooks` is the critical control plane. Files like `pre_tool_use.py`, `post_tool_use.py`, `user_prompt_submit.py`, `session_start.py`, and `stop.py` indicate that governance happens by intercepting tool usage and session lifecycle events. That pack also includes `gate_4_runner.py`, suggesting a staged review or approval gate in the session flow.

5. The Claude pack’s **policy and knowledge model** is file-based and explicit:
   - `.claude/manifests` defines automation policy, capability routing, and subagent definitions.
   - `.claude/agents` and `.claude/skills` encode role definitions and reusable workflows.
   - `.claude/sealed-prompts` contains locked prompt assets for planning, implementation, review, red-teaming, verification, and audits.
   This pack is designed to make agent behavior predictable and mechanically constrained.

6. The Claude pack’s **Python harness scripts** provide supporting services around enforcement and memory:
   - `event_log.py`, `session_index.py`, `rotate_logs.py` manage persistent traceability.
   - `memory_manager.py`, `learning_log.py`, `taxonomy_learner.py`, `insights_engine.py` support long-term adaptation.
   - `runtime_gate.py`, `risk_policy.py`, `oversight_policy.py`, `protected_paths.py`, `size_check.py` enforce guardrails.
   - `subagent_planner.py`, `automation_planner.py`, `skill_auto_gen.py` generate or route work.
   This makes the Claude pack a hook-driven governance system with logging and learning attached.

7. In the **Codex harness**, the equivalent control plane is split differently. The `.codex/hooks` directory plus `hooks.json` and `hook_adapter.py` suggest a hook adapter rather than direct hook wiring. The presence of `runtime.json`, `telemetry`, and `audits` indicates a more explicit runtime/state model with observability and audit trails.

8. The Codex pack’s **policy surface is broader and more mode-oriented**:
   - `.codex/manifests` includes automation policy, capability routing, evolution policy, mode policy, review matrix, and subagents.
   - `.codex/playbooks` includes automations, browser QA, computer use, git ops, modes, and subagents.
   - `review_gate.py`, `review_digest.py`, `mode_recommender.py`, `ownership_guard.py`, and `worktree_manager.py` show that Codex is structured around task orchestration, mode selection, and workspace isolation.
   Compared with Claude, Codex leans more on operational modes and task routing than hard hook blocking.

9. The Codex pack’s **script layer** has a stronger separation between workflow coordination and policy enforcement:
   - `activity_bridge.py`, `session_state.py`, `memory_feedback.py`, and `insights_report.py` connect runtime events to persistent state.
   - `manifest_loader.py`, `validate_manifests.py`, and `review_matrix_policy.py` keep the configuration graph coherent.
   - `protect_paths.py`, `append_only_guard.py`, `ownership_guard.py`, and `runtime_gate.py` enforce safety boundaries.
   - `meta_audit.py`, `review_gate.py`, and `self_test.py` provide internal validation.
   This gives the Codex pack a more compositional architecture around reusable runtime primitives.

10. The **templates** directory in both packs is the artifact boundary for generated human-facing documents. Files like `PRD.md`, `Plan.md`, `Implement.md`, `Documentation.md`, `Prompt.md`, `Subagent-Manifest.md`, and review/design variants act as structured inputs or outputs for the harness workflows. They define the document-driven workflow that the scripts and prompts consume.

11. The **playbooks** are the operational runbooks. They translate policy into repeatable practices such as automation, git operations, browser/computer use, MCP usage, memory handling, hooks recipes, and subagent usage. Architecturally, these are not execution code; they are the human-operational layer that defines how the runtime should be used.

12. The **skills directories** are another reusable behavior layer. Both packs have `_manual` skill folders with workflows such as investigate, review, ship, QA, plan/review, and vibe-coding workflow. These are likely invoked by the harness or referenced by prompts to standardize how a session proceeds.

13. The **tests** are intentionally thin but important: each pack has a `tests/test_harness.py`, indicating the harness itself is treated as the unit under test rather than the product being built. That fits the repository’s purpose: validate the pack’s rules, not a domain application.

14. For an architecture diagram, the key flows are:
   - User prompt or session start enters the runtime hook/adapter layer.
   - Hooks/scripts consult manifests and policies.
   - Work is routed to subagents, automations, or mode-specific workflows.
   - Execution produces logs, learning artifacts, audits, and session state.
   - Templates and sealed prompts shape the next planning/review cycle.
   In short, this repo is a **meta-operating system for agent sessions**, with Claude and Codex as two distinct runtime backends.

Main entry points: [`vb-pack-codex-harness/README.md`](https://github.com/merchantlee99/vibebuilder/blob/main/vb-pack-codex-harness/README.md) (Codex README), [`vb-pack-claude-harness/README.md`](https://github.com/merchantlee99/vibebuilder/blob/main/vb-pack-claude-harness/README.md) (Claude README), [`vb-pack-claude-harness/scripts/harness`](https://github.com/merchantlee99/vibebuilder/tree/main/vb-pack-claude-harness/scripts/harness) (Harness scripts), [`vb-pack-codex-harness/scripts/harness`](https://github.com/merchantlee99/vibebuilder/tree/main/vb-pack-codex-harness/scripts/harness) (Harness scripts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_registry["Registry"]
  node_repo_readme["README<br/>registry doc<br/>[README.md]"]
end

subgraph group_claude_pack["Claude pack"]
  node_claude_readme["Claude README<br/>pack guide<br/>[README.md]"]
  node_claude_hooks["Hook plane<br/>control plane<br/>[hooks]"]
  node_claude_manifests["Manifests<br/>policy config<br/>[manifests]"]
  node_claude_prompts["Sealed prompts<br/>prompt assets<br/>[sealed-prompts]"]
  node_claude_skills["Manual skills<br/>workflow library<br/>[_manual]"]
  node_claude_scripts["Harness scripts<br/>enforcement/runtime"]
  node_claude_templates["Templates"]
  node_claude_tests["Harness tests<br/>self-checks<br/>[test_harness.py]"]
end

subgraph group_codex_pack["Codex pack"]
  node_codex_readme["Codex README<br/>pack guide<br/>[README.md]"]
  node_codex_hooks["Hook adapter<br/>control plane<br/>[hooks]"]
  node_codex_manifests["Manifests<br/>policy config<br/>[manifests]"]
  node_codex_playbooks["Playbooks<br/>operational runbooks<br/>[playbooks]"]
  node_codex_runtime["Runtime state<br/>state config<br/>[runtime.json]"]
  node_codex_telemetry["Telemetry<br/>observability<br/>[telemetry]"]
  node_codex_scripts["Harness scripts<br/>enforcement/runtime"]
  node_codex_templates["Templates"]
  node_codex_tests["Harness tests<br/>self-checks<br/>[test_harness.py]"]
end

node_repo_readme -->|"introduces"| node_claude_readme
node_repo_readme -->|"introduces"| node_codex_readme
node_claude_readme -->|"uses"| node_claude_hooks
node_claude_readme -->|"uses"| node_claude_manifests
node_claude_readme -->|"uses"| node_claude_prompts
node_claude_readme -->|"uses"| node_claude_skills
node_claude_readme -->|"runs"| node_claude_scripts
node_claude_readme -->|"produces"| node_claude_templates
node_claude_readme -->|"verifies"| node_claude_tests
node_claude_hooks -->|"consults"| node_claude_manifests
node_claude_scripts -.->|"supports"| node_claude_prompts
node_claude_scripts -.->|"emits"| node_claude_templates
node_codex_readme -->|"uses"| node_codex_hooks
node_codex_readme -->|"uses"| node_codex_manifests
node_codex_readme -->|"uses"| node_codex_playbooks
node_codex_readme -->|"uses"| node_codex_runtime
node_codex_readme -->|"observes"| node_codex_telemetry
node_codex_readme -->|"runs"| node_codex_scripts
node_codex_readme -->|"produces"| node_codex_templates
node_codex_readme -->|"verifies"| node_codex_tests
node_codex_hooks -->|"consults"| node_codex_manifests
node_codex_scripts -.->|"updates"| node_codex_runtime
node_codex_scripts -.->|"records"| node_codex_telemetry

click node_repo_readme "https://github.com/merchantlee99/vibebuilder/blob/main/README.md"
click node_claude_readme "https://github.com/merchantlee99/vibebuilder/blob/main/vb-pack-claude-harness/README.md"
click node_codex_readme "https://github.com/merchantlee99/vibebuilder/blob/main/vb-pack-codex-harness/README.md"
click node_claude_hooks "https://github.com/merchantlee99/vibebuilder/blob/main/vb-pack-claude-harness/.claude/hooks"
click node_claude_manifests "https://github.com/merchantlee99/vibebuilder/blob/main/vb-pack-claude-harness/.claude/manifests"
click node_claude_prompts "https://github.com/merchantlee99/vibebuilder/blob/main/vb-pack-claude-harness/.claude/sealed-prompts"
click node_claude_skills "https://github.com/merchantlee99/vibebuilder/blob/main/vb-pack-claude-harness/.claude/skills/_manual"
click node_claude_scripts "https://github.com/merchantlee99/vibebuilder/tree/main/vb-pack-claude-harness/scripts/harness"
click node_claude_templates "https://github.com/merchantlee99/vibebuilder/tree/main/vb-pack-claude-harness/templates"
click node_claude_tests "https://github.com/merchantlee99/vibebuilder/blob/main/vb-pack-claude-harness/tests/test_harness.py"
click node_codex_hooks "https://github.com/merchantlee99/vibebuilder/blob/main/vb-pack-codex-harness/.codex/hooks"
click node_codex_manifests "https://github.com/merchantlee99/vibebuilder/blob/main/vb-pack-codex-harness/.codex/manifests"
click node_codex_playbooks "https://github.com/merchantlee99/vibebuilder/blob/main/vb-pack-codex-harness/.codex/playbooks"
click node_codex_runtime "https://github.com/merchantlee99/vibebuilder/blob/main/vb-pack-codex-harness/.codex/runtime.json"
click node_codex_telemetry "https://github.com/merchantlee99/vibebuilder/blob/main/vb-pack-codex-harness/.codex/telemetry"
click node_codex_scripts "https://github.com/merchantlee99/vibebuilder/tree/main/vb-pack-codex-harness/scripts/harness"
click node_codex_templates "https://github.com/merchantlee99/vibebuilder/tree/main/vb-pack-codex-harness/templates"
click node_codex_tests "https://github.com/merchantlee99/vibebuilder/blob/main/vb-pack-codex-harness/tests/test_harness.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_repo_readme toneBlue
class node_claude_readme,node_claude_hooks,node_claude_manifests,node_claude_prompts,node_claude_skills,node_claude_scripts,node_claude_templates,node_claude_tests toneAmber
class node_codex_readme,node_codex_hooks,node_codex_manifests,node_codex_playbooks,node_codex_runtime,node_codex_telemetry,node_codex_scripts,node_codex_templates,node_codex_tests toneMint
```

## Components

### Registry

Top-level repository framing the two harness packs

- [README](https://github.com/merchantlee99/vibebuilder/blob/main/README.md): registry doc · Repository overview and pack selection guidance · `README.md`

### Claude pack

Hook-driven harness for Claude Code

- [Claude README](https://github.com/merchantlee99/vibebuilder/blob/main/vb-pack-claude-harness/README.md): pack guide · Entry point for the Claude harness · `vb-pack-claude-harness/README.md`
- [Hook plane](https://github.com/merchantlee99/vibebuilder/blob/main/vb-pack-claude-harness/.claude/hooks): control plane · Lifecycle and tool-use interception for Claude · `vb-pack-claude-harness/.claude/hooks`
- [Manifests](https://github.com/merchantlee99/vibebuilder/blob/main/vb-pack-claude-harness/.claude/manifests): policy config · Automation, routing, and subagent policy for Claude · `vb-pack-claude-harness/.claude/manifests`
- [Sealed prompts](https://github.com/merchantlee99/vibebuilder/blob/main/vb-pack-claude-harness/.claude/sealed-prompts): prompt assets · Locked prompts for planning, review, verification, and audits · `vb-pack-claude-harness/.claude/sealed-prompts`
- [Manual skills](https://github.com/merchantlee99/vibebuilder/blob/main/vb-pack-claude-harness/.claude/skills/_manual): workflow library · Reusable human-facing workflows for Claude sessions · `vb-pack-claude-harness/.claude/skills/_manual`
- [Harness scripts](https://github.com/merchantlee99/vibebuilder/tree/main/vb-pack-claude-harness/scripts/harness): enforcement/runtime · Logging, policy, planning, and learning utilities · `vb-pack-claude-harness/scripts/harness`
- [Templates](https://github.com/merchantlee99/vibebuilder/tree/main/vb-pack-claude-harness/templates): artifact templates · Structured documents produced and consumed by the harness · `vb-pack-claude-harness/templates`
- [Harness tests](https://github.com/merchantlee99/vibebuilder/blob/main/vb-pack-claude-harness/tests/test_harness.py): self-checks · Validation for the Claude harness itself · `vb-pack-claude-harness/tests/test_harness.py`

### Codex pack

Mode- and subagent-driven harness for Codex

- [Codex README](https://github.com/merchantlee99/vibebuilder/blob/main/vb-pack-codex-harness/README.md): pack guide · Entry point for the Codex harness · `vb-pack-codex-harness/README.md`
- [Hook adapter](https://github.com/merchantlee99/vibebuilder/blob/main/vb-pack-codex-harness/.codex/hooks): control plane · Hook surface and adapter for Codex runtime events · `vb-pack-codex-harness/.codex/hooks`
- [Manifests](https://github.com/merchantlee99/vibebuilder/blob/main/vb-pack-codex-harness/.codex/manifests): policy config · Automation, routing, mode, and review policy for Codex · `vb-pack-codex-harness/.codex/manifests`
- [Playbooks](https://github.com/merchantlee99/vibebuilder/blob/main/vb-pack-codex-harness/.codex/playbooks): operational runbooks · Mode, browser, computer-use, git, and subagent workflows · `vb-pack-codex-harness/.codex/playbooks`
- [Runtime state](https://github.com/merchantlee99/vibebuilder/blob/main/vb-pack-codex-harness/.codex/runtime.json): state config · Explicit runtime and context state for Codex · `vb-pack-codex-harness/.codex/runtime.json`
- [Telemetry](https://github.com/merchantlee99/vibebuilder/blob/main/vb-pack-codex-harness/.codex/telemetry): observability · Runtime observation and audit support · `vb-pack-codex-harness/.codex/telemetry`
- [Harness scripts](https://github.com/merchantlee99/vibebuilder/tree/main/vb-pack-codex-harness/scripts/harness): enforcement/runtime · State bridging, validation, gating, and workspace orchestration · `vb-pack-codex-harness/scripts/harness`
- [Templates](https://github.com/merchantlee99/vibebuilder/tree/main/vb-pack-codex-harness/templates): artifact templates · Structured documents produced and consumed by the harness · `vb-pack-codex-harness/templates`
- [Harness tests](https://github.com/merchantlee99/vibebuilder/blob/main/vb-pack-codex-harness/tests/test_harness.py): self-checks · Validation for the Codex harness itself · `vb-pack-codex-harness/tests/test_harness.py`

## Connections

- README → Claude README: introduces · Top-level registry points to the Claude pack
- README → Codex README: introduces · Top-level registry points to the Codex pack
- Claude README → Hook plane: uses · Claude runtime is governed by hook interception
- Claude README → Manifests: uses · Claude runtime consumes policy manifests
- Claude README → Sealed prompts: uses · Claude workflows are shaped by sealed prompts
- Claude README → Manual skills: uses · Claude workflows reference reusable manual skills
- Claude README → Harness scripts: runs · Claude pack delegates enforcement and learning to scripts
- Claude README → Templates: produces · Claude sessions emit structured artifacts from templates
- Claude README → Harness tests: verifies · Claude harness is validated by its own tests
- Hook plane → Manifests: consults · Hooks enforce policy defined in manifests
- Harness scripts → Sealed prompts: supports · Scripts operationalize prompt-driven workflows
- Harness scripts → Templates: emits · Scripts generate or consume template artifacts
- Codex README → Hook adapter: uses · Codex runtime enters through hooks and adapter logic
- Codex README → Manifests: uses · Codex runtime consumes broader policy manifests
- Codex README → Playbooks: uses · Codex runtime is organized by operational playbooks
- Codex README → Runtime state: uses · Codex pack keeps explicit runtime state
- Codex README → Telemetry: observes · Codex pack records telemetry and audit traces
- Codex README → Harness scripts: runs · Codex pack delegates orchestration and enforcement to scripts
- Codex README → Templates: produces · Codex sessions emit structured artifacts from templates
- Codex README → Harness tests: verifies · Codex harness is validated by its own tests
- Hook adapter → Manifests: consults · Hook adapter resolves policy and routing from manifests
- Harness scripts → Runtime state: updates · Scripts bridge events into persistent runtime state
- Harness scripts → Telemetry: records · Scripts feed telemetry and audit outputs
