# guen-efanunji/loom architecture

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

- Interactive diagram: https://gitdiagram.com/guen-efanunji/loom
- Repository: https://github.com/guen-efanunji/loom

## Overview

Loom is a local-first workspace for planning coding tasks, running agents concurrently in isolated Git worktrees, and reviewing changes before merge. The main flow is user goal → plan and validation → dependency-aware dispatch → task workspaces and agent execution → integration checks and human-approved merge. The graph also preserves chat, design-canvas, context, walkthrough, MCP, and project capabilities documented in the README. Some server internals were not sampled; those subsystems are represented at their known module paths, and links are limited to documented or indexed relationships.

Main entry points: [`apps/web/src/routes/+page.svelte`](https://github.com/guen-efanunji/loom/blob/main/apps/web/src/routes/%2Bpage.svelte) (Browser workspace), [`packages/orchestrator/src/index.ts`](https://github.com/guen-efanunji/loom/blob/main/packages/orchestrator/src/index.ts) (Task orchestration), [`apps/server/src/index.ts`](https://github.com/guen-efanunji/loom/blob/main/apps/server/src/index.ts) (Local daemon and API), [`packages/orchestrator/src/automation.ts`](https://github.com/guen-efanunji/loom/blob/main/packages/orchestrator/src/automation.ts) (Plan generation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Workspace experience"]
  node_web["Browser workspace<br/>[+page.svelte]"]
  node_chat["Chat sessions<br/>[chat.ts]"]
  node_context["Context Hub<br/>[context-hub.ts]"]
  node_walkthrough["Change walkthrough<br/>[walkthrough.ts]"]
  node_projects["Projects and files<br/>[projects.ts]"]
end

subgraph group_planning["Planning and design"]
  node_planning["Plan generation<br/>[automation.ts]"]
  node_planengine["Plan and validation<br/>[planner.ts]"]
  node_design["Design canvas<br/>[design.ts]"]
end

subgraph group_execution["Task execution"]
  node_orchestrator["Task orchestration<br/>[index.ts]"]
  node_scheduler["Ready-task scheduler<br/>[scheduler.ts]"]
  node_worktrees["Git worktrees<br/>[index.ts]"]
  node_integration["Review and integration<br/>[automation.ts]"]
end

subgraph group_runtime["Agent runtime"]
  node_providers["Provider management<br/>[manager.ts]"]
  node_provideradapters["CLI provider adapters<br/>[cli.ts]"]
  node_opencode["OpenCode runtime<br/>[index.ts]"]
  node_mcp["MCP connections<br/>[mcp-manager.ts]"]
end

subgraph group_local["Local services and state"]
  node_daemon["Local daemon and API<br/>[index.ts]"]
  node_database[("Local SQLite state<br/>[workflow.ts]")]
  node_cli["Loom CLI<br/>[index.ts]"]
end

node_user(("Developer"))
node_externalprovider{{"Selected model provider"}}

node_user -->|"describes work"| node_web
node_web -->|"uses local UI"| node_daemon
node_daemon -->|"persists local state"| node_database
node_daemon -->|"routes task workflow"| node_orchestrator
node_orchestrator -->|"starts planning"| node_planning
node_planning -->|"builds and validates"| node_planengine
node_planning -->|"stores plans"| node_database
node_user -->|"reviews plan"| node_planning
node_orchestrator -->|"dispatches ready tasks"| node_scheduler
node_scheduler -->|"prepares task workspace"| node_worktrees
node_orchestrator -->|"uses isolated worktrees"| node_worktrees
node_orchestrator -->|"prompts agent runtime"| node_providers
node_providers -->|"selects adapter"| node_provideradapters
node_providers -->|"sends selected request"| node_externalprovider
node_orchestrator -->|"records task state"| node_database
node_user -->|"reviews before merge"| node_integration
node_integration -->|"integrates task branches"| node_worktrees
node_web -->|"starts conversations"| node_chat
node_chat -.->|"uses project knowledge"| node_context
node_web -->|"opens design canvas"| node_design
node_daemon -->|"serves MCP management"| node_mcp
node_web -.->|"requests walkthrough"| node_walkthrough
node_web -.->|"manages projects"| node_projects
node_cli -->|"starts daemon"| node_daemon
node_opencode -.->|"provides primary runtime"| node_providers

click node_web "https://github.com/guen-efanunji/loom/blob/main/apps/web/src/routes/%2Bpage.svelte"
click node_chat "https://github.com/guen-efanunji/loom/blob/main/apps/server/src/chat.ts"
click node_context "https://github.com/guen-efanunji/loom/blob/main/apps/server/src/context-hub.ts"
click node_walkthrough "https://github.com/guen-efanunji/loom/blob/main/apps/server/src/walkthrough.ts"
click node_projects "https://github.com/guen-efanunji/loom/blob/main/apps/server/src/projects.ts"
click node_planning "https://github.com/guen-efanunji/loom/blob/main/packages/orchestrator/src/automation.ts"
click node_planengine "https://github.com/guen-efanunji/loom/blob/main/packages/automation/src/planner.ts"
click node_design "https://github.com/guen-efanunji/loom/blob/main/packages/orchestrator/src/design.ts"
click node_orchestrator "https://github.com/guen-efanunji/loom/blob/main/packages/orchestrator/src/index.ts"
click node_scheduler "https://github.com/guen-efanunji/loom/blob/main/packages/orchestrator/src/scheduler.ts"
click node_worktrees "https://github.com/guen-efanunji/loom/blob/main/packages/worktree/src/index.ts"
click node_integration "https://github.com/guen-efanunji/loom/blob/main/packages/orchestrator/src/automation.ts"
click node_providers "https://github.com/guen-efanunji/loom/blob/main/packages/providers/src/core/manager.ts"
click node_provideradapters "https://github.com/guen-efanunji/loom/blob/main/packages/providers/src/adapters/cli.ts"
click node_opencode "https://github.com/guen-efanunji/loom/blob/main/packages/opencode/src/index.ts"
click node_mcp "https://github.com/guen-efanunji/loom/blob/main/apps/server/src/mcp-manager.ts"
click node_daemon "https://github.com/guen-efanunji/loom/blob/main/apps/server/src/index.ts"
click node_database "https://github.com/guen-efanunji/loom/blob/main/packages/db/src/schema/workflow.ts"
click node_cli "https://github.com/guen-efanunji/loom/blob/main/apps/cli/src/index.ts"

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_web,node_chat,node_context,node_walkthrough,node_projects toneBlue
class node_planning,node_planengine,node_design toneAmber
class node_orchestrator,node_scheduler,node_worktrees,node_integration toneMint
class node_providers,node_provideradapters,node_opencode,node_mcp toneRose
class node_daemon,node_database,node_cli,node_user,node_externalprovider toneIndigo
```

## Components

### Workspace experience

- [Browser workspace](https://github.com/guen-efanunji/loom/blob/main/apps/web/src/routes/%2Bpage.svelte): `apps/web/src/routes/+page.svelte`
- [Chat sessions](https://github.com/guen-efanunji/loom/blob/main/apps/server/src/chat.ts): `apps/server/src/chat.ts`
- [Context Hub](https://github.com/guen-efanunji/loom/blob/main/apps/server/src/context-hub.ts): `apps/server/src/context-hub.ts`
- [Change walkthrough](https://github.com/guen-efanunji/loom/blob/main/apps/server/src/walkthrough.ts): `apps/server/src/walkthrough.ts`
- [Projects and files](https://github.com/guen-efanunji/loom/blob/main/apps/server/src/projects.ts): `apps/server/src/projects.ts`

### Planning and design

- [Plan generation](https://github.com/guen-efanunji/loom/blob/main/packages/orchestrator/src/automation.ts): `packages/orchestrator/src/automation.ts`
- [Plan and validation](https://github.com/guen-efanunji/loom/blob/main/packages/automation/src/planner.ts): `packages/automation/src/planner.ts`
- [Design canvas](https://github.com/guen-efanunji/loom/blob/main/packages/orchestrator/src/design.ts): `packages/orchestrator/src/design.ts`

### Task execution

- [Task orchestration](https://github.com/guen-efanunji/loom/blob/main/packages/orchestrator/src/index.ts): `packages/orchestrator/src/index.ts`
- [Ready-task scheduler](https://github.com/guen-efanunji/loom/blob/main/packages/orchestrator/src/scheduler.ts): `packages/orchestrator/src/scheduler.ts`
- [Git worktrees](https://github.com/guen-efanunji/loom/blob/main/packages/worktree/src/index.ts): `packages/worktree/src/index.ts`
- [Review and integration](https://github.com/guen-efanunji/loom/blob/main/packages/orchestrator/src/automation.ts): `packages/orchestrator/src/automation.ts`

### Agent runtime

- [Provider management](https://github.com/guen-efanunji/loom/blob/main/packages/providers/src/core/manager.ts): `packages/providers/src/core/manager.ts`
- [CLI provider adapters](https://github.com/guen-efanunji/loom/blob/main/packages/providers/src/adapters/cli.ts): `packages/providers/src/adapters/cli.ts`
- [OpenCode runtime](https://github.com/guen-efanunji/loom/blob/main/packages/opencode/src/index.ts): `packages/opencode/src/index.ts`
- [MCP connections](https://github.com/guen-efanunji/loom/blob/main/apps/server/src/mcp-manager.ts): `apps/server/src/mcp-manager.ts`

### Local services and state

- [Local daemon and API](https://github.com/guen-efanunji/loom/blob/main/apps/server/src/index.ts): `apps/server/src/index.ts`
- [Local SQLite state](https://github.com/guen-efanunji/loom/blob/main/packages/db/src/schema/workflow.ts): `packages/db/src/schema/workflow.ts`
- [Loom CLI](https://github.com/guen-efanunji/loom/blob/main/apps/cli/src/index.ts): `apps/cli/src/index.ts`

### Other components

- **Developer**
- **Selected model provider**

## Connections

- Developer → Browser workspace: describes work (evidence: `README.md`)
- Browser workspace → Local daemon and API: uses local UI (evidence: `README.md`)
- Local daemon and API → Local SQLite state: persists local state (evidence: `README.md`)
- Local daemon and API → Task orchestration: routes task workflow (evidence: `apps/server/src/index.ts`)
- Task orchestration → Plan generation: starts planning (evidence: `packages/orchestrator/src/index.ts`)
- Plan generation → Plan and validation: builds and validates (evidence: `packages/orchestrator/src/automation.ts`)
- Plan generation → Local SQLite state: stores plans (evidence: `packages/orchestrator/src/automation.ts`)
- Developer → Plan generation: reviews plan (evidence: `README.md`)
- Task orchestration → Ready-task scheduler: dispatches ready tasks (evidence: `packages/orchestrator/src/index.ts`)
- Ready-task scheduler → Git worktrees: prepares task workspace (evidence: `README.md`)
- Task orchestration → Git worktrees: uses isolated worktrees (evidence: `README.md`)
- Task orchestration → Provider management: prompts agent runtime (evidence: `packages/orchestrator/src/index.ts`)
- Provider management → CLI provider adapters: selects adapter (evidence: `packages/providers/src/core/manager.ts`)
- Provider management → Selected model provider: sends selected request (evidence: `README.md`)
- Task orchestration → Local SQLite state: records task state
- Developer → Review and integration: reviews before merge (evidence: `README.md`)
- Review and integration → Git worktrees: integrates task branches (evidence: `README.md`)
- Browser workspace → Chat sessions: starts conversations (evidence: `README.md`)
- Chat sessions → Context Hub: uses project knowledge
- Browser workspace → Design canvas: opens design canvas (evidence: `README.md`)
- Local daemon and API → MCP connections: serves MCP management (evidence: `apps/server/src/index.ts`)
- Browser workspace → Change walkthrough: requests walkthrough
- Browser workspace → Projects and files: manages projects
- Loom CLI → Local daemon and API: starts daemon (evidence: `apps/cli/src/index.ts`)
- OpenCode runtime → Provider management: provides primary runtime
