# drdobbymazz/office architecture

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

- Interactive diagram: https://gitdiagram.com/drdobbymazz/office
- Repository: https://github.com/drdobbymazz/office

## Overview

Munder Difflin is an Electron desktop harness that turns Claude Code PTY sessions into a coordinated, visible agent team. The main workflow is user input to the GOD agent, hive routing to worker agents, and live terminal/avatar feedback, with memory and approvals supporting coordination. The README documents additional task, schedule, GitHub, CI, Git, and chat capabilities. Sampled excerpts confirm key renderer, preload, and main-process bridges; unsampled subsystem wiring is shown only where the README or tree supports it.

Main entry points: [`src/main/index.ts`](https://github.com/drdobbymazz/office/blob/main/src/main/index.ts) (Main IPC process), [`src/preload/index.ts`](https://github.com/drdobbymazz/office/blob/main/src/preload/index.ts) (IPC bridge), [`src/renderer/src/components`](https://github.com/drdobbymazz/office/tree/main/src/renderer/src/components) (Agent panels), [`src/main/hive.ts`](https://github.com/drdobbymazz/office/blob/main/src/main/hive.ts) (Hive manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Desktop experience"]
  node_app["App shell<br/>[App.tsx]"]
  node_panels["Agent panels"]
  node_office["Office floor<br/>[OfficeFloor.tsx]"]
  node_frontend_state["UI state<br/>[store.ts]"]
  node_preload["IPC bridge<br/>[index.ts]"]
end

subgraph group_coordination["Agent coordination"]
  node_hive_hook["Hive controller<br/>[useHive.ts]"]
  node_director["Game director<br/>[useDirector.ts]"]
  node_hive_manager["Hive manager<br/>[hive.ts]"]
  node_hook_server["Agent hooks<br/>[hooks.ts]"]
  node_memory_manager["Memory layer<br/>[memory.ts]"]
  node_scheduler["Mission scheduler<br/>[index.ts]"]
  node_tasks["Task board<br/>[TasksKanban.tsx]"]
end

subgraph group_runtime["Agent runtime"]
  node_main_process["Main IPC process<br/>[index.ts]"]
  node_pty["PTY sessions<br/>[pty.ts]"]
  node_git["Git operations<br/>[git.ts]"]
  node_filesystem["File access<br/>[fs.ts]"]
  node_transcripts["Usage telemetry<br/>[transcript.ts]"]
  node_config[("Harness settings<br/>[config.ts]")]
  node_hive_files[("Hive files<br/>[hive.ts]")]
  node_memory_store[("Memory index<br/>[memory.ts]")]
end

subgraph group_integrations["External services"]
  node_claude["Claude CLI"]
  node_ollama["Ollama"]
  node_slack["Slack"]
  node_github["GitHub CLI"]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_office
node_app -->|"starts game mode"| node_director
node_panels -->|"reads and updates"| node_frontend_state
node_hive_hook -->|"updates agent state"| node_frontend_state
node_hive_hook -->|"spawns and exchanges events"| node_preload
node_app -->|"loads configuration"| node_preload
node_preload -->|"invokes IPC"| node_main_process
node_main_process -->|"manages sessions"| node_pty
node_pty -->|"runs command"| node_claude
node_pty -->|"streams terminal data"| node_preload
node_main_process -->|"coordinates agents"| node_hive_manager
node_main_process -->|"starts hooks"| node_hook_server
node_hook_server -->|"handles agent events"| node_hive_manager
node_hive_manager -->|"reads and writes"| node_hive_files
node_hive_hook -->|"receives hive events"| node_preload
node_hive_manager -->|"provides agent memory"| node_memory_manager
node_memory_manager -->|"indexes and recalls"| node_memory_store
node_panels -->|"requests memory and approvals"| node_preload
node_tasks -->|"reads and updates tasks"| node_preload
node_scheduler -->|"loads missions"| node_config
node_scheduler -->|"dispatches missions"| node_hive_manager
node_main_process -->|"reads and writes settings"| node_config
node_panels -->|"requests repository views"| node_git
node_panels -->|"browses and edits files"| node_filesystem
node_panels -->|"requests usage data"| node_transcripts
node_main_process -->|"reads session usage"| node_transcripts
node_director -->|"checks local model"| node_preload
node_preload -->|"queries model service"| node_ollama
node_hive_hook -.->|"receives messages"| node_slack
node_main_process -.->|"starts webhook server"| node_slack
node_main_process -.->|"ingests issues and CI status"| node_github

click node_app "https://github.com/drdobbymazz/office/blob/main/src/renderer/src/App.tsx"
click node_panels "https://github.com/drdobbymazz/office/tree/main/src/renderer/src/components"
click node_office "https://github.com/drdobbymazz/office/blob/main/src/renderer/src/scene/office/OfficeFloor.tsx"
click node_frontend_state "https://github.com/drdobbymazz/office/blob/main/src/renderer/src/store/store.ts"
click node_preload "https://github.com/drdobbymazz/office/blob/main/src/preload/index.ts"
click node_hive_hook "https://github.com/drdobbymazz/office/blob/main/src/renderer/src/hooks/useHive.ts"
click node_director "https://github.com/drdobbymazz/office/blob/main/src/renderer/src/game/useDirector.ts"
click node_hive_manager "https://github.com/drdobbymazz/office/blob/main/src/main/hive.ts"
click node_hook_server "https://github.com/drdobbymazz/office/blob/main/src/main/hooks.ts"
click node_memory_manager "https://github.com/drdobbymazz/office/blob/main/src/main/memory.ts"
click node_scheduler "https://github.com/drdobbymazz/office/blob/main/src/main/index.ts"
click node_tasks "https://github.com/drdobbymazz/office/blob/main/src/renderer/src/components/TasksKanban.tsx"
click node_main_process "https://github.com/drdobbymazz/office/blob/main/src/main/index.ts"
click node_pty "https://github.com/drdobbymazz/office/blob/main/src/main/pty.ts"
click node_git "https://github.com/drdobbymazz/office/blob/main/src/main/git.ts"
click node_filesystem "https://github.com/drdobbymazz/office/blob/main/src/main/fs.ts"
click node_transcripts "https://github.com/drdobbymazz/office/blob/main/src/main/transcript.ts"
click node_config "https://github.com/drdobbymazz/office/blob/main/src/main/config.ts"
click node_hive_files "https://github.com/drdobbymazz/office/blob/main/src/main/hive.ts"
click node_memory_store "https://github.com/drdobbymazz/office/blob/main/src/main/memory.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_app,node_panels,node_office,node_frontend_state,node_preload,node_user toneBlue
class node_hive_hook,node_director,node_hive_manager,node_hook_server,node_memory_manager,node_scheduler,node_tasks toneAmber
class node_main_process,node_pty,node_git,node_filesystem,node_transcripts,node_config,node_hive_files,node_memory_store toneMint
class node_claude,node_ollama,node_slack,node_github toneRose
```

## Components

### Desktop experience

- [App shell](https://github.com/drdobbymazz/office/blob/main/src/renderer/src/App.tsx): `src/renderer/src/App.tsx`
- [Agent panels](https://github.com/drdobbymazz/office/tree/main/src/renderer/src/components): `src/renderer/src/components`
- [Office floor](https://github.com/drdobbymazz/office/blob/main/src/renderer/src/scene/office/OfficeFloor.tsx): `src/renderer/src/scene/office/OfficeFloor.tsx`
- [UI state](https://github.com/drdobbymazz/office/blob/main/src/renderer/src/store/store.ts): `src/renderer/src/store/store.ts`
- [IPC bridge](https://github.com/drdobbymazz/office/blob/main/src/preload/index.ts): `src/preload/index.ts`

### Agent coordination

- [Hive controller](https://github.com/drdobbymazz/office/blob/main/src/renderer/src/hooks/useHive.ts): `src/renderer/src/hooks/useHive.ts`
- [Game director](https://github.com/drdobbymazz/office/blob/main/src/renderer/src/game/useDirector.ts): `src/renderer/src/game/useDirector.ts`
- [Hive manager](https://github.com/drdobbymazz/office/blob/main/src/main/hive.ts): `src/main/hive.ts`
- [Agent hooks](https://github.com/drdobbymazz/office/blob/main/src/main/hooks.ts): `src/main/hooks.ts`
- [Memory layer](https://github.com/drdobbymazz/office/blob/main/src/main/memory.ts): `src/main/memory.ts`
- [Mission scheduler](https://github.com/drdobbymazz/office/blob/main/src/main/index.ts): `src/main/index.ts`
- [Task board](https://github.com/drdobbymazz/office/blob/main/src/renderer/src/components/TasksKanban.tsx): `src/renderer/src/components/TasksKanban.tsx`

### Agent runtime

- [Main IPC process](https://github.com/drdobbymazz/office/blob/main/src/main/index.ts): `src/main/index.ts`
- [PTY sessions](https://github.com/drdobbymazz/office/blob/main/src/main/pty.ts): `src/main/pty.ts`
- [Git operations](https://github.com/drdobbymazz/office/blob/main/src/main/git.ts): `src/main/git.ts`
- [File access](https://github.com/drdobbymazz/office/blob/main/src/main/fs.ts): `src/main/fs.ts`
- [Usage telemetry](https://github.com/drdobbymazz/office/blob/main/src/main/transcript.ts): `src/main/transcript.ts`
- [Harness settings](https://github.com/drdobbymazz/office/blob/main/src/main/config.ts): `src/main/config.ts`
- [Hive files](https://github.com/drdobbymazz/office/blob/main/src/main/hive.ts): `src/main/hive.ts`
- [Memory index](https://github.com/drdobbymazz/office/blob/main/src/main/memory.ts): `src/main/memory.ts`

### External services

- **Claude CLI**
- **Ollama**
- **Slack**
- **GitHub CLI**

### Other components

- **User**

## Connections

- User → App shell: uses
- App shell → Office floor: renders
- App shell → Game director: starts game mode
- Agent panels → UI state: reads and updates
- Hive controller → UI state: updates agent state
- Hive controller → IPC bridge: spawns and exchanges events
- App shell → IPC bridge: loads configuration
- IPC bridge → Main IPC process: invokes IPC
- Main IPC process → PTY sessions: manages sessions
- PTY sessions → Claude CLI: runs command
- PTY sessions → IPC bridge: streams terminal data
- Main IPC process → Hive manager: coordinates agents
- Main IPC process → Agent hooks: starts hooks
- Agent hooks → Hive manager: handles agent events
- Hive manager → Hive files: reads and writes
- Hive controller → IPC bridge: receives hive events
- Hive manager → Memory layer: provides agent memory
- Memory layer → Memory index: indexes and recalls
- Agent panels → IPC bridge: requests memory and approvals
- Task board → IPC bridge: reads and updates tasks
- Mission scheduler → Harness settings: loads missions
- Mission scheduler → Hive manager: dispatches missions
- Main IPC process → Harness settings: reads and writes settings
- Agent panels → Git operations: requests repository views
- Agent panels → File access: browses and edits files
- Agent panels → Usage telemetry: requests usage data
- Main IPC process → Usage telemetry: reads session usage
- Game director → IPC bridge: checks local model
- IPC bridge → Ollama: queries model service
- Hive controller → Slack: receives messages
- Main IPC process → Slack: starts webhook server
- Main IPC process → GitHub CLI: ingests issues and CI status
