@marver-design/marver 0.2.4 → 0.3.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.
@@ -0,0 +1,171 @@
1
+ # Shape - an idea needs thinking before it needs screens
2
+
3
+ Run this when the human wants to think a feature through on the canvas - specs,
4
+ workflows, mood boards, inspiration - or when meaty new work deserves visual
5
+ alignment before wireframes. In a FIRST session it runs only when the human
6
+ chose it at the welcome/setup fork ("think it through together" / "start
7
+ something new, together") - never unprompted; the welcome flow owns the first
8
+ session and routes here. Discover stays the interview - questions, brief,
9
+ mode; Shape is the visual thinking surface built from its answers.
10
+
11
+ ## The feature-story board
12
+
13
+ One board per feature, reading as the feature's whole story - thinking at the
14
+ top, structure in the middle, the answer at the bottom:
15
+
16
+ ```
17
+ [ intent ] [ flow diagram ] [ spec ] [ moodboard ] <- scene: <feature>-specs
18
+ [ lo-fi list ] [ lo-fi editor ] [ lo-fi confirm ] <- scene: <feature>-lofi
19
+ [ hi-fi ] [ A variant ] [ B variant ] <- scene: <feature>
20
+ ```
21
+
22
+ **One scene per phase, not one scene for everything.** `<feature>-specs`
23
+ (content frames), `<feature>-lofi` (wireframes), `<feature>` (the hi-fi
24
+ answer). Scenes are the canvas's grouping unit - phase scenes give the board
25
+ rows, the sidebar sections, and device keys a phase to act on.
26
+
27
+ **Spacing is meaning - compose the board with a recipe, deliberately:**
28
+
29
+ ```json
30
+ "layout": {
31
+ "rows": [ ["evening-specs"], { "space": 2 },
32
+ ["evening-lofi"], { "space": 4 },
33
+ ["evening"] ],
34
+ "scenes": { "evening": { "rows": [["list", { "space": 2 }, "editor"]] } }
35
+ }
36
+ ```
37
+
38
+ - Graduate the gaps: a bigger space before the final hi-fi row than between
39
+ thinking and structure - the answer deserves its own room.
40
+ - Space units are ADAPTIVE (proportional to the touching frames), so a gap
41
+ between phone-sized rows needs a higher count than the same visual gap
42
+ between big spec frames - which is why the example uses 4 before the hi-fi
43
+ row and only 2 after the large specs. Judge the RENDERED gap, not the
44
+ number.
45
+ - ALWAYS isolate a variant group from ordinary frames with `space: 2` or more
46
+ on each touching side. Two similar-looking frames sitting near a normal one
47
+ read as confusion; the gap is what says "these two are alternatives of one
48
+ thing". (This rule is also in boards.md - it is binding, not taste.)
49
+
50
+ Content frames sit beside UI frames on the same board - ordinary atoms in the
51
+ board layout grammar (instructions/boards.md). Everything the canvas does -
52
+ selection, device keys, `d`, tidy, play, publish - works identically on them.
53
+
54
+ ## Content frames - blocks, not markup
55
+
56
+ A content frame is a normal `.tsx` frame composed from marver's block
57
+ primitives. Import them directly in the frame file (not through a barrel -
58
+ detection is lexical), and declare `intent` on every content frame:
59
+
60
+ ```tsx
61
+ import { Doc, Row, Col, Md, Diagram, Img } from '@marver-design/marver/content'
62
+
63
+ export const meta = { title: 'Checkout - how it works', intent: 'diagram' }
64
+
65
+ export default () => (
66
+ <Doc layout="wide">
67
+ <Row>
68
+ <Diagram title="Checkout flow">{`
69
+ flowchart LR
70
+ Cart --> Pay --> Confirm
71
+ `}</Diagram>
72
+ <Col>
73
+ <Img src="stripe-ref.png" caption="Inspiration: Stripe checkout" />
74
+ <Md>{`### Why payment before account\nDropoff data says... see the [cart](goto:checkout/cart).`}</Md>
75
+ </Col>
76
+ </Row>
77
+ </Doc>
78
+ )
79
+ ```
80
+
81
+ - `Doc` is the frame root: `layout="document"` (readable column, 760) or
82
+ `"wide"` (1280). It owns the outer padding and reports its height - the
83
+ frame sizes itself to its content on the canvas.
84
+ - `Row` / `Col` / `Space` are the board vocabulary at frame scale - flex lanes
85
+ with gap units (`space={n}`, one-off gaps via `<Space n={2} />`). Rows wrap
86
+ on narrow devices, so responsiveness is free. This RHYMES with the board
87
+ layout grammar; it is not the same grammar - think flex, not lanes.
88
+ - `Md` renders theme-aware markdown. `[label](goto:scene/frame)` links jump
89
+ the canvas to a real frame - cross-link specs and screens. Raw HTML is
90
+ inert; images must be local `design/assets/` paths.
91
+ - `Diagram` is first-class Mermaid - it can be an entire frame. A parse error
92
+ shows an in-frame card: fix the source, the frame heals live. Never hand-set
93
+ colors or `%%{init}%%` themes - marver's palette is injected and source
94
+ overrides are stripped.
95
+ - `Img` shows `design/assets/<src>` with an optional caption; `h={n}` cover-crops
96
+ to a fixed rendered height (the lever for optically aligning a mixed row - see
97
+ "Images and mood boards" below). Blocks carry their own padding, border, and
98
+ surface - never hand-manage spacing around them.
99
+ - `intent` (`diagram` | `spec` | `moodboard` | `notes`) is the frame's PURPOSE,
100
+ not its content mix - a frame with two diagrams and a paragraph is still the
101
+ "diagram frame" if diagrams are why it exists. It drives the icon the human
102
+ scans for in the sidebar.
103
+
104
+ ## Choosing a diagram
105
+
106
+ Mermaid has real breadth: flowchart, sequence, state, class, user journey,
107
+ quadrant chart, git graph, gantt, timeline, mindmap, pie, sankey, and more.
108
+ Pick the visualization that fits the IDEA - a journey for experience thinking,
109
+ a quadrant for prioritization, a state diagram for lifecycle logic, a sequence
110
+ for API choreography. The syntax reference is the Mermaid docs:
111
+ https://mermaid.js.org/intro/ - pull the one page you need, apply, return.
112
+
113
+ **Color carries meaning - and the floor is never gray-on-gray.** The marver
114
+ theme already colors every node (accent-washed fills, accent borders, both
115
+ modes) - a default diagram looks designed with zero effort, so never hand-set
116
+ grays "to be safe" and never re-theme (init directives are stripped anyway).
117
+ Where the diagram has SEMANTICS, add them with `classDef` on top:
118
+
119
+ ```
120
+ flowchart LR
121
+ A[Draft] --> B{Review?} -->|approved| C[Published]
122
+ B -->|rejected| D[Archived]
123
+ classDef win fill:#34C759,stroke:#248A3D,color:#fff
124
+ classDef stop fill:#FF383C,stroke:#D70015,color:#fff
125
+ class C win
126
+ class D stop
127
+ ```
128
+
129
+ Use the system palette (the same 12 colors the series ramp uses), a few
130
+ classes at most, and never encode meaning in color ALONE - the label or shape
131
+ must carry it too. Check the diagram in BOTH themes (`d`): fills flip with
132
+ the theme, hand-set classDef colors do not, so pick values that hold on both
133
+ grounds (the system colors do).
134
+
135
+ ## Images and mood boards
136
+
137
+ Images arrive through the conversation: the human dumps screenshots and links,
138
+ you file them into `design/assets/` (kebab-case names that say what the image
139
+ IS - `stripe-checkout-2col.png`, not `img4.png`) and compose the mood board -
140
+ `Row`s of `Img` blocks with captions, short `Md` notes between them. Nothing
141
+ is ingested without intent. Always give an `Img` a caption or alt.
142
+
143
+ Go get assets yourself too: when the human names an inspiration ("like Stripe's
144
+ checkout", "Linear's sidebar") and you have web access, FETCH the real thing -
145
+ screenshots, official brand logos, product visuals - download into
146
+ `design/assets/` and place them. A mood board of real fetched imagery beats one
147
+ of described imagery every time (the full asset rules: instructions/craft.md,
148
+ "Real assets").
149
+
150
+ **Size images to be SEEN, and make rows read as one set:**
151
+
152
+ - An image that renders as a stamp is a defect. The image IS the content of a
153
+ mood board - give the important one most of a row, let supporting shots share
154
+ a row, and never pack so many into one `Row` that each collapses below
155
+ legibility.
156
+ - Equal component widths do NOT make unequal images look equal - aspect ratios
157
+ and internal density differ, so a row of same-width `Img` blocks can still
158
+ read ragged. Normalize a mixed row with a shared rendered height:
159
+ `<Img src="..." h={240} />` cover-crops every image in the row to one height,
160
+ which is what makes them READ aligned. Group similar aspects together when
161
+ cropping would destroy the shot.
162
+ - Alignment is judged on the RENDER, not the props: after composing, look at the
163
+ actual frame (screenshot it if you can) and adjust until the rows sit
164
+ optically consistent. "The code says they're the same width" proves nothing.
165
+
166
+ ## When Shape ends
167
+
168
+ The board holds the agreed flow, spec, and direction. Wireframe picks up from
169
+ there (the spec IS the brief - do not re-interview), then Brand, then Build.
170
+ The content frames stay on the board: the feature's documentation lives beside
171
+ its screens, and both publish together.
@@ -67,24 +67,39 @@ without narrating into the void; your next message is the reveal.
67
67
  + shadcn/ui; brand tokens in <file>; design/theme.css imports them." No
68
68
  component library? Say that, and what it means (shared pieces get extracted
69
69
  to design/components/). Anything wrong gets fixed now, while it is cheap
70
- (configure.md, old-repo checklist). Once confirmed, hand them the hosted
71
- tour (the waiting room above) and get to work.
72
- 3. **Put THEIR product on the canvas - impressively.** Recreate 3-4 of the
73
- app's real screens as frames from its real components, linked with data-goto
74
- so play mode flows, working in both themes, responsive. This is the human's
75
- first impression of the canvas: hold it to the craft bar
76
- (instructions/craft.md, instructions/reference/slop.md). Create a curated
77
- board for the set. First sessions skip the written-brief ceremony, never the
78
- quality bar; real work after the tour runs the full method ladder.
79
- 4. **Explain the working model while building:** existing components are reused
70
+ (configure.md, old-repo checklist).
71
+ 3. **Ask the fork - STOP.** You now understand their app; before any tunnel,
72
+ let their priority decide what happens first (structured question tool
73
+ when the harness has one):
74
+ - **Start something new, together** - pick a feature or idea and co-develop
75
+ it on the canvas: the idea, the workflow, the specs, the mood
76
+ (instructions/shape.md). What goes on each screen, what stays out, what
77
+ the intent is.
78
+ - **See your app on the canvas first** - I recreate a few existing screens
79
+ quickly so you have something real to play with, and we go from there.
80
+ STOP for the answer. Then hand them the hosted tour (the waiting room
81
+ above) and get to work.
82
+ 4. **The recreate path: put THEIR product on the canvas - impressively.**
83
+ Recreate 3-4 of the app's real screens as frames from its real components,
84
+ linked with data-goto so play mode flows, working in both themes,
85
+ responsive. This is the human's first impression of the canvas: hold it to
86
+ the craft bar (instructions/craft.md, instructions/reference/slop.md).
87
+ Create a curated board for the set. First sessions skip the written-brief
88
+ ceremony, never the quality bar; real work after the tour runs the full
89
+ method ladder.
90
+ **The something-new path:** run Shape (instructions/shape.md) - seed the
91
+ feature-story board (intent, first-guess workflow diagram, mood with real
92
+ fetched references), reveal it early, and iterate together; wireframes and
93
+ hi-fi follow once the story is agreed.
94
+ 5. **Explain the working model while building:** existing components are reused
80
95
  as-is; missing pieces are created as presentational components - fixture
81
96
  props, placeholder handlers - and get real wiring at promotion (where they
82
97
  live is AGENTS.md's structure ladder). Look and feel converges first;
83
98
  production becomes plugging functionality into agreed UI.
84
- 5. **Offer a divergence.** "Want a variant of <frame> exploring a different
99
+ 6. **Offer a divergence.** "Want a variant of <frame> exploring a different
85
100
  direction?" One a-/b- pair teaches the variant workflow better than any
86
101
  explanation.
87
- 6. **Give the tour** (below), ending with the deep link.
102
+ 7. **Give the tour** (below), ending with the deep link.
88
103
 
89
104
  ## The reveal
90
105
 
@@ -30,7 +30,14 @@ lands on what is actually being decided.
30
30
  Never source or generate imagery in this phase.
31
31
  5. **Every screen reachable.** Wire the flow with `data-goto` as you go. A wireframe
32
32
  that cannot be walked end-to-end in play mode (press P) is not done.
33
- 6. **States are structure.** empty / error / loading as sibling frames for any screen
33
+ 6. **Interactive reads interactive - even in grayscale.** Every target that would be
34
+ clickable in the real product gets `cursor: pointer` and a visible hover shift (a
35
+ light gray fill is enough; no new visual language needed). The wireframe is WALKED
36
+ in play mode - a hover-dead button reads as a broken prototype, not as an
37
+ unfinished sketch, and the human stops trusting the flow. This applies to every
38
+ fidelity; the hi-fi version of this rule (and component-library gotchas) is in
39
+ instructions/craft.md.
40
+ 7. **States are structure.** empty / error / loading as sibling frames for any screen
34
41
  where they meaningfully differ - "what does empty look like" is a structural
35
42
  decision, not polish.
36
43