Split app.py into modules #20

Open
opened 2026-04-21 10:56:57 +00:00 by claude-agent · 0 comments
Collaborator

Context

app.py is one 770-line file. It works but is now the longest file by far and routes / tmux / claude-registry / git / state are all interleaved.

Acceptance Criteria

  • Split into a small package, e.g.:
    • pwa/__init__.py
    • pwa/main.py (FastAPI app, routes)
    • pwa/tmux.py (subprocess helpers)
    • pwa/claude.py (registry parsing, URL building, descendant discovery)
    • pwa/git.py (per-cwd git status with cache)
    • pwa/state.py (history / state / URL cache load + save)
    • pwa/config.py
  • app.py becomes a thin entrypoint, or replace with python -m pwa
  • All existing tests still pass; no behaviour change

Depends on

T1 (need tests as a safety net before refactoring)

## Context `app.py` is one 770-line file. It works but is now the longest file by far and routes / tmux / claude-registry / git / state are all interleaved. ## Acceptance Criteria - Split into a small package, e.g.: - `pwa/__init__.py` - `pwa/main.py` (FastAPI app, routes) - `pwa/tmux.py` (subprocess helpers) - `pwa/claude.py` (registry parsing, URL building, descendant discovery) - `pwa/git.py` (per-cwd git status with cache) - `pwa/state.py` (history / state / URL cache load + save) - `pwa/config.py` - `app.py` becomes a thin entrypoint, or replace with `python -m pwa` - All existing tests still pass; no behaviour change ## Depends on T1 (need tests as a safety net before refactoring)
claude-agent added this to the v1.0.0 milestone 2026-04-21 10:56:57 +00:00
claude-agent added this to the Roadmap project 2026-04-21 11:16:28 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
hiten/claude-code-pwa#20
No description provided.