@ethlete/agent-rules 0.1.0-next.4 → 0.1.0-next.41
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/AGENTS.md +28 -0
- package/CHANGELOG.md +627 -0
- package/CLAUDE.md +1 -0
- package/README.md +406 -29
- package/THIRD-PARTY-LICENSES.md +35 -0
- package/content/defaults.json +1 -1
- package/content/git-hooks/post-checkout.sh +10 -0
- package/content/git-hooks/pre-push.sh +5 -0
- package/content/hooks/away-mode.py +287 -0
- package/content/hooks/background-design-commands.py +215 -0
- package/content/hooks/builder-chat-words.py +269 -0
- package/content/hooks/context-warning.py +836 -142
- package/content/hooks/git-safety.py +213 -0
- package/content/hooks/subagent-model-policy.py +261 -0
- package/content/mods/.claude-plugin/marketplace.json +16 -0
- package/content/mods/plugins/e2e-progress/.claude-plugin/plugin.json +6 -0
- package/content/mods/plugins/e2e-progress/hooks/hooks.json +1 -0
- package/content/mods/plugins/e2e-progress/hooks/register.tsx +442 -0
- package/content/mods/plugins/e2e-progress/tsconfig.json +3 -0
- package/content/mods/plugins/e2e-progress/types/index.d.ts +23 -0
- package/content/mods/plugins/status-line/.claude-plugin/plugin.json +6 -0
- package/content/mods/plugins/status-line/hooks/hooks.json +1 -0
- package/content/mods/plugins/status-line/hooks/line.ts +73 -0
- package/content/mods/plugins/status-line/hooks/register.tsx +141 -0
- package/content/mods/plugins/status-line/types/index.d.ts +5 -0
- package/content/output-styles/ste-clarity.md +131 -0
- package/content/rules/agent-sessions-wake-up.md +11 -0
- package/content/rules/app-styling.md +66 -0
- package/content/rules/comments.md +4 -1
- package/content/rules/lint-and-format.md +7 -5
- package/content/rules/nx-layout.md +53 -0
- package/content/rules/reactive-state.md +1 -1
- package/content/rules/styling.md +19 -10
- package/content/rules/subagent-models.md +42 -0
- package/content/skills/agent-sessions/SKILL.md +94 -0
- package/content/skills/agent-sessions/agent-sessions.mjs +1125 -0
- package/content/skills/angular-patterns/SKILL.md +31 -7
- package/content/skills/api-source/SKILL.md +156 -0
- package/content/skills/app-testing/SKILL.md +141 -0
- package/content/skills/codex-subagent/SKILL.md +90 -0
- package/content/skills/codex-subagent/codex-agent.mjs +229 -0
- package/content/skills/design-exploration/SKILL.md +190 -0
- package/content/skills/design-exploration/check-story.mjs +139 -0
- package/content/skills/design-exploration/reference-check-and-notes.md +92 -0
- package/content/skills/design-exploration/reference-flows-and-wireframes.md +78 -0
- package/content/skills/design-exploration/reference-inbox-and-mcp.md +54 -0
- package/content/skills/design-exploration/reference-order-and-design-system.md +124 -0
- package/content/skills/design-exploration/reference-products-and-sketches.md +211 -0
- package/content/skills/design-exploration/reference-shots.md +25 -0
- package/content/skills/design-exploration/shoot-template.mjs +61 -0
- package/content/skills/domain-modeling/ADR-FORMAT.md +47 -0
- package/content/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
- package/content/skills/domain-modeling/SKILL.md +80 -0
- package/content/skills/e2e-triage/SKILL.md +80 -0
- package/content/skills/figma-export/SKILL.md +191 -0
- package/content/skills/figma-export/dump-figma-layers.py +83 -0
- package/content/skills/figma-export/dump-figma-svg.py +235 -0
- package/content/skills/figma-export/measure-template.mjs +87 -0
- package/content/skills/git-commit/SKILL.md +21 -7
- package/content/skills/git-flow/SKILL.md +87 -0
- package/content/skills/grill-with-docs/SKILL.md +13 -0
- package/content/skills/grilling/SKILL.md +52 -0
- package/content/skills/handoff/SKILL.md +29 -69
- package/content/skills/handoff/save.md +187 -0
- package/content/skills/query/SKILL.md +165 -64
- package/content/skills/report/SKILL.md +26 -0
- package/content/skills/rxjs-signals/SKILL.md +33 -4
- package/content/skills/sdk-docs/SKILL.md +50 -14
- package/content/skills/sdk-local-build/SKILL.md +26 -8
- package/content/skills/sdk-local-build/sdk-local-baseline.mjs +64 -0
- package/content/skills/sdk-source/SKILL.md +37 -34
- package/content/skills/sdk-update/SKILL.md +103 -0
- package/content/skills/story-styling/SKILL.md +10 -8
- package/content/skills/styleguide/SKILL.md +13 -8
- package/content/skills/styleguide/assets.md +54 -0
- package/content/skills/styleguide/changesets.md +17 -0
- package/content/skills/styleguide/file-structure.md +73 -0
- package/content/skills/styleguide/lint-rule-lookup.md +52 -0
- package/content/skills/styleguide/storybook-structure.md +25 -0
- package/content/skills/theming/SKILL.md +56 -28
- package/content/skills/timetrack/SKILL.md +324 -0
- package/content/skills/verify-in-app/SKILL.md +107 -0
- package/content/skills/verify-in-storybook/SKILL.md +1 -1
- package/migrations/list-state-query-form.md +20 -0
- package/migrations/nx-layout.md +29 -0
- package/migrations/sdk-components-over-hand-built-ui.md +27 -0
- package/migrations/search-query-field.md +52 -0
- package/migrations.json +39 -0
- package/package.json +19 -3
- package/src/index.js +99 -32
- package/src/index.js.map +1 -1
- package/src/lib/cli-args.d.ts +9 -0
- package/src/lib/cli-args.js +48 -0
- package/src/lib/cli-args.js.map +1 -0
- package/src/lib/commitlint.d.ts +10 -0
- package/src/lib/commitlint.js +51 -0
- package/src/lib/commitlint.js.map +1 -0
- package/src/lib/config.d.ts +51 -6
- package/src/lib/config.js +127 -10
- package/src/lib/config.js.map +1 -1
- package/src/lib/filter.d.ts +2 -0
- package/src/lib/filter.js +4 -4
- package/src/lib/filter.js.map +1 -1
- package/src/lib/frontmatter.d.ts +2 -0
- package/src/lib/frontmatter.js +33 -5
- package/src/lib/frontmatter.js.map +1 -1
- package/src/lib/git-flow/build.d.ts +35 -0
- package/src/lib/git-flow/build.js +24 -0
- package/src/lib/git-flow/build.js.map +1 -0
- package/src/lib/git-flow/config.d.ts +59 -0
- package/src/lib/git-flow/config.js +50 -0
- package/src/lib/git-flow/config.js.map +1 -0
- package/src/lib/git-flow/index.d.ts +6 -0
- package/src/lib/git-flow/index.js +23 -0
- package/src/lib/git-flow/index.js.map +1 -0
- package/src/lib/git-flow/parse.d.ts +49 -0
- package/src/lib/git-flow/parse.js +300 -0
- package/src/lib/git-flow/parse.js.map +1 -0
- package/src/lib/git-flow/rename.d.ts +24 -0
- package/src/lib/git-flow/rename.js +70 -0
- package/src/lib/git-flow/rename.js.map +1 -0
- package/src/lib/git-flow/start.d.ts +49 -0
- package/src/lib/git-flow/start.js +57 -0
- package/src/lib/git-flow/start.js.map +1 -0
- package/src/lib/git-flow/validate.d.ts +34 -0
- package/src/lib/git-flow/validate.js +72 -0
- package/src/lib/git-flow/validate.js.map +1 -0
- package/src/lib/git-flow-command.d.ts +4 -0
- package/src/lib/git-flow-command.js +165 -0
- package/src/lib/git-flow-command.js.map +1 -0
- package/src/lib/git-flow-repair.d.ts +17 -0
- package/src/lib/git-flow-repair.js +165 -0
- package/src/lib/git-flow-repair.js.map +1 -0
- package/src/lib/git-flow-start.d.ts +20 -0
- package/src/lib/git-flow-start.js +140 -0
- package/src/lib/git-flow-start.js.map +1 -0
- package/src/lib/git-test-env.fixtures.d.ts +11 -0
- package/src/lib/git-test-env.fixtures.js +31 -0
- package/src/lib/git-test-env.fixtures.js.map +1 -0
- package/src/lib/git.d.ts +64 -0
- package/src/lib/git.js +131 -0
- package/src/lib/git.js.map +1 -0
- package/src/lib/gitlab.d.ts +35 -0
- package/src/lib/gitlab.js +116 -0
- package/src/lib/gitlab.js.map +1 -0
- package/src/lib/index.d.ts +2 -0
- package/src/lib/index.js +26 -11
- package/src/lib/index.js.map +1 -1
- package/src/lib/migrate.js +8 -2
- package/src/lib/migrate.js.map +1 -1
- package/src/lib/output-style-command.d.ts +3 -0
- package/src/lib/output-style-command.js +69 -0
- package/src/lib/output-style-command.js.map +1 -0
- package/src/lib/output-style.d.ts +38 -0
- package/src/lib/output-style.js +134 -0
- package/src/lib/output-style.js.map +1 -0
- package/src/lib/owned-paths.js +27 -3
- package/src/lib/owned-paths.js.map +1 -1
- package/src/lib/package-runner.d.ts +4 -0
- package/src/lib/package-runner.js +86 -0
- package/src/lib/package-runner.js.map +1 -0
- package/src/lib/peer-path.d.ts +12 -0
- package/src/lib/peer-path.js +39 -0
- package/src/lib/peer-path.js.map +1 -0
- package/src/lib/plain-text.d.ts +9 -0
- package/src/lib/plain-text.js +22 -0
- package/src/lib/plain-text.js.map +1 -0
- package/src/lib/plan.d.ts +6 -6
- package/src/lib/plan.js +168 -40
- package/src/lib/plan.js.map +1 -1
- package/src/lib/prettier.d.ts +21 -0
- package/src/lib/prettier.js +51 -0
- package/src/lib/prettier.js.map +1 -0
- package/src/lib/prompt.d.ts +8 -0
- package/src/lib/prompt.js +35 -0
- package/src/lib/prompt.js.map +1 -0
- package/src/lib/render.d.ts +26 -2
- package/src/lib/render.js +45 -10
- package/src/lib/render.js.map +1 -1
- package/src/lib/report-command.d.ts +33 -0
- package/src/lib/report-command.js +312 -0
- package/src/lib/report-command.js.map +1 -0
- package/src/lib/sessions-command.d.ts +4 -0
- package/src/lib/sessions-command.js +16 -0
- package/src/lib/sessions-command.js.map +1 -0
- package/src/lib/sync.d.ts +1 -2
- package/src/lib/sync.js +37 -17
- package/src/lib/sync.js.map +1 -1
- package/src/lib/targets/agents-skills.js +1 -1
- package/src/lib/targets/agents-skills.js.map +1 -1
- package/src/lib/targets/claude-hooks.d.ts +3 -23
- package/src/lib/targets/claude-hooks.js +22 -86
- package/src/lib/targets/claude-hooks.js.map +1 -1
- package/src/lib/targets/claude-mods.d.ts +20 -0
- package/src/lib/targets/claude-mods.js +47 -0
- package/src/lib/targets/claude-mods.js.map +1 -0
- package/src/lib/targets/claude.js +2 -3
- package/src/lib/targets/claude.js.map +1 -1
- package/src/lib/targets/codex-hooks.d.ts +12 -0
- package/src/lib/targets/codex-hooks.js +35 -0
- package/src/lib/targets/codex-hooks.js.map +1 -0
- package/src/lib/targets/codex.js +4 -4
- package/src/lib/targets/codex.js.map +1 -1
- package/src/lib/targets/copilot.js +4 -4
- package/src/lib/targets/copilot.js.map +1 -1
- package/src/lib/targets/cursor.js +3 -3
- package/src/lib/targets/cursor.js.map +1 -1
- package/src/lib/targets/git-hooks.d.ts +25 -0
- package/src/lib/targets/git-hooks.js +71 -0
- package/src/lib/targets/git-hooks.js.map +1 -0
- package/src/lib/targets/hooks-shared.d.ts +60 -0
- package/src/lib/targets/hooks-shared.js +174 -0
- package/src/lib/targets/hooks-shared.js.map +1 -0
- package/src/lib/targets/mcp.d.ts +16 -0
- package/src/lib/targets/mcp.js +72 -0
- package/src/lib/targets/mcp.js.map +1 -0
- package/src/lib/targets/shared.d.ts +1 -9
- package/src/lib/targets/shared.js +4 -8
- package/src/lib/targets/shared.js.map +1 -1
- package/src/lib/timetrack-command.d.ts +11 -0
- package/src/lib/timetrack-command.js +1262 -0
- package/src/lib/timetrack-command.js.map +1 -0
- package/src/lib/timetrack-snapshot.d.ts +66 -0
- package/src/lib/timetrack-snapshot.js +146 -0
- package/src/lib/timetrack-snapshot.js.map +1 -0
- package/src/lib/timetrack.d.ts +607 -0
- package/src/lib/timetrack.js +285 -0
- package/src/lib/timetrack.js.map +1 -0
- package/content/skills/styleguide/STYLEGUIDE.md +0 -520
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Design exploration: flows and wireframes
|
|
2
|
+
|
|
3
|
+
### Draw a flow
|
|
4
|
+
|
|
5
|
+
A flow joins states of pages into a path the user reads left to right in Studio's Flows view.
|
|
6
|
+
It is `<product>/flows/<name>.json`; `position` and `label` are optional:
|
|
7
|
+
|
|
8
|
+
```json
|
|
9
|
+
{
|
|
10
|
+
"frames": [{ "part": "pages/library", "state": "empty", "position": { "x": 0, "y": 0 } }],
|
|
11
|
+
"lines": [
|
|
12
|
+
{
|
|
13
|
+
"from": { "part": "pages/library", "state": "empty" },
|
|
14
|
+
"to": { "part": "pages/film-detail", "state": "default" },
|
|
15
|
+
"label": "user adds a film"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Every flow line is labelled, and the element the label names is visible in the frame before it: a line
|
|
22
|
+
labelled "user clicks 'Log in'" starts from a frame that shows a "Log in" button. A line that names
|
|
23
|
+
nothing the reader can see, or a label for a control the page lacks, is a defect.
|
|
24
|
+
|
|
25
|
+
A line may join two states of one page. A frame may name a page that exists only as an open sketch;
|
|
26
|
+
the flow then shows its first variant. Lines hold for every preset. Without `position`, Studio
|
|
27
|
+
lays the frames out along the lines.
|
|
28
|
+
|
|
29
|
+
### Draw a wireframe
|
|
30
|
+
|
|
31
|
+
A wireframe exists to iterate fast, in minutes per round, rough enough to redraw with a client at
|
|
32
|
+
the table. It answers one thing: which regions a screen has and what each region holds. These
|
|
33
|
+
rules are strict:
|
|
34
|
+
|
|
35
|
+
- **Keep what exists.** Before a sketch, list what the running app already does on that screen.
|
|
36
|
+
Keep it as a labelled box, and draw only what is still open.
|
|
37
|
+
- **One sketch per screen or flow**, never one per region or per detail. The variants differ in
|
|
38
|
+
layout: where the regions sit and how big they are.
|
|
39
|
+
- **Regions and names only.** A region is a box with a label; a list shows item names. Draw no
|
|
40
|
+
counts, badges, status markers, inspectors, size labels or field lists. If a detail matters,
|
|
41
|
+
write it as a word in the region label.
|
|
42
|
+
- **Never polish.** Do not fix alignment, spacing or a kit gap. When the kit lacks a shape, draw a
|
|
43
|
+
labelled box. Look at each shot only for a broken frame: overflow, a scroll bar, clipped text.
|
|
44
|
+
- **Draw it yourself.** A wireframe round is small work: no subagent, no friction report.
|
|
45
|
+
- **Stop early.** When the regions of the main screens are settled, the stage ends. Comments on
|
|
46
|
+
the look of a wireframe belong to the next stage, not to a new wireframe round.
|
|
47
|
+
|
|
48
|
+
A page may not import another page. To show a page inside a page ("in context"), embed it:
|
|
49
|
+
`embedPage('pages/system', { state, width, height, scale })` from `@design-system` answers a
|
|
50
|
+
drawing whose `body` is a frame of that page, drawn in the same product, sketch variant and theme
|
|
51
|
+
as the embedding frame. `width` and `height` are the viewport the page is drawn at (default
|
|
52
|
+
1280 x 800; `height: 'auto'` fits its content), `scale` shrinks the frame. Never rebuild a page
|
|
53
|
+
from its elements to show it.
|
|
54
|
+
|
|
55
|
+
A page that has no parts yet draws grey stand-ins from the wireframe kit; pages and elements may
|
|
56
|
+
import it, components and foundations may not:
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
import { box, heading, textLines, image, button, input, icon, select } from '@design-system/kit';
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Signatures are in `libs/cli/design/wireframe-kit.ts`: `box(children, { direction, gap, padding, width, height, grow, plain, stackBelow, fill })`,
|
|
63
|
+
`heading(text, { size })`, `textLines({ lines, width, size })`, `image({ width, height, ratio })`,
|
|
64
|
+
`button(label, { primary })`, `input({ label, placeholder, width })`, `icon({ size, glyph })`,
|
|
65
|
+
`select({ label, value, width })`, `tabs(labels, { active })`, `segmented(options, { active })`,
|
|
66
|
+
`checkbox(label, { checked })`, `badge(text)` and `dot({ hollow, size })`. Draw a control as its
|
|
67
|
+
type: a picker is a `select`, a section switch `tabs`, a size switch `segmented`, a count a `badge`,
|
|
68
|
+
a status a `dot`, never a row of buttons or an empty `icon`. Give an icon a `glyph` (`'plus'`,
|
|
69
|
+
`'close'`, `'menu'`, `'more'`, …; another name draws its first letter). Give the root box of a page or a
|
|
70
|
+
shell `fill: true` so it is as tall as the frame, instead of a hand-written `min-height`. Draw for
|
|
71
|
+
every preset, not one width: give a picture a `ratio` (`'2/3'`) instead of a fixed height, and give
|
|
72
|
+
a row `stackBelow: <px>`, the width below which it stacks its children, instead of fixed widths
|
|
73
|
+
that only fit the desktop. Never use `vh`, `dvh` or `svh` in a part: a part has no viewport of its own, so the unit measures Studio's frame, not the page. A full page is a frame of a fixed size. Put titles in `heading`, never in hand-written markup. Studio lists such a page under
|
|
74
|
+
"Wireframes" with its kit-use count. A shell is a normal element named by purpose (`shell-main`); draw a rough one with the kit, so each
|
|
75
|
+
page imports the shell instead of repeating it, and a shell pick lands in one file.
|
|
76
|
+
A dialog without its own URL is an element that a page state shows ("login open"). Examples in
|
|
77
|
+
`.ethlete/design/studio-lab`: `pages/film-detail`, `elements/shell-main`, `elements/login-dialog`,
|
|
78
|
+
`flows/sign-in.json`.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Design exploration: the inbox and the MCP server
|
|
2
|
+
|
|
3
|
+
### Read the inbox
|
|
4
|
+
|
|
5
|
+
The user comments on a state of a part in Studio, at a point, or on a sketch variant. The sketch of
|
|
6
|
+
an element also shows each page that uses it, with each variant swapped in: a comment there names
|
|
7
|
+
the page as its part and the element's sketch variant, so change the variant, not the page.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
et design inbox [--json] [--product <p>] # open comments and rebases, then what waits for the user
|
|
11
|
+
et design inbox done <id> --note <text> --by <model id> # set the part note, mark the thread addressed
|
|
12
|
+
et design comment reply <id> --by <model id> <text> [--question] # answer a comment thread (takes --product)
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Read the inbox at the start of a session and after each sketch you mark `ready`. Answer a comment
|
|
16
|
+
by changing the sketch or the part, then `inbox done <id> --note "…"`. The note replaces the `note` of the part the comment was made on (for a sketch variant, the product's part), so write it to explain the whole shape of the part, and pass the old note unchanged when it still holds. `done` fails without `--note`; only the user withdraws a comment without one, in Studio. `done` also stores your `--by` where the comment sat: in the authors of the sketch variant, or in the `madeBy` of the part. A pick or discard decision is listed as waiting
|
|
17
|
+
for the user: Studio merges or discards on the user's click, so never run `sketch merge` after a pick.
|
|
18
|
+
|
|
19
|
+
A comment is a thread: the user and you both reply. When a comment is unclear, ask with
|
|
20
|
+
`comment reply --question` instead of guessing. The thread then moves to the "waiting for the user" group
|
|
21
|
+
(`waitingForUser` in `--json`) and returns to the inbox when the user answers. A thread there is
|
|
22
|
+
not work for you.
|
|
23
|
+
|
|
24
|
+
A thread has three states. **Open** waits for an answer. **Addressed** (`addressed`: who, when, why,
|
|
25
|
+
the round) means `inbox done`, a new round, a merge or a discard answered it: it leaves the inbox and
|
|
26
|
+
the check, Studio shows it with an "addressed" badge, and you may still `comment reply` on it to say
|
|
27
|
+
what you changed. A reply by the user opens it again. **Resolved** means the user closed it in Studio -
|
|
28
|
+
only the user resolves. The file stays so the user can look back at it; a reply or `done` on it fails.
|
|
29
|
+
|
|
30
|
+
Pass `--question` only when you cannot go on without the user's answer. Studio lists only those
|
|
31
|
+
threads under "Questions for you". A report of what you did is no question: reply without the
|
|
32
|
+
flag, and the thread shows as "answered" until the user withdraws it or replies.
|
|
33
|
+
|
|
34
|
+
### The `ethlete-design` MCP server
|
|
35
|
+
|
|
36
|
+
`ethlete-agents sync` registers `et design mcp` as `ethlete-design` in `.mcp.json` and
|
|
37
|
+
`.codex/config.toml` when `@ethlete/cli` is installed. When the tools are in your tool list, use them
|
|
38
|
+
instead of the CLI: each runs the `et design` command of the same name in the session's working
|
|
39
|
+
directory, takes its flags as arguments, and every write takes `by` (your model id). `product` may be
|
|
40
|
+
left out when the workspace has one. `shot` and `motion_shots` return the sheet image itself, so you
|
|
41
|
+
look at it without opening a PNG path.
|
|
42
|
+
|
|
43
|
+
- **Read:** `parts` (every part, as JSON), `call` (a call's `call.ts`, `fixture.ts`, the variant file to draw into and the frame URL; never change the fixture).
|
|
44
|
+
- **Check:** `check` (a product; with `call` and `variant` it lints, type-checks and renders that variant - run it after every edit of a variant), `sketch_check` (each variant laid over the product), `sketch_preview` (what a merge of a variant changes).
|
|
45
|
+
- **Shots:** `shot` (a part's states, `variants` for the open sketch), `motion_shots` (a motion at its keyframes, full and reduced, plus its tracks as JSON).
|
|
46
|
+
- **Sketch lifecycle:** `sketch_new`, `sketch_variant`, `sketch_round`, `sketch_report`, `sketch_ready`, `sketch_rebase`, `sketch_list`. `sketch_merge` and `sketch_discard` exist, but Studio runs them on the user's click; do not call them.
|
|
47
|
+
- **Comments:** `inbox` (what waits for you, then for the user), `comment_reply` (`question` waits for the user's answer), `inbox_done` (needs the new part `note`).
|
|
48
|
+
|
|
49
|
+
Part files are written with your own file tools; the server has no write tool for them. Call
|
|
50
|
+
`sketch_report` before every variant edit: it tells Studio what you build. It refuses a `ready` sketch: only when the
|
|
51
|
+
user asks for a change, run `et design sketch report … --reopen`, which moves the sketch back to in progress, and call
|
|
52
|
+
`sketch_ready` again when you are done. `sketch_ready` runs the
|
|
53
|
+
render check and refuses on any render issue; mark an element that renders wrong on purpose with
|
|
54
|
+
`data-et-skip="<rule>"`. A tool that fails returns the CLI's output; fix it and call again.
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# Design exploration: the order of a design and drawing from the design system
|
|
2
|
+
|
|
3
|
+
## The order of a design
|
|
4
|
+
|
|
5
|
+
A product design runs in this order. Each stage settles in calls before the next starts, and
|
|
6
|
+
each stage draws with what the stages before it settled (the wireframes draw with the kit only):
|
|
7
|
+
|
|
8
|
+
1. **Wireframes**: early, rough concepts of the main flows (a legacy call with `mode: 'wireframe'`;
|
|
9
|
+
in a product, draw them with the wireframe kit, see "Draw a wireframe"). They show
|
|
10
|
+
which components the product needs, not how they look. The stage ends with an inventory in
|
|
11
|
+
the wireframe call: every part the wireframes need, each mapped to the SDK component it
|
|
12
|
+
starts from, or marked new with the component call that draws it. The inventory is the
|
|
13
|
+
queue of component calls:
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
inventory: [
|
|
17
|
+
{ part: 'Search field', sdk: 'et-input' },
|
|
18
|
+
{ part: 'Match card', new: true, call: 'tomflix/components/match-card' },
|
|
19
|
+
],
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
2. **Foundations**: colours, colour themes and surface themes (the project's `themes` in
|
|
23
|
+
`config.json`), plus the type scale, spacing and radius.
|
|
24
|
+
3. **Logo and CI**, if the project needs them.
|
|
25
|
+
4. **Components**, the inventory is their queue, from the SDK ones rendered with `ng()`, themed and set up for the project.
|
|
26
|
+
Each accepted one becomes a design-system entry.
|
|
27
|
+
5. **Larger elements**: the shell, the navigation, headers, lists, built from the entries.
|
|
28
|
+
6. **Pages**, built from the elements and the entries.
|
|
29
|
+
7. **The working prototype**: the pages joined with `ngStates` and `flow.on`.
|
|
30
|
+
|
|
31
|
+
Do not start a stage before the one above it is settled, and do not draw a page from parts that
|
|
32
|
+
are not in the design system. If the user asks for a later stage first, say which earlier stage
|
|
33
|
+
is missing, and draw that first.
|
|
34
|
+
|
|
35
|
+
The stages map onto the layers of a product: wireframes, foundations, components, elements, pages. A settled
|
|
36
|
+
Legacy call with a stage counts for that stage in this order.
|
|
37
|
+
|
|
38
|
+
A later stage can show that an earlier one is incomplete. If a page needs a part that the system
|
|
39
|
+
does not have, add it to the inventory. A part becomes a component only when at least two hosts
|
|
40
|
+
draw the same case. Until then it stays in the one element or page that draws it. When a second
|
|
41
|
+
host draws it, open a component sketch, and list in its brief every host and every case each one
|
|
42
|
+
draws, so the component covers them all.
|
|
43
|
+
|
|
44
|
+
A component documents its states per axis, not every combination: for example kind, end mark and
|
|
45
|
+
interaction (rest, hover, focus-visible, selected, inert), plus only the combinations that look
|
|
46
|
+
different. A smaller piece with no states of its own, such as an icon set, is a foundation asset,
|
|
47
|
+
not a component.
|
|
48
|
+
|
|
49
|
+
When each of several cases is drawn at rest and in the same interactions, build the states and their grid with
|
|
50
|
+
`interactionRows(rows, { interactions: ['hover', 'active'], force: (props, interaction) => ({ ...props, interaction }) })`
|
|
51
|
+
from `@design-system` and spread the result into `definePart`; never write those states and the grid by hand.
|
|
52
|
+
`sketch check` prints `grid <rows> x <columns> ok`, or the states the grid leaves out; a state in two cells
|
|
53
|
+
fails it as `GRID`, in `design check` too.
|
|
54
|
+
Interaction states (a state name whose last word is hover, focus, pressed, active or selected, such as `row-hover`) live only on a control
|
|
55
|
+
part, one whose `controls` declare a control of a checked kind. On a shell, element or page they fail as
|
|
56
|
+
`CONTROL-STATE`: declare the component's controls (Q164), or extract the button or row as its own control part and draw its states there.
|
|
57
|
+
A drawn `button`, `a[href]`, `input`, `select`, `textarea` or control role without `data-et-control` on it or around
|
|
58
|
+
it is `CONTROL-PART-INPUT`: no control check sees it. Wrap it in `control(markup, name)` from
|
|
59
|
+
`@ethlete/components/design/control` and declare the name in `controls`; a sketch fails on one it adds,
|
|
60
|
+
`design check` only warns of one a merged part already draws. On a reused control part's render,
|
|
61
|
+
`control(drawn.body, name)` renames its control: never string-replace `data-et-control`.
|
|
62
|
+
`definePart({ interactions })` forces an interaction on the part's root only. To draw one element of the part
|
|
63
|
+
hovered, focused, pressed or disabled, such as one row of a list, wrap that element's markup in
|
|
64
|
+
`forceInteraction(markup, 'hover')` from `@design-system` inside `render`, driven by a prop; never write
|
|
65
|
+
`data-et-force` by hand.
|
|
66
|
+
|
|
67
|
+
## Draw from the design system
|
|
68
|
+
|
|
69
|
+
A call that invents its own button, field or row does not match the calls beside it. **Before
|
|
70
|
+
you draw a part, look for it in this order, and draw new only when none of them has it:**
|
|
71
|
+
|
|
72
|
+
1. The product's design system, `.ethlete/design/<product>/` (and its base).
|
|
73
|
+
2. The real SDK components, rendered on the design server with `ng()` from `@design-explore`:
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
const field = ng(`<et-form-field><et-label>Name</et-label><et-input /></et-form-field>`, {
|
|
77
|
+
imports: ['FORM_FIELD_IMPORTS', 'INPUT_IMPORTS'],
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
export default field.then((body) => drawing({ body }));
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Never `await` at the top level of a design module: WebKit can hang for good when a frame is
|
|
84
|
+
removed while the module evaluates, and `et design check` fails it with `TOP-LEVEL-AWAIT`. A
|
|
85
|
+
call default-exports a promise of its drawing; a part awaits inside its `render`.
|
|
86
|
+
|
|
87
|
+
The template is a real Angular template, and `imports` names exports of
|
|
88
|
+
`@ethlete/components`. The project's `providers` module in `config.json` supplies the themes.
|
|
89
|
+
Render every component of a drawing in **one** `ng()` call: each call is a new app, so two
|
|
90
|
+
calls repeat element ids. The server renders the built package, so in the SDK rebuild
|
|
91
|
+
`dist` after a component change.
|
|
92
|
+
|
|
93
|
+
To draw a form state (a value, an error, a touched field), give `ng()` (or `ngStates()`)
|
|
94
|
+
`fields`. Each entry becomes a signal form field the template binds as
|
|
95
|
+
`[formField]="fields.<name>"`. An error is a kind (`'required'`) or a kind and a message. A
|
|
96
|
+
field shows its errors only when it is touched:
|
|
97
|
+
|
|
98
|
+
```ts
|
|
99
|
+
const form = ng(`<et-form-field><et-label>Email</et-label><et-input [formField]="fields.email" /></et-form-field>`, {
|
|
100
|
+
imports: ['FORM_FIELD_IMPORTS', 'INPUT_IMPORTS'],
|
|
101
|
+
fields: { email: { value: 'ada@', errors: [{ kind: 'email', message: 'Not an email' }], touched: true } },
|
|
102
|
+
});
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
3. Only then a new drawing. Build it from the two above, and say in the variant's `claim`
|
|
106
|
+
that the part is new.
|
|
107
|
+
|
|
108
|
+
**Colours come from the two SDK theming systems, never from tokens of your own.** A raised or
|
|
109
|
+
floating area sets a surface scope (`data-et-surface` or a surface scope class) and takes its
|
|
110
|
+
background, text, border and interaction states from the `et-surface` tokens of that scope. An
|
|
111
|
+
accent, a warning or a danger colour comes from the SDK colour theming (`--et-theme-color-*` under a
|
|
112
|
+
colour theme scope). Foundations define only the inputs of these themes. Never add a tier class
|
|
113
|
+
(`bg-surface-raised`), an accent utility or a `var(--accent)` to a part or to the product
|
|
114
|
+
stylesheet. Give a raised or floating area `data-et-auto-surface` and an interactive one
|
|
115
|
+
`data-et-surface-interactive`, never a picked `et-surface--<name>` class: the frame resolves them by elevation like
|
|
116
|
+
`etAutoSurface` and `etSurfaceInteractive`. Give a warning, error or success accent
|
|
117
|
+
`data-et-semantic-color="<type>"`, never a picked `et-color--<name>` class: the frame resolves it by type like
|
|
118
|
+
`injectSemanticColorTheme`. Read the theming skill of the SDK before the first colour in a drawing. `et design check` reports
|
|
119
|
+
a denied class from the product's `deniedClasses` list in `config.json`.
|
|
120
|
+
|
|
121
|
+
A part is one folder, `<product>/<layer>/<part>/`, with its drawing and states. Read the parts of
|
|
122
|
+
the product before the first drawing of a session. **A part exists only because the user picked a
|
|
123
|
+
sketch.** A `chosen` verdict in an old call is not enough. Never change a part's look without a
|
|
124
|
+
sketch the user decided.
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
# Design exploration: products, sketches and rounds
|
|
2
|
+
|
|
3
|
+
### Create a product
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
et design product new <name> [--base @ethlete/components|<path>] [--from-project <name>]
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
It writes the `config.json` entry and the empty layer folders. A product on `@ethlete/components`
|
|
10
|
+
takes the SDK as its base, so its parts start from the real components rendered with `ng()`.
|
|
11
|
+
Without a base it gets the presets phone (390x844) and desktop (1440x900). A product's own `presets`
|
|
12
|
+
replace its base's whole: a desktop-only app lists `desktop` alone and draws no phone state. `--from-project` copies
|
|
13
|
+
`styles`, `head`, `providers` and `themes` from an old project entry. Studio never writes
|
|
14
|
+
`config.json`; the command does.
|
|
15
|
+
|
|
16
|
+
Every frame loads the product's tokens stylesheets once, before the part's own `styles`, so a part
|
|
17
|
+
never imports the tokens and never adds them to its `styles`. The product's config `tokens` lists
|
|
18
|
+
those parts in load order (`["foundations/tokens"]` when left out); a listed part that does not
|
|
19
|
+
exist yet is skipped. A product's own copy of a listed part, or a sketch of it, replaces the base's
|
|
20
|
+
in every frame. Never list a `tokens.css` in config `styles`.
|
|
21
|
+
|
|
22
|
+
A part file default-exports its `definePart(...)` and may also export named helpers, such as a piece of its
|
|
23
|
+
markup: `import { studioMark } from '@system/foundations/logo'`. Import a piece from the part that draws it;
|
|
24
|
+
never copy its markup into another part. A piece that uses the part's classes needs its stylesheet too
|
|
25
|
+
(`@system/foundations/logo.css?inline`), or from the part's default export when the part sets
|
|
26
|
+
`definePart({ styles })`: every drawing of that part gets it, so `render` returns only extra styles, or `drawing({ body })` with none. The layer
|
|
27
|
+
rules hold for these imports as well.
|
|
28
|
+
|
|
29
|
+
A component a host embeds exports its markup as such a helper, and a wrapper only its own frame needs, such as
|
|
30
|
+
padding that makes room for a focus ring, goes in `render` alone, never in that helper: the host places the
|
|
31
|
+
component itself and would inherit the wrapper's offset.
|
|
32
|
+
|
|
33
|
+
A product whose app uses Tailwind lists one stylesheet in config `styles` that imports the app's styles and
|
|
34
|
+
registers the drawing folders with `@source './'`. Sketches then use the app's utilities; plain CSS stays for what
|
|
35
|
+
utilities cannot express, such as camera geometry.
|
|
36
|
+
|
|
37
|
+
### Propose a change as a sketch
|
|
38
|
+
|
|
39
|
+
A change to a part, or a new part, is a **sketch**: the question is the part, the variants are the
|
|
40
|
+
answers. Variants are drawn at the same geometry, and one variant wins only against the others.
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
et design sketch new <layer>/<name> --variants a,b --by <model id> [--like <layer>/<name>] [--variant-note a=<text>]… [--product <p>] # each variant starts as a copy of the part
|
|
44
|
+
et design sketch new <layer>/<name> <layer>/<name>… --variants a --by <model id> # one change across several parts: one sketch, one ready, one merge
|
|
45
|
+
et design sketch target add <layer>/<name> <layer>/<name> --by <model id> # add a part to an open sketch's targets, seeded into each variant
|
|
46
|
+
et design sketch report <layer>/<name> --variant b --by <model id> "phone" # tell Studio what you build now
|
|
47
|
+
et design sketch report <layer>/<name> --variant b --by <model id> --done # you stopped drawing b; Studio shows its frames
|
|
48
|
+
et design sketch check [<layer>/<name>] [--fix] # each variant laid over the product
|
|
49
|
+
et design sketch ready <layer>/<name> --by <model id> # now the user can pick
|
|
50
|
+
et design sketch reject <layer>/<name> --variant b [--reason <text>] --by <model id> # only when the user rejected b; no pick or merge until reopened
|
|
51
|
+
et design sketch reopen <layer>/<name> --variant b [--reason <text>] --by <model id> # only when the user takes b back; the rejection stays in the history
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
When the app shows UI the design does not draw, open the sketch at once with the built look as variant a, and
|
|
55
|
+
name the compare DIFFs it explains:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
et design sketch covers <layer>/<name> <state> <state>@<x>,<y>,<w>,<h>… --by <model id> # no state clears them
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
While the sketch is open, `compare` lists each covered DIFF with the sketch name and passes it. A bare state
|
|
62
|
+
covers its whole DIFF; `@x,y,w,h` covers only differing pixels inside that box of the state's picture (the
|
|
63
|
+
diff PNG compare writes), and never a size change. A sketch with several targets needs the part in front,
|
|
64
|
+
`<layer>/<name>:<state>[@x,y,w,h]`, and refuses a bare state (exit 2); a one-target sketch takes both forms. Any other DIFF on the part still fails. After the pick the
|
|
65
|
+
cover ends, and the part must compare green again.
|
|
66
|
+
|
|
67
|
+
One change across several parts (an alias removal, a token rename) is one sketch with several targets: each
|
|
68
|
+
variant holds every target, and `ready` compares them all. `ready` and `preview` also name every part a `shared/`
|
|
69
|
+
edit reaches.
|
|
70
|
+
|
|
71
|
+
Variants are alternatives. A variant never stands for a state of another variant: a hidden or
|
|
72
|
+
collapsed mode of variant d is a further state of d, not a variant e. Before you draw a new control,
|
|
73
|
+
look for a control that already does the job (an active rail button that toggles its panel), and
|
|
74
|
+
draw that first.
|
|
75
|
+
|
|
76
|
+
A section of an app is a page under `pages/`, never a state of the shell. An element holds its
|
|
77
|
+
own chrome only. A sketch on an element adds no state whose difference is page content in a slot.
|
|
78
|
+
|
|
79
|
+
A variant mirrors the product layout and holds only the parts it changes. Draw two to four
|
|
80
|
+
variants, each with what it costs, and run `sketch check` before `ready`. A variant with problems
|
|
81
|
+
cannot be picked. A part in a variant keeps every state the part has in the product: `sketch check`
|
|
82
|
+
and `sketch ready` fail on a dropped state, and warn when two stylesheets of one part define the same class. A problem the product already had prints as `NOTE (was there before)` and fails
|
|
83
|
+
neither. Use `sketch list` to see the open ones.
|
|
84
|
+
`sketch check` also runs tsc over each variant with its `@shared/` and `@system/` imports, so never write a
|
|
85
|
+
tsconfig of your own. It warns of a variant stylesheet that restyles a class of `shared/`, of a
|
|
86
|
+
variant file nothing imports, and of a `shared/` export the variant does not import; `design check` warns of
|
|
87
|
+
an export in a merged part's `shared/` that nothing imports, and (`STALE-REPLACE`) of a `.replace('<…')` or
|
|
88
|
+
`.replace(/<…/)` on markup that neither the part nor a part it uses draws. To delete a file of a part, delete it in the variant: a merge deletes the
|
|
89
|
+
product file the picked variant no longer holds.
|
|
90
|
+
|
|
91
|
+
Each variant's note, what it is and what it costs, goes in with `sketch new --variant-note a=<text>`, once
|
|
92
|
+
per variant: `sketch.json` keeps it apart from the part's `definePart({ note })`, and Studio shows it in the
|
|
93
|
+
variant's head. A merge keeps the part's note, takes its `--note`, or gives a new part the picked variant's note.
|
|
94
|
+
`sketch new` and `sketch variant` write their files in the checkout's Prettier format; after an edit,
|
|
95
|
+
`sketch check --fix` formats the variants before it checks them. A sketch command
|
|
96
|
+
without `--product` takes the product that holds the sketch.
|
|
97
|
+
|
|
98
|
+
Start a new part from a close one with `--like`: `sketch new pages/inbox --like pages/system`
|
|
99
|
+
copies the product's `pages/system` into each variant, renamed to the target and without its
|
|
100
|
+
`madeBy`; `--like pages/system:b` copies variant b of the open sketch on it, with that sketch's
|
|
101
|
+
`shared/` folder.
|
|
102
|
+
|
|
103
|
+
Rendering for one variant lives in that variant's files. `shared/` holds only code every variant
|
|
104
|
+
uses: do not give a shared helper a parameter, branch, import or style rule that only one variant, or
|
|
105
|
+
a variant you dropped, needs. A merge takes `shared/` whole, so what stays there ships with the pick.
|
|
106
|
+
|
|
107
|
+
Code the variants of one sketch have in common (sample data, a switch, a helper) goes in the
|
|
108
|
+
sketch's `shared/` folder, next to the variant folders, never into copies per variant. A part in a
|
|
109
|
+
variant imports it as `@shared/<path>`, and a shared file may import `@system/...` and
|
|
110
|
+
`@shared/...`. A part outside a sketch may not import `@shared/`. A variant that needs a shared file
|
|
111
|
+
changed holds its own copy at `<variant>/shared/<path>`; `@shared/<path>` finds that copy first, and a merge
|
|
112
|
+
of that variant takes it. On a merge, `shared/` moves into
|
|
113
|
+
the target's folder as `shared/` with its imports made relative; when no part imports it, it is
|
|
114
|
+
dropped. With several targets, each takes only the files it imports, directly or through another
|
|
115
|
+
shared file; a file nobody imports goes back to the target that held it, and the merge refuses one no
|
|
116
|
+
target held. `sketch new` refuses targets whose `shared/` folders hold one path with different contents. Only the target may import it: a merge refuses while another part of the picked variant
|
|
117
|
+
does, so move that code into the part. `sketch new` prints each file it puts in `shared/`, for example
|
|
118
|
+
the `shared/` folder of a merged page: edit it there, as part of the sketch, not in a variant copy.
|
|
119
|
+
|
|
120
|
+
```ts
|
|
121
|
+
// sketches/pages-flows/shared/flow-data.ts
|
|
122
|
+
export const flows = [{ name: 'Checkout', steps: 4 }];
|
|
123
|
+
|
|
124
|
+
// sketches/pages-flows/a/pages/flows/flows.ts
|
|
125
|
+
import { flows } from '@shared/flow-data';
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
An asset (a mark, logo, icon, picture or font) is one file in `.ethlete/design/<product>/assets/`,
|
|
129
|
+
never a copy inlined into parts. A part imports it as `@assets/<file>`: the default import is a URL
|
|
130
|
+
for `<img src>`; an SVG that must follow tokens (`currentColor`, `var(--accent)`) imports with
|
|
131
|
+
`?raw` and goes inline, for example `@assets/icons/<name>.svg?raw`. A stylesheet, the product's
|
|
132
|
+
`styles.css` or a part's, uses `url('@assets/<file>')`, for example in an `@font-face`. A foundation
|
|
133
|
+
part may wrap an asset in a named export. A product finds its base product's assets too. A sketch
|
|
134
|
+
variant adds or changes an asset in its own `<variant>/assets/` folder (`sketch new` and `sketch variant`
|
|
135
|
+
print it next to the part file), and a merge copies it into the product's. Size an inline SVG with
|
|
136
|
+
`svgAsset(mark, { size: 32 })` from `@design-system`, never by replacing its `width`/`height` as a
|
|
137
|
+
string; `class` and `attrs` (`{ 'aria-hidden': 'true' }`) set the rest of the root's attributes. `design check` fails an SVG asset with no root `<svg>` or without
|
|
138
|
+
`xmlns="http://www.w3.org/2000/svg"` (an `<img src>` and an image viewer do not draw it). The part hash behind `design check` and "changed outside a sketch" counts the bytes of
|
|
139
|
+
the assets a part uses.
|
|
140
|
+
|
|
141
|
+
Every change to a merged part goes through a sketch, also a small one: new copy, sample data, an
|
|
142
|
+
added state. When there is nothing to choose, the sketch has one variant (`--variants a`), and the
|
|
143
|
+
user merges it or comments on it. Never edit a merged part directly, or the user cannot compare or
|
|
144
|
+
comment on the change in Studio. `design check` warns, and Studio marks the part "changed", when a
|
|
145
|
+
merged part changed outside a sketch; only a merged sketch on that part clears it.
|
|
146
|
+
|
|
147
|
+
A sketch on a foundations part such as `foundations/tokens` keeps the part's overview drawing: the
|
|
148
|
+
variant adds its token group as a state, or extends that group's state. It never replaces the
|
|
149
|
+
drawing with a demo scene, since the merge would drop every other group. A demo may be an extra state.
|
|
150
|
+
|
|
151
|
+
Name the variant you work on with `--variant`. Studio marks it as drawing, and hides its frames,
|
|
152
|
+
while the latest report names it. `sketch new` starts no report, so `report --done` follows only a report
|
|
153
|
+
of your own; it prints the next steps. `sketch new`, `sketch variant` and each report record your
|
|
154
|
+
model id as an author of the variants they write, and `sketch ready` records it on every variant
|
|
155
|
+
that has no author yet. A merge adds the picked variant's authors to the `madeBy` the part file
|
|
156
|
+
already holds, and never removes it.
|
|
157
|
+
|
|
158
|
+
### Combine variants in a new round
|
|
159
|
+
|
|
160
|
+
Studio never combines variants. When the user asks for one in a comment ("solid like a, outline
|
|
161
|
+
like b"), draw it as a new variant in a new round:
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
et design sketch variant <layer>/<name> c --from a --by <model id> --round "Solid a, outline b" --note "r1 showed pill and square; the user wants a's solid with b's outline"
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
`--from` copies a variant into the new one, sets the sketch back to in progress and clears the
|
|
168
|
+
pick; it refuses while the decision is a discard (the user picks a variant first). Without `--round` the new variant joins the running round; with it, `--note` is required and
|
|
169
|
+
goes on the running round: what it showed and why its variants lost. Older variants stay pickable.
|
|
170
|
+
The command prints the notes of the previous round. Fix a round's title or note later with `sketch round <layer>/<name> <round> --title … --note … --by <model id>`; `sketch list` shows each sketch's rounds.
|
|
171
|
+
Letters continue across rounds (r1: a, b; r2: c, d). `sketch variant <layer>/<name> c,d --from a` adds
|
|
172
|
+
several variants at once; with `--round` they all start the new round. A new round answers the comments on the
|
|
173
|
+
`--from` variant and marks them "addressed in round" with the new round's key. A variant without `--round` fails while the sketch has open comments and lists them: a variant that answers a comment starts a new round. Draw the combined
|
|
174
|
+
variant and mark the sketch `ready` again. `sketch new --round <title> --note <text>` names
|
|
175
|
+
round 1 and sets its note; `--round` without `--note` fails. `sketch ready` refuses while the running round has no note; set it with `sketch round`.
|
|
176
|
+
`sketch ready` also shoots every state of every variant and of the product's part: when not one pixel differs
|
|
177
|
+
in any of them, it merges the sketch itself. Any difference or failed shot leaves it `ready`.
|
|
178
|
+
A problem the product already had before the merge does not block it (the check prints it as a note); only a problem the merge adds does.
|
|
179
|
+
Run `sketch ready` again on a `ready` sketch to repeat the check and the auto merge.
|
|
180
|
+
|
|
181
|
+
Mark a sketch `ready` only when no change to it waits on anything: no open decision, no helper still to
|
|
182
|
+
land, no "once X is decided I adapt the sketch". A pending change keeps the sketch in work and out of the
|
|
183
|
+
merge queue: ask first, make the change, then mark it `ready`. Record the wait with
|
|
184
|
+
`et design sketch hold <layer>/<name> --until "<what it waits on>" --by <model id>` (a `ready` sketch goes back
|
|
185
|
+
in progress) and `sketch release` it once the change is in.
|
|
186
|
+
|
|
187
|
+
### Your model id: `--by`
|
|
188
|
+
|
|
189
|
+
Every command that writes takes `--by <model id>` and fails without it: `sketch new`, `variant`, `report`,
|
|
190
|
+
`ready`, `rebase`, `merge`, `discard`, `inbox done` and `comment reply`. The id is the exact model
|
|
191
|
+
id as free text, for example `claude-opus-5-5`, `gpt-6.1-sol` or `gemini-3-argon`. Studio shows it
|
|
192
|
+
on the variant, the reply and the part, so the user sees which model made what.
|
|
193
|
+
|
|
194
|
+
**Never guess your id.** Use the one your prompt names. If your prompt names none and you do not
|
|
195
|
+
know your own exact id, ask the coordinator or the user before you write.
|
|
196
|
+
|
|
197
|
+
### The user decides, Studio merges
|
|
198
|
+
|
|
199
|
+
The user picks a variant, or discards the sketch, in Studio. **Studio merges on the user's click.
|
|
200
|
+
Never run `sketch merge` or `sketch discard` yourself, and never pick a variant.** Both mark
|
|
201
|
+
the open comments on the sketch's variants addressed: the user's click answers them. Comments on the
|
|
202
|
+
product's parts stay. If a part the variant replaces changed
|
|
203
|
+
in the product since the sketch was created, the merge refuses: bring each variant up to date, run
|
|
204
|
+
`et design sketch rebase <layer>/<name>`, and mark it `ready` again. `sketch preview <layer>/<name>
|
|
205
|
+
<variant>` lists the elements and pages a merge changes. The note on a part records why it has its
|
|
206
|
+
current shape. The user's reason is optional: with one, the merge sets the note from it; without
|
|
207
|
+
one, the part keeps the `note` the picked variant file holds, so write that note while you draw.
|
|
208
|
+
|
|
209
|
+
A part is build-ready when `design check` writes a current check record with no blockers (`ready.json`, tool-written, committed); Studio shows "Baubereit", "Nicht baubereit (n)" or "Wird geprüft". A direct edit of a merged part outside a sketch opens an old/new edit sketch that the user picks in Studio; there is no go and no accept command. `design check` warns `LEFTOVER-FILE` for a leftover gate file of the old go and accept flow and names the file to delete.
|
|
210
|
+
|
|
211
|
+
To drop a merged part the user no longer wants (folded back into its host, say), run `et design part remove <layer>/<name> --product <p> --by <model id>`: it deletes the folder, its `merged.json` entry and its tsconfig path, and resolves its comments. It refuses while another part imports it or an open sketch targets it. Never `git rm` a part by hand.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Design exploration: shots and screenshots
|
|
2
|
+
|
|
3
|
+
**Do not send a screenshot.** The user keeps the call open. Screenshot only for your own
|
|
4
|
+
check that a variant renders. In a repository with `et design`, take it with
|
|
5
|
+
`et design shot <layer>/<name> --states [--variants]`: one contact sheet of every state, and
|
|
6
|
+
every variant of the open sketch, with a label per cell; below each variant row, a diff row marks
|
|
7
|
+
the pixels that differ from the merged state in red, or says "no pixel change" (with ", but the markup differs" when only the markup changed, e.g. both sides miss the same content). It prints the PNG path last. `--scale 2` enlarges a small part; `--crop x,y,w,h` cuts each cell to that CSS-pixel box, to judge hairlines. `--interaction hover` forces an interaction on every cell. `--state a,b` draws only those states, to compare them side by side. With `--variants`, `--round r2` or `--variant i,j` draws only those variants next to the merged row, so the current round stays readable; it filters the picture, never the checks. With `--variants`, `--diff-props` compares each variant with the merged part drawn with the variant's state props, so changed props do not paint the diff red. It draws
|
|
8
|
+
undimmed, whatever Studio shows. Do not write a scratch script for batch shots.
|
|
9
|
+
`et design motion shots <layer>/<name> <motion>` draws a motion at its keyframes, in full and reduced motion, into one sheet, and writes its tracks (element, properties, start, duration, easing) as JSON next to it.
|
|
10
|
+
|
|
11
|
+
## Screenshots
|
|
12
|
+
|
|
13
|
+
**Off by default.** The user has the call open and sends you a picture when something looks
|
|
14
|
+
wrong. Take one only when the code cannot tell you whether two variants really differ, and
|
|
15
|
+
never to put in front of the user. Copy `shoot-template.mjs` from this skill folder to the repository
|
|
16
|
+
root.
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
node shoot.mjs <story-id> 1100 760 out.png
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
- `waitUntil: 'networkidle'` never settles on an iframe that holds a live dev server
|
|
23
|
+
connection. Use `'domcontentloaded'`.
|
|
24
|
+
- `:hover`, `:focus-visible` and `:active` need a CDP session and `CSS.forcePseudoState`.
|
|
25
|
+
Several hold open at once, so one image shows them all. The template does this.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Screenshot one Storybook story, with optional forced pseudo-states.
|
|
3
|
+
*
|
|
4
|
+
* Copy to the repository root - Node resolves `playwright` from the working directory.
|
|
5
|
+
*
|
|
6
|
+
* node shoot.mjs <story-id> [width] [height] [out.png]
|
|
7
|
+
*
|
|
8
|
+
* To hold :hover / :focus-visible / :active open at the same time, fill FORCED below with
|
|
9
|
+
* one entry per element. A CSS selector is matched inside the story's document.
|
|
10
|
+
*/
|
|
11
|
+
import { chromium } from 'playwright';
|
|
12
|
+
|
|
13
|
+
const BASE = process.env.SB_URL ?? 'http://localhost:4400';
|
|
14
|
+
|
|
15
|
+
/** @type {{ selector: string, states: ('hover'|'focus'|'focus-visible'|'active')[] }[]} */
|
|
16
|
+
const FORCED = [
|
|
17
|
+
// { selector: '[data-state="hover"] .the-band', states: ['hover'] },
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
const [id, width = '1100', height = '760', out = 'shot.png'] = process.argv.slice(2);
|
|
21
|
+
|
|
22
|
+
if (!id) {
|
|
23
|
+
console.error('usage: node shoot.mjs <story-id> [width] [height] [out.png]');
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const browser = await chromium.launch();
|
|
28
|
+
const page = await browser.newPage({
|
|
29
|
+
viewport: { width: Number(width), height: Number(height) },
|
|
30
|
+
deviceScaleFactor: 2,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
await page.goto(`${BASE}/iframe.html?id=${id}&viewMode=story`, { waitUntil: 'domcontentloaded' });
|
|
34
|
+
await page.waitForSelector('#storybook-root > *', { timeout: 15000 });
|
|
35
|
+
|
|
36
|
+
const overlays = await page.locator('#webpack-dev-server-client-overlay, vite-error-overlay').count();
|
|
37
|
+
if (overlays > 0) {
|
|
38
|
+
console.error('compile error overlay is present - the image would lie');
|
|
39
|
+
await browser.close();
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (FORCED.length > 0) {
|
|
44
|
+
const cdp = await page.context().newCDPSession(page);
|
|
45
|
+
await cdp.send('DOM.enable');
|
|
46
|
+
await cdp.send('CSS.enable');
|
|
47
|
+
const { root } = await cdp.send('DOM.getDocument', { depth: -1 });
|
|
48
|
+
|
|
49
|
+
for (const { selector, states } of FORCED) {
|
|
50
|
+
const { nodeIds } = await cdp.send('DOM.querySelectorAll', { nodeId: root.nodeId, selector });
|
|
51
|
+
for (const nodeId of nodeIds) {
|
|
52
|
+
await cdp.send('CSS.forcePseudoState', { nodeId, forcedPseudoClasses: states });
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
await page.waitForTimeout(400);
|
|
58
|
+
await page.screenshot({ path: out });
|
|
59
|
+
await browser.close();
|
|
60
|
+
|
|
61
|
+
console.log(out);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# ADR Format
|
|
2
|
+
|
|
3
|
+
ADRs live in `docs/adr/` and use sequential numbering: `0001-slug.md`, `0002-slug.md`, etc.
|
|
4
|
+
|
|
5
|
+
Create the `docs/adr/` directory lazily: only when the first ADR is needed.
|
|
6
|
+
|
|
7
|
+
## Template
|
|
8
|
+
|
|
9
|
+
```md
|
|
10
|
+
# {Short title of the decision}
|
|
11
|
+
|
|
12
|
+
{1-3 sentences: what's the context, what did we decide, and why.}
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
That's it. An ADR can be a single paragraph. The value is in recording _that_ a decision was made and _why_, not in filling out sections.
|
|
16
|
+
|
|
17
|
+
## Optional sections
|
|
18
|
+
|
|
19
|
+
Only include these when they add genuine value. Most ADRs won't need them.
|
|
20
|
+
|
|
21
|
+
- **Status** frontmatter (`proposed | accepted | deprecated | superseded by ADR-NNNN`): useful when decisions are revisited
|
|
22
|
+
- **Considered Options**: only when the rejected alternatives are worth remembering
|
|
23
|
+
- **Consequences**: only when non-obvious downstream effects need to be called out
|
|
24
|
+
|
|
25
|
+
## Numbering
|
|
26
|
+
|
|
27
|
+
Scan `docs/adr/` for the highest existing number and increment by one.
|
|
28
|
+
|
|
29
|
+
## When to offer an ADR
|
|
30
|
+
|
|
31
|
+
All three of these must be true:
|
|
32
|
+
|
|
33
|
+
1. **Hard to reverse**: the cost of changing your mind later is meaningful
|
|
34
|
+
2. **Surprising without context**: a future reader will look at the code and wonder "why on earth did they do it this way?"
|
|
35
|
+
3. **The result of a real trade-off**: there were genuine alternatives and you picked one for specific reasons
|
|
36
|
+
|
|
37
|
+
If a decision is easy to reverse, skip it: you'll just reverse it. If it's not surprising, nobody will wonder why. If there was no real alternative, there's nothing to record beyond "we did the obvious thing."
|
|
38
|
+
|
|
39
|
+
### What qualifies
|
|
40
|
+
|
|
41
|
+
- **Architectural shape.** "We're using a monorepo." "The write model is event-sourced, the read model is projected into Postgres."
|
|
42
|
+
- **Integration patterns between contexts.** "Ordering and Billing communicate via domain events, not synchronous HTTP."
|
|
43
|
+
- **Technology choices that carry lock-in.** Database, message bus, auth provider, deployment target. Not every library: just the ones that would take a quarter to swap out.
|
|
44
|
+
- **Boundary and scope decisions.** "Customer data is owned by the Customer context; other contexts reference it by ID only." The explicit no-s are as valuable as the yes-s.
|
|
45
|
+
- **Deliberate deviations from the obvious path.** "We're using manual SQL instead of an ORM because X." Anything where a reasonable reader would assume the opposite. These stop the next engineer from "fixing" something that was deliberate.
|
|
46
|
+
- **Constraints not visible in the code.** "We can't use AWS because of compliance requirements." "Response times must be under 200ms because of the partner API contract."
|
|
47
|
+
- **Rejected alternatives when the rejection is non-obvious.** If you considered GraphQL and picked REST for subtle reasons, record it; otherwise someone will suggest GraphQL again in six months.
|