summaryrefslogtreecommitdiff
path: root/docs/adr/001-language-and-architecture.md
blob: 99022f107b012cf48992d7a553e89847ce8d97e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# ADR-001: Go with Server + Mobile PWA Architecture

## Status
Accepted

## Context
Claudomator needs to capture tasks, dispatch them to Claude Code, and report results.
The primary human interface is a mobile device requiring push notifications and frictionless input.

## Decision
- **Language**: Go for the backend (CLI + API server)
- **Architecture**: Pipeline with bounded executor pool (goroutines)
- **API**: REST + WebSocket for real-time updates
- **Storage**: SQLite + filesystem (logs, artifacts)
- **Task format**: YAML definitions
- **Mobile**: PWA with Web Push notifications (future phase)

## Rationale
- Go: single binary, excellent process management (`os/exec`), natural concurrency
- SQLite: zero-dependency, embeddable, queryable metadata
- WebSocket: real-time progress streaming to mobile clients
- REST: simple task creation from any HTTP client (mobile, curl, CI)

## Alternatives Considered
- **TypeScript/Node.js**: Claude Code SDK exists, but runtime dependency hurts distribution
- **Python**: Good async, but packaging/distribution is painful for CLI tools
- **Rust**: Overkill for this problem domain; slower iteration speed

## Consequences
- CGo dependency via `go-sqlite3` (requires C compiler for builds)
- Mobile PWA to be built as a separate frontend phase
- Claude Code invoked via CLI flags (`-p`, `--output-format stream-json`), not SDK