dreative 0.5.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +49 -27
  2. package/dist/cli/audit.js +206 -0
  3. package/dist/cli/audit.test.js +79 -0
  4. package/dist/cli/docsCheck.js +163 -0
  5. package/dist/cli/docsCheck.test.js +8 -0
  6. package/dist/cli/index.js +81 -8
  7. package/dist/server/preview.js +73 -73
  8. package/dist/server/store.js +11 -0
  9. package/dist/shared/artifacts.js +162 -0
  10. package/dist/shared/design.js +42 -22
  11. package/dist/shared/ruleSystem.js +130 -0
  12. package/dist/shared/ruleSystem.test.js +187 -0
  13. package/dist/shared/skillSystem.js +173 -0
  14. package/dist/shared/skillSystem.test.js +110 -0
  15. package/dist/ui/assets/{index--vztc_MR.js → index-CKwmbx2j.js} +13 -13
  16. package/dist/ui/index.html +12 -12
  17. package/package.json +5 -3
  18. package/skill/dreative/DESIGN.md +290 -95
  19. package/skill/dreative/PLAN.md +462 -71
  20. package/skill/dreative/SKILL.md +230 -126
  21. package/skill/dreative/frameworks/nextjs.md +13 -0
  22. package/skill/dreative/frameworks/react-vite.md +12 -0
  23. package/skill/dreative/frameworks/styling.md +14 -0
  24. package/skill/dreative/frameworks/sveltekit.md +10 -0
  25. package/skill/dreative/frameworks/vue-nuxt.md +12 -0
  26. package/skill/dreative/recipes/3d-recipes.md +44 -0
  27. package/skill/dreative/recipes/cinematic-recipes.md +19 -0
  28. package/skill/dreative/recipes/immersive-recipes.md +18 -0
  29. package/skill/dreative/recipes/media-recipes.md +60 -0
  30. package/skill/dreative/recipes/motion-recipes.md +44 -0
  31. package/skill/dreative/references/ARTIFACTS.md +180 -0
  32. package/skill/dreative/references/REFLEX_FONTS.json +44 -0
  33. package/skill/dreative/references/RULES.json +186 -0
  34. package/skill/dreative/references/SKILL_CONTRACT.md +30 -0
  35. package/skill/dreative/references/TIERS.md +42 -0
  36. package/skill/dreative/schemas/plan.schema.json +241 -0
  37. package/skill/dreative/schemas/verify.schema.json +61 -0
  38. package/skill/dreative/skills/3d.md +94 -157
  39. package/skill/dreative/skills/cinematic.md +56 -232
  40. package/skill/dreative/skills/experimental.md +111 -0
  41. package/skill/dreative/skills/immersive.md +61 -223
  42. package/skill/dreative/skills/interaction.md +9 -1
  43. package/skill/dreative/skills/media.md +135 -216
  44. package/skill/dreative/skills/mobile.md +128 -117
  45. package/skill/dreative/skills/motion.md +89 -229
  46. package/skill/dreative/skills/refined.md +116 -102
  47. package/skill/dreative/skills/ux.md +155 -144
  48. package/dist/server/ai.js +0 -177
@@ -1,126 +1,230 @@
1
- ---
2
- name: dreative
3
- description: Frontend design skill + optional visual round-trip editor. Use for DRASTIC frontend change — redesign/restructure/build a section, a page, or the whole site; landing pages; animations, motion, 3D, micro-interactions; "make my UI look good" — and for visual editing when the user says "open dreative" or "let me edit the layout visually". NOT for micro-tweaks (a button color, one label) unless the user explicitly invokes it. Default is direct design: apply the design doctrine straight to the codebase, after offering Plan Mode. The browser editor (extract → wireframes → edit → apply diff) is an optional mode the user can ask for.
4
- ---
5
-
6
- # Dreative — frontend design skill (+ optional visual editor)
7
-
8
- You (the coding agent) are the intelligence. Dreative has **two modes**:
9
-
10
- - **Mode A — Direct design (default).** The user asks you to design, redesign, restyle, animate, or build UI. Your FIRST action for every request is the plan gate per `PLAN.md` (same folder): ask the user "plan first (Recommended) or build directly?" — every time, one question, plan recommended. When plan is accepted, run the PLAN.md protocol: probe your environment's capabilities (image-gen, video-gen, 3D tooling, browser tools), draft a section-by-section blueprint with a media plan and fallbacks, bundle every user decision into one structured question round (including the media-type multi-select with its token-cost warning, and the mockups-first offer), persist the approved plan, build 1:1 mockups of the highest-impact pages if the user opted in, then execute assets-first. Read `DESIGN.md` (and any specialist `skills/<name>.md` the plan calls for), then design/edit the real code directly. No server, no extraction, no wireframes. When you finish, add one closing note: *"Tip: run `dreative start` / say 'open dreative' if you want to tweak this visually — I'll extract the pages into an editable canvas."* That's the only place the editor should come up; never force the round-trip on a plain design request. **Depth first:** when the request implies more than a fresh coat of paint ("redesign", "change it entirely", "make it like <reference site>"), present DESIGN.md §11's transformation-depth ladder (restyle → re-layout → restructure → reimagine) as explicit options and let the user pick BEFORE designing; a confirmed restructure/reimagine means rebuilding markup, component trees, and routing for real — never just editing stylesheets on the old skeleton. **Preservation contract (non-negotiable when redesigning existing code):** BEFORE editing any existing page, build the preservation manifest per DESIGN.md §11 (every link, id/data-attribute, handler, form field, visible string, data view, and conditional state — tabs, modals, auth branches); AFTER redesigning, mechanically verify each entry survives in the new code and report the preservation ledger. Restructure moves things; it never loses them. **Real motion engineering:** when motion/3d/immersive/cinematic treatments are chosen, deliver them with the proper libraries per the skill files (GSAP + ScrollTrigger, Lenis, `motion/react`, three.js/R3F) — actually add the dependencies to the project (`npm i gsap lenis` etc.), wire providers/render loops, and build the choreography. A static page with a few CSS transitions does not fulfill a motion request; the target is unseen.co-grade coordinated animation, the shipped result must clear the motion-dial inventory in `skills/motion.md` §9, and the self-critique pass must name the specific animations shipped. **Generated media:** probe your environment for image/video generation tools before designing and use them per DESIGN.md §7 — generated hero imagery, textures, and especially seamless video loops (hero backgrounds, pre-rendered living surfaces, hover previews) integrated into the motion system are among the highest-impact upgrades available. **Skill picker:** in Plan Mode's single question round (PLAN.md §3 — use the agent's structured question tool, e.g. AskUserQuestion, multi-select), offer the specialist skills with a one-line plain-language description each so the user chooses the treatments they want — recommend the ones the request obviously implies and mark them "(Recommended)":
11
- - **motion** scroll animations, staggered entrances, parallax, kinetic type
12
- - **interaction** — micro-interactions: hover states, magnetic buttons, cursor effects, tactile feedback
13
- - **3d** WebGL / three.js scenes, shader backgrounds, 3D product showcases
14
- - **immersive** award-site feel: the page becomes a spatial world, scroll-as-journey, page transitions
15
- - **cinematic** dark, shader-graded experiential look: fluid/particle surfaces, drag-to-explore, sound
16
- - **refined** premium clean business look: whitespace, photography, calm minimal motion (the professional pole)
17
- - **media** — generated images/video woven into the motion system: hero video loops, distortion galleries, living thumbnails
18
- - **ux** make everything actually work: nav, mobile menu, forms, states, keyboard, nothing blocks clicks (recommend by default)
19
- - **mobile** first-class phone experience: clean, tidy, thumb-ergonomic, with animations scaled to mobile (calmer than desktop, still premium)
20
- Plus a "none — plain design doctrine only" option. Skip the question only when the user already named the treatments or the request is trivially a restyle; read each chosen `skills/<name>.md` before designing.
21
- - **Mode B — Visual round-trip (only when asked).** The user explicitly wants the visual editor ("open dreative", "let me edit visually"). Flow: **extract → baseline → serve requests → finish → apply**. Be token-frugal at every step: read only the files you need, never re-read the whole app, and keep JSON compact.
22
-
23
- Everything below §0 describes Mode B; the design doctrine paragraphs apply to both modes.
24
-
25
- **Design quality is a hard requirement.** `DESIGN.md` (same folder as this file) is the design doctrine. Read it ONCE before servicing the first `propose-skeletons`, `propose-variants`, `design-page`, or `edit-element` request, keep it in mind for all later ones, and run its pre-flight checklist (§12) before every respond. Requests may carry a `brief` object (aesthetic preset + vibe + dials set by the user in the UI); when present it is the user's explicit direction and overrides doctrine defaults. Before writing any `design-page` code, state (to yourself, one line) the register, the design read, and the signature element — if you cannot name all three, you are about to produce the generic default; stop and commit first.
26
-
27
- **Specialist skills.** The `skills/` folder next to this file holds expert playbooks for advanced work: `motion.md` (animation & scroll choreography), `3d.md` (WebGL/three.js/shaders), `interaction.md` (micro-interactions & effect craft), `immersive.md` (award-site worlds, spatial page transitions, scroll-as-journey), `cinematic.md` (dark shader-graded experiential interfaces: fluid/particle surfaces, drag-to-explore, click & hold, sound design opt-in aesthetic), `refined.md` (premium clean business/DTC/e-commerce: restraint, photography, whitespace — the calm pole), `media.md` (generated images/video as motion material: production pipeline, DOM and WebGL media treatments, media planes), `ux.md` (the working-page contract: nav, forms, states, keyboard, pointer-events audit — load for any product-register page), `mobile.md` (mobile as a first-class surface: calm-premium motion translation, ergonomics, mobile verification). All are universal: they apply directly to any codebase in Mode A; the editor is never required. When a request's `plan.skills` lists names, read each listed `skills/<name>.md` ONCE before writing code (then keep it in mind, like DESIGN.md); when `plan.sections[].skills` tags a section, that section gets that treatment (e.g. "this hero has 3d"). If the brief/prompt clearly calls for one of these but the plan missed it, read it anyway. If a listed file isn't installed, proceed on DESIGN.md alone and note it to the user (`dreative install-skill` installs all).
28
-
29
- **References the user gives you.** If the user attaches screenshots/images, read them with your image tools and treat them as the visual target (extract palette, type feel, layout family, motion cues from any described behavior). If the user names reference URLs, fetch them (browser tools if available, else web fetch of the HTML — look at real script/font/class evidence, not just the text) and distill what specifically to borrow before designing; never guess at a named reference from memory alone when you can look.
30
-
31
- **Verification pass (Mode A, required before declaring done).** Doctrine at write-time is weaker than judgment at review-time, and screenshots alone cannot catch broken function — a dead WebGL canvas, a menu that won't close, an invisible layer eating clicks all screenshot fine. Verification is TWO stages, both mandatory.
32
-
33
- *Stage 1 — runtime gates (functional).* Run the app with browser tools and prove the page WORKS: (a) **console clean** — zero uncaught errors/unhandled rejections while loading, scrolling the full page, and interacting; (b) **effects provably running** — if WebGL shipped, the canvas has a live context and draws (not black/blank); if animations shipped, sample a moving element's transform twice ~500ms apart and confirm it changes, and confirm scroll triggers fire at their positions; if video shipped, confirm `!video.paused` and the poster shows pre-play; (c) **interaction smoke test** — run `skills/ux.md` §7's functional audit (click nav links, open/close the mobile menu, submit a form invalid+valid, tab through, hit-test controls inside effect-heavy regions); (d) at ~390px too (`skills/mobile.md` §5 when mobile shipped). **Failure doctrine:** any effect that fails a runtime gate is fixed or replaced with its planned fallback (PLAN.md §2) before done — never shipped broken, never silently removed; the final report names what fell back and why.
34
-
35
- *Stage 2 — visual self-critique.* Screenshot the result at desktop AND ~390px mobile width, then grade the screenshots against this rubric — (1) would a stranger name the brand's register and audience from one glance? (2) does it pass DESIGN.md §2's slop tests *as rendered* (not as intended)? (3) is the signature element actually visible and working? (4) spatial integrity per DESIGN.md §15 — scan the screenshot for anything overlapping anything else: controls covered by other elements, rows/text clipped at a viewport or container edge, two floating widgets fighting for the same corner, fixed bars hiding content; overlap failures outrank aesthetic ones — fix them first? (4b) any contrast failure, unloaded font/image, or motion jank? (5) does mobile hold up per DESIGN.md §13? (6) preservation ledger clean — every link, action, form field, text string, and tab/modal/state from the manifest present or logged as intentional? (7) if motion treatments were chosen: are the animation libraries actually installed and imported, and can you name ≥3 specific shipped animations (element + trigger + duration) visible in the running page? (8) if generated media shipped: posters present, loops playing, treatments wired per `skills/media.md` §5's floors? Fix what fails and re-check once. If you cannot run the app or screenshot (no browser available), say so explicitly and degrade honestly: walk the rendered DOM/CSS mentally against both stages' rubrics, grep for the runtime-gate evidence (imports wired, providers mounted, pointer-events on overlay layers, fallback branches present), and tell the user which gates could not be verified — never silently skip the pass.
36
-
37
- ## 0. Setup
38
-
39
- Requires `dreative` on PATH (`npm i -g dreative` or `npx dreative`). All commands run from the user's project root. State lives in `.dreative/` (paths in payloads are relative to `.dreative/`).
40
-
41
- ## 1. Extract (code → layout + replica)
42
-
43
- Goal: replicate the app's current UI **view-by-view** so the user recognizes every screen. Do this **one page at a time** — find the routes/pages first (router config, pages/ dir, app/ dir), then open only each page's component files. **Single pass per page:** while the source is in front of you, produce all three outputs at once (layout JSON, replica file, summaries) — never revisit a file for a second output.
44
-
45
- **One Dreative page per VIEW, not per route file.** If a route renders mutually-exclusive views — tab panels, admin vs viewer modes, auth states, wizard steps, a modal that fills the screen — each view becomes its own Dreative page. A page's layout must show exactly what the user sees at one moment; never stack multiple tab panels' content into one layout. Name split views `"<Screen> — <View>"` (e.g. "Admin Studio — Library", "Admin Studio — Ranking Board"), give them the same `source`, the same `group` (e.g. `"group": "Admin Studio"`), and cluster them on the canvas. Shared chrome (header, tab bar) repeats in each view's layout, with the active tab noted in its `text`.
46
-
47
- **Expose hidden UI.** UI that exists but isn't visible by default must still surface, or the user gets a wrong picture of their app:
48
- - *Full-screen or view-sized* hidden UI (modals, dialogs, drawers, overlay panels with real content) → its own Dreative page, grouped with its parent screen (e.g. "Library — Edit Show modal").
49
- - *Small* hidden UI (dropdown menus, tooltips-with-actions, hover-revealed buttons, expandable rows) → model it as a block **inside its trigger's parent**, labeled for what it is (e.g. label "Sort dropdown (opens on click)"), with a `summary` saying when it appears. Don't invent open-state visuals in the replica — the replica shows the default state; the layout is where hidden things are enumerated.
50
-
51
- **Fidelity is the whole point.** The wireframe and replica must be recognizable as *that* page at a glance. Model every visible major section in order — hero/banner, search+filter bars, stat/KPI rows, each shelf/carousel with its cards, footers. A real page with 8 visible sections must yield ~8 top-level children, not 3 generic boxes. Card grids get realistic counts (a shelf showing 7 posters → a card-grid the user reads as a row of posters, with real show titles in `text`). Before moving on, self-check: *would the user, seeing only this wireframe, name which page of their app it is?* If not, you under-extracted — fix it before the next page.
52
-
53
- Per page, produce:
54
-
55
- 1. **Layout** the block tree in `project.json` (schema below).
56
- 2. **Replica** — `.dreative/replica/<pageId>.tsx`: a stripped, non-functional **1:1 visual copy** of the real page. Single file, default export, no imports beyond react, Tailwind classes (translate other styling to Tailwind or inline styles). Strip everything behavioral: no handlers, no hooks, no data fetching; replace dynamic state/props with representative literal values (the ones a real user would see). It only needs to LOOK identical, not work. Every block id from the layout appears as `data-dreative-id="<id>"` on the matching element. Set `replicaFile` on the page.
57
- 3. **Summaries** on each meaningful block, `summary`: one plain line of what it shows or does ("Submits the signup form and redirects to /dashboard", "Lists the 6 most recent orders from the API"). These render as hover tooltips in the replica so the user understands behavior without you re-reading code later, and they are your own re-entry notes at apply time. Keep each under ~120 chars.
58
-
59
- Write `.dreative/project.json`:
60
-
61
- ```json
62
- { "version": 1, "brief": { "aesthetic": "minimal", "vibe": "", "audience": "", "variance": 7, "motion": 5, "density": 4, "notes": "" }, "pages": [ {
63
- "id": "pg_home", "name": "Home", "canvasPos": {"x": 40, "y": 40},
64
- "theme": { "bg": "#0d0d0f", "fg": "#e8e8ea", "accent": "#f59e0b" },
65
- "status": "skeleton", "source": "src/pages/Home.tsx",
66
- "layout": { "id": "blk_root", "type": "section", "label": "Home", "direction": "column", "children": [ … ] }
67
- } ] }
68
- ```
69
-
70
- (page objects also take `"replicaFile": "replica/pg_home.tsx"` and `"group": "Admin Studio"` for split views of one screen)
71
-
72
- Block: `{ id, type, label, text?, summary?, direction?, sizeHint?, source?, children? }`
73
- - `type`: section | row | column | nav | hero | card-grid | list | form | footer | text | image | button
74
- - `label`: short recognizable name (shown on hover/inspector).
75
- - `text`: the **actual visible copy** (heading text, button caption, first ~80 chars of a paragraph) — set it on every text/button/hero leaf; it renders verbatim in the wireframe so the user recognizes the page.
76
- - Page `theme` `{bg, fg, accent}`: pull the real CSS colors (page background, main text color, brand accent) so the wireframe card matches the app's look. Set it on every page.
77
- - `source`: the real file that owns this block (component path). Set it on every block whose owner differs from its parent's — this is what lets you apply the diff later without re-searching.
78
- - Keep depth sensible (3–5 levels); every meaningful visible element should exist, but don't model every span.
79
- - Ids must be unique and stable; prefix `pg_`/`blk_` plus a slug.
80
- - Space pages on the canvas: x += 480 per page.
81
- - Top-level `brief` is optional at extraction time (the user edits it in the UI); if the app has an obvious existing aesthetic, seed it so redesigns preserve the brand.
82
-
83
- Then snapshot the baseline: `dreative baseline` (start the server first, step 2, if not running).
84
-
85
- ## 2. Launch
86
-
87
- ```
88
- dreative start # serves http://localhost:4820, opens browser (background this)
89
- ```
90
-
91
- Tell the user the UI is open: they can view the **Replica** tab (1:1 copy of their real page, hover shows your summaries), drag elements in **Layout**, add/remove blocks, set the **Design brief** (preset + dials), attach reference images and prompts, hit **🎨 Design all**, and click **Finish** when done.
92
-
93
- ## 3. Service requests (the wait loop)
94
-
95
- Repeat until finish:
96
-
97
- ```
98
- dreative wait # blocks up to ~8 min; prints ONE event as JSON
99
- ```
100
-
101
- - `{"kind":"none"}` just run `dreative wait` again.
102
- - `{"kind":"request","id","type","payload"}` handle per table below, then
103
- `dreative respond <id> <resultFile>` (write the result JSON to a temp file) or `dreative respond <id> --error "why"`.
104
- - `{"kind":"finish","diff":…}` → go to step 4.
105
-
106
- | type | payload | result to respond with |
107
- |---|---|---|
108
- | `propose-skeletons` | `{prompt, brief?}` | Array of 1–3 `{name, layout}` page proposals (block schema above), structured per DESIGN.md layout rules |
109
- | `propose-variants` | `{pageName, layout, brief?}` | Array of 1–3 `{name, layout}` variants |
110
- | `edit-block` | `{block, instruction}` | The updated block JSON (same id) |
111
- | `design-page` | `{pageName, layout, brief?, plan?, refImage?, blockRefs, designPrompt?, previousFile?, siblingPages, outFile}` | Write a single-file React+Tailwind component (default export, no imports beyond react) to `.dreative/<outFile>`; every block id in layout must appear as `data-dreative-id="<id>"`. **`plan` is Dreative's pre-computed design decision — execute it, don't re-decide:** it carries resolved dials, a layout family per section (`plan.sections`, sections may carry `skills` tags like `["3d"]`), spacing/motion budgets (`plan.directives`), doctrine violations to fix (`plan.lints`), and required specialist skills (`plan.skills` → read `skills/<name>.md` first). DESIGN.md still governs everything the plan doesn't specify. Read `refImage`/`blockRefs[].refImage` (paths under `.dreative/`) with your image tools; if `previousFile` set, read it and preserve prior element edits. Respond `{"ok":true}` |
112
- | `edit-element` | `{file, elementId, instruction, refImage?}` | Edit `.dreative/<file>` in place, only the element with `data-dreative-id=elementId`, keeping DESIGN.md rules intact. Respond `{"ok":true}` |
113
-
114
- A "Design all pages" click in the UI arrives as one `design-page` request per page, back to back: keep visual consistency across them (same accent, type scale, radius system — the first page you design sets the system for the rest).
115
-
116
- Token rules: only read ref images when a request names them; never dump whole files into responses; for edits, edit files directly instead of returning code.
117
-
118
- ## 4. Apply (finish)
119
-
120
- The finish event's `diff` (also saved at `.dreative/finish.json`) contains only what changed vs the baseline:
121
-
122
- - `pagesAdded` full layouts; create real pages/components for them.
123
- - `pagesRemoved` confirm with the user before deleting real code.
124
- - `pagesChanged` per page: `blocksMoved` (reorder in the source), `blocksAdded`, `blocksRemoved`, `blocksChanged` (only differing props listed; `refImage` = style reference to match, `intents` = behavior notes), plus page-level `refImage`/`designPrompt`.
125
-
126
- Use each block's/page's `source` pointer to open **only the owning files**, and each block's `summary` to recall what an element does **without re-reading unrelated code**. Read annotated ref images now (paths relative to `.dreative/`). Make the real code match the final layout and annotations, run the project's checks, and summarize what you changed.
1
+ ---
2
+ name: dreative
3
+ description: Frontend design skill for substantial UI work, with an optional visual round-trip editor. Use for pages, sections, redesigns, motion, media, interaction, 3D, and visual editing. Direct design is the default.
4
+ ---
5
+
6
+ # Dreative
7
+
8
+ Dreative makes the coding agent responsible for design judgment, implementation,
9
+ preservation, and proof. It has no AI runtime of its own.
10
+
11
+ ## 1. Choose the mode
12
+
13
+ - **Direct design (default):** plan, edit the real application, and verify it.
14
+ No server, extraction, replica, or wireframe is involved.
15
+ - **Visual round-trip:** use only when the user explicitly asks to open Dreative
16
+ or edit visually. Follow §8.
17
+
18
+ For a tiny isolated change, make the change directly and run the smallest useful
19
+ check. For substantial design work, follow every Direct Design step below.
20
+
21
+ ## 2. Read progressively
22
+
23
+ Read this file first, then only the references selected by the plan:
24
+
25
+ 1. `PLAN.md` planning and the section blueprint.
26
+ 2. `DESIGN.md` — visual doctrine and redesign/preservation rules.
27
+ 3. `references/TIERS.md` — ambition-tier deliverables.
28
+ 4. `references/ARTIFACTS.md` — machine-readable plan, preservation, ledger,
29
+ and verification files.
30
+ 5. `references/RULES.json` and `references/REFLEX_FONTS.json` — rule categories,
31
+ failure history, bounded substitutions, and reflex font choices.
32
+ 6. `frameworks/<name>.md` — the adapter matching the repository.
33
+ 7. Each selected `skills/<name>.md`, once.
34
+ 8. Only after three original concepts are recorded, load the relevant
35
+ `recipes/<name>-recipes.md` for feasibility, implementation, performance,
36
+ fallback selection, or repair of a weak concept.
37
+
38
+ Detailed doctrine belongs in those references, not in this orchestration file.
39
+
40
+ ## 3. Direct Design protocol
41
+
42
+ ### 3.1 Discover
43
+
44
+ - Inspect the minimum repository context needed to understand the relevant page,
45
+ framework, styling system, routes, and available media/tooling.
46
+ - For an existing interface, create `.dreative/preservation.json` before edits.
47
+ Include links, handlers, forms, visible copy, states, routes, analytics hooks,
48
+ and accessibility contracts. Every item needs a stable `file` + `needle` that
49
+ `dreative audit` can check mechanically.
50
+ - Read `.dreative/ledger.json` when it exists. Treat it as preference and failure
51
+ history, never as proof that a new request is complete.
52
+
53
+ ### 3.2 Plan
54
+
55
+ - Run `PLAN.md` and resolve the transformation depth: restyle, relayout,
56
+ restructure, or reimagine.
57
+ - Resolve one ambition tier: solid, premium, expressive, or award.
58
+ - Explore three genuinely different concepts, commit to one, and record why the
59
+ others were rejected.
60
+ - Classify important rules through `references/RULES.json`: hard gates are
61
+ absolute; evidence-backed defaults remain the proven remedy; creative
62
+ provocations influence exploration rather than becoming shipment quotas.
63
+ - Follow the proven default, or outperform it with a named alternative,
64
+ measurable success criteria, and runtime evidence. Any substitution is
65
+ declared before `implementationStartedAt` in `ruleExceptions`; hard gates
66
+ cannot be substituted.
67
+ - Run one short decision phase containing several sequential single-question
68
+ calls. Use the environment's structured question tool when available;
69
+ otherwise ask in chat. Do not ask about implementation details the agent can
70
+ infer safely.
71
+ - Write `.dreative/plan.json` using `references/ARTIFACTS.md`. For multi-page
72
+ work, show a page × skill matrix: the user can assign treatments to specific
73
+ pages, and approve routing for selected skills left unassigned. Every section
74
+ names its layout family, skills, assets, interactions, mobile translation,
75
+ fallback, and verification criteria.
76
+ - Render a concise `.dreative/plan.md` for the user and for session re-entry.
77
+
78
+ The approved plan is a delivery contract. A section ends as `shipped`,
79
+ `fallback`, or `cut` with a reason—never silently omitted.
80
+
81
+ At `expressive` and `award`, choose one coherent quality path: `diversity`
82
+ (several mechanisms across several drivers) or `development` (one signature
83
+ mechanism evolving through at least three materially different roles, supported
84
+ by two quieter mechanisms). Experimental work explores one non-obvious candidate
85
+ per major section, then selects only the strongest two or three to ship.
86
+
87
+ ### 3.3 Select skills
88
+
89
+ Universal foundation: ux and baseline mobile apply to every web page.
90
+ Add treatments from this complete picker:
91
+
92
+ | Skill | Use it for |
93
+ | --- | --- |
94
+ | `refined` | Premium clean business, commerce, photography, and restrained motion |
95
+ | `motion` | Scroll choreography, entrances, parallax, kinetic type, and transitions |
96
+ | `interaction` | Hover craft, magnetic controls, cursor effects, and tactile feedback |
97
+ | `media` | Generated/sourced image and video production, grading, and media treatments |
98
+ | `3d` | WebGL, three.js/R3F, shaders, models, particles, and fallbacks |
99
+ | `immersive` | Persistent scenes, spatial transitions, preloaders, and scroll-as-journey |
100
+ | `cinematic` | Living surfaces, shader grading, gesture exploration, and sound |
101
+ | `experimental` | High-variance composition, material shifts, and unusual provocations |
102
+ | `ux` | Working navigation, forms, states, accessibility, and interaction audits |
103
+ | `mobile` | Mobile-native composition, touch ergonomics, and phone verification |
104
+
105
+ Skill dependencies are additive:
106
+
107
+ - All skills depend on `ux` and `mobile`.
108
+ - `immersive` depends on `motion`, `interaction`, and `media`.
109
+ - `cinematic` depends on `motion`, `interaction`, and `media`.
110
+ - `experimental` depends on `motion`, `interaction`, and `media`.
111
+
112
+ The user's selected skills are authoritative. Routing recommends placement; it
113
+ never silently activates an unselected optional skill. Explicit page assignments
114
+ always win. The planner resolves dependencies and places selected-but-unassigned
115
+ skills across suitable pages for approval. If the user selects all, every skill
116
+ must appear somewhere in the overall plan, but not on every page.
117
+
118
+ ### 3.4 Build
119
+
120
+ - Prepare planned media before section implementation. Record each asset and its
121
+ delivery status in the plan.
122
+ - Follow the chosen framework adapter and the repository's established patterns.
123
+ - Preserve the manifest unless the user explicitly approved a change; record
124
+ approved divergence with a reason.
125
+ - Implement blueprint sections in order. Keep the machine plan status current.
126
+ - Do not open recipe catalogs before `conceptExploration` records three
127
+ brand-native concepts. Record every recipe file and load time in `recipeAccess`.
128
+ - A restructure or reimagine rebuilds markup/component boundaries when necessary;
129
+ it is not a stylesheet-only restyle.
130
+ - Every heavy effect ships with its planned reduced-motion, mobile, loading, and
131
+ runtime fallback.
132
+
133
+ ### 3.5 Craft
134
+
135
+ Run one dedicated finish pass with no new features:
136
+
137
+ - typography, wrapping, optical alignment, selection, and scrollbar;
138
+ - coherent surfaces, light direction, shadows, and material cues;
139
+ - hover, focus-visible, active, disabled, loading, empty, and error states;
140
+ - media crop, grading, dimensions, posters, and alt text;
141
+ - motion easing, choreography, intent, and reduced-motion behavior;
142
+ - responsive spacing, touch targets, overflow, and spatial integrity.
143
+
144
+ ### 3.6 Verify
145
+
146
+ Verification is evidence, not prose asserting that something was checked.
147
+
148
+ 1. Run the repository's targeted tests, typecheck, and build.
149
+ 2. Run the page and perform the `ux` functional audit.
150
+ 3. Verify desktop and approximately 390px mobile.
151
+ 4. Check the console, links, forms, keyboard path, states, reduced motion,
152
+ responsive overflow, and pointer hit areas.
153
+ 5. For motion/WebGL/video, record runtime evidence and performance numbers.
154
+ 6. Reconcile every plan section and asset against what visibly shipped.
155
+ 7. Write `.dreative/verify.json` and run `dreative audit`.
156
+ 8. Fix every error. Warnings require either a fix or a recorded justification.
157
+
158
+ Every evidence-backed substitution references passing evidence IDs whose proof
159
+ meets its declared success criteria. Vague reasons such as "it did not fit",
160
+ "restraint", "felt better", or "3D was unnecessary" fail audit.
161
+
162
+ The task is complete only when the plan has no `planned` sections, preservation
163
+ passes, verification contains no failing evidence, and `dreative audit` passes.
164
+
165
+ ### 3.7 Learn
166
+
167
+ Append one entry to `.dreative/ledger.json` after delivery:
168
+
169
+ - chosen and rejected concepts;
170
+ - user preferences;
171
+ - treatments already used;
172
+ - runtime failures and the fallback they earned.
173
+
174
+ Use this history to avoid repetitive signatures and known-bad approaches on the
175
+ next run. Never store secrets or unrelated user information.
176
+
177
+ ## 4. Ambition tiers
178
+
179
+ - **Solid (`solid`):** complete, accessible, responsive product-quality UI.
180
+ - **Premium (`premium`):** strong design read, deliberate media, signature detail, craft pass.
181
+ - **Expressive (`expressive`):** coordinated motion/interaction system with measured fallbacks.
182
+ - **Award (`award`):** distinctive spatial/media system with performance, occlusion, and
183
+ fallback evidence.
184
+
185
+ Higher tiers inherit lower-tier requirements. Do not impose `award`-tier cost on a
186
+ solid or premium request. See `references/TIERS.md` for exact deliverables.
187
+
188
+ ## 5. Preservation rules
189
+
190
+ - Preserve behavior, not necessarily placement or markup shape.
191
+ - Stable IDs, routes, handlers, form fields, visible strings, conditional states,
192
+ analytics hooks, and accessibility labels are contractual unless approved.
193
+ - `dreative audit` checks each manifest needle after implementation.
194
+ - Intentional changes require `intentionallyChanged: true` and `changeReason`.
195
+ - A visually successful redesign that loses behavior fails.
196
+
197
+ ## 6. Framework adapters
198
+
199
+ Load exactly one primary adapter from `frameworks/` plus `styling.md` when useful.
200
+ Adapters provide technical implementation guidance only; they do not override the
201
+ plan, design doctrine, preservation contract, or verification gates.
202
+
203
+ ## 7. Completion report
204
+
205
+ Report:
206
+
207
+ - chosen concept, tier, depth, and skills;
208
+ - each section as shipped/fallback/cut;
209
+ - preservation result;
210
+ - tests and runtime evidence;
211
+ - known limitations and next step.
212
+
213
+ Never claim a check ran unless it actually ran.
214
+
215
+ ## 8. Optional visual round-trip
216
+
217
+ Use only when explicitly requested:
218
+
219
+ 1. Extract the relevant pages into `.dreative/project.json` and replica files.
220
+ 2. Run `dreative baseline`.
221
+ 3. Start the editor and service `dreative wait` events.
222
+ 4. Supported requests are `propose-skeletons`, `propose-variants`, `edit-block`,
223
+ `design-page`, and `edit-element`. Read `DESIGN.md` and request-selected skills
224
+ before responding.
225
+ 5. On the `finish` event, apply the compact diff to the real source using its
226
+ source pointers, then run the same preservation and verification gates as
227
+ Direct Design.
228
+
229
+ The editor is an optional input surface. It never weakens the Direct Design
230
+ quality, preservation, or verification contract.
@@ -0,0 +1,13 @@
1
+ # Next.js adapter
2
+
3
+ - Preserve App Router/Pages Router conventions already used by the repository.
4
+ - Prefer Server Components; add `"use client"` only at the smallest interactive
5
+ boundary.
6
+ - Keep metadata, loading, error, not-found, route groups, and parallel routes
7
+ intact during redesigns.
8
+ - Use `next/image` with dimensions/sizes and `next/font` when compatible with the
9
+ existing stack.
10
+ - Dynamically import browser-only animation/WebGL with SSR disabled and a real
11
+ poster/skeleton fallback.
12
+ - Do not move data fetching client-side merely to simplify visual implementation.
13
+ - Verify navigation, hydration, production build, and both server/client states.
@@ -0,0 +1,12 @@
1
+ # React and Vite adapter
2
+
3
+ - Follow the repository's component boundaries and state-management conventions.
4
+ - Keep page structure semantic; use components for repeated behavior, not every
5
+ visual wrapper.
6
+ - Lazy-load heavy routes and 3D/media systems with `React.lazy` and `Suspense`.
7
+ - Put browser-only effects in guarded effects and clean up listeners, observers,
8
+ timelines, media, and WebGL resources on unmount.
9
+ - Preserve existing providers, route composition, handlers, and test selectors.
10
+ - Use Vite asset imports or `public/` consistently with the host project.
11
+ - Run the repository's typecheck/build and verify the production bundle, not only
12
+ the development server.
@@ -0,0 +1,14 @@
1
+ # Styling-system adapter
2
+
3
+ - Keep the repository's existing styling system unless migration was explicitly
4
+ approved.
5
+ - For Tailwind, reuse theme tokens and component recipes; avoid unreadable piles
6
+ of one-off arbitrary values.
7
+ - For CSS Modules, colocate component styles and keep global tokens/utilities in
8
+ the established global layer.
9
+ - For CSS-in-JS, preserve SSR extraction and theme providers; avoid per-render
10
+ style object creation in animated paths.
11
+ - For design systems, compose existing primitives before creating replacements.
12
+ - Put durable color, type, spacing, radius, shadow, and motion decisions in tokens.
13
+ - Verify focus-visible, forced colors where relevant, reduced motion, responsive
14
+ overflow, and browser support for advanced CSS.
@@ -0,0 +1,10 @@
1
+ # SvelteKit adapter
2
+
3
+ - Preserve load functions, actions, route layouts, error pages, and progressive
4
+ enhancement.
5
+ - Keep browser-only motion/WebGL inside `onMount` and return cleanup functions.
6
+ - Use actions for reusable DOM behaviors and stores/runes according to the
7
+ repository's established version.
8
+ - Preserve form actions, enhancement behavior, bindings, events, and selectors.
9
+ - Avoid turning server data flows into client-only fetches for visual convenience.
10
+ - Verify SSR/hydration, navigation, actions, production build, and mobile states.
@@ -0,0 +1,12 @@
1
+ # Vue and Nuxt adapter
2
+
3
+ - Preserve the repository's Composition/Options API convention and component
4
+ contracts.
5
+ - Keep Nuxt layouts, middleware, route metadata, async data, error, and loading
6
+ behavior intact.
7
+ - Put browser-only effects behind `onMounted`/`ClientOnly`; dispose them in
8
+ `onBeforeUnmount`.
9
+ - Prefer scoped components/composables for behavior and semantic templates for
10
+ structure.
11
+ - Preserve emitted events, model bindings, slots, and test selectors.
12
+ - Verify SSR/hydration, production build, navigation, and state transitions.
@@ -0,0 +1,44 @@
1
+ # 3D implementation recipes
2
+
3
+ Load only after three original spatial concepts are recorded. Record access in
4
+ `recipeAccess`.
5
+
6
+ ## Recognizable product/subject
7
+
8
+ - R3F Canvas loaded dynamically with SSR off.
9
+ - `useGLTF` + preload, Environment/IBL, one key light, contact shadows, bounded
10
+ camera framing, restrained damped parallax/orbit.
11
+ - Poster occupies the final layout while loading and on mobile/low power.
12
+ - Compress GLB with Draco/Meshopt; measure bytes and triangles.
13
+
14
+ ## Photoreal cutout billboard
15
+
16
+ - Real transparent image on a plane (`alphaTest` where appropriate).
17
+ - Depth comes from parallax against other layers, restrained perspective
18
+ rotation, contact shadow, rim/fresnel treatment, and optional angle swaps.
19
+ - Verify alpha, matching light temperature, and no sticker-like overlap.
20
+
21
+ ## Shader surface
22
+
23
+ - Plane/fullscreen material with `uTime`, damped input, resolution, and palette
24
+ uniforms from the page system.
25
+ - Slow domain-warp/noise, material response, or media-texture transformation;
26
+ never use rainbow cycling or promote a generic blob as the signature.
27
+
28
+ ## Points/data structure
29
+
30
+ - BufferGeometry points or instancing; shader-driven position/size/color.
31
+ - Use when data/spatial subject earns it, not as ambient filler.
32
+ - Desktop count measured; mobile halves or posters; pause off-screen.
33
+
34
+ ## DOM-synced media
35
+
36
+ - One shared scene, real DOM images/videos retained, planes follow measured
37
+ bounding rects, exact source assets become textures.
38
+ - Context loss/reduced motion reveals DOM media immediately.
39
+
40
+ ## Runtime checklist
41
+
42
+ Live context and nonblank draw; asset loaded; texture/material identity; input
43
+ response; reduced-motion still; mobile fallback; context-loss poster; no
44
+ occlusion; capped DPR; frame-time and transferred-weight evidence.
@@ -0,0 +1,19 @@
1
+ # Cinematic implementation recipes
2
+
3
+ Load after three original cinematic concepts are recorded; log the file and
4
+ timestamp in `recipeAccess`.
5
+
6
+ - **Living shader surface:** slow palette-bound domain warp/refraction with
7
+ damped input and graded grain; static poster fallback.
8
+ - **Velocity-reactive media:** exact image/video texture responds to clamped
9
+ scroll/drag velocity and settles crisp at rest.
10
+ - **Drag-to-explore:** bounded/inertial scene or media movement with keyboard
11
+ chapter controls and visible instruction.
12
+ - **Click/hold focus:** hold changes material/camera/audio state; click/tap toggle
13
+ alternative and Escape restores.
14
+ - **Material transition:** same surface masks/dissolves between chapters while
15
+ content remains semantic DOM.
16
+ - **Audio layer:** opt-in ambient bed plus sparse state cues; mute/pause on hidden
17
+ and route cleanup.
18
+ - **Budget path:** pre-rendered seamless video/sequence carries atmosphere while
19
+ DOM interaction and type provide responsiveness.
@@ -0,0 +1,18 @@
1
+ # Immersive implementation recipes
2
+
3
+ Load after three world concepts are recorded; log access in `recipeAccess`.
4
+
5
+ - **Persistent stage:** root canvas/DOM stage plus route-published scene states;
6
+ tween between states without remounting the world.
7
+ - **Scroll journey:** tall semantic DOM chapters drive damped camera/material/
8
+ media state; expose chapter navigation and keep copy selectable.
9
+ - **Shared-object transition:** one subject persists while route content exits,
10
+ camera/material moves, then new content enters.
11
+ - **Portal transition:** mask/plane opens into the next state; direct URLs render
12
+ the destination without requiring the transition.
13
+ - **Preloader:** real progress from fonts/models/textures, useful content/fallback
14
+ immediately available, one choreographed handoff.
15
+ - **Mobile translation:** shorter chapters, no long pins, lower scene complexity,
16
+ poster/static spatial composition where necessary.
17
+ - **Fallback:** conventional routes and content remain complete when the stage is
18
+ absent, reduced, or lost.
@@ -0,0 +1,60 @@
1
+ # Media implementation recipes
2
+
3
+ Load only after `conceptExploration` records three original concepts. Record the
4
+ load in `recipeAccess`. These constructions solve technical problems; they do
5
+ not choose the concept.
6
+
7
+ ## DOM-tier constructions
8
+
9
+ - **Curtain/window:** overflow-hidden frame; animate an inner clip/mask while
10
+ coordinating nearby type. Keep the image semantic and dimensions explicit.
11
+ - **Strip/slice:** duplicate the same asset into clipped strips with staggered
12
+ offsets; cap strip count on mobile and provide an unsliced fallback.
13
+ - **Print/pixel develop:** reveal a preprocessed dither/mosaic state into the
14
+ final image; avoid per-pixel DOM nodes.
15
+ - **Directional hover:** map entry direction or pointer position to a mask;
16
+ expose the same content by tap/focus.
17
+ - **Drag/inertia gallery:** pointer capture + velocity decay + bounds; keyboard
18
+ controls and conventional links remain available.
19
+ - **Frame scrub:** preload a bounded image sequence, draw into one canvas, map
20
+ scroll/time to frame index, and use a poster on reduced motion.
21
+
22
+ ## WebGL media plane
23
+
24
+ 1. Keep `<img>`/`<video>` in normal DOM flow with semantics and dimensions.
25
+ 2. Use its exact asset as the texture and copy its bounding rect to one shared
26
+ scene plane.
27
+ 3. Apply brand-native displacement/refraction/decomposition uniforms driven by
28
+ scroll, pointer, drag, or time.
29
+ 4. Compare effect and source rects during verification.
30
+ 5. On context loss, low power, or reduced motion, reveal the DOM media.
31
+
32
+ Useful families: noise-mask dissolve, UV flow/refraction, velocity smear/RGB
33
+ split, depth-map parallax, point/particle decomposition, slice/shatter,
34
+ feedback/trails, and material-light response. Use the family that develops the
35
+ concept; do not collect one of each.
36
+
37
+ ## Participatory constructions
38
+
39
+ - **Depth dive:** separate foreground/background or depth map; camera/UV scale
40
+ crosses the image plane into layered space; reverse cleanly on scroll-back.
41
+ - **Decompose/reassemble:** image samples become particles/tiles and later
42
+ reorganize into a new semantic state.
43
+ - **Temporal scrub:** visitor controls a meaningful change in time, not a
44
+ decorative autoplay loop.
45
+ - **Physical media:** drag, throw, stack, sort, or peel assets with inertia and
46
+ accessible equivalents.
47
+ - **Refractive exploration:** pointer/scroll changes how the visitor sees the
48
+ same asset rather than layering unrelated noise above it.
49
+ - **Scene-responsive media:** media palette, material, crop, or topology reacts
50
+ to a persistent scene instrument.
51
+
52
+ ## Performance and fallbacks
53
+
54
+ - Compress responsive images (AVIF/WebP plus safe fallback), define `sizes`, and
55
+ preload only true LCP media.
56
+ - Keep initial heavy media inside the selected tier budget; lazy-load later
57
+ chapters and pause hidden/off-screen work.
58
+ - Cap canvas DPR, reuse buffers/materials, avoid allocations in render loops.
59
+ - Mobile halves complexity or uses a purpose-designed poster/DOM treatment.
60
+ - Fallback preserves the concept's hierarchy even when the mechanism simplifies.