developing-reeflisted
Install: claude install-skill Blushyes/reef
# Developing Reef
Use this skill as the project onboarding guide for non-test Reef changes. Reef is a minimal single-process Rust TUI: UI must stay responsive, and expensive host work must not run from render.
## Core Architecture Rules
- Keep `ui::*::render` on cached state only. Do not call git, filesystem walks, diff generation, syntax highlighting, or long formatting from render.
- Treat input handlers as intent dispatchers. They may update cheap UI state (selection, scroll, hover, active tab) and request work, but must not do blocking host work.
- Route expensive work through the background task coordinator in `src/tasks.rs`; merge results only from `App::tick`.
- Prefer stale cached UI over blocking. Show old data plus loading/stale/error status instead of waiting during tab switches or hover/mouse movement.
- Use generation tokens for async results. Late results from older requests must not overwrite newer selections or newer snapshots.
- Keep each tab/panel independently refreshable. Adding a feature should not require another tab to render before data can update.
## Runtime Data Flow
1. User input mutates cheap UI state or calls an `App` request method such as `refresh_status`, `load_diff`, or `load_preview`.
2. The request method marks an `AsyncState`, increments its generation, and sends a worker request through `TaskCoordinator`.
3. Workers do git/filesystem/diff/highlight work off the render path and send `WorkerResult`.
4. `App::tick` drains results, accept