@dexhq/canvas 0.15.0 → 0.16.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 +34 -0
- package/app/canvas/activity-parts.tsx +50 -6
- package/app/canvas/activity.tsx +2 -3
- package/app/canvas/agent-changes.ts +18 -8
- package/app/canvas/anchoring.ts +13 -3
- package/app/canvas/canvas-context.tsx +6 -2
- package/app/canvas/canvas-input.ts +35 -0
- package/app/canvas/canvas-model.ts +2 -2
- package/app/canvas/canvas-scene.ts +243 -24
- package/app/canvas/canvas-ui.ts +11 -2
- package/app/canvas/canvas.css +86 -3
- package/app/canvas/comments.tsx +66 -29
- package/app/canvas/element-link.ts +135 -0
- package/app/canvas/element-picker.ts +23 -0
- package/app/canvas/export-dialog.tsx +265 -0
- package/app/canvas/flow-canvas.tsx +65 -14
- package/app/canvas/frame-context-menu.tsx +61 -7
- package/app/canvas/frame-node.tsx +10 -11
- package/app/canvas/layout.ts +41 -22
- package/app/canvas/linked-element.tsx +196 -0
- package/app/canvas/live-page.ts +14 -0
- package/app/canvas/mentions.tsx +209 -0
- package/app/canvas/picked-box.tsx +21 -0
- package/app/canvas/removed-views-panel.tsx +4 -4
- package/app/canvas/request-node.tsx +151 -0
- package/app/canvas/review-panel.tsx +8 -3
- package/app/canvas/section-node.tsx +4 -133
- package/app/canvas/spec-margin.tsx +4 -1
- package/app/canvas/teammates-layer.tsx +205 -0
- package/app/canvas/text-layer.tsx +103 -17
- package/app/canvas/tool-cursors.ts +7 -6
- package/app/canvas/tool-icons.tsx +24 -56
- package/app/canvas/typing.ts +12 -0
- package/app/canvas/use-agent-changes.tsx +6 -2
- package/app/canvas/use-canvas-editor.ts +4 -2
- package/app/export/player-model.ts +159 -0
- package/app/export/player.tsx +198 -0
- package/app/export.html +31 -0
- package/app/export.tsx +9 -0
- package/app/frame/announce-refreshes.ts +21 -0
- package/app/frame/start-frame.tsx +50 -0
- package/app/frame/view-loads.ts +161 -0
- package/app/frame/views.ts +13 -49
- package/app/frame.tsx +2 -38
- package/app/i18n/locales/en/messages.po +145 -6
- package/app/i18n/locales/en/messages.ts +1 -1
- package/app/i18n/locales/pseudo/messages.po +144 -5
- package/app/i18n/locales/pseudo/messages.ts +1 -1
- package/app/icons/dex-glyphs.tsx +219 -0
- package/app/icons/glyphs.tsx +76 -80
- package/app/kit/use-flow.ts +2 -1
- package/app/live/canvas-teammates.ts +90 -0
- package/app/live/studio-api.ts +30 -20
- package/app/pages/canvas.tsx +18 -6
- package/app/pages/commands-settings.tsx +1 -1
- package/app/pages/render.tsx +39 -11
- package/app/shell/bell.tsx +15 -5
- package/app/shell/presence.tsx +123 -26
- package/app/shell/thread-list.tsx +25 -8
- package/app/shell/working-on.tsx +35 -3
- package/app/ui/prompt-editor.tsx +39 -11
- package/app/ui/reference.tsx +21 -8
- package/bin/sudio.mjs +1 -1
- package/dist/cli/commands/create.d.mts +5 -5
- package/dist/cli/commands/create.mjs +4 -4
- package/dist/cli/commands/export.d.mts +40 -0
- package/dist/cli/commands/export.mjs +66 -0
- package/dist/cli/commands/init.d.mts +2 -2
- package/dist/cli/commands/upgrade.mjs +1 -1
- package/dist/cli/help.d.mts +1 -1
- package/dist/cli/help.mjs +13 -7
- package/dist/cli/main.d.mts +42 -5
- package/dist/cli/main.mjs +1 -0
- package/dist/config/load.mjs +14 -2
- package/dist/config/project-files.d.mts +5 -0
- package/dist/config/project-files.mjs +10 -1
- package/dist/config/renamed.d.mts +7 -0
- package/dist/config/renamed.mjs +13 -1
- package/dist/content/commands.d.mts +11 -9
- package/dist/content/commands.mjs +22 -16
- package/dist/content/comments-log.mjs +2 -1
- package/dist/content/content.d.mts +11 -3
- package/dist/content/content.mjs +49 -15
- package/dist/content/element-words.d.mts +42 -0
- package/dist/content/element-words.mjs +112 -0
- package/dist/content/hosted-person.d.mts +31 -0
- package/dist/content/hosted-person.mjs +68 -0
- package/dist/content/merge-rules.d.mts +5 -0
- package/dist/content/merge-rules.mjs +17 -1
- package/dist/content/screenshot.mjs +9 -0
- package/dist/content/text-edit.d.mts +24 -14
- package/dist/content/text-edit.mjs +92 -81
- package/dist/content/text-replace.mjs +2 -26
- package/dist/content/thread-module.d.mts +2 -4
- package/dist/content/thread-module.mjs +4 -5
- package/dist/server/agents.d.mts +10 -0
- package/dist/server/agents.mjs +21 -6
- package/dist/server/canvas-presence.d.mts +22 -0
- package/dist/server/canvas-presence.mjs +160 -0
- package/dist/server/command-settings.mjs +1 -1
- package/dist/server/comments/actions.d.mts +0 -8
- package/dist/server/comments/actions.mjs +1 -9
- package/dist/server/comments/routes.mjs +10 -31
- package/dist/server/dev-server.mjs +35 -13
- package/dist/server/export/build.d.mts +15 -0
- package/dist/server/export/build.mjs +220 -0
- package/dist/server/export/page.d.mts +25 -0
- package/dist/server/export/page.mjs +40 -0
- package/dist/server/export/plugin.d.mts +31 -0
- package/dist/server/export/plugin.mjs +69 -0
- package/dist/server/export/run.d.mts +9 -0
- package/dist/server/export/run.mjs +61 -0
- package/dist/server/export/save.d.mts +7 -0
- package/dist/server/export/save.mjs +29 -0
- package/dist/server/hosted.d.mts +8 -0
- package/dist/server/hosted.mjs +78 -0
- package/dist/server/live-mirror.mjs +66 -10
- package/dist/server/live.mjs +28 -1
- package/dist/server/mcp.mjs +2 -0
- package/dist/server/me.d.mts +2 -0
- package/dist/server/me.mjs +8 -2
- package/dist/server/notices.d.mts +1 -1
- package/dist/server/notices.mjs +1 -1
- package/dist/server/own-copies.mjs +1 -1
- package/dist/server/people.d.mts +7 -2
- package/dist/server/people.mjs +6 -2
- package/dist/server/pictures.d.mts +1 -1
- package/dist/server/pictures.mjs +2 -2
- package/dist/server/prebundle.d.mts +32 -0
- package/dist/server/prebundle.mjs +115 -0
- package/dist/server/problems.d.mts +8 -0
- package/dist/server/problems.mjs +13 -0
- package/dist/server/requests.mjs +43 -30
- package/dist/server/source-stamp.d.mts +4 -3
- package/dist/server/source-stamp.mjs +60 -31
- package/dist/server/state.d.mts +19 -10
- package/dist/server/state.mjs +27 -18
- package/dist/server/thread-source.d.mts +8 -0
- package/dist/server/thread-source.mjs +24 -5
- package/dist/server/tools/export.d.mts +5 -0
- package/dist/server/tools/export.mjs +35 -0
- package/dist/server/tools/place-frame.mjs +16 -16
- package/dist/server/tools/thread-list.mjs +1 -1
- package/dist/server/vite.d.mts +9 -4
- package/dist/server/vite.mjs +63 -61
- package/dist/server/welcome.mjs +2 -1
- package/dist/setup/apply.d.mts +4 -0
- package/dist/setup/apply.mjs +5 -4
- package/dist/setup/create.mjs +5 -5
- package/dist/setup/design-system-checks.mjs +1 -6
- package/dist/setup/detect/workspace.d.mts +10 -10
- package/dist/setup/detect/workspace.mjs +10 -12
- package/dist/setup/doctor.d.mts +4 -1
- package/dist/setup/doctor.mjs +7 -5
- package/dist/setup/migrate/dex-folder.d.mts +61 -0
- package/dist/setup/migrate/dex-folder.mjs +544 -0
- package/dist/setup/migrate/files-folder.mjs +1 -1
- package/dist/setup/migrate/guides.mjs +1 -1
- package/dist/setup/migrate/migrations.mjs +4 -0
- package/dist/setup/migrate/setup-files.d.mts +5 -0
- package/dist/setup/migrate/setup-files.mjs +115 -0
- package/dist/setup/migrate/studio-state.d.mts +2 -2
- package/dist/setup/migrate/studio-state.mjs +4 -4
- package/dist/setup/placement.d.mts +1 -1
- package/dist/setup/placement.mjs +5 -4
- package/dist/setup/plan.d.mts +5 -5
- package/dist/setup/plan.mjs +8 -12
- package/dist/setup/project.mjs +1 -1
- package/dist/setup/prompts.d.mts +2 -1
- package/dist/setup/prompts.mjs +4 -3
- package/dist/setup/questions.mjs +3 -2
- package/dist/setup/starters.d.mts +1 -1
- package/dist/setup/starters.mjs +2 -2
- package/dist/setup/write.d.mts +15 -3
- package/dist/setup/write.mjs +23 -3
- package/dist/shared/canvas-core.d.mts +22 -7
- package/dist/shared/canvas-core.mjs +38 -10
- package/dist/shared/comments/routes.d.mts +3 -1
- package/dist/shared/comments/routes.mjs +4 -2
- package/dist/shared/export-core.d.mts +62 -0
- package/dist/shared/export-core.mjs +101 -0
- package/dist/shared/live-core.d.mts +2 -0
- package/dist/shared/live-core.mjs +6 -1
- package/dist/shared/live-presence.d.mts +57 -2
- package/dist/shared/live-presence.mjs +90 -4
- package/dist/shared/page-messages.d.mts +14 -1
- package/dist/shared/page-messages.mjs +30 -3
- package/dist/shared/people-core.d.mts +28 -0
- package/dist/shared/people-core.mjs +27 -1
- package/dist/shared/presence-core.d.mts +2 -0
- package/dist/shared/references-core.d.mts +4 -0
- package/dist/shared/references-core.mjs +12 -4
- package/dist/shared/studio-files.d.mts +9 -0
- package/dist/shared/studio-files.mjs +11 -2
- package/dist/shared/studio-routes.d.mts +13 -1
- package/dist/shared/threads-core.d.mts +27 -4
- package/dist/shared/threads-core.mjs +67 -12
- package/extension/dist/feedback.js +104 -294
- package/extension/dist/manifest.json +1 -1
- package/extension/dist/picker.js +104 -294
- package/package.json +2 -2
- package/src/cli/commands/create.ts +4 -4
- package/src/cli/commands/export.ts +78 -0
- package/src/cli/commands/upgrade.ts +1 -1
- package/src/cli/help.ts +13 -7
- package/src/cli/main.ts +1 -0
- package/src/config/load.ts +26 -2
- package/src/config/project-files.ts +15 -0
- package/src/config/renamed.ts +19 -1
- package/src/content/commands.ts +30 -18
- package/src/content/comments-log.ts +4 -1
- package/src/content/content.ts +64 -16
- package/src/content/element-words.ts +175 -0
- package/src/content/hosted-person.ts +107 -0
- package/src/content/merge-rules.ts +29 -0
- package/src/content/screenshot.ts +14 -0
- package/src/content/text-edit.ts +172 -105
- package/src/content/text-replace.ts +3 -32
- package/src/content/thread-module.ts +2 -4
- package/src/content/trash.ts +1 -1
- package/src/server/agents.ts +48 -17
- package/src/server/canvas-presence.ts +237 -0
- package/src/server/channel.ts +1 -1
- package/src/server/command-settings.ts +1 -1
- package/src/server/comments/actions.ts +0 -19
- package/src/server/comments/routes.ts +9 -54
- package/src/server/dev-server.ts +66 -26
- package/src/server/export/build.ts +310 -0
- package/src/server/export/page.ts +85 -0
- package/src/server/export/plugin.ts +138 -0
- package/src/server/export/run.ts +79 -0
- package/src/server/export/save.ts +38 -0
- package/src/server/hosted.ts +113 -0
- package/src/server/live-mirror.ts +93 -8
- package/src/server/live.ts +46 -1
- package/src/server/machine-update.ts +3 -3
- package/src/server/mcp.ts +2 -0
- package/src/server/me.ts +10 -1
- package/src/server/notices.ts +2 -2
- package/src/server/people.ts +11 -2
- package/src/server/pictures.ts +2 -2
- package/src/server/prebundle.ts +230 -0
- package/src/server/presence.ts +1 -1
- package/src/server/problems.ts +11 -0
- package/src/server/requests.ts +55 -40
- package/src/server/roster.ts +1 -1
- package/src/server/saved.ts +1 -1
- package/src/server/source-stamp.ts +118 -37
- package/src/server/state.ts +53 -31
- package/src/server/thread-source.ts +35 -3
- package/src/server/tools/export.ts +56 -0
- package/src/server/tools/place-frame.ts +23 -15
- package/src/server/tools/thread-list.ts +1 -1
- package/src/server/updates.ts +2 -2
- package/src/server/vite.ts +106 -110
- package/src/server/welcome.ts +3 -1
- package/src/setup/apply.ts +8 -5
- package/src/setup/create.ts +10 -10
- package/src/setup/design-system-checks.ts +1 -6
- package/src/setup/detect/workspace.ts +20 -21
- package/src/setup/doctor.ts +13 -6
- package/src/setup/migrate/dex-folder.ts +842 -0
- package/src/setup/migrate/files-folder.ts +1 -1
- package/src/setup/migrate/guides.ts +3 -1
- package/src/setup/migrate/migrations.ts +8 -2
- package/src/setup/migrate/setup-files.ts +198 -0
- package/src/setup/migrate/studio-state.ts +12 -10
- package/src/setup/own-app.ts +1 -1
- package/src/setup/placement.ts +7 -6
- package/src/setup/plan.ts +13 -18
- package/src/setup/project.ts +2 -2
- package/src/setup/prompts.ts +5 -4
- package/src/setup/questions.ts +6 -3
- package/src/setup/starters.ts +3 -3
- package/src/setup/write.ts +34 -3
- package/src/shared/canvas-core.ts +48 -9
- package/src/shared/comments/routes.ts +3 -1
- package/src/shared/export-core.ts +198 -0
- package/src/shared/live-core.ts +8 -0
- package/src/shared/live-presence.ts +171 -2
- package/src/shared/page-messages.ts +38 -2
- package/src/shared/people-core.ts +44 -0
- package/src/shared/presence-core.ts +2 -0
- package/src/shared/references-core.ts +22 -3
- package/src/shared/studio-files.ts +15 -1
- package/src/shared/studio-routes.ts +11 -1
- package/src/shared/threads-core.ts +132 -10
- package/templates/methods/explore.md +1 -1
- package/templates/methods/handoff.md +1 -1
- package/templates/methods/review.md +2 -1
- package/templates/rules/canvas-frames.md +6 -3
- package/templates/rules/commands.md +1 -0
- package/templates/rules/prototypes.md +1 -1
- package/templates/rules/studio.md +17 -11
- package/templates/skills/comprehend/SKILL.md +56 -0
- package/templates/skills/distill/SKILL.md +172 -0
- package/templates/skills/export-prototype/SKILL.md +35 -0
- package/templates/skills/riff/SKILL.md +21 -0
- package/templates/skills/riff-deep/SKILL.md +40 -0
- package/templates/skills/riff-max/SKILL.md +46 -0
- package/templates/skills/riff-state/SKILL.md +45 -0
- package/templates/skills/riff-up/SKILL.md +38 -0
- package/templates/skills/riff-wide/SKILL.md +40 -0
- package/templates/starters/standalone/README.md +1 -1
- package/templates/starters/turborepo/README.md +2 -2
- package/templates/starters/turborepo/apps/web/src/app.tsx +2 -2
- package/templates/starters/vite/README.md +1 -1
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: distill
|
|
3
|
+
description: "Distills reusable components and a theme from it, on shadcn's tokens"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Distill the element in focus into reusable components and a theme. The
|
|
7
|
+
element might be a snapshot, several elements, or a whole screen. Leave
|
|
8
|
+
the original as it is: what you distill goes beside it, and the rebuild
|
|
9
|
+
goes in a row below it.
|
|
10
|
+
|
|
11
|
+
The tokens are shadcn's, and the components are shadcn's wherever one
|
|
12
|
+
fits. Where the project has no shadcn (no `components.json`), do the same
|
|
13
|
+
with its design system's own tokens and components.
|
|
14
|
+
|
|
15
|
+
**Read.** Read every element in focus, and its stylesheet. A snapshot's
|
|
16
|
+
CSS file holds its design, and a snapshot that is one image holds it in
|
|
17
|
+
the image. Write down each raw value it uses: colours, radii, spacing,
|
|
18
|
+
type (family, sizes, weights, line heights), borders, shadows and motion.
|
|
19
|
+
Then write down the parts it repeats: the same card, row or control
|
|
20
|
+
appearing twice, or appearing in each of several elements, is one
|
|
21
|
+
component with variants.
|
|
22
|
+
|
|
23
|
+
**Map the tokens.** Give every colour a role, not a name. Use the role it
|
|
24
|
+
plays on the screen, whatever its hue:
|
|
25
|
+
|
|
26
|
+
- Page and text: `background`, `foreground`.
|
|
27
|
+
- Raised surfaces: `card`, `popover`, and their `-foreground`.
|
|
28
|
+
- The main action: `primary`. Quieter actions: `secondary`. Hover and
|
|
29
|
+
selected: `accent`. Subdued surfaces and secondary text: `muted`,
|
|
30
|
+
`muted-foreground`.
|
|
31
|
+
- Danger: `destructive`. Lines: `border`, `input`. Focus: `ring`.
|
|
32
|
+
- Data: `chart-1` to `chart-5`. A side navigation: the `sidebar-*` tokens.
|
|
33
|
+
|
|
34
|
+
Values close to each other are one token. Two greys a few steps apart are
|
|
35
|
+
one `muted-foreground`, not two. A colour with no role here is either
|
|
36
|
+
data (a `chart-*`) or an accent worth one new token, named for its role
|
|
37
|
+
(`--success`, `--warning`). A status that is not an action (a critical
|
|
38
|
+
badge, an info banner) is one of these, never `destructive`, which is
|
|
39
|
+
for actions that destroy. Keep new tokens to the fewest the design
|
|
40
|
+
needs. The corner radius becomes `--radius`, and the theme derives its
|
|
41
|
+
other radii from it. Fonts become `--font-sans` and `--font-mono`.
|
|
42
|
+
Spacing, widths and heights map to the nearest step of Tailwind's scale
|
|
43
|
+
(`w-50`, `max-w-256`), rounded, never written out. Type does too, except the size most of the text uses: when
|
|
44
|
+
that falls between two steps (13px, between 12 and 14), set the design
|
|
45
|
+
system's token for that step to it in the theme, rather than resize
|
|
46
|
+
every line.
|
|
47
|
+
|
|
48
|
+
**Write the theme.** Write a `theme.css` in your folder (`people/<you>/`),
|
|
49
|
+
with every token in `oklch()`, scoped under a class named for where the
|
|
50
|
+
design came from (`.theme-<name>`). The source's own scheme gets its
|
|
51
|
+
values, under `.theme-<name>` for light or `.dark .theme-<name>` for
|
|
52
|
+
dark. Derive the other scheme, and say that you did. Leave out a token
|
|
53
|
+
whose value matches the project's theme. A token the design system
|
|
54
|
+
derives from others on `:root` (a hover or focus colour mixed from
|
|
55
|
+
`--primary`, say) keeps the root's value under your class, so set it
|
|
56
|
+
again in the theme. The project's own theme belongs to the design
|
|
57
|
+
system, so never change it here. Each view that uses the distilled
|
|
58
|
+
design imports `theme.css` and puts the class on its root, and the
|
|
59
|
+
design system's components inside it take the theme from there.
|
|
60
|
+
|
|
61
|
+
**Choose each component.** Go through the repeated parts and the
|
|
62
|
+
one-offs worth naming, and find each one with `components` before
|
|
63
|
+
writing any:
|
|
64
|
+
|
|
65
|
+
1. **A shadcn component as it is**, with one of its variants or sizes.
|
|
66
|
+
Prefer this whenever the difference from the source is only its tokens,
|
|
67
|
+
which the theme now carries.
|
|
68
|
+
2. **A new variant** of a shadcn component, when the source needs a look
|
|
69
|
+
that it lacks. Add the variant in your folder by wrapping the
|
|
70
|
+
component with `cva`, never by editing the design system's copy.
|
|
71
|
+
3. **A composition** of shadcn components, when the part is several of
|
|
72
|
+
them used together (a stat card, a settings row, a toolbar).
|
|
73
|
+
4. **Base UI**, only when the part needs behaviour that no shadcn
|
|
74
|
+
component has (a meter, a number field, a hover card or an unusual
|
|
75
|
+
menu). Build it on `@base-ui/react` primitives as shadcn's own
|
|
76
|
+
components are built: `data-slot` on each part, styled with tokens
|
|
77
|
+
and `cva`, and states from Base UI's data attributes
|
|
78
|
+
(`data-[open]`, `data-[disabled]`).
|
|
79
|
+
|
|
80
|
+
Icons come from the design system's icon library, matched by meaning. An
|
|
81
|
+
icon that is the source's own (a logo, a status glyph) is copied as an
|
|
82
|
+
SVG component into `components/icons.tsx`.
|
|
83
|
+
|
|
84
|
+
`class-variance-authority`, `@base-ui/react` and the icon library may not
|
|
85
|
+
be among the imports the design system allows views. Where `dex check`
|
|
86
|
+
warns about one, keep using it, and say in your reply that it needs
|
|
87
|
+
adding to `designSystem.imports` in `dex.config.ts`.
|
|
88
|
+
|
|
89
|
+
Each component is a file in `people/<you>/components/`, named for the
|
|
90
|
+
job it does (`plan-card.tsx`, not `blue-box.tsx`). These are your own,
|
|
91
|
+
built from the design system's. They are not new design-system
|
|
92
|
+
components, which the rules say never to add. Its props are the content
|
|
93
|
+
and the variants (a `size` variant is fine), never colours or pixels. Its
|
|
94
|
+
classes use only tokens: no colours, spacing or arbitrary values written
|
|
95
|
+
out. A new token is used through its variable, `text-(--success)`.
|
|
96
|
+
|
|
97
|
+
**Rebuild.** Build the element again from the distilled components and
|
|
98
|
+
theme, in a new row below it, with the source frame's size. Add the row
|
|
99
|
+
with `place_frame`, then set the frame's `size` in `canvas.json`. The
|
|
100
|
+
rebuild keeps the source's sizes, words and layout. Then add a view
|
|
101
|
+
showing each component in each of its variants, using `useViewControl`
|
|
102
|
+
for its states, in a row of its own.
|
|
103
|
+
|
|
104
|
+
Beside it, add a **token sheet**: a view that shows the theme, so people
|
|
105
|
+
see what was set up without reading CSS. Render it inside the theme's
|
|
106
|
+
class, so it reads every value from `theme.css` and never repeats one:
|
|
107
|
+
|
|
108
|
+
- A swatch for each colour token the theme sets, and for each of the
|
|
109
|
+
project's it keeps, marked as kept, with its name and its role in a
|
|
110
|
+
few words. Mark the new tokens. Show dark beside it from a copy inside
|
|
111
|
+
an element with the `dark` class. (The values it
|
|
112
|
+
replaced go in the report: `dex check` flags colours written in a view.)
|
|
113
|
+
- The radius on a card and a control, the type styles the source uses,
|
|
114
|
+
and its spacing steps, as bars.
|
|
115
|
+
|
|
116
|
+
Compare the rebuild with the source in the source's own scheme and at
|
|
117
|
+
the source frame's width (a snapshot may render wider than its frame),
|
|
118
|
+
and check that the derived scheme reads well. Done when they match, and
|
|
119
|
+
when the rebuild's view holds no value written out.
|
|
120
|
+
|
|
121
|
+
**Write the guidelines.** Write how to design with what you distilled,
|
|
122
|
+
so the next screen built from it looks as if it belonged. Put it in a
|
|
123
|
+
spec in your folder, `specs/distill-<name>.md`. Use the sections of
|
|
124
|
+
Google's DESIGN.md format, in the order `methods/design-md.md` gives
|
|
125
|
+
them, and include only the ones you have something to say for:
|
|
126
|
+
|
|
127
|
+
- **Overview**: how the design feels and how dense it is, as the source
|
|
128
|
+
shows it, in two or three lines.
|
|
129
|
+
- **Colors**: each token by its role: what it is for, and what it is
|
|
130
|
+
never for ("`primary` is the one action per screen; never a link").
|
|
131
|
+
- **Typography**: the few type styles the source uses, and which text
|
|
132
|
+
each is for.
|
|
133
|
+
- **Layout**: the spacing steps it uses and where each goes, the widths
|
|
134
|
+
of its columns, and its alignment.
|
|
135
|
+
- **Elevation & Depth** and **Shapes**: whether depth comes from
|
|
136
|
+
borders, shadows or tonal surfaces, and which radius goes where.
|
|
137
|
+
- **Components**: each distilled component, with what it is for, when to
|
|
138
|
+
use something else, and its variants.
|
|
139
|
+
- **Do's and Don'ts**: the patterns the source keeps to, and the
|
|
140
|
+
mistakes a rebuild made before you fixed them.
|
|
141
|
+
|
|
142
|
+
Write only what the source shows. Where you cannot tell why it does
|
|
143
|
+
something, say what it does and leave the why out. A guess becomes a rule
|
|
144
|
+
for every screen after it. People place specs on the canvas, not you:
|
|
145
|
+
reply that the person can place this one in the section (D on the canvas),
|
|
146
|
+
so that work there follows it.
|
|
147
|
+
|
|
148
|
+
The workspace's guidelines (`DESIGN.md`) are shared by every file. Add to
|
|
149
|
+
them only when the request asks for that, or says the source is the
|
|
150
|
+
team's own product. Then follow `methods/design-md.md`: the rules go
|
|
151
|
+
under its sections, and its front matter gets the tokens only once they
|
|
152
|
+
are in the design system's stylesheets. Otherwise, name the three rules
|
|
153
|
+
that are most worth adding there in your reply.
|
|
154
|
+
|
|
155
|
+
**Report.** Write up what happened as one document, titled "Distill:
|
|
156
|
+
<element>", and save it beside the work, where the project keeps
|
|
157
|
+
documents. It is the record of the distilling; how to use the result is
|
|
158
|
+
the spec's. Include:
|
|
159
|
+
|
|
160
|
+
1. **Tokens**: each one you set, and the source values it replaced.
|
|
161
|
+
Include any new ones, with why.
|
|
162
|
+
2. **Sources**: for each component, where it came from (as it is, a
|
|
163
|
+
variant, a composition, or Base UI) and where the source used it.
|
|
164
|
+
3. **Gaps**: what the shadcn components could not carry, and what was
|
|
165
|
+
rounded or merged.
|
|
166
|
+
4. **Promote**: the components and tokens worth proposing to the design
|
|
167
|
+
system, with why. Name them only: changing the design system is its
|
|
168
|
+
owners' call, made apart from this file, with `methods/components.md`
|
|
169
|
+
when someone asks for it.
|
|
170
|
+
|
|
171
|
+
Reply with the number of components and tokens, the biggest gap, the
|
|
172
|
+
imports that need allowing, and where the guidelines went.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: export-prototype
|
|
3
|
+
description: "Prepares frames for an exported prototype, then exports them"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Get the frames the comment is on (or its section's) ready to send as a
|
|
7
|
+
prototype that opens by double-click, offline, then export them with the
|
|
8
|
+
`export` tool (or `npx dex export`). The comment's words say which kind:
|
|
9
|
+
`clickable` unless they say otherwise.
|
|
10
|
+
|
|
11
|
+
Export makes the build: never write HTML, a bundler config or a zip
|
|
12
|
+
yourself. What you do is make the frames work on their own:
|
|
13
|
+
|
|
14
|
+
- **Every kind:** the frames should move on as the real product would. A
|
|
15
|
+
step's main action calls `useFlow().next()` (`@studio/kit/use-flow`), or
|
|
16
|
+
links to the next view (`<a href="/files/<slug>/views/<view>">`); follow
|
|
17
|
+
`connect-frames` where they don't. The exported page steps through the
|
|
18
|
+
frames as Play does, so leave the frames where they are.
|
|
19
|
+
- **content:** move the words and data people will want to change out of
|
|
20
|
+
each view's JSX into `content.json` beside your views (in your
|
|
21
|
+
`people/<you>/` folder), and import it in the view
|
|
22
|
+
(`import copy from "../content.json"`). Keep the JSON plain: strings,
|
|
23
|
+
numbers, lists and objects, keyed by what each is ("heading",
|
|
24
|
+
"cta"), so someone who has never seen the code can edit it.
|
|
25
|
+
- **source:** keep the views' own code in your folder (data, parts,
|
|
26
|
+
stylesheets beside them), importing only the design system and
|
|
27
|
+
`@studio/kit`, so what the export takes is what it needs.
|
|
28
|
+
- **pages:** nothing more: each frame gets a page of its own.
|
|
29
|
+
|
|
30
|
+
Change only views in your own folder. For a view of someone else's, copy
|
|
31
|
+
it into yours first (as the rules say) or leave it, and say which.
|
|
32
|
+
|
|
33
|
+
Then export with `export` (`kind`, the comment's `frames` or `sections`,
|
|
34
|
+
and `flows: true` when people should switch between several flows), and
|
|
35
|
+
close the comment with what the zip holds and where it is.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: riff
|
|
3
|
+
description: "Riffs on the element in words: picks deep, state, wide, up or max"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Pick the riff the request asks for, say which in your reply, and follow
|
|
7
|
+
that skill's SKILL.md, in its folder beside this one, for the element in
|
|
8
|
+
focus:
|
|
9
|
+
|
|
10
|
+
- **riff-deep**: where it leads, one person further into the experience.
|
|
11
|
+
"What happens next", "then", a journey.
|
|
12
|
+
- **riff-state**: every state it can be in. "Empty", "error", "states",
|
|
13
|
+
"edge cases".
|
|
14
|
+
- **riff-wide**: other kinds of the same thing. "Types", "variations",
|
|
15
|
+
"versions", "other ways".
|
|
16
|
+
- **riff-up**: the need above it and other ways to meet that need. "Why",
|
|
17
|
+
"what for", "bigger picture".
|
|
18
|
+
- **riff-max**: deeper, states and wide at once, passed between
|
|
19
|
+
perspectives. "Everything", "go wide and deep", "brainwrite".
|
|
20
|
+
|
|
21
|
+
With no hint, riff-deep.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: riff-deep
|
|
3
|
+
description: "Follows one person further into the experience, step by step"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Riff deep on the element in focus: "and then what?", one person further
|
|
7
|
+
into the experience than the screen goes. A riff extends the idea in
|
|
8
|
+
words: change nothing in the design.
|
|
9
|
+
|
|
10
|
+
**Seed.** Read the element, the screen around it, and any spec or notes
|
|
11
|
+
on who uses it. Write in a few lines what it is, the job it does for
|
|
12
|
+
someone, what sits around it and leads to it, and the states it has
|
|
13
|
+
today. Name only what the screen shows, never what you hope it will.
|
|
14
|
+
|
|
15
|
+
**Perspective.** Take one person: the one the request names, else one the
|
|
16
|
+
project's notes describe, else a situation (someone on their first visit,
|
|
17
|
+
someone who uses it daily, someone in a hurry or recovering from a
|
|
18
|
+
mistake).
|
|
19
|
+
|
|
20
|
+
**Walk.** Go forward from where the screen ends, five steps. The screen
|
|
21
|
+
already shows what it shows: each step is something it does not have
|
|
22
|
+
yet, a screen, a moment or a decision further on (what they check, who
|
|
23
|
+
they tell, what they come back to tomorrow). Each step is what they see,
|
|
24
|
+
what they do, and what they now want, in a line or two, and builds on the
|
|
25
|
+
step before. Where a step could go two ways, name the other way as a
|
|
26
|
+
**branch** in a line and keep going on the likelier one. Done when the
|
|
27
|
+
person has reached what they came for, or five steps, and every branch
|
|
28
|
+
is named.
|
|
29
|
+
|
|
30
|
+
**Harvest.** Write it up as one document, titled "Riff deep: <element>":
|
|
31
|
+
|
|
32
|
+
1. The seed.
|
|
33
|
+
2. The walk, step by step, its branches under the step they leave from.
|
|
34
|
+
3. **Holds together**: what came up more than once, and where two steps
|
|
35
|
+
pull against each other.
|
|
36
|
+
4. **Build next**: three ideas worth building, each a line on what it
|
|
37
|
+
would answer.
|
|
38
|
+
|
|
39
|
+
Save it beside the work, where the project keeps documents, and reply
|
|
40
|
+
with the strongest idea in a line.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: riff-max
|
|
3
|
+
description: "Brainwrites on it between perspectives: deep, states and wide"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Riff on the element in focus as a brainwriting round: ideas written down,
|
|
7
|
+
passed on, and built on by the next writer. A riff extends the idea in
|
|
8
|
+
words: change nothing in the design.
|
|
9
|
+
|
|
10
|
+
**Seed.** Read the element, the screen around it, and any spec or notes
|
|
11
|
+
on who uses it. Write in a few lines what it is, the job it does for
|
|
12
|
+
someone, what sits around it and leads to it, and the states it has
|
|
13
|
+
today. Name only what the screen shows, never what you hope it will.
|
|
14
|
+
|
|
15
|
+
**Writers.** One per perspective, three by default: the people the
|
|
16
|
+
request names, else those the project's notes describe, else situations
|
|
17
|
+
(someone on their first visit, someone who uses it daily, someone in a
|
|
18
|
+
hurry or recovering from a mistake).
|
|
19
|
+
|
|
20
|
+
**Rounds.** Each writer starts a **sheet** from the seed. Each round,
|
|
21
|
+
every sheet passes to the next writer. Write every turn yourself, in
|
|
22
|
+
order, as each writer in turn: you see every sheet, so an idea already on
|
|
23
|
+
one is never written again on another. A writer reads the seed and the
|
|
24
|
+
whole sheet so far, and adds three ideas, each building on one already
|
|
25
|
+
there ("yes, and"), from its perspective:
|
|
26
|
+
|
|
27
|
+
- **Deeper**: one step further into the experience.
|
|
28
|
+
- **State**: a state the sheet lacks (empty, loading, partial, error,
|
|
29
|
+
many, no permission, done, undone).
|
|
30
|
+
- **Wide**: another kind of the same thing.
|
|
31
|
+
|
|
32
|
+
Three rounds, so every sheet has passed through every writer. Done when
|
|
33
|
+
every sheet has had every round, and each idea names the one it builds on.
|
|
34
|
+
|
|
35
|
+
**Harvest.** Write it up as one document, titled "Riff max: <element>":
|
|
36
|
+
|
|
37
|
+
1. The seed.
|
|
38
|
+
2. Each sheet round by round, every idea with its writer and the idea it
|
|
39
|
+
builds on, so the idea's evolution can be read.
|
|
40
|
+
3. **Holds together**: what came up on more than one sheet, and where two
|
|
41
|
+
ideas pull against each other.
|
|
42
|
+
4. **Build next**: three ideas worth building, each a line on what it
|
|
43
|
+
would answer.
|
|
44
|
+
|
|
45
|
+
Save it beside the work, where the project keeps documents, and reply
|
|
46
|
+
with the strongest idea in a line.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: riff-state
|
|
3
|
+
description: "Every state it can be in: empty, loading, error, many and more"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Riff on every state the element in focus can be in. A riff extends the
|
|
7
|
+
idea in words: change nothing in the design.
|
|
8
|
+
|
|
9
|
+
**Seed.** Read the element, the screen around it, and any spec or notes
|
|
10
|
+
on who uses it. Write in a few lines what it is, the job it does for
|
|
11
|
+
someone, what sits around it and leads to it, and the states it has
|
|
12
|
+
today. Name only what the screen shows, never what you hope it will.
|
|
13
|
+
|
|
14
|
+
**States.** Go through each in turn, the UI stack and past it:
|
|
15
|
+
|
|
16
|
+
- **Ideal**: the state the screen shows, as the seed says.
|
|
17
|
+
- **Empty**: nothing yet, the first time and after everything is cleared.
|
|
18
|
+
- **Loading**: waiting, and waiting too long.
|
|
19
|
+
- **Partial**: some there, some still to come or to fill in.
|
|
20
|
+
- **Error**: what failed, and what the person can do about it.
|
|
21
|
+
- **Many**: hundreds, long names, the crowded end.
|
|
22
|
+
- **No permission**: seen by someone who can look but not act.
|
|
23
|
+
- **Done** and **undone**: just after it worked, and taking its result back.
|
|
24
|
+
- **Needs you**: waiting on the person, for an answer or a choice.
|
|
25
|
+
- **Others**: someone else's, or several people's at once.
|
|
26
|
+
- **In the way**: a small window, or covering something the person needs.
|
|
27
|
+
- **Reduced motion**: what still says the state when nothing moves.
|
|
28
|
+
|
|
29
|
+
Then add any state only this element has, from the seed, that none of
|
|
30
|
+
these covers; a state the seed names that fits one above goes in that
|
|
31
|
+
row. For each, write what the person sees and what they can do next, in
|
|
32
|
+
a line or two. A state the element cannot be in gets a line on why. Done
|
|
33
|
+
when every state has its line.
|
|
34
|
+
|
|
35
|
+
**Harvest.** Write it up as one document, titled "Riff state: <element>":
|
|
36
|
+
|
|
37
|
+
1. The seed.
|
|
38
|
+
2. The states as a table: state, what they see, what they can do next.
|
|
39
|
+
3. **Holds together**: what several states share, and where two pull
|
|
40
|
+
against each other.
|
|
41
|
+
4. **Build next**: three states worth building first, each a line on what
|
|
42
|
+
it would answer.
|
|
43
|
+
|
|
44
|
+
Save it beside the work, where the project keeps documents, and reply
|
|
45
|
+
with the state most worth building in a line.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: riff-up
|
|
3
|
+
description: "Climbs to the need above it, and finds other ways to meet it"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Riff up from the element in focus, an abstraction ladder. A riff extends
|
|
7
|
+
the idea in words: change nothing in the design.
|
|
8
|
+
|
|
9
|
+
**Seed.** Read the element, the screen around it, and any spec or notes
|
|
10
|
+
on who uses it. Write in a few lines what it is, the job it does for
|
|
11
|
+
someone, what sits around it and leads to it, and the states it has
|
|
12
|
+
today. Name only what the screen shows, never what you hope it will.
|
|
13
|
+
|
|
14
|
+
**Climb.** Ask "why does someone use this?" and write the answer as a
|
|
15
|
+
need, then ask why of that need. Three rungs, each a line, from the
|
|
16
|
+
element to a need a person would say in their own words.
|
|
17
|
+
|
|
18
|
+
**Come down.** From each rung, ask "how else could we meet this?" and
|
|
19
|
+
write two other ways, in a line each, with what each would cost and what
|
|
20
|
+
it would replace. Lower rungs give near neighbours of the element; the top
|
|
21
|
+
rung gives other features altogether, one of them with no interface of
|
|
22
|
+
its own, and may show the element is not needed.
|
|
23
|
+
|
|
24
|
+
**Weigh.** Mark the way down you would try first, and say why in a line.
|
|
25
|
+
Done when there are three rungs, each with two ways down, and one marked.
|
|
26
|
+
|
|
27
|
+
**Harvest.** Write it up as one document, titled "Riff up: <element>":
|
|
28
|
+
|
|
29
|
+
1. The seed.
|
|
30
|
+
2. The ladder: the element at the bottom, each rung above it, its ways
|
|
31
|
+
down beside it.
|
|
32
|
+
3. **Holds together**: what the ways down share, and where two pull
|
|
33
|
+
against each other.
|
|
34
|
+
4. **Build next**: three ways worth building, each a line on what it
|
|
35
|
+
would answer, the marked one first.
|
|
36
|
+
|
|
37
|
+
Save it beside the work, where the project keeps documents, and reply
|
|
38
|
+
with the marked way in a line.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: riff-wide
|
|
3
|
+
description: "Other kinds of the same thing: types, sizes, versions"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Riff wide on the element in focus: other kinds of the same thing, each
|
|
7
|
+
doing its job another way. A riff extends the idea in words: change
|
|
8
|
+
nothing in the design.
|
|
9
|
+
|
|
10
|
+
**Seed.** Read the element, the screen around it, and any spec or notes
|
|
11
|
+
on who uses it. Write in a few lines what it is, the job it does for
|
|
12
|
+
someone, what sits around it and leads to it, and the states it has
|
|
13
|
+
today. Name only what the screen shows, never what you hope it will.
|
|
14
|
+
|
|
15
|
+
**Variations.** Write eight, each one line: what it is, and what it does
|
|
16
|
+
better or worse than the element. Each moves on a different axis, so no
|
|
17
|
+
two differ only in colour or copy:
|
|
18
|
+
|
|
19
|
+
- **Type**: another kind of control or content for the same job.
|
|
20
|
+
- **Size**: smaller, larger, inline, full screen.
|
|
21
|
+
- **Density**: one at a time, a list, a grid.
|
|
22
|
+
- **Substitute**, **combine**, **remove**: swap a part, merge it with a
|
|
23
|
+
neighbour, take a part away and see what still works.
|
|
24
|
+
- **Reverse**: the order, the default, or who acts first.
|
|
25
|
+
- **Channel**: off the screen: a notification, a sound, a message.
|
|
26
|
+
|
|
27
|
+
The request can name the axes ("sizes only"). Done when there are eight,
|
|
28
|
+
each on its own axis, or as many as the request's axes allow.
|
|
29
|
+
|
|
30
|
+
**Harvest.** Write it up as one document, titled "Riff wide: <element>":
|
|
31
|
+
|
|
32
|
+
1. The seed.
|
|
33
|
+
2. The variations, each with its axis.
|
|
34
|
+
3. **Holds together**: what the strongest variations share, and where two
|
|
35
|
+
pull against each other.
|
|
36
|
+
4. **Build next**: three variations worth building, each a line on what
|
|
37
|
+
it would answer.
|
|
38
|
+
|
|
39
|
+
Save it beside the work, where the project keeps documents, and reply
|
|
40
|
+
with the strongest variation in a line.
|
|
@@ -18,4 +18,4 @@ If your design system is a published package, install it and point
|
|
|
18
18
|
`designSystem` in `dex.config.ts` at it.
|
|
19
19
|
|
|
20
20
|
Studio settings are in `dex.config.ts`; Dex files and guidelines for
|
|
21
|
-
agents (`DESIGN.md`) are in `
|
|
21
|
+
agents (`DESIGN.md`) are in its Dex folder, `dex/`.
|
|
@@ -12,11 +12,11 @@ __PM__ run dex # Dex only: files on @workspace/ui
|
|
|
12
12
|
| --- | --- |
|
|
13
13
|
| `apps/web` | Your product: Vite and React, built from `@workspace/ui`. |
|
|
14
14
|
| `packages/ui` | The design system, `@workspace/ui`: shadcn on Base UI in the look of Dex's own interface (Inter, Lucide icons), with the tokens in `src/styles/globals.css`. |
|
|
15
|
-
| `apps/
|
|
15
|
+
| `apps/dex` | Dex. It depends on `@workspace/ui` as `apps/web` does, and its agents build files with those components. |
|
|
16
16
|
|
|
17
17
|
Add components to the shared package with `npx shadcn@latest add <name>` from
|
|
18
18
|
`apps/web` (its `components.json` sends them to `packages/ui`). Dex's own
|
|
19
19
|
interface keeps its own buttons, menus and icons, whatever your components look
|
|
20
20
|
like.
|
|
21
21
|
|
|
22
|
-
Dex files and guidelines for agents (`DESIGN.md`) are in `apps/
|
|
22
|
+
Dex files and guidelines for agents (`DESIGN.md`) are in `apps/dex`.
|
|
@@ -27,8 +27,8 @@ export function App() {
|
|
|
27
27
|
</CardHeader>
|
|
28
28
|
<CardContent>
|
|
29
29
|
<p className="text-muted-foreground">
|
|
30
|
-
Prototype it in Dex, apps/
|
|
31
|
-
|
|
30
|
+
Prototype it in Dex, apps/dex: run <code>__PM__ run dex</code> from
|
|
31
|
+
the repository's root.
|
|
32
32
|
</p>
|
|
33
33
|
</CardContent>
|
|
34
34
|
<CardFooter>
|
|
@@ -16,4 +16,4 @@ files with them. Dex's own interface keeps its own buttons, menus and icons,
|
|
|
16
16
|
whatever your components look like.
|
|
17
17
|
|
|
18
18
|
Studio settings are in `dex.config.ts`; Dex files and guidelines for
|
|
19
|
-
agents (`DESIGN.md`) are in `
|
|
19
|
+
agents (`DESIGN.md`) are in its Dex folder, `dex/`.
|