@@ -0,0 +1,25 @@
1+# Implementation plan
2+
3+## Phase 1 — Foundation (no UI, no LLM)
4+
5+- [ ] `session.ts` — SQLite schema, CRUD, turn numbering, undo, fork, cumulative stats
6+- [ ] `tools.ts` — edit (exact-text replace, new file creation) and shell (exec, output truncation)
7+- [ ] `git.ts` — branch, dirty counts, ahead/behind, repo root detection
8+
9+## Phase 2 — Context assembly
10+
11+- [ ] `skills.ts` — SKILL.md discovery, frontmatter parsing, catalog generation, name collision resolution
12+- [ ] `prompt.ts` — AGENTS.md discovery, system prompt construction (base + AGENTS.md + skills + plugins + git footer)
13+
14+## Phase 3 — Agent loop
15+
16+- [ ] `agent.ts` — core loop: stream → handle events → execute tools → loop. Interrupt handling. Context limit / compaction.
17+- [ ] `plugins.ts` — plugin loader, init/destroy lifecycle, tool + prompt injection
18+- [ ] `readImage` tool — base64 encoding, mime detection, conditional registration
19+
20+## Phase 4 — UI
21+
22+- [ ] `ui.ts` — cel-tui layout (log + input + status bar), state management, message rendering
23+- [ ] `index.ts` — entry point, provider discovery, startup sequence, command routing
24+- [ ] Commands — `/model`, `/session`, `/new`, `/fork`, `/undo`, `/reasoning`, `/verbose`, `/login`, `/logout`, `/help`
25+- [ ] Input handling — `/skill:name` parsing, image path detection, Tab file autocomplete