# gtxnrg-ship-it/kuro-chan architecture

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

- Interactive diagram: https://gitdiagram.com/gtxnrg-ship-it/kuro-chan
- Repository: https://github.com/gtxnrg-ship-it/kuro-chan

## Overview

Kuro-chan is an AI coding companion organized around a chat-first studio: a user describes a project, the app routes conversation to model/agent services, and engineering workflows inspect and edit repository files, run checks, diagnose failures, and support repair. The studio also exposes project memory, checkpoints, roadmaps, research/assets, voice, local models, and GitHub workflows. Browser persistence and secure credential storage form a useful internal layer. Unsampled subsystems are included from the README and source index; their unverified connections are omitted or dashed.

Main entry points: [`src/pages/studio.tsx`](https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/pages/studio.tsx) (Workspace studio), [`src/engine/agents.ts`](https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/agents.ts) (Agent workflow), [`src/engine/router.ts`](https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/router.ts) (Model router), [`src/components/her/ChatPanel.tsx`](https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/components/her/ChatPanel.tsx) (Chat companion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_studio["Studio experience"]
  node_studio["Workspace studio<br/>[studio.tsx]"]
  node_chat["Chat companion<br/>[ChatPanel.tsx]"]
  node_preview["Live preview<br/>[PreviewPane.tsx]"]
  node_design["Visual design"]
end

subgraph group_conversation["Conversation and models"]
  node_agents["Agent workflow<br/>[agents.ts]"]
  node_agentclient["Agent client<br/>[agents-client.ts]"]
  node_router["Model router<br/>[router.ts]"]
  node_providers["Model providers<br/>[providers.ts]"]
  node_llm["Chat streaming<br/>[llm.ts]"]
  node_localmodels["On-device models<br/>[local-llm.ts]"]
end

subgraph group_engineering["Engineering workflows"]
  node_repository["Repository context"]
  node_files["Repository files"]
  node_tools["Engineering tools<br/>[tools.ts]"]
  node_qa["Checks and diagnosis<br/>[qa-harness.ts]"]
  node_research["Research and assets<br/>[research.ts]"]
end

subgraph group_continuity["Project continuity"]
  node_memory["Project memory<br/>[project-memory.ts]"]
  node_roadmap["Roadmaps<br/>[roadmap.ts]"]
  node_checkpoints["Checkpoints and resume<br/>[build-resume.ts]"]
  node_store[("Browser project store<br/>[db.ts]")]
end

subgraph group_integrations["Voice and integrations"]
  node_voice["Voice interaction<br/>[voice-loop.ts]"]
  node_github["GitHub workflows<br/>[github.ts]"]
  node_broker["GitHub App broker<br/>[index.ts]"]
end

node_user(("User"))
node_githubservice["GitHub"]
node_assetservices["Search and asset sources"]

node_user -->|"opens"| node_studio
node_studio -->|"presents"| node_chat
node_chat -->|"requests agents"| node_agentclient
node_agentclient -->|"dispatches"| node_agents
node_chat -->|"routes chat"| node_router
node_router -->|"selects models"| node_providers
node_router -->|"streams responses"| node_llm
node_router -->|"checks local availability"| node_localmodels
node_router -->|"records usage"| node_store
node_studio -->|"shows preview"| node_preview
node_preview -->|"builds harness"| node_qa
node_agents -.->|"uses project context"| node_repository
node_agents -.->|"edits files"| node_files
node_agents -.->|"runs tools"| node_tools
node_agents -.->|"runs checks"| node_qa
node_qa -.->|"reports failures"| node_agents
node_agents -.->|"supports research"| node_research
node_studio -->|"opens design studio"| node_design
node_studio -->|"opens memory"| node_memory
node_studio -.->|"opens roadmap"| node_roadmap
node_studio -->|"opens checkpoints"| node_checkpoints
node_chat -.->|"supports voice"| node_voice
node_memory -->|"persists memory"| node_store
node_checkpoints -->|"persists resume state"| node_store
node_studio -->|"starts repository workflow"| node_github
node_github -.->|"accesses repositories"| node_githubservice
node_github -.->|"uses broker integration"| node_broker
node_research -.->|"searches sources"| node_assetservices

click node_studio "https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/pages/studio.tsx"
click node_chat "https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/components/her/ChatPanel.tsx"
click node_preview "https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/components/her/PreviewPane.tsx"
click node_design "https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/components/her/VisualIntentStudio.tsx"
click node_agents "https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/agents.ts"
click node_agentclient "https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/agents-client.ts"
click node_router "https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/router.ts"
click node_providers "https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/providers.ts"
click node_llm "https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/llm.ts"
click node_localmodels "https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/local-llm.ts"
click node_repository "https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/repository-context.ts"
click node_files "https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/repository-files.ts"
click node_tools "https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/tools.ts"
click node_qa "https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/qa-harness.ts"
click node_research "https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/research.ts"
click node_memory "https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/project-memory.ts"
click node_roadmap "https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/roadmap.ts"
click node_checkpoints "https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/build-resume.ts"
click node_store "https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/db.ts"
click node_voice "https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/voice-loop.ts"
click node_github "https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/github.ts"
click node_broker "https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/broker/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_studio,node_chat,node_preview,node_design,node_user toneBlue
class node_agents,node_agentclient,node_router,node_providers,node_llm,node_localmodels toneAmber
class node_repository,node_files,node_tools,node_qa,node_research toneMint
class node_memory,node_roadmap,node_checkpoints,node_store toneRose
class node_voice,node_github,node_broker,node_githubservice,node_assetservices toneIndigo
```

## Components

### Studio experience

- [Workspace studio](https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/pages/studio.tsx): `src/pages/studio.tsx`
- [Chat companion](https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/components/her/ChatPanel.tsx): `src/components/her/ChatPanel.tsx`
- [Live preview](https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/components/her/PreviewPane.tsx): `src/components/her/PreviewPane.tsx`
- [Visual design](https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/components/her/VisualIntentStudio.tsx): `src/components/her/VisualIntentStudio.tsx`

### Conversation and models

- [Agent workflow](https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/agents.ts): `src/engine/agents.ts`
- [Agent client](https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/agents-client.ts): `src/engine/agents-client.ts`
- [Model router](https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/router.ts): `src/engine/router.ts`
- [Model providers](https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/providers.ts): `src/engine/providers.ts`
- [Chat streaming](https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/llm.ts): `src/engine/llm.ts`
- [On-device models](https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/local-llm.ts): `src/engine/local-llm.ts`

### Engineering workflows

- [Repository context](https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/repository-context.ts): `src/engine/repository-context.ts`
- [Repository files](https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/repository-files.ts): `src/engine/repository-files.ts`
- [Engineering tools](https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/tools.ts): `src/engine/tools.ts`
- [Checks and diagnosis](https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/qa-harness.ts): `src/engine/qa-harness.ts`
- [Research and assets](https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/research.ts): `src/engine/research.ts`

### Project continuity

- [Project memory](https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/project-memory.ts): `src/engine/project-memory.ts`
- [Roadmaps](https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/roadmap.ts): `src/engine/roadmap.ts`
- [Checkpoints and resume](https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/build-resume.ts): `src/engine/build-resume.ts`
- [Browser project store](https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/db.ts): `src/engine/db.ts`

### Voice and integrations

- [Voice interaction](https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/voice-loop.ts): `src/engine/voice-loop.ts`
- [GitHub workflows](https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/src/engine/github.ts): `src/engine/github.ts`
- [GitHub App broker](https://github.com/gtxnrg-ship-it/kuro-chan/blob/main/broker/src/index.ts): `broker/src/index.ts`

### Other components

- **User**
- **GitHub**
- **Search and asset sources**

## Connections

- User → Workspace studio: opens (evidence: `README.md`)
- Workspace studio → Chat companion: presents (evidence: `src/pages/studio.tsx`)
- Chat companion → Agent client: requests agents (evidence: `src/components/her/ChatPanel.tsx`)
- Agent client → Agent workflow: dispatches (evidence: `src/engine/agents-client.ts`)
- Chat companion → Model router: routes chat (evidence: `src/components/her/ChatPanel.tsx`)
- Model router → Model providers: selects models (evidence: `src/engine/router.ts`)
- Model router → Chat streaming: streams responses (evidence: `src/engine/router.ts`)
- Model router → On-device models: checks local availability (evidence: `src/engine/router.ts`)
- Model router → Browser project store: records usage (evidence: `src/engine/router.ts`)
- Workspace studio → Live preview: shows preview (evidence: `src/pages/studio.tsx`)
- Live preview → Checks and diagnosis: builds harness (evidence: `src/components/her/PreviewPane.tsx`)
- Agent workflow → Repository context: uses project context
- Agent workflow → Repository files: edits files (evidence: `README.md`)
- Agent workflow → Engineering tools: runs tools
- Agent workflow → Checks and diagnosis: runs checks (evidence: `README.md`)
- Checks and diagnosis → Agent workflow: reports failures (evidence: `README.md`)
- Agent workflow → Research and assets: supports research (evidence: `README.md`)
- Workspace studio → Visual design: opens design studio (evidence: `src/pages/studio.tsx`)
- Workspace studio → Project memory: opens memory (evidence: `src/pages/studio.tsx`)
- Workspace studio → Roadmaps: opens roadmap (evidence: `README.md`)
- Workspace studio → Checkpoints and resume: opens checkpoints (evidence: `src/pages/studio.tsx`)
- Chat companion → Voice interaction: supports voice (evidence: `README.md`)
- Project memory → Browser project store: persists memory (evidence: `src/engine/db.ts`)
- Checkpoints and resume → Browser project store: persists resume state (evidence: `src/engine/db.ts`)
- Workspace studio → GitHub workflows: starts repository workflow (evidence: `src/pages/studio.tsx`)
- GitHub workflows → GitHub: accesses repositories (evidence: `README.md`)
- GitHub workflows → GitHub App broker: uses broker integration (evidence: `README.md`)
- Research and assets → Search and asset sources: searches sources (evidence: `README.md`)
