# Roadmap

Current: `1.0.0-alpha.31`.

The 1.0.0 line is early preview. Each alpha adds one major capability; beta consolidates; 1.0.0 ships the full vision.

## Shipped

### 1.0.0-alpha.1 — M1: skeleton
- Ink-based terminal REPL with multi-turn conversation
- DeepSeek / OpenAI-compatible client with function-calling
- First-run auth prompt → `~/.codedesign/auth.toml`
- Tool registry + dispatcher with structured error handling
- `ds_query` tool (stub data)

### 1.0.0-alpha.2 — M2: real DS + Figma passthrough
- `ds.json` loader with Zod-validated schema (`~/.codedesign/ds.json`)
- `ds_query` reads the real DS; returns a hint when none configured
- `figma_execute` tool — MCP stdio client against `figma-console-mcp`, passes Plugin API JS through to Figma Desktop
- Startup surface prints DS + Figma status

### 1.0.0-alpha.3 — M3a: visual-direction picker + turn-1 rule
- Five deterministic schools with full 6-role palettes (sRGB+OKLch) and 3-font stacks
- `list_directions` + `pick_direction` tools
- System prompt: turn-1 hard rule, runtime state injection, palette-discipline guardrails
- `DsStore` mutable wrapper; `/ds` REPL command

### 1.0.0-alpha.5 — M4a: layered prompts + craft vendoring + craft_lint
- `prompts.ts` refactored into 12-slot `LAYER_ORDER` composition spine
- 11 craft `.md` files vendored under `craft/`; `DEFAULT_CRAFT` auto-injected
- `craftLint()` scanner + `craft_lint` tool (deterministic P0 checks — no LLM round trip)

### 1.0.0-alpha.6–8 — M4b: SKILL.md + three shipped skills
- `SkillMeta` schema + `src/skills.ts` loader with minimal hand-written YAML parser
- Skill layer wired; `skill.cd.craft.requires` displaces `DEFAULT_CRAFT`
- REPL `/skills` `/skill <slug>` `/skill none` commands with in-place system-prompt rebuild
- Shipped: `pitch-deck-figma`, `mobile-screens-figma`, `dashboard-figma`

### 1.0.0-alpha.9 — M4c: DESIGN.md 9-section upgrade
- `src/designSpec.ts` — deterministic render / parse / load for the 9-section authoritative DS format
- `pick_direction` dual-writes `~/.codedesign/ds.json` and `~/.codedesign/design-systems/<id>/DESIGN.md`
- `ds.json` kept as a derived flat index for backward-compat with `ds_query`

### 1.0.0-alpha.10 — M4d: 5-panelist critique + research seam
- `layerCritique` ships the full 5-panelist round-loop (designer / critic / brand / a11y / copy) with JSON output contract (`cd.critique.v1`) and convergence rule
- 5-dim fast path retained for simple tweaks
- `research` reserved layer added to `LAYER_ORDER`, documented contract, empty body until a search tool lands

### 1.0.0-alpha.11 — M5a: session persistence + /resume
- `src/session.ts` — atomic autosave to `~/.codedesign/sessions/<id>.json` after every turn
- REPL `/sessions` / `/resume <id>` commands; `codedesign --resume [<id>]` CLI flag
- Sortable timestamp session ids (`YYYYMMDD-HHMMSS-<rand4>`)

### 1.0.0-alpha.12 — M5b: isolated-session summarizer
- `src/summarizer.ts` — `compactHistory()` cuts at user-message boundaries so tool-call pairs stay intact
- System prompt + last 4 user turns preserved verbatim; middle range replaced by one synthetic summary message
- REPL `/compact` (manual), `/compact --auto|--off` (silent compaction when history > 40 messages)
- Injectable `SummarizerFn` keeps the module testable without hitting the LLM

### 1.0.0-alpha.13 — M5c: image_understand + DS case library
- `deepseek_vision_model` auth.toml key — same endpoint + API key as the text model; unset → tool refuses with a structured hint
- `src/cases.ts` loader for `~/.codedesign/cases/` (images + optional `<id>.json` sidecars)
- `image_understand` tool — accepts `case_id` / `image_path` / `image_url`, inlines local files as data URLs, issues an isolated vision-model call, returns a terse design digest (no main-conversation pollution)
- `list_cases` tool — enumerates available case ids for the agent
- Prompt layer: design-system layer lists available cases; mcp layer reports vision-ready state

### 1.0.0-alpha.14 — M5d.1: local file tools (read_file + list_dir)
- `read_file` — UTF-8 text ingest with size + truncation reporting, NUL-byte binary detection, `~` expansion, cwd-relative + absolute + home-prefixed paths
- `list_dir` — shallow directory listing, dirs sorted before files, dotfiles hidden by default (`include_hidden: true` to surface), per-entry size for files
- No sandboxing — user's CLI, user's permissions. The agent now reads PRDs, brand specs, and reference docs from disk instead of asking the user to paste them.

### 1.0.0-alpha.15 — M5d.2: `codedesign ds` CLI subcommand
- `codedesign ds list` — prints the 5 direction schools with palette preview
- `codedesign ds show` — prints the bound `ds.json` summary + `DESIGN.md` section count
- `codedesign ds init <id> [--brand N] [--force]` — writes `ds.json` + `DESIGN.md` without entering the REPL; refuses to clobber an existing DS unless `--force` is set
- `codedesign ds edit [--id <id>]` — opens `DESIGN.md` in `$EDITOR` / `$VISUAL`, re-parses on close and reports section coverage (flat `ds.json` unchanged; tokens are edited directly)
- `src/dsCli.ts` carries the full handler with dependency-injectable paths + editor spawner so tests never touch `~/.codedesign`

## Next

### M5d — polish + 1.0 (beta → 1.0.0)
- `ds.json` / `DESIGN.md` init/edit subcommand
- Additional file / env / collab tools per the tool inventory
- Docs site

## Non-goals (explicit)

- In-terminal image preview — the terminal is a command console; viewing stays in Figma.
- Internal CanvasOps / multi-adapter abstraction over Figma write paths — `figma_execute` passes Plugin API JS through unmodified.
- PRD file ingestion as a dedicated tool — the discovery-brief conversation handles this.
- Any closed-source code inheritance.
