# ASCII Art Generator Upgrade Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Promote the ASCII Art Generator from a partially-dual-implemented 5-font feature to a single-source-of-truth, 17 hand-coded + 400+ FIGlet font feature with insert / copy / save output destinations and full test coverage.
**Architecture:** Extract the algorithm from `renderer.js:5942-6736` into a pure `src/main/AsciiArt.js` module that mirrors the `DocQA`/`DailyNotes` pattern. Hand-coded font tables move into `src/main/AsciiArt.fonts.js`; templates into `src/main/AsciiArt.templates.js`; `figlet` becomes a lazy-loaded `src/main/AsciiArt.figlet-adapter.js`. A new `src/renderer/ascii-controller.js` drives the existing standalone `src/ascii-generator.html` window. The in-app modal (`#ascii-art-dialog`, `showASCIIGenerator*`, `preload.js` receive channels) is deleted; the standalone window remains the only path. `electron-store` `ascii:lastFont` (via the existing `store` JSON helper in `main.js:267-289`) remembers the last-used font.
**Tech Stack:** Electron 41.10.7 · electron-builder 26.15.3 · vanilla CommonJS · `figlet@^1.8.0` (pure JS) · Jest + jsdom · ESLint flat config · Prettier (2-space, single quotes, semicolons, 100-col).
**Spec:** docs/superpowers/specs/2026-09-14-ascii-art-upgrade-design.md
## Global Constraints
- Electron 41.10.7, electron-builder 26.15.3
- Vanilla JS, no bundler. Pure modules in `src/main/`, IPC wired in `src/main.js`
- Preload allow-list at `src/preload.js` for any new IPC channels (`invoke` reuses `ALLOWED_SEND_CHANNELS`; `on` uses `ALLOWED_RECEIVE_CHANNELS`)
- Tests: Jest + jsdom. Run `npm test`, `npm run lint`, `npm run format:check`
- Single ASCII art path: standalone `BrowserWindow` only; in-app modal `#ascii-art-dialog` and dead channels `show-ascii-generator*` deleted
- New dep: `figlet` npm package (latest 1.x, pure JS, ~400 KB unpacked)
- Hand-coded font count: 17 (5 existing + 12 new) — big, small, lean, slant, isometric1-4, 3-d, 3x5, ansi-shadow, calvin-s
- New settings key: `ascii:lastFont` (via the existing `store` JSON helper in `main.js:267-289`)
- Output destinations: insert at cursor (existing, fenced code block wrapper) + copy to clipboard + save to file
- The standalone `src/ascii-generator.html` (751 lines) keeps its layout but its controller moves to a new `src/renderer/ascii-controller.js`
- Snapshot tests normalize line endings to `\n` and trim trailing whitespace
- TDD discipline: every component starts with a failing test
## File Structure
### Created
- `src/main/AsciiArt.fonts.js` — 17 hand-coded font tables (`HAND_CODED_FONTS`).
- `src/main/AsciiArt.templates.js` — 19 named ASCII templates (`ASCII_TEMPLATES`).
- `src/main/AsciiArt.figlet-adapter.js` — Lazy `require('figlet')` + `fontsSync()` cache + `textSync(text, font)` wrapper + structured error.
- `src/main/AsciiArt.js` — Pure orchestrator: `generate({ text, font, options })`, `listFonts()`, `getFontMeta(id)`.
- `src/renderer/ascii-controller.js` — Renderer-side controller for the standalone window.
- `tests/main/ascii-art.test.js` — Unit tests for `generate` / `listFonts` / `getFontMeta` / figlet adapter.
- `tests/main/ascii-art.fonts.test.js` — Snapshot tests per hand-coded font (HELLO + edge cases).
- `tests/main/ascii-art.templates.test.js` — Snapshot tests per template.
- `tests/main/ascii-art.figlet-adapter.test.js` — Adapter tests with `figlet` mocked.
- `tests/preload-ascii.test.js` — Allow-list assertions for new `ascii:*` channels.
### Modified
- `package.json` — Add `"figlet": "^1.8.0"` to `dependencies`.
- `src/main.js:4005-4010` — Add `const AsciiArt = require('./main/AsciiArt');` after DocQA require.
- `src/main.js` (after line 5611, near other recent IPC handler blocks) — Register `ascii:generate`, `ascii:list-fonts`, `ascii:get-font-meta`, `ascii:save`, `ascii:copy`, `ascii:last-font` handlers.
- `src/preload.js:98-99,294-296` — Delete dead receive channels `show-ascii-generator` and `show-ascii-generator-window`. Add new invoke channels `ascii:generate`, `ascii:list-fonts`, `ascii:get-font-meta`, `ascii:save`, `ascii:copy`, `ascii:last-font` to `ALLOWED_SEND_CHANNELS`. Add `generators.ascii.*` namespace helpers.
- `src/renderer.js:2188` — Delete `const asciiModal = new ModalManager('#ascii-art-dialog');`.
- `src/renderer.js:2202` — Delete `asciiModal` entry from `window.modals`.
- `src/renderer.js:5942-6736` — Delete entire in-app modal block.
- `src/index.html:812-1028` — Delete entire `#ascii-art-dialog` modal markup.
- `src/ascii-generator.html` — Rewrite inline ``)
**Interfaces:**
- Consumes: `src/renderer/ascii-controller.js`
- Produces: a standalone window that loads the controller, renders all 17+ fonts, and exposes Insert / Copy / Save.
- [ ] **Step 1: Replace the inline FONTS/TEMPLATES/BOX_STYLES + generation script with a controller script tag.** In `src/ascii-generator.html`, remove the entire `` (lines ~364-749). Replace with:
```html
```
- [ ] **Step 2: Replace the text-mode font-style `