# agiflow/doompi architecture

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

- Interactive diagram: https://gitdiagram.com/agiflow/doompi
- Repository: https://github.com/agiflow/doompi

## Overview

DoomPi is a composable distribution of the Pi coding agent: users choose modes, domains and optionally profiles, then launch a session with only the selected tools and skills. The CLI resolves that composition and prepares the runtime; the active session then exposes domain capabilities such as tasks, Git worktrees, sandboxing, voice and structured feedback. The graph also preserves major README capabilities whose runtime wiring is not shown in the sampled sources. Dashed, uncited links indicate unverified integration; source excerpts are limited, so these do not assert specific calls.

Main entry points: [`packages/cli/doompi/src/builders/cli/composition.ts`](https://github.com/agiflow/doompi/blob/main/packages/cli/doompi/src/builders/cli/composition.ts) (Composition resolver), [`packages/clients/doompi-web/src/web`](https://github.com/agiflow/doompi/tree/main/packages/clients/doompi-web/src/web) (Web cockpit), [`packages/foundations/doompi-config/src`](https://github.com/agiflow/doompi/tree/main/packages/foundations/doompi-config/src) (Doom config), [`packages/cli/doompi/src/cli/router.ts`](https://github.com/agiflow/doompi/blob/main/packages/cli/doompi/src/cli/router.ts) (CLI launcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_composition["Session composition"]
  node_config["Doom config"]
  node_domains["Domains"]
  node_profiles["Profiles"]
  node_cli["CLI launcher<br/>[router.ts]"]
  node_composition_engine["Composition resolver<br/>[composition.ts]"]
  node_harness["Harness context<br/>[harnessContext.ts]"]
end

subgraph group_runtime["Agent runtime"]
  node_pi["Pi agent session"]
  node_core["Core session services"]
end

subgraph group_work["Work capabilities"]
  node_tasks["Persistent tasks"]
  node_git["Git worktrees"]
  node_sandbox["Sandbox execution"]
  node_workflow["Workflow automation"]
end

subgraph group_context["Context and access"]
  node_guidance["Model guidance"]
  node_mcp["MCP access"]
end

subgraph group_interfaces["User interfaces"]
  node_feedback["Structured feedback"]
  node_voice["Voice mode"]
  node_web["Web cockpit"]
  node_style["Story preview"]
end

node_user(("Engineer"))

node_user -->|"selects composition"| node_config
node_config -.->|"configures"| node_composition_engine
node_composition_engine -.->|"prepares session"| node_harness
node_harness -.->|"starts with resources"| node_pi
node_user -->|"launches"| node_cli
node_cli -.->|"composes session"| node_composition_engine
node_domains -.->|"adds selected tools"| node_pi
node_profiles -.->|"supplies persona"| node_pi
node_pi -.->|"uses session services"| node_core
node_pi -.->|"uses persistent tasks"| node_tasks
node_pi -.->|"uses worktrees"| node_git
node_pi -.->|"uses sandbox"| node_sandbox
node_pi -.->|"dispatches workflows"| node_workflow
node_pi -.->|"loads guidance"| node_guidance
node_pi -.->|"uses scoped MCP"| node_mcp
node_pi -.->|"asks questions"| node_feedback
node_pi -.->|"supports voice"| node_voice
node_user -.->|"operates cockpit"| node_web
node_web -.->|"accesses session APIs"| node_core
node_style -.->|"offers story preview"| node_web

click node_config "https://github.com/agiflow/doompi/tree/main/packages/foundations/doompi-config/src"
click node_domains "https://github.com/agiflow/doompi/tree/main/packages"
click node_profiles "https://github.com/agiflow/doompi/tree/main/packages/foundations/doompi-config/src"
click node_cli "https://github.com/agiflow/doompi/blob/main/packages/cli/doompi/src/cli/router.ts"
click node_composition_engine "https://github.com/agiflow/doompi/blob/main/packages/cli/doompi/src/builders/cli/composition.ts"
click node_harness "https://github.com/agiflow/doompi/blob/main/packages/cli/doompi/src/builders/cli/harnessContext.ts"
click node_core "https://github.com/agiflow/doompi/tree/main/packages/core/doompi-core/src"
click node_tasks "https://github.com/agiflow/doompi/tree/main/layers/task/doompi-task/src"
click node_git "https://github.com/agiflow/doompi/tree/main/layers/source-control/doompi-git/src"
click node_sandbox "https://github.com/agiflow/doompi/tree/main/layers/sandbox/doompi-sandbox/src"
click node_workflow "https://github.com/agiflow/doompi/tree/main/packages/minor/doompi-workflow/src"
click node_guidance "https://github.com/agiflow/doompi/tree/main/layers/llm/doompi-model-guidance/src"
click node_mcp "https://github.com/agiflow/doompi/tree/main/packages/default/doompi-mcp/src"
click node_feedback "https://github.com/agiflow/doompi/tree/main/layers/ask-user/doompi-user-feedback/src"
click node_voice "https://github.com/agiflow/doompi/tree/main/packages/minor/doompi-voice/src"
click node_web "https://github.com/agiflow/doompi/tree/main/packages/clients/doompi-web/src/web"
click node_style "https://github.com/agiflow/doompi/tree/main/layers/design/doompi-style-system/src"

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_config,node_domains,node_profiles,node_cli,node_composition_engine,node_harness toneBlue
class node_pi,node_core toneAmber
class node_tasks,node_git,node_sandbox,node_workflow toneMint
class node_guidance,node_mcp toneRose
class node_feedback,node_voice,node_web,node_style,node_user toneIndigo
```

## Components

### Session composition

- [Doom config](https://github.com/agiflow/doompi/tree/main/packages/foundations/doompi-config/src): `packages/foundations/doompi-config/src`
- [Domains](https://github.com/agiflow/doompi/tree/main/packages): `packages`
- [Profiles](https://github.com/agiflow/doompi/tree/main/packages/foundations/doompi-config/src): `packages/foundations/doompi-config/src`
- [CLI launcher](https://github.com/agiflow/doompi/blob/main/packages/cli/doompi/src/cli/router.ts): `packages/cli/doompi/src/cli/router.ts`
- [Composition resolver](https://github.com/agiflow/doompi/blob/main/packages/cli/doompi/src/builders/cli/composition.ts): `packages/cli/doompi/src/builders/cli/composition.ts`
- [Harness context](https://github.com/agiflow/doompi/blob/main/packages/cli/doompi/src/builders/cli/harnessContext.ts): `packages/cli/doompi/src/builders/cli/harnessContext.ts`

### Agent runtime

- **Pi agent session**
- [Core session services](https://github.com/agiflow/doompi/tree/main/packages/core/doompi-core/src): `packages/core/doompi-core/src`

### Work capabilities

- [Persistent tasks](https://github.com/agiflow/doompi/tree/main/layers/task/doompi-task/src): `layers/task/doompi-task/src`
- [Git worktrees](https://github.com/agiflow/doompi/tree/main/layers/source-control/doompi-git/src): `layers/source-control/doompi-git/src`
- [Sandbox execution](https://github.com/agiflow/doompi/tree/main/layers/sandbox/doompi-sandbox/src): `layers/sandbox/doompi-sandbox/src`
- [Workflow automation](https://github.com/agiflow/doompi/tree/main/packages/minor/doompi-workflow/src): `packages/minor/doompi-workflow/src`

### Context and access

- [Model guidance](https://github.com/agiflow/doompi/tree/main/layers/llm/doompi-model-guidance/src): `layers/llm/doompi-model-guidance/src`
- [MCP access](https://github.com/agiflow/doompi/tree/main/packages/default/doompi-mcp/src): `packages/default/doompi-mcp/src`

### User interfaces

- [Structured feedback](https://github.com/agiflow/doompi/tree/main/layers/ask-user/doompi-user-feedback/src): `layers/ask-user/doompi-user-feedback/src`
- [Voice mode](https://github.com/agiflow/doompi/tree/main/packages/minor/doompi-voice/src): `packages/minor/doompi-voice/src`
- [Web cockpit](https://github.com/agiflow/doompi/tree/main/packages/clients/doompi-web/src/web): `packages/clients/doompi-web/src/web`
- [Story preview](https://github.com/agiflow/doompi/tree/main/layers/design/doompi-style-system/src): `layers/design/doompi-style-system/src`

### Other components

- **Engineer**

## Connections

- Engineer → Doom config: selects composition (evidence: `README.md`)
- Doom config → Composition resolver: configures
- Composition resolver → Harness context: prepares session (evidence: `packages/cli/doompi/src/builders/cli/composition.ts`)
- Harness context → Pi agent session: starts with resources
- Engineer → CLI launcher: launches (evidence: `README.md`)
- CLI launcher → Composition resolver: composes session
- Domains → Pi agent session: adds selected tools
- Profiles → Pi agent session: supplies persona
- Pi agent session → Core session services: uses session services
- Pi agent session → Persistent tasks: uses persistent tasks
- Pi agent session → Git worktrees: uses worktrees
- Pi agent session → Sandbox execution: uses sandbox
- Pi agent session → Workflow automation: dispatches workflows
- Pi agent session → Model guidance: loads guidance
- Pi agent session → MCP access: uses scoped MCP
- Pi agent session → Structured feedback: asks questions
- Pi agent session → Voice mode: supports voice
- Engineer → Web cockpit: operates cockpit
- Web cockpit → Core session services: accesses session APIs
- Story preview → Web cockpit: offers story preview
