@marver-design/marver 0.2.3 → 0.3.0
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/CHANGELOG.md +46 -0
- package/README.md +1 -0
- package/dist/{build-Bqd6OEsQ.mjs → build-Ckmyci3O.mjs} +55 -4
- package/dist/cli.mjs +12 -5
- package/dist/{dev-9-80L5i5.mjs → dev-C2oTKuXe.mjs} +6 -4
- package/dist/{init-ClhCgn4v.mjs → init-DolP_Ld4.mjs} +183 -28
- package/dist/{manifest-mYlO_1Pj.mjs → manifest-DW-T52MM.mjs} +29 -1
- package/dist/{plugin-YVpBNTB3.mjs → plugin-Crp4CAma.mjs} +2 -2
- package/dist/{serve-BvbAbWeK.mjs → serve-OtA9Nlow.mjs} +1 -1
- package/package.json +6 -2
- package/src/client/const.ts +5 -0
- package/src/client/content/diagram.tsx +96 -0
- package/src/client/content/index.tsx +196 -0
- package/src/client/content/md.ts +50 -0
- package/src/client/content/palette.ts +93 -0
- package/src/client/shell/App.tsx +50 -6
- package/src/client/shell/canvas/FrameNode.tsx +3 -1
- package/src/client/shell/icons.tsx +22 -0
- package/src/client/shell/store.ts +150 -17
- package/src/client/shell/styles.css +9 -1
- package/templates/AGENTS-embedded.md +17 -2
- package/templates/AGENTS-studio.md +17 -2
- package/templates/instructions/boards.md +6 -0
- package/templates/instructions/brand.md +3 -1
- package/templates/instructions/configure.md +5 -2
- package/templates/instructions/craft.md +49 -0
- package/templates/instructions/discover.md +4 -3
- package/templates/instructions/iterate.md +50 -0
- package/templates/instructions/shape.md +171 -0
- package/templates/instructions/welcome.md +137 -0
- package/templates/instructions/wireframe.md +8 -1
|
@@ -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.
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# Welcome - the human's first session
|
|
2
|
+
|
|
3
|
+
Run this the FIRST time you work with the human in a repo, or whenever they ask
|
|
4
|
+
what marver is or how it works. Unsure whether they were already welcomed? If
|
|
5
|
+
design/DESIGN.md is missing or no curated board exists yet, treat it as not
|
|
6
|
+
yet. The job: by the end of the session the human understands the tool, has
|
|
7
|
+
seen their own product on the canvas, and knows what to do next. Narrate as you
|
|
8
|
+
go - one short plain sentence per step, teaching by doing, never a lecture.
|
|
9
|
+
|
|
10
|
+
## Voice - tell the story, not the machinery
|
|
11
|
+
|
|
12
|
+
These instruction files are stage directions, not a script to read aloud. Never
|
|
13
|
+
narrate them to the human ("setup.md says...", "step 2 requires...", "per the
|
|
14
|
+
generated instructions I must...") - speak as a designer who is excited to
|
|
15
|
+
start: what we're doing, why it matters, what comes next. Intent over
|
|
16
|
+
internals; one warm, concrete sentence beats three procedural ones.
|
|
17
|
+
|
|
18
|
+
- Robotic: "Init flagged that there's no app yet and pointed me to setup.md.
|
|
19
|
+
I'm following that file now, and step one is a conversation with you."
|
|
20
|
+
- Human: "Canvas is in. Before anything gets built I want to know what we're
|
|
21
|
+
making - that decides everything else."
|
|
22
|
+
|
|
23
|
+
Precision still matters - engineers are reading - but the file paths, step
|
|
24
|
+
numbers, and phase names are yours, not theirs.
|
|
25
|
+
|
|
26
|
+
When you ask the human to choose (the stack, a variant direction), use your
|
|
27
|
+
harness's structured question tool (AskUserQuestion or similar) if one exists -
|
|
28
|
+
short option labels, one-line trade-offs, and a small ASCII sketch per option
|
|
29
|
+
when the choice is visual. Plain prose is the fallback, never the preference.
|
|
30
|
+
Asking through the tool IS the stop: no further tool calls after it, wait for
|
|
31
|
+
the answer.
|
|
32
|
+
|
|
33
|
+
## The pitch (say it early, in your own words)
|
|
34
|
+
|
|
35
|
+
marver co-designs the user experience with the human in real code. Frames are
|
|
36
|
+
not mockups - they are components using the app's actual theme and component
|
|
37
|
+
library. The theme, components, and screens shaped while designing ARE the
|
|
38
|
+
app's building blocks: by the time the design is agreed, most of the UI work
|
|
39
|
+
already exists, and building the product means plugging functionality into it.
|
|
40
|
+
The goal is full alignment on look and feel - across light and dark, across
|
|
41
|
+
every device size - before app logic is written.
|
|
42
|
+
|
|
43
|
+
## Empty repo?
|
|
44
|
+
|
|
45
|
+
design/instructions/setup.md is the authority (it exists only while the repo
|
|
46
|
+
has no app). Follow it end to end; it sends you back here for the reveal.
|
|
47
|
+
|
|
48
|
+
## The waiting room - hand them the hosted tour while you build
|
|
49
|
+
|
|
50
|
+
Building well takes real minutes, and the human should spend them inside a
|
|
51
|
+
canvas, not watching a terminal. The moment the plan is agreed (the stack nod,
|
|
52
|
+
or the Path B confirmation below), send them to the marver tour - a published
|
|
53
|
+
canvas made to be explored: https://tour.marver.design - password `welcome`.
|
|
54
|
+
It teaches selection, devices, themes, variants, and play mode from inside the
|
|
55
|
+
frames, and it ends by sending them back to check on your work. Then build
|
|
56
|
+
without narrating into the void; your next message is the reveal.
|
|
57
|
+
|
|
58
|
+
## Existing codebase - first session flow
|
|
59
|
+
|
|
60
|
+
1. **Say what the app is.** Read the repo (entry point, routes, key screens).
|
|
61
|
+
State your understanding of the product in 2-3 sentences, ask "did I get
|
|
62
|
+
that right?" - then STOP: no further tool calls, end your turn, resume when
|
|
63
|
+
the human replies. (Only exception: they explicitly asked for unattended
|
|
64
|
+
execution - assume, mark UNCONFIRMED, surface it first.)
|
|
65
|
+
2. **Confirm the stack aloud - what detection ACTUALLY found.** Read AGENTS.md's
|
|
66
|
+
UI line and design/theme.css and narrate the reality, for example: "Tailwind
|
|
67
|
+
+ shadcn/ui; brand tokens in <file>; design/theme.css imports them." No
|
|
68
|
+
component library? Say that, and what it means (shared pieces get extracted
|
|
69
|
+
to design/components/). Anything wrong gets fixed now, while it is cheap
|
|
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
|
|
95
|
+
as-is; missing pieces are created as presentational components - fixture
|
|
96
|
+
props, placeholder handlers - and get real wiring at promotion (where they
|
|
97
|
+
live is AGENTS.md's structure ladder). Look and feel converges first;
|
|
98
|
+
production becomes plugging functionality into agreed UI.
|
|
99
|
+
6. **Offer a divergence.** "Want a variant of <frame> exploring a different
|
|
100
|
+
direction?" One a-/b- pair teaches the variant workflow better than any
|
|
101
|
+
explanation.
|
|
102
|
+
7. **Give the tour** (below), ending with the deep link.
|
|
103
|
+
|
|
104
|
+
## The reveal
|
|
105
|
+
|
|
106
|
+
Deliver conversationally when the first draft is ready - a short guided
|
|
107
|
+
message, not a manual. Start `npx marver dev` if it is not already running
|
|
108
|
+
(allowed for this purpose) and ALWAYS hand a deep link to the board you
|
|
109
|
+
prepared, using the port the dev server PRINTED:
|
|
110
|
+
`http://localhost:<port>/#/b/<board>` - never the bare root URL. The link goes
|
|
111
|
+
at the BOTTOM of the message, on its own line: the human reads through, then
|
|
112
|
+
clicks. The human has already played with the hosted tour by now, so keep it
|
|
113
|
+
short - let their own product carry the moment. The highlights, all real
|
|
114
|
+
features:
|
|
115
|
+
|
|
116
|
+
- **Select and preview.** Click frames (shift-click for several). Digit keys
|
|
117
|
+
switch device presets - 1-4 for the configured devices, 0 back to each
|
|
118
|
+
frame's own size - scoped to the selection when one exists, the whole board
|
|
119
|
+
otherwise. `d` cycles light/dark the same way: selected frames, or the
|
|
120
|
+
entire canvas view (frames pinned to a theme in their meta stay put).
|
|
121
|
+
- **Touch it.** Double-click a frame - the purple ring is interact mode: the
|
|
122
|
+
frame is live, clickable, scrollable.
|
|
123
|
+
- **Play it.** `p` opens play mode: the design full screen in a device, with
|
|
124
|
+
data-goto links navigating between frames like the real app. `[` and `]`
|
|
125
|
+
switch variants in place; devices switch inside play too, including
|
|
126
|
+
full-screen fill.
|
|
127
|
+
- **Explore alternatives.** Letter-prefixed sibling files (a-bold.tsx,
|
|
128
|
+
b-minimal.tsx) form a variant group - badged, kept contiguous, compared at a
|
|
129
|
+
glance. The cheap way to diverge on a direction before committing.
|
|
130
|
+
- **Compose.** `t` re-tidies; boards carry a `layout` recipe for deliberate
|
|
131
|
+
arrangement (instructions/boards.md).
|
|
132
|
+
- **Share it.** `marver build` bundles the boards; `marver serve` with
|
|
133
|
+
MARVER_PASSWORD on any Node host (Railway, Fly, a VPS) publishes them as a
|
|
134
|
+
password-gated canvas the human owns - colleagues get the link plus the
|
|
135
|
+
password. Comments on the board are coming soon.
|
|
136
|
+
|
|
137
|
+
Close by asking what they want to design first.
|
|
@@ -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. **
|
|
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
|
|