Files
Rosea/.agents/features/art-pipeline.md
T

11 KiB
Raw Blame History

The art pipeline and the art board

Status: merged to main, reviewed in feature-art-board.md. Gap: G0.24. Roadmap: Phase 0, art/STYLE.md drafted with Mark, art/manifest.json for Phase 1 assets, Claude's SVG placeholders, and the art preparation page working end to end on one asset. The pipeline itself is docs/ART.md.


1. Why and what, in the player's terms

The player never sees this feature. They see what it produces: one rose who looks the same in every picture, a garden whose light follows the real day, and nothing that looks copied from the book. Without a pipeline, each picture is a separate gamble. The rose's face drifts between pictures, a glass dome sneaks in from the generator's memory of the book, and a 3 MB PNG lands in the precache.

For Mark it is a board. Every picture the game needs sits on one page with the prompt that makes it. He copies the prompt and pastes back what the generator made. The board measures the picture, Claude reviews it, and he taps Accept. Claude moves it into the game.

2. Technical architecture

flowchart LR
  style["art/STYLE.md"]
  manifest["art/manifest.json"]
  content["packages/content<br/>findForbidden"]
  schema["packages/schema<br/>PRODUCT_NAME"]
  prep["tools/art-prep<br/>manifest.ts · prompt.ts · placeholders.ts<br/>board.ts · accept.ts"]
  placeholders["art/placeholders/*.svg"]
  dist["tools/art-prep/dist/board/<br/>index.html · board-data.json · placeholders/"]
  board["Art board<br/>claude.ai artifact: db + assets"]
  final["art/final/*.webp"]
  style --> prep
  manifest --> prep
  content --> prep
  schema --> prep
  prep -- "pnpm art:board" --> placeholders
  prep -- "pnpm art:board" --> dist
  dist -- "Claude publishes" --> board
  board -- "Claude downloads the accepted picture;<br/>pnpm art:accept" --> final

tools/art-prep is a workspace package (@rosea/art-prep) so that it gets its own tests, typecheck and lint. Nothing imports it: not the app, not the packages.

Decisions

# Decision Why
A1 The art preparation page is a private claude.ai artifact, the Panda Domi board adapted, not a page on 127.0.0.1. Mark asked for this board. It works from his phone, keeps the pictures between sessions, and Claude can read its rows and images. The roadmap and CLAUDE.md now say so (ROADMAP Phase 0, Decided 2026-11-01).
A2 Prompts are built, never typed: STYLE.md §1 plus the manifest's words. STYLE.md is the only copy of the style prompt and the review points. The same words describe the rose every time, so she stays the same rose. Changing the style means editing one file.
A3 The manifest is checked before any prompt exists. That covers sizes generators offer, grids that divide into whole pixels, unique ids, characters with sheets, transparent sprites and layers, and every forbidden word from @rosea/content. A prompt naming the book is how a likeness gets in (§8). Prompts are not player copy, so lint:copy never reads them.
A4 Every prompt ends with a shared avoid list: glass dome, folding screen, tiny round planet, desert, scarf, the look of any existing book's drawings. The book's most recognisable images are the ones a generator will reach for when it hears rose and fox.
A5 The sky is code. Garden pictures are layers, transparent above a horizon at 40 %. The sun follows the player's real time and the stars are the real constellations (CLAUDE.md §1). A painted sky could be neither.
A6 Sprite sheets come with exact pixel geometry: cut lines, cell centres, a safe box at 12 % of the cell's shorter side. Each cell can also be made one at a time. Taken from the Panda Domi board, where a sheet's drift off the grid was the common failure.
A7 art:accept refuses rather than guesses. A sheet with an empty or painted cell is refused whole, a transparent picture with an opaque background is refused, and so is a file still over budget at WebP quality 62. A full picture is cropped to shape, then only ever shrunk. A cut that "mostly worked" ships a broken picture. Every final picture is precached, so the budget is real bandwidth on a player's phone.
A8 Stand-ins are generated from the same manifest and committed in art/placeholders/. A test fails if they drift. The board and, from Phase 1, the app both show them. One manifest change must update both.
A9 The board's page takes the product name from @rosea/schema (%PRODUCT_NAME%). Renaming stays a one-commit operation (CLAUDE.md preamble).
A10 Claude writes its review and the final paths into the board's rows. The card shows them. Mark sees on the card what Claude checked and whether the picture is in the game, with no separate report to read.
A11 Added 2026-11-01 (art/phase2-3-pictures). The manifest also holds Phase 2 (the fox, berries, the bush, the brush) and the Phase 3 pictures whose mechanics are already decided (paths, lanterns). Every card carries a phase, the manifest lists phases in order, and the board shows Phase N on each card. Mark asked for more pictures on the board. Making them now lets the fox's look settle before Phase 2 code depends on it. The phase on the card keeps a Phase 3 picture from being taken for something Phase 1 needs.
A12 The planets are not on the board. Each planet is designed in its own feature doc (ROADMAP Phase 2), and their grown-ups are the book's most recognisable drawings. Asking for pictures before the design exists would fix a look with the highest likeness risk and no design behind it.
A13 The fox is a second character with his own sheet (fox-sheet) and two review points (STYLE.md §7, 8–9). His look (F1–F4 in STYLE.md §0) was a draft, and Mark approved it on 2026-11-01 with one change: a deep red-orange coat (#BC4A22) instead of muted russet (art/fox-coat). The same mechanism that keeps the rose consistent, reused. The draft was marked as one, so the rose's approval was not stretched over choices he had not seen.
A14 A stand-in with no drawing stops the build. Before this, an unknown cell got an empty box. 28 new pictures made a silent blank likely. A blank stand-in looks like a layout bug, not a missing drawing.

3. Risk analysis

Risk Where Defence
A picture that looks like the book (copyright, and the product claiming a lineage it promised not to, GAMEPLAY §8) Prompts; generated pictures A3, A4. STYLE.md §8 makes likeness Claude's first review check. Mark's eye is the last gate. No automatic likeness check exists (docs/ART.md §5).
A rose who looks hurt or sad because of the player (a lonely person feeling worse, §8 drift that reads as blame) rose-waiting, rose-thirsty, rose-overwatered prompts Their prompts say tired, not hurt, gently comic, never ill, quiet, waiting with patience, never sad, hurt or blaming. Review point 7 is about exactly this.
Words painted into a picture, bypassing the copy library Generated pictures Every prompt forbids text. Claude's review refuses painted words (STYLE.md §8). The petal's words are added in code.
Player data leaving the device The board None can. The board holds only generated art and Mark's notes, and the app never talks to it (docs/ART.md §3, Privacy).
Someone being reachable — Not applicable: no player is involved.
A huge bundle on a phone art/final/ A7's budgets: about 1.4 MB for the four layers, 120 KB per small picture.
The board and the repo disagree Manifest changes art:board rewrites art/placeholders/ from the manifest, and the drift test fails until it is run. The board is republished from the same build.

4. Gap analysis and the designed solution

Gap (G0.24) Solution State
No docs/ART.md Written: the six steps, the manifest's rules, the board, budgets, what's missing Done
No art/STYLE.md "drafted with Mark" A draft by Claude, with its open choices S1–S5 listed for Mark Done: Mark kept the draft, 2026-11-01
No art/manifest.json 11 cards, 25 Phase 1 pictures: rose sheet, stages, care, moments, care things, chair, four garden layers, icon. Since A11: 18 cards and 53 pictures, the 28 more for Phases 2–3 Done
No SVG placeholders 29 stand-ins, generated and committed; 63 since A11 Done
No art preparation page The art board, published (A1) Done
Phase 0 gate: one picture through the pipeline into art/final/ Every step exists and is tested with synthetic pictures Open. It waits on Mark making and accepting the first real picture

5. Verification matrix

Case Kind Where
The real manifest passes every check unit tools/art-prep/test/manifest.test.ts
Each manifest rule fires: a repeated id, cell id clash, bad id, odd size, cell/grid mismatch, non-dividing grid, grid on a single, unknown character, shipped sheet, opaque sprite, missing review point, a phase outside 1–6, phases out of order, no subject, unused picture, a book name, a medical word, lonely in the avoid list, a missing or wrong sheet unit (19 cases) same
STYLE.md §1 and §7 are read exactly; a missing section is an error unit prompt.test.ts
All 63 prompts start with §1 word for word, carry the shared avoid list, and contain no forbidden term unit same
Rose prompts ask for rose-sheet; the sheet itself doesn't. Fox prompts, one-at-a-time ones included, ask for fox-sheet and never name rose-sheet unit same
Grid numbers in the prompt equal cellBoxes; tall cells made alone use 1024 × 1536 unit same
The board data has the shape the page reads; every kind has a group on the page; the page never spells the product name unit board.test.ts
A stand-in for every picture and cell, at its size, loading nothing; art/placeholders/ equals the generator's output; a picture with no drawing stops the build; every card shows its phase unit same
art:accept: single picture to WebP within budget; opaque refused; sheet cut into its cells; any-size sheet cut by grid with a note; empty cell refused by name; painted cell refused; edge-touch warned; solo cell fitted; a layer's clear sky required; a wrong-shape full picture cropped, never enlarged; over budget refused; unknown id or non-image refused unit, real sharp (12 cases) accept.test.ts
The board renders: 11 cards, 18 cells, 5 groups, no broken stand-in, no sideways scroll. Since A11: 18 cards, Phase N on each manual, built page on 127.0.0.1 the reviews
The published board's store starts empty manual (ArtifactData list art) the review
One real picture end to end manual, Mark not done: the Phase 0 gate