dreative 0.4.1 → 0.5.1
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.
- package/README.md +35 -35
- package/dist/cli/index.js +38 -1
- package/dist/server/ai.js +177 -0
- package/dist/server/preview.js +73 -73
- package/dist/ui/index.html +11 -11
- package/package.json +1 -1
- package/skill/dreative/DESIGN.md +206 -15
- package/skill/dreative/PLAN.md +455 -157
- package/skill/dreative/SKILL.md +149 -128
- package/skill/dreative/skills/3d.md +113 -3
- package/skill/dreative/skills/cinematic.md +232 -232
- package/skill/dreative/skills/experimental.md +98 -0
- package/skill/dreative/skills/immersive.md +223 -223
- package/skill/dreative/skills/media.md +564 -216
- package/skill/dreative/skills/mobile.md +117 -117
- package/skill/dreative/skills/motion.md +31 -4
- package/skill/dreative/skills/refined.md +102 -102
- package/skill/dreative/skills/ux.md +144 -144
package/skill/dreative/SKILL.md
CHANGED
|
@@ -1,128 +1,149 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: dreative
|
|
3
|
-
description:
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Dreative — frontend design skill (+ optional visual editor)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
**
|
|
32
|
-
|
|
33
|
-
**
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
(
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
-
|
|
104
|
-
- `
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
- `
|
|
125
|
-
- `
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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: run the mandatory Plan Mode protocol, then apply the design doctrine straight to the codebase. 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. Follow the checklist in §A, in order, every time. No server, no extraction, no wireframes.
|
|
11
|
+
- **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** (§0–§4 below). Be token-frugal at every step: read only the files you need, never re-read the whole app, and keep JSON compact.
|
|
12
|
+
|
|
13
|
+
## A. Mode A checklist (do the steps IN ORDER — skipping one is a bug)
|
|
14
|
+
|
|
15
|
+
1. **Plan — mandatory.** Run the `PLAN.md` protocol (same folder). Never ask *whether* to plan; the only skip is the user explicitly saying "no plan / just do it".
|
|
16
|
+
2. **Probe capabilities** (PLAN.md §1): image-gen, video-gen, 3D tooling, browser tools, ffmpeg. Verify by looking — a capability you didn't verify doesn't exist.
|
|
17
|
+
3. **Blueprint** (PLAN.md §2): section-by-section table (layout / media plan / motion / interaction / fallback) BEFORE asking the user anything.
|
|
18
|
+
4. **Questions — one at a time** (PLAN.md §3): AskUserQuestion, ONE question per call; skip what the prompt already answers clearly, re-ask narrowly what's ambiguous. The pool (incl. the treatments picker and its option list) lives in PLAN.md §3.
|
|
19
|
+
5. **Persist the plan** to `.dreative/plan.md` (PLAN.md §4), including the full Q&A transcript and skipped-question inferences.
|
|
20
|
+
6. **Mockups** if the user opted in (PLAN.md §4b): 1:1 visual replicas of the 1–2 highest-impact pages; approval gate before real code.
|
|
21
|
+
7. **Read the doctrine before code**: `DESIGN.md` + each chosen `skills/<name>.md`, ONCE. Run DESIGN.md §2's explore → commit passes (three divergent concepts, rejects recorded in the plan file; consult the choice ledger at `~/.dreative/ledger.md` if it exists). Commit (one line, to yourself) to register + design read + signature element — can't name all three ⇒ you're about to produce the generic default; stop and commit first.
|
|
22
|
+
8. **Assets first** (skills/media.md §1): generate AND edit (grade, crop, loop-cut, poster) every planned asset before section code. Record each in `.dreative/assets.json` (media.md §1) and reuse instead of regenerating.
|
|
23
|
+
9. **Build**: foundation (install + WIRE the animation stack, fonts, tokens, providers) → sections in blueprint order → page-level choreography + signature element. The Hard rules below apply throughout. **After the FIRST page is built, write `.dreative/system.md`** — the committed visual system as actually shipped: color tokens, type roles + sizes, radius rule, spacing base, motion vocabulary (the durations/eases in use), icon set, signature element. Every subsequent page — same session, resumed session, or later edit — reads it before designing; "the first page sets the system" only holds if the system survives context loss as a file.
|
|
24
|
+
10. **Craft pass — one full pass for finish only, no new features.** Top-tier and almost-there are separated by the last 5%, and it never survives being folded into the build step. Sweep and fix: (a) **easing audit** — every animation uses the build's motion signature (motion.md §5.5); grep for unexamined `ease`/default/`linear` and replace; (b) **surface audit** — every major surface passes DESIGN.md's surface & light doctrine (material cue present, one light direction, tinted shadows, no banding); (c) **state completeness** — every interactive element has designed hover, focus-visible, and active states (no browser defaults, no dead hovers); (d) **type finish** — `text-wrap: balance` on headlines, no orphan words in heroes, optical alignment of numerals/quotes, real `::selection` color, themed scrollbar where the register supports it; (e) **media finish** — every image/video sits at correct aspect with no CLS, posters graded to match the page, `alt` text real; (f) **the quiet check** — anything moving without a reason to (motion on task-flow surfaces: forms, checkout, dense data) gets stilled; clean-when-needed is part of craft, not a lesser mode. List what the pass changed in verify.md under `craft:`.
|
|
25
|
+
11. **Verify and write `.dreative/verify.md`** (§V). You may not declare done until that file exists with real evidence.
|
|
26
|
+
12. **Append the choice ledger**: one line to `~/.dreative/ledger.md` (DESIGN.md §2 — date · project · fonts · palette strategy · signature type · hero concept; create the file if missing).
|
|
27
|
+
13. **Report** against the plan — each blueprint row shipped / fallback / cut with reason — and close with the one editor tip: *"Tip: run `dreative start` / say 'open dreative' if you want to tweak this visually."* That's the only place the editor comes up.
|
|
28
|
+
|
|
29
|
+
### Hard rules (steps 9–11; details live in the named files)
|
|
30
|
+
|
|
31
|
+
- **Preservation contract** (DESIGN.md §11 — non-negotiable when redesigning existing code): BEFORE editing, build the manifest (every link, id/data-attribute, handler, form field, visible string, data view, conditional state — tabs, modals, auth branches); AFTER, mechanically verify each entry survives and report the ledger. Restructure moves things; it never loses them.
|
|
32
|
+
- **Depth honesty** (DESIGN.md §11): a confirmed restructure/reimagine rebuilds markup, component trees, and routing for real — never just restyles the old skeleton.
|
|
33
|
+
- **Real motion engineering** (skills/motion.md): chosen motion/3d/immersive/cinematic treatments ship with the proper libraries (GSAP + ScrollTrigger, Lenis, `motion/react`, three.js/R3F) — dependencies actually installed (`npm i gsap lenis` …), providers/render loops wired, choreography built. A static page with a few CSS transitions does not fulfill a motion request; the shipped result must clear motion.md §9's inventory.
|
|
34
|
+
- **No static media** (skills/media.md §0): a bare `background-image` or `<img>` behind text is a failure — every image/video gets an entrance/idle/response treatment (reveal, dissolve, pixel-develop, hover-wake, media plane…) and is edited/graded to the page before shipping. At award-site ambition, media planes with scroll-driven shader response are MANDATORY for hero + key gallery imagery (media.md §3). Generated media per DESIGN.md §7 — hero imagery, textures, seamless video loops woven into the motion system — is among the highest-impact upgrades available.
|
|
35
|
+
- **No coded organic 3D** (skills/3d.md §3): never model a real-world organic/textured object from primitives — realistic 3D subjects use a real GLB or a cutout image billboard (generated, or a sourced/matted photo when no image-gen tool exists); coded geometry is for abstract forms only and must carry real texture maps (generated, sourced, or procedural-shader). This ban is tool-independent: a missing image-gen MCP means the organic 3D element gets CUT or replaced (3d.md §3 rung 4), never coded from primitives.
|
|
36
|
+
- **References are studied, never guessed.** Screenshots/images → read with image tools, extract palette/type/layout/motion cues. URLs → fetch (browser tools or web fetch; look at real script/font/class evidence). Videos → watch only if tooling allows (PLAN.md §3's optional video-MCP offer); otherwise work from the user's description and say so.
|
|
37
|
+
|
|
38
|
+
## V. Verification (Mode A — evidence file required, mobile first)
|
|
39
|
+
|
|
40
|
+
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 (plus a comparative critique at expressive+ ambition), all mandatory, and it produces a FILE: write `.dreative/verify.md` recording the evidence below (screenshot paths, console summary, transform samples with values, audit results, rubric grades, fallbacks taken). **"Done" without `verify.md` is not done.** Run every check at **~390px mobile width FIRST** (most real traffic is mobile, and it's where motion-heavy builds break), then desktop.
|
|
41
|
+
|
|
42
|
+
*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 (record both values in verify.md), and confirm scroll triggers fire at their positions — **but for image/media elements at dial ≥ 6, a sample whose only delta is uniform scale, translate, or opacity is NOT treatment evidence: that pattern IS the banned ken-burns/fade floor (media.md §0). Media evidence must name the mechanism and show it changing — clip-path/mask values mid-scroll, diverging parallax-layer offsets, a sampled shader uniform, a hover-response property — one line per hero/key image in verify.md, and a page whose per-image lines are all scale/opacity deltas fails item 10 below**; 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) the mobile pass per `skills/mobile.md` §5 when mobile shipped; (e) **performance gate** (whenever WebGL, video, or heavy scroll choreography shipped — always at award-site ambition): scroll the full page and watch for stutter — sample `requestAnimationFrame` deltas for a few seconds of scrolling (via the console/javascript tool) and flag sustained frames > 33ms; check total transferred weight against the tier budget (~3–5MB initial at award-site, less below); record both numbers in verify.md. A janky award-site is worse than a smooth expressive one — jank routes to the same failure doctrine as a broken effect (fix, tier down per DESIGN.md §13's tiering, or ship the planned fallback). **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; verify.md and the final report name what fell back and why.
|
|
43
|
+
|
|
44
|
+
*Stage 2 — visual self-critique.* Screenshot at ~390px mobile AND desktop — **one desktop screenshot PER blueprint section** (scrolled to each, saved to `.dreative/screenshots/`; a section without a screenshot is unverified, and mid-page sections are where traveling objects park on text), plus, if any persistent/traveling scene object shipped, an **occlusion sweep**: step the scroll 0→100% in ~10 increments and at each stop check the object against every visible headline/paragraph/control (screenshot or bounding-rect intersection via the console — `getBoundingClientRect` overlap between the object and text nodes; `pointer-events:none` does not excuse visual coverage). Any stop where decor covers words fails DESIGN.md §15's travel-map rule: fix the object's scripted berth, then re-sweep. 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, working, and honoring its commit mini-spec (right driver, brand-native — not swapped for a generic effect mid-build)? (4) spatial integrity per DESIGN.md §15 — scan for anything overlapping anything else: controls covered, rows/text clipped at an edge, floating widgets fighting for a 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? (9) **object honesty** — screenshot every custom 3D element and ask: would a stranger name it as the real object it claims to be (a coffee bean, a bottle), or does it read as an untextured blob/primitive? A blob FAILS: replace it with the cutout-billboard rung of 3d.md §3 (or cut it) before done. This check is answered with MECHANICAL evidence, not adjectives: quote the material line from the scene code in verify.md and confirm it carries a texture map or custom shader (3d.md §3's texture test) — writing "textured/physical/sculptural roast core" over a flat-color primitive is self-deception the screenshot won't argue with, and the subject test goes by what the plan/copy says the element represents, not what the code names it. Passing the texture test does NOT save an abstract signature: if the page's promoted signature object is a coded sphere/orb/blob/torus (3d.md §3 — abstract forms are supporting-only), it fails here however well-shaded, and especially if it floats over a photograph; replace it with a recognizable rung-1/rung-2 subject or demote it to background atmosphere before done. Also check STAGING (3d.md §1.5): does every 3D prop sit in its planned berth — and does any prop's bounding rect overlap a photograph/media element without being genuinely composited into it (matched light + cast shadow)? A prop floating over other imagery, or with no reserved berth in the plan, fails here. At award-site ambition also confirm the REQUIRED prop shipped (3d.md §0): at least one recognizable dimensional object (GLB or cutout billboard) with its dimensional behaviors provably running — a page with zero real-looking props, or only a shader background, fails the tier. (10) at motion dial ≥ 6 / expressive ambition and up: do hero + key section images each have a scroll- or cursor-DRIVEN treatment (media.md §0's zoom/fade-floor rule) — fade-in + ken-burns everywhere fails, sourced/stock images included; at dial ≥ 7 additionally: does the planned media SET-PIECE (media.md §0 — tornado/vortex, disintegration, shatter, living overlay…) provably run (named element + driver + evidence), and at dial ≥ 8 is it PIXEL-transforming per media.md §0 (sampled uniform/particle count/frame index changing with scroll — rectangle choreography like orbit/collapse does not qualify)? A page of uniformly quiet treatments with no set-piece fails; at award-site ambition additionally: is at least one image provably a scroll-reactive media plane (media.md §3's sampled-uniform evidence in verify.md), and does the page meet media.md §0's PIXEL-class coverage floor — tally every hero/key image in verify.md as quiet-class or pixel-class with its named mechanism: at dial ≥ 8 at least half (minimum 3, set-piece included) must be pixel-class, each a different mechanism, quiet ones justified as intensity-curve rests? One set-piece + curtains everywhere else fails the tally. All images flat/static ⇒ the tier is not met. Each pixel-class entry also passes media.md §0's PERCEIVABILITY bar with screenshot-pair evidence: capture the element at two scroll/input states (save both to `.dreative/screenshots/`, reference the pair in verify.md) and confirm the image's CONTENT differs unmistakably between them — pieces apart, pixels displaced, particles detached; a pair a stranger would describe as "it zoomed/slid" is a FAIL however the uniforms moved (raise amplitude or swap mechanism, then re-shoot). Confirm the tally spans more than one mechanism FAMILY (all-depth or all-particles is monotone — media.md §0's choice disciplines), that the set-piece family differs from the previous build's per the choice ledger, and shoot the same two-state pair for the required 3D prop's motion. If a second set-piece shipped, confirm its stated purpose, different family, and the rest between them. (11) **wholeheartedness, dial ≥ 7 / expressive+** — re-count PLAN.md §2's mechanism-diversity quota against what actually SHIPPED (≥4 distinct mechanisms, ≥3 distinct drivers, none used more than twice; tallies in verify.md); confirm plan.md records the entropy draw (literal command + output) and the rolled provocation is visibly on the page, not token-gestured; then name the THREE moments a visitor would screenshot or describe to someone — if you can't name three, the page is compliant, not designed: build them before done. A build where every media/motion item sits exactly at its rule's minimum is a failed build at this tier — floors are where fallbacks land, never where designs aim. Fix what fails and re-check once; grades go in verify.md.
|
|
45
|
+
|
|
46
|
+
*Stage 2b — comparative critique (expressive/award-site ambition).* Rubrics catch rule-breaks; they can't measure taste. Put the desktop screenshot next to the closest reference actually studied for this build — the user's reference if one was given, else the nearest calibration site from PLAN.md §3 (fetch/screenshot it now if browser tools exist) — and name the THREE biggest gaps between yours and theirs (type confidence, spacing rhythm, motion cohesion, image quality, compositional courage…). Fix what's fixable in this pass; log each gap + action (fixed / accepted with reason) in verify.md. "No meaningful gaps" is almost never the honest answer — finding none means look harder.
|
|
47
|
+
|
|
48
|
+
*§9 hard gate (expressive/award-site ambition).* motion.md §9's shipped-motion inventory is a completion gate, not a checklist: for the chosen dial, every inventory item must be either PROVEN running by Stage 1 (named element + trigger + evidence in verify.md) or logged in verify.md as a deliberate cut with the reason. An item that is merely absent — no evidence, no cut-reason — means the task is NOT done: build it (or its PLAN.md fallback), then re-verify; never report done with an unexplained §9 gap. Grade the mobile pass against the shifted dial (mobile.md maps desktop dial N to mobile N−2), not the desktop inventory.
|
|
49
|
+
|
|
50
|
+
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 record in verify.md which gates could NOT be verified — never silently skip the pass.
|
|
51
|
+
|
|
52
|
+
## Doctrine (applies to BOTH modes)
|
|
53
|
+
|
|
54
|
+
**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.
|
|
55
|
+
|
|
56
|
+
**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).
|
|
57
|
+
|
|
58
|
+
Everything below describes Mode B.
|
|
59
|
+
|
|
60
|
+
## 0. Setup
|
|
61
|
+
|
|
62
|
+
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/`).
|
|
63
|
+
|
|
64
|
+
## 1. Extract (code → layout + replica)
|
|
65
|
+
|
|
66
|
+
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.
|
|
67
|
+
|
|
68
|
+
**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`.
|
|
69
|
+
|
|
70
|
+
**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:
|
|
71
|
+
- *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").
|
|
72
|
+
- *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.
|
|
73
|
+
|
|
74
|
+
**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.
|
|
75
|
+
|
|
76
|
+
Per page, produce:
|
|
77
|
+
|
|
78
|
+
1. **Layout** — the block tree in `project.json` (schema below).
|
|
79
|
+
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.
|
|
80
|
+
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.
|
|
81
|
+
|
|
82
|
+
Write `.dreative/project.json`:
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
{ "version": 1, "brief": { "aesthetic": "minimal", "vibe": "", "audience": "", "variance": 7, "motion": 5, "density": 4, "notes": "" }, "pages": [ {
|
|
86
|
+
"id": "pg_home", "name": "Home", "canvasPos": {"x": 40, "y": 40},
|
|
87
|
+
"theme": { "bg": "#0d0d0f", "fg": "#e8e8ea", "accent": "#f59e0b" },
|
|
88
|
+
"status": "skeleton", "source": "src/pages/Home.tsx",
|
|
89
|
+
"layout": { "id": "blk_root", "type": "section", "label": "Home", "direction": "column", "children": [ … ] }
|
|
90
|
+
} ] }
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
(page objects also take `"replicaFile": "replica/pg_home.tsx"` and `"group": "Admin Studio"` for split views of one screen)
|
|
94
|
+
|
|
95
|
+
Block: `{ id, type, label, text?, summary?, direction?, sizeHint?, source?, children? }`
|
|
96
|
+
- `type`: section | row | column | nav | hero | card-grid | list | form | footer | text | image | button
|
|
97
|
+
- `label`: short recognizable name (shown on hover/inspector).
|
|
98
|
+
- `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.
|
|
99
|
+
- 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.
|
|
100
|
+
- `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.
|
|
101
|
+
- Keep depth sensible (3–5 levels); every meaningful visible element should exist, but don't model every span.
|
|
102
|
+
- Ids must be unique and stable; prefix `pg_`/`blk_` plus a slug.
|
|
103
|
+
- Space pages on the canvas: x += 480 per page.
|
|
104
|
+
- 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.
|
|
105
|
+
|
|
106
|
+
Then snapshot the baseline: `dreative baseline` (start the server first, step 2, if not running).
|
|
107
|
+
|
|
108
|
+
## 2. Launch
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
dreative start # serves http://localhost:4820, opens browser (background this)
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
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.
|
|
115
|
+
|
|
116
|
+
## 3. Service requests (the wait loop)
|
|
117
|
+
|
|
118
|
+
Repeat until finish:
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
dreative wait # blocks up to ~8 min; prints ONE event as JSON
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
- `{"kind":"none"}` → just run `dreative wait` again.
|
|
125
|
+
- `{"kind":"request","id","type","payload"}` → handle per table below, then
|
|
126
|
+
`dreative respond <id> <resultFile>` (write the result JSON to a temp file) or `dreative respond <id> --error "why"`.
|
|
127
|
+
- `{"kind":"finish","diff":…}` → go to step 4.
|
|
128
|
+
|
|
129
|
+
| type | payload | result to respond with |
|
|
130
|
+
|---|---|---|
|
|
131
|
+
| `propose-skeletons` | `{prompt, brief?}` | Array of 1–3 `{name, layout}` page proposals (block schema above), structured per DESIGN.md layout rules |
|
|
132
|
+
| `propose-variants` | `{pageName, layout, brief?}` | Array of 1–3 `{name, layout}` variants |
|
|
133
|
+
| `edit-block` | `{block, instruction}` | The updated block JSON (same id) |
|
|
134
|
+
| `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}` |
|
|
135
|
+
| `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}` |
|
|
136
|
+
|
|
137
|
+
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). Persist that system to `.dreative/system.md` after the first page and re-read it before each later page or `edit-element`, so consistency survives session boundaries.
|
|
138
|
+
|
|
139
|
+
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.
|
|
140
|
+
|
|
141
|
+
## 4. Apply (finish)
|
|
142
|
+
|
|
143
|
+
The finish event's `diff` (also saved at `.dreative/finish.json`) contains only what changed vs the baseline:
|
|
144
|
+
|
|
145
|
+
- `pagesAdded` — full layouts; create real pages/components for them.
|
|
146
|
+
- `pagesRemoved` — confirm with the user before deleting real code.
|
|
147
|
+
- `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`.
|
|
148
|
+
|
|
149
|
+
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.
|
|
@@ -17,6 +17,17 @@ decoration: a random floating torus/blob behind hero text is the 3D equivalent o
|
|
|
17
17
|
the gradient blob — banned as a default reach. One 3D moment per page; make it the
|
|
18
18
|
signature element (DESIGN.md §2) or don't ship it.
|
|
19
19
|
|
|
20
|
+
**At award-site ambition, one 3D prop is REQUIRED, not optional:** the page
|
|
21
|
+
ships at least ONE dimensional prop that looks real — a rung-1 GLB or a
|
|
22
|
+
rung-2 transparent-background cutout billboard (§3) of a recognizable
|
|
23
|
+
subject, photoreal because it IS a photo/render, carrying the full
|
|
24
|
+
dimensional kit (parallax against layers, damped ±5-10° rotation, contact
|
|
25
|
+
shadow, rim light, multi-angle pseudo-orbit where it earns it) and sitting
|
|
26
|
+
in a §1.5 berth. An award plan with zero 3D props is incomplete; a page
|
|
27
|
+
whose only "3D" is a background shader plane does not satisfy this — the
|
|
28
|
+
prop must be an OBJECT. (Abstract coded forms remain supporting-only and
|
|
29
|
+
never count.)
|
|
30
|
+
|
|
20
31
|
Cheaper substitutes to consider first: CSS 3D transforms (`perspective` +
|
|
21
32
|
`rotateX/Y` on real DOM — free, accessible, great for cards/mockups/tilt), a
|
|
22
33
|
pre-rendered video/image sequence scrubbed on scroll, or a Lottie/Rive vector
|
|
@@ -40,6 +51,31 @@ usually the strongest pre-render source.
|
|
|
40
51
|
Lazy-load the entire 3D bundle (`next/dynamic` / `React.lazy`) with an SSR-off
|
|
41
52
|
canvas and a styled poster fallback. Three.js must never be in the critical path.
|
|
42
53
|
|
|
54
|
+
## 1.5 Staging: a prop gets a designed berth, never a squat
|
|
55
|
+
|
|
56
|
+
Where a 3D element SITS is as much of the craft as what it is. Every 3D
|
|
57
|
+
prop/canvas object gets a reserved compositional berth negotiated with the
|
|
58
|
+
layout at plan time — an empty grid lane, a color-field stage, a gutter the
|
|
59
|
+
type deliberately avoids — exactly like DESIGN.md §15's travel map. Hard
|
|
60
|
+
rules:
|
|
61
|
+
|
|
62
|
+
- **Never parked on top of other imagery.** A 3D object overlapping a
|
|
63
|
+
photograph or media plane (the floating-orb-over-the-hero-photo failure)
|
|
64
|
+
is banned UNLESS it is composited INTO that scene for real: light
|
|
65
|
+
direction, color temperature, and a contact/cast shadow all matched so it
|
|
66
|
+
reads as part of the photo, not a sticker on it. "Semi-transparent so you
|
|
67
|
+
can see the photo through it" is the sticker, not the integration.
|
|
68
|
+
- **Never covering text or controls** — DESIGN.md §15's occlusion rules
|
|
69
|
+
apply at every scroll position.
|
|
70
|
+
- The berth is named in the plan blueprint (which section, which lane,
|
|
71
|
+
what the type does to make room). A prop with no reserved berth doesn't
|
|
72
|
+
ship — the layout must be designed around the object, not the object
|
|
73
|
+
dropped onto a finished layout.
|
|
74
|
+
- The object is anchored to its berth by scene means: grounded by shadow,
|
|
75
|
+
lit by the page's one light direction, cropped by the frame on purpose if
|
|
76
|
+
oversized. An object that just floats centered in leftover space reads as
|
|
77
|
+
clipart (see §2 grounding).
|
|
78
|
+
|
|
43
79
|
## 2. Scene fundamentals (where amateur scenes fail)
|
|
44
80
|
|
|
45
81
|
- **Lighting is the craft.** Default: `<Environment preset="studio"|"city">` for
|
|
@@ -64,9 +100,77 @@ canvas and a styled poster fallback. Three.js must never be in the critical path
|
|
|
64
100
|
- glTF/GLB only, Draco or Meshopt compressed (`gltf-transform optimize in.glb
|
|
65
101
|
out.glb --compress draco`). Budget: hero model ≤ 2-3 MB, ≤ 100k triangles.
|
|
66
102
|
- `useGLTF.preload(url)`; wrap in `<Suspense>` with a poster (not a spinner).
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
103
|
+
|
|
104
|
+
**No model available? Walk the realism ladder — in this order:**
|
|
105
|
+
|
|
106
|
+
1. **Real GLB** the repo/user already has, or one the user can supply.
|
|
107
|
+
2. **Image-billboard prop (the DEFAULT for any real-world subject).** Get
|
|
108
|
+
the object as a transparent-background cutout — generate it if an image
|
|
109
|
+
tool exists (media.md §1.5 pipeline — verify the alpha is real); with NO
|
|
110
|
+
image-gen tool, source a real photo instead (a verified stock/CDN photo of
|
|
111
|
+
the subject, matted to transparency with rembg/sharp/ImageMagick if
|
|
112
|
+
available, or a photo whose own background already matches the scene so no
|
|
113
|
+
matte is needed). Put it on a plane in the scene
|
|
114
|
+
(`transparent`, `alphaTest ~0.5`, `toneMapped: false` if pre-graded), and
|
|
115
|
+
sell the depth with scene means: parallax against other layers, damped
|
|
116
|
+
mouse/scroll rotation of ±5-10° (a flat card barely rotating reads as
|
|
117
|
+
dimensional), scroll-linked scale/drift, a soft contact shadow, and a rim
|
|
118
|
+
of scene light via a subtle additive duplicate or shader fresnel. Generate
|
|
119
|
+
2-3 angles of the same subject and crossfade/swap by scroll chapter for a
|
|
120
|
+
pseudo-orbit. This looks photoreal because it IS a photo — it beats coded
|
|
121
|
+
geometry for any organic or textured subject, every time.
|
|
122
|
+
3. **Coded geometry — abstract SUPPORTING forms ONLY.** Primitives/extrusions
|
|
123
|
+
are allowed for geometry that is genuinely abstract or hard-surface-simple
|
|
124
|
+
(shader planes, ribbons, crystals, grids, a device from rounded boxes with
|
|
125
|
+
an `Html` screen) — but only in a SUPPORTING role: background surface,
|
|
126
|
+
particle field, atmosphere. **An abstract coded form may never be the
|
|
127
|
+
promoted signature object.** A floating sphere/orb/blob/torus — however
|
|
128
|
+
shader-textured, however poetic its name ("eclipse", "core", "monolith") —
|
|
129
|
+
reads to a visitor as "a stupid orb"; the signature 3D element must be a
|
|
130
|
+
RECOGNIZABLE subject a stranger names correctly: a rung-1 GLB, a rung-2
|
|
131
|
+
generated/sourced cutout billboard, or a textured mesh of a nameable thing.
|
|
132
|
+
If image-gen exists, the signature defaults to rung 2 — generate the subject
|
|
133
|
+
as a transparent cutout and sell the depth with scene means. Compositing a
|
|
134
|
+
translucent shader sphere ON TOP of a photograph is the canonical form of
|
|
135
|
+
this failure and is a ship-blocker, not a signature.
|
|
136
|
+
**Modeling an organic or richly-textured real object
|
|
137
|
+
(food, beans, plants, fabric, skin, liquid, wood…) from primitives is
|
|
138
|
+
BANNED as a visible element** — an untextured lathe/sphere "coffee bean"
|
|
139
|
+
reads as a red blob, not a bean; that failure is worse than no 3D. If a
|
|
140
|
+
realistic subject must be 3D and no GLB exists, use rung 2.
|
|
141
|
+
4. **Rung 2 unreachable does NOT unlock rung 3.** The organic-subject ban is
|
|
142
|
+
unconditional — it does not relax because the environment has no image-gen
|
|
143
|
+
tool or the cutout failed. If neither a GLB nor any photo source (rung 2's
|
|
144
|
+
no-tool path) exists, the organic 3D element is CUT: replace it with an
|
|
145
|
+
abstract signature (shader plane, particles, ribbons — rung-3-legal forms)
|
|
146
|
+
or with the sourced photography itself as a scroll-reactive media plane
|
|
147
|
+
(media.md §3), and tell the user what asset would unlock the real thing.
|
|
148
|
+
(The rung-3 supporting-only restriction still applies to that replacement:
|
|
149
|
+
it demotes the moment to atmosphere; it does not mint a new hero orb.)
|
|
150
|
+
"We had no tools, so I coded the bean" is the exact failure this rung
|
|
151
|
+
exists to stop.
|
|
152
|
+
|
|
153
|
+
Any coded mesh that DOES ship must carry a real material identity per
|
|
154
|
+
experimental.md §1 — and texture maps can be GENERATED: prompt the image tool
|
|
155
|
+
for a tileable albedo/detail texture ("seamless tileable dark roast coffee-bean
|
|
156
|
+
surface texture, matte, high detail"), load it as `map` + drive `bumpMap`/
|
|
157
|
+
`roughnessMap` from it. With no image tool, source a tileable texture (a real
|
|
158
|
+
photo crop, a CC0 texture CDN) or build material identity in a shader
|
|
159
|
+
(procedural noise-driven roughness/normal, fresnel rim, environment
|
|
160
|
+
reflection). A flat-color `meshStandardMaterial` on a visible custom mesh is a
|
|
161
|
+
ship-blocker, not a style — and "no image tool" is not an exemption; if no
|
|
162
|
+
texture path exists, the mesh doesn't ship.
|
|
163
|
+
|
|
164
|
+
**The subject test is what the element REPRESENTS, not what the code names
|
|
165
|
+
it.** If the plan, copy, aria-label, or your own verify prose describes the
|
|
166
|
+
mesh as a real thing ("roast core… coffee bean", "the bottle", "a leaf"), it
|
|
167
|
+
IS an organic/real subject and the ban applies — renaming a sphere-bean to an
|
|
168
|
+
"abstract signature" while shaping and coloring it as a bean is the exact
|
|
169
|
+
rationalization this section exists to stop. And texture is MECHANICAL, not
|
|
170
|
+
rhetorical: a shipped custom mesh passes only if its material provably carries
|
|
171
|
+
a `map`/`normalMap`/`roughnessMap` texture or a custom shader — point to the
|
|
172
|
+
line in verify.md. `meshPhysicalMaterial` with a flat `color` plus clearcoat/
|
|
173
|
+
roughness numbers is untextured, whatever the verify prose calls it.
|
|
70
174
|
|
|
71
175
|
## 4. Shaders (the highest-leverage 100 lines)
|
|
72
176
|
|
|
@@ -147,6 +251,12 @@ hues; size attenuation on; additive blending only on dark surfaces.
|
|
|
147
251
|
|
|
148
252
|
- **Product hero**: GLB + `Environment` + key light + `ContactShadows`, `Float`
|
|
149
253
|
idle, damped mouse parallax, scroll scrubs a 90° orbit. Poster until loaded.
|
|
254
|
+
**Variant trick (ciaoenergy.com):** ONE model, N variants — swap only the
|
|
255
|
+
label/albedo texture (`TextureLoader`, one AVIF per flavor/colorway) on the
|
|
256
|
+
same geometry as the user browses variants, and pair each with a
|
|
257
|
+
pre-rendered background video loop. Photoreal product-line 3D for the cost
|
|
258
|
+
of one GLB. The label texture can be GENERATED (image-gen at the label's
|
|
259
|
+
unwrapped aspect) when no real artwork exists.
|
|
150
260
|
- **Gradient-mesh hero background**: one plane, fbm + domain-warp fragment shader
|
|
151
261
|
mixing 3 palette colors, `uTime` 0.08, `uMouse` warps locally. ~120 lines, no
|
|
152
262
|
model, no lighting — the best effort/impact ratio in this file.
|