xonecas.io
64875
Mc

mini-coder / commit 4f87ab8

docs: update AGENTS.md and TODO.md for session continuity

- TODO.md: mark session.ts complete, add Phase 1 notes and Phase 2
  entry points with dependency context
- AGENTS.md: clarify toolchain split (prettier=formatting,
  biome=lint+imports), document JSDoc convention

xonecas2026-04-04 4f87ab84815a6dae625d15e9741a19e2629bb9c0 parent 786c3ed

2 files changed

AGENTS.md+8−2
@@ -8,9 +8,15 @@
88 ## Repo
99
1010 - Runtime: Bun. Use `bun run` for scripts, `bun test` for tests, `bun install` for deps, `bunx` instead of `npx`.
11-- `bun run check` runs biome (lint + format + organize imports). `bun run format` checks prettier. `bun run typecheck` runs tsc. `bun test` runs tests. The lefthook pre-commit runs all four.
12-- `bun run check:fix` and `bun run format:fix` auto-fix issues.
11+- Toolchain split: **prettier** owns all formatting, **biome** owns linting + import sorting (formatter disabled to avoid conflicts). Both fail CI on violations.
12+ - `bun run check` — biome: lint rules + organize imports.
13+ - `bun run format` — prettier: check formatting.
14+ - `bun run typecheck` — tsc --noEmit.
15+ - `bun test` — bun test runner.
16+ - `bun run check:fix` / `bun run format:fix` — auto-fix.
17+- Lefthook pre-commit runs all four steps sequentially (`--silent`, `parallel: false`).
1318 - App data directory: `~/.config/mini-coder/`.
19+- All exports should have JSDoc comments (descriptions, `@param`, `@returns`). Interface fields get single-line JSDoc. See `session.ts` for the established pattern.
1420 - Key dependency source code for reference:
1521 - pi-ai: `~/src/pi-mono/packages/ai/` — LLM provider SDK. See `src/types.ts` for core types, `src/stream.ts` for streaming API, `src/utils/oauth/` for OAuth, `src/providers/faux.ts` for test provider.
1622 - cel-tui: `~/src/cel-tui/` — TUI framework. See `spec.md` for full API, `examples/chat.ts` for the chat UI pattern, `packages/components/src/markdown.ts` for Markdown component.
TODO.md+16−2
@@ -2,15 +2,29 @@
22
33 ## Phase 1 — Foundation (no UI, no LLM)
44
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)
5+- [x] `session.ts` — SQLite schema, CRUD, turn numbering, undo, fork, cumulative stats
6+- [x] `session.test.ts` — 20 tests against real in-memory bun:sqlite
7+- [ ] `tools.ts` — `edit` (exact-text replace, new file creation) and `shell` (exec, output truncation)
8+- [ ] `tools.test.ts` — pure function tests per AGENTS.md testing strategy
79 - [ ] `git.ts` — branch, dirty counts, ahead/behind, repo root detection
810
11+### Notes from Phase 1
12+
13+- `session.ts` exports: `openDatabase`, `createSession`, `getSession`, `listSessions`, `deleteSession`, `appendMessage`, `loadMessages`, `undoLastTurn`, `forkSession`, `computeStats`.
14+- Internal row types (`SessionRow`, `MaxTurnRow`, `DataRow`) and a `SQL` constants object keep queries centralized and avoid formatter conflicts.
15+- `@mariozechner/pi-ai` is the only runtime dependency so far. Its `Message`, `AssistantMessage`, `UserMessage`, `ToolResultMessage` types are used for session persistence.
16+
917 ## Phase 2 — Context assembly
1018
1119 - [ ] `skills.ts` — SKILL.md discovery, frontmatter parsing, catalog generation, name collision resolution
1220 - [ ] `prompt.ts` — AGENTS.md discovery, system prompt construction (base + AGENTS.md + skills + plugins + git footer)
1321
22+### Phase 2 entry points
23+
24+- `skills.ts` depends on nothing from Phase 1. It scans directories for `SKILL.md` files, parses YAML frontmatter (name, description), resolves name collisions (project-level wins over user-level), and generates the XML catalog string for the system prompt. See spec.md "Agent Skills" section.
25+- `prompt.ts` depends on `skills.ts` and `git.ts`. It walks from CWD to scan root collecting `AGENTS.md`/`CLAUDE.md` files, assembles the full system prompt in construction order (base → AGENTS.md → skills catalog → plugin suffixes → session footer with date/cwd/git). See spec.md "System prompt" section.
26+- `git.ts` (from Phase 1) is needed by `prompt.ts` for the session footer git line.
27+
1428 ## Phase 3 — Agent loop
1529
1630 - [ ] `agent.ts` — core loop: stream → handle events → execute tools → loop. Interrupt handling. Context limit / compaction.