@ethlete/agent-rules 0.1.0-next.50 → 0.1.0-next.52
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 +42 -0
- package/README.md +20 -53
- package/content/hooks/away-mode.py +90 -7
- package/content/hooks/{background-design-commands.py → background-commands.py} +14 -65
- package/content/hooks/builder-idle-check.py +101 -13
- package/content/mods/plugins/codex-runs/.claude-plugin/plugin.json +1 -1
- package/content/mods/plugins/codex-runs/hooks/agent-runs.ts +310 -0
- package/content/mods/plugins/codex-runs/hooks/register.tsx +171 -12
- package/content/mods/plugins/codex-runs/types/index.d.ts +18 -0
- package/content/mods/plugins/e2e-progress/.claude-plugin/plugin.json +1 -1
- package/content/mods/plugins/e2e-progress/hooks/progress.ts +12 -4
- package/content/mods/plugins/e2e-progress/hooks/register.tsx +2 -2
- package/content/mods/plugins/status-line/.claude-plugin/plugin.json +1 -1
- package/content/mods/plugins/usage-line/.claude-plugin/plugin.json +1 -1
- package/content/mods/plugins/usage-line/hooks/rate-limits.ts +23 -0
- package/content/mods/plugins/usage-line/hooks/register.tsx +16 -0
- package/content/skills/agent-sessions/SKILL.md +1 -1
- package/content/skills/codex-subagent/SKILL.md +8 -2
- package/content/skills/codex-subagent/codex-agent.mjs +33 -2
- package/content/skills/design-exploration/SKILL.md +22 -104
- package/content/skills/design-exploration/reference-shots.md +1 -11
- package/content/skills/theming/SKILL.md +22 -20
- package/migrations/studio-claude-plugin.md +27 -0
- package/migrations.json +8 -0
- package/package.json +1 -1
- package/src/index.js +0 -6
- package/src/index.js.map +1 -1
- package/src/lib/config.d.ts +8 -8
- package/src/lib/config.js +13 -9
- package/src/lib/config.js.map +1 -1
- package/src/lib/filter.d.ts +1 -0
- package/src/lib/filter.js +3 -1
- package/src/lib/filter.js.map +1 -1
- package/src/lib/plan.js +15 -6
- package/src/lib/plan.js.map +1 -1
- package/src/lib/report-command.js +8 -2
- package/src/lib/report-command.js.map +1 -1
- package/src/lib/targets/claude-hooks.d.ts +3 -0
- package/src/lib/targets/claude-hooks.js +21 -3
- package/src/lib/targets/claude-hooks.js.map +1 -1
- package/src/lib/targets/hooks-shared.d.ts +5 -0
- package/src/lib/targets/hooks-shared.js +12 -10
- package/src/lib/targets/hooks-shared.js.map +1 -1
- package/src/lib/targets/mcp.d.ts +10 -1
- package/src/lib/targets/mcp.js +43 -1
- package/src/lib/targets/mcp.js.map +1 -1
- package/src/lib/timetrack.d.ts +0 -591
- package/src/lib/timetrack.js +3 -139
- package/src/lib/timetrack.js.map +1 -1
- package/content/hooks/design-live-check.py +0 -136
- package/content/skills/design-exploration/reference-check-and-notes.md +0 -100
- package/content/skills/design-exploration/reference-flows.md +0 -38
- package/content/skills/design-exploration/reference-inbox-and-mcp.md +0 -54
- package/content/skills/design-exploration/reference-order-and-design-system.md +0 -120
- package/content/skills/design-exploration/reference-products-and-sketches.md +0 -250
- package/content/skills/timetrack/SKILL.md +0 -324
- package/src/lib/peer-path.d.ts +0 -12
- package/src/lib/peer-path.js +0 -39
- package/src/lib/peer-path.js.map +0 -1
- package/src/lib/timetrack-command.d.ts +0 -11
- package/src/lib/timetrack-command.js +0 -1262
- package/src/lib/timetrack-command.js.map +0 -1
- package/src/lib/timetrack-snapshot.d.ts +0 -66
- package/src/lib/timetrack-snapshot.js +0 -146
- package/src/lib/timetrack-snapshot.js.map +0 -1
|
@@ -1,120 +0,0 @@
|
|
|
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, after the first real screen of a new product (see `SKILL.md`), which draws its own colours, type and parts first. Each stage settles in calls before the next starts, and
|
|
6
|
-
each stage draws with what the stages before it settled:
|
|
7
|
-
|
|
8
|
-
1. **Foundations**: colours, colour themes and surface themes (the project's `themes` in
|
|
9
|
-
`config.json`), plus the type scale, spacing and radius.
|
|
10
|
-
2. **Logo and CI**, if the project needs them. A logo sketch variant shows only the mark at one size; the six sections
|
|
11
|
-
(anatomy, clear space, minimum size, colour variants, misuse, motion) come after the merge of the picked variant.
|
|
12
|
-
3. **Components**, from the SDK ones rendered with `ng()`, themed and set up for the project.
|
|
13
|
-
Each accepted one becomes a design-system entry.
|
|
14
|
-
4. **Larger elements**: the shell, the navigation, headers, lists, built from the entries.
|
|
15
|
-
5. **Pages**, built from the elements and the entries.
|
|
16
|
-
6. **The working prototype**: the pages joined with `ngStates` and `flow.on`.
|
|
17
|
-
|
|
18
|
-
Do not start a stage before the one above it is settled, and do not draw a page from parts that
|
|
19
|
-
are not in the design system. If the user asks for a later stage first, say which earlier stage
|
|
20
|
-
is missing, and draw that first.
|
|
21
|
-
|
|
22
|
-
The stages map onto the layers of a product: foundations, components, elements, pages. A settled
|
|
23
|
-
Legacy call with a stage counts for that stage in this order.
|
|
24
|
-
|
|
25
|
-
A later stage can show that an earlier one is incomplete. If a page needs a part that the system
|
|
26
|
-
does not have, add it to the components queue. A part becomes a component only when at least two hosts
|
|
27
|
-
draw the same case. Until then it stays in the one element or page that draws it. When a second
|
|
28
|
-
host draws it, open a component sketch, and list in its brief every host and every case each one
|
|
29
|
-
draws, so the component covers them all.
|
|
30
|
-
|
|
31
|
-
A component documents its states per axis, not every combination: for example kind, end mark and
|
|
32
|
-
interaction (rest, hover, focus-visible, selected, inert), plus only the combinations that look
|
|
33
|
-
different. A smaller piece with no states of its own, such as an icon set, is a foundation asset,
|
|
34
|
-
not a component.
|
|
35
|
-
|
|
36
|
-
When each of several cases is drawn at rest and in the same interactions, build the states and their grid with
|
|
37
|
-
`interactionRows(rows, { interactions: ['hover', 'active'], force: (props, interaction) => ({ ...props, interaction }) })`
|
|
38
|
-
from `@design-system` and spread the result into `definePart`; never write those states and the grid by hand.
|
|
39
|
-
Draw the interactions once, on the first row. A row that only changes content, such as a badge, a longer title or a
|
|
40
|
-
missing logo, is drawn only at rest: name it in `restOnly: ['series']`. `sketch ready` refuses a content row whose
|
|
41
|
-
interactions look the same as the first row's as `INTERACTION-REPEAT`.
|
|
42
|
-
The first sketch of a new part draws every variant only at rest, one state per content. Once the user picks a base
|
|
43
|
-
variant, open a second round from it (`sketch variant <layer>/<name> <key> --from <picked> --round <title> --note <why>`)
|
|
44
|
-
and draw hover, active, focus-visible and disabled there, for that variant only. `sketch ready` refuses interactions in
|
|
45
|
-
round 1 of a new part, and a missing one in a later round, as `INTERACTION-ROUND`; drop an interaction the part cannot
|
|
46
|
-
have with `sketch round <layer>/<name> <round> --drops <interaction>`.
|
|
47
|
-
`sketch check` prints `grid <rows> x <columns> ok`, or the states the grid leaves out; a state in two cells
|
|
48
|
-
fails it as `GRID`, in `design check` too.
|
|
49
|
-
Interaction states (a state name whose last word is hover, focus, pressed, active or selected, such as `row-hover`) live only on a control
|
|
50
|
-
part, one whose `controls` declare a control of a checked kind. On a shell, element or page they fail as
|
|
51
|
-
`CONTROL-STATE`: declare the component's controls (Q164), or extract the button or row as its own control part and draw its states there.
|
|
52
|
-
A drawn `button`, `a[href]`, `input`, `select`, `textarea` or control role without `data-et-control` on it or around
|
|
53
|
-
it is `CONTROL-PART-INPUT`: no control check sees it. Wrap it in `control(markup, name)` from
|
|
54
|
-
`@ethlete/components/design/control` and declare the name in `controls`; a sketch fails on one it adds,
|
|
55
|
-
`design check` only warns of one a merged part already draws. On a reused control part's render,
|
|
56
|
-
`control(drawn.body, name)` renames its control: never string-replace `data-et-control`.
|
|
57
|
-
`definePart({ interactions })` forces an interaction on the part's root only. To draw one element of the part
|
|
58
|
-
hovered, focused, pressed or disabled, such as one row of a list, wrap that element's markup in
|
|
59
|
-
`forceInteraction(markup, 'hover')` from `@design-system` inside `render`, driven by a prop; never write
|
|
60
|
-
`data-et-force` by hand.
|
|
61
|
-
|
|
62
|
-
## Draw from the design system
|
|
63
|
-
|
|
64
|
-
A call that invents its own button, field or row does not match the calls beside it. **Before
|
|
65
|
-
you draw a part, look for it in this order, and draw new only when none of them has it:**
|
|
66
|
-
|
|
67
|
-
1. The product's design system, `.ethlete/design/<product>/` (and its base).
|
|
68
|
-
2. The real SDK components, rendered on the design server with `ng()` from `@design-explore`:
|
|
69
|
-
|
|
70
|
-
```ts
|
|
71
|
-
const field = ng(`<et-form-field><et-label>Name</et-label><et-input /></et-form-field>`, {
|
|
72
|
-
imports: ['FORM_FIELD_IMPORTS', 'INPUT_IMPORTS'],
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
export default field.then((body) => drawing({ body }));
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
Never `await` at the top level of a design module: WebKit can hang for good when a frame is
|
|
79
|
-
removed while the module evaluates, and `et design check` fails it with `TOP-LEVEL-AWAIT`. A
|
|
80
|
-
call default-exports a promise of its drawing; a part awaits inside its `render`.
|
|
81
|
-
|
|
82
|
-
The template is a real Angular template, and `imports` names exports of
|
|
83
|
-
`@ethlete/components`. The project's `providers` module in `config.json` supplies the themes.
|
|
84
|
-
Render every component of a drawing in **one** `ng()` call: each call is a new app, so two
|
|
85
|
-
calls repeat element ids. The server renders the built package, so in the SDK rebuild
|
|
86
|
-
`dist` after a component change.
|
|
87
|
-
|
|
88
|
-
To draw a form state (a value, an error, a touched field), give `ng()` (or `ngStates()`)
|
|
89
|
-
`fields`. Each entry becomes a signal form field the template binds as
|
|
90
|
-
`[formField]="fields.<name>"`. An error is a kind (`'required'`) or a kind and a message. A
|
|
91
|
-
field shows its errors only when it is touched:
|
|
92
|
-
|
|
93
|
-
```ts
|
|
94
|
-
const form = ng(`<et-form-field><et-label>Email</et-label><et-input [formField]="fields.email" /></et-form-field>`, {
|
|
95
|
-
imports: ['FORM_FIELD_IMPORTS', 'INPUT_IMPORTS'],
|
|
96
|
-
fields: { email: { value: 'ada@', errors: [{ kind: 'email', message: 'Not an email' }], touched: true } },
|
|
97
|
-
});
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
3. Only then a new drawing. Build it from the two above, and say in the variant's `claim`
|
|
101
|
-
that the part is new.
|
|
102
|
-
|
|
103
|
-
**Colours come from the two SDK theming systems, never from tokens of your own.** A raised or
|
|
104
|
-
floating area sets a surface scope (`data-et-surface` or a surface scope class) and takes its
|
|
105
|
-
background, text, border and interaction states from the `et-surface` tokens of that scope. An
|
|
106
|
-
accent, a warning or a danger colour comes from the SDK colour theming (`--et-tone-*` under a
|
|
107
|
-
colour theme scope). Foundations define only the inputs of these themes. Never add a tier class
|
|
108
|
-
(`bg-surface-raised`), an accent utility or a `var(--accent)` to a part or to the product
|
|
109
|
-
stylesheet. Give a raised or floating area `data-et-auto-surface`, never a picked
|
|
110
|
-
`et-surface--<name>` class: the frame resolves it by elevation like `etAutoSurface`. Give a warning, error or success accent
|
|
111
|
-
`data-et-semantic-color="<type>"`, never a picked `et-color--<name>` class: the frame resolves it by type like
|
|
112
|
-
`injectSemanticColorTheme`. A generated colors foundation registers one theme per type, named after it
|
|
113
|
-
(`et-color--error`, `et-color--warning`); an SDK drawing input that takes a theme name, like the button's `color`,
|
|
114
|
-
takes that name, since no other name resolves. `sketch check` warns when a state uses an `et-color--<name>` no foundation of the product defines, naming the defined ones. Read the theming skill of the SDK before the first colour in a drawing. `et design check` reports
|
|
115
|
-
a denied class from the product's `deniedClasses` list in `config.json`.
|
|
116
|
-
|
|
117
|
-
A part is one folder, `<product>/<layer>/<part>/`, with its drawing and states. Read the parts of
|
|
118
|
-
the product before the first drawing of a session. **A part exists only because the user picked a
|
|
119
|
-
sketch.** A `chosen` verdict in an old call is not enough. Never change a part's look without a
|
|
120
|
-
sketch the user decided.
|
|
@@ -1,250 +0,0 @@
|
|
|
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
|
-
The variants of a composition (an element or a page) differ only in arrangement and use the same
|
|
80
|
-
sub-parts. A sub-part the composition needs (a tab bar, a search field) is a part of its own under
|
|
81
|
-
`components/`: open a sketch on it and import it as `@system/components/<name>`. `sketch check` and
|
|
82
|
-
`design check` fail a composition whose variants hold different copies of a part they import. While
|
|
83
|
-
that sub-part is new in its open sketch, record the variant you recommend with
|
|
84
|
-
`sketch recommend <layer>/<name> --variant <key> --by <model id>`: every sketch that imports it
|
|
85
|
-
draws that variant, or the user's pick once there is one, with no hint in Studio. The composition
|
|
86
|
-
cannot merge before the sub-part does; the merge of the sub-part rebases the composition sketch onto
|
|
87
|
-
the merged part.
|
|
88
|
-
|
|
89
|
-
A new part one variant builds for its own arrangement (a hero's poster strip) is a marked sub-part:
|
|
90
|
-
`sketch sub-part <target> <layer>/<name>[,…] --variant <key> --by <model id>` (`--remove` drops it).
|
|
91
|
-
Marked sub-parts may differ between variants; the check fails every new part a composition variant
|
|
92
|
-
builds without a mark, and every mark on an existing part. A new part whose name matches an existing
|
|
93
|
-
component or element (`hero-badges` and `badge`) must embed it, or state the difference:
|
|
94
|
-
`sketch sub-part … <part> "<what it is that the other is not>" --not-rebuild-of sdk:badge`. The same holds
|
|
95
|
-
for markup a variant draws inline: a value named like an existing part as an element's text
|
|
96
|
-
(`<span>${FIXTURE.badge}</span>`), or an element with content in an existing part's root class or tag under
|
|
97
|
-
another prefix (`<span class="tsh-badge">Serie</span>` for `et-badge`), must become that part, or the target states the difference with itself as
|
|
98
|
-
`<part>`. Never rename a part or value to dodge the match. Studio shows the marks at the variant header; a mark change on a ready
|
|
99
|
-
sketch moves it back to in progress.
|
|
100
|
-
|
|
101
|
-
A pick of a variant with marked sub-parts merges nothing: it opens one sub-sketch per sub-part, seeded from
|
|
102
|
-
that variant. Draw each and mark it ready with `sketch ready` first: `sketch approve` refuses a sub-sketch
|
|
103
|
-
in progress. Once the user approves it, record that with
|
|
104
|
-
`sketch approve <sub-part> --variant <key> [--mandate <quoted chat text>] --by <model id>`; a sub-sketch never
|
|
105
|
-
merges on its own. The parent merge waits until every sub-sketch is approved and names the open ones;
|
|
106
|
-
then one merge writes the parent and every approved sub-part with its `shared/` and asset changes, and closes
|
|
107
|
-
the sub-sketches. Two of them changing the same `shared/` or asset file refuse the merge, naming the file.
|
|
108
|
-
A pick of another variant while the parent is unmerged discards the sub-sketches the new variant does not
|
|
109
|
-
mark, approved ones too, keeps those it marks again and opens its new ones; `sketch pick` names them and
|
|
110
|
-
needs `--discard-sub-sketches` to confirm.
|
|
111
|
-
|
|
112
|
-
A variant mirrors the product layout and holds only the parts it changes. Draw two to four
|
|
113
|
-
variants, each with what it costs, and run `sketch check` before `ready`. A variant with problems
|
|
114
|
-
cannot be picked. A part in a variant keeps every state the part has in the product: `sketch check`
|
|
115
|
-
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
|
|
116
|
-
neither. Use `sketch list` to see the open ones.
|
|
117
|
-
`sketch check` also runs tsc over each variant with its `@shared/` and `@system/` imports, so never write a
|
|
118
|
-
tsconfig of your own. It warns of a variant stylesheet that restyles a class of `shared/`, of a
|
|
119
|
-
variant file nothing imports, and of a `shared/` export the variant does not import; `design check` warns of
|
|
120
|
-
an export in a merged part's `shared/` that nothing imports, and (`STALE-REPLACE`) of a `.replace('<…')` or
|
|
121
|
-
`.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
|
|
122
|
-
product file the picked variant no longer holds.
|
|
123
|
-
|
|
124
|
-
Each variant's note, what it is and what it costs, goes in with `sketch new --variant-note a=<text>`, once
|
|
125
|
-
per variant: `sketch.json` keeps it apart from the part's `definePart({ note })`, and Studio shows it in the
|
|
126
|
-
variant's head. A merge keeps the part's note, takes its `--note`, or gives a new part the picked variant's note.
|
|
127
|
-
`sketch new` and `sketch variant` write their files in the checkout's Prettier format; after an edit,
|
|
128
|
-
`sketch check --fix` formats the variants before it checks them. A sketch command
|
|
129
|
-
without `--product` takes the product that holds the sketch.
|
|
130
|
-
|
|
131
|
-
Start a new part from a close one with `--like`: `sketch new pages/inbox --like pages/system`
|
|
132
|
-
copies the product's `pages/system` into each variant, renamed to the target and without its
|
|
133
|
-
`madeBy`; `--like pages/system:b` copies variant b of the open sketch on it, with that sketch's
|
|
134
|
-
`shared/` folder.
|
|
135
|
-
|
|
136
|
-
Rendering for one variant lives in that variant's files. `shared/` holds only code every variant
|
|
137
|
-
uses: do not give a shared helper a parameter, branch, import or style rule that only one variant, or
|
|
138
|
-
a variant you dropped, needs. A merge takes `shared/` whole, so what stays there ships with the pick.
|
|
139
|
-
|
|
140
|
-
Code the variants of one sketch have in common (sample data, a switch, a helper) goes in the
|
|
141
|
-
sketch's `shared/` folder, next to the variant folders, never into copies per variant. A part in a
|
|
142
|
-
variant imports it as `@shared/<path>`, and a shared file may import `@system/...` and
|
|
143
|
-
`@shared/...`. A part outside a sketch may not import `@shared/`. A variant that needs a shared file
|
|
144
|
-
changed holds its own copy at `<variant>/shared/<path>`; `@shared/<path>` finds that copy first, and a merge
|
|
145
|
-
of that variant takes it. On a merge, `shared/` moves into
|
|
146
|
-
the target's folder as `shared/` with its imports made relative; when no part imports it, it is
|
|
147
|
-
dropped. With several targets, each takes only the files it imports, directly or through another
|
|
148
|
-
shared file; a file nobody imports goes back to the target that held it, and the merge refuses one no
|
|
149
|
-
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
|
|
150
|
-
does, so move that code into the part. `sketch new` prints each file it puts in `shared/`, for example
|
|
151
|
-
the `shared/` folder of a merged page: edit it there, as part of the sketch, not in a variant copy.
|
|
152
|
-
|
|
153
|
-
```ts
|
|
154
|
-
// sketches/pages-flows/shared/flow-data.ts
|
|
155
|
-
export const flows = [{ name: 'Checkout', steps: 4 }];
|
|
156
|
-
|
|
157
|
-
// sketches/pages-flows/a/pages/flows/flows.ts
|
|
158
|
-
import { flows } from '@shared/flow-data';
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
An asset (a mark, logo, icon, picture or font) is one file in `.ethlete/design/<product>/assets/`,
|
|
162
|
-
never a copy inlined into parts. A part imports it as `@assets/<file>`: the default import is a URL
|
|
163
|
-
for `<img src>`; an SVG that must follow tokens (`currentColor`, `var(--accent)`) imports with
|
|
164
|
-
`?raw` and goes inline, for example `@assets/icons/<name>.svg?raw`. A picture with the title baked in
|
|
165
|
-
(a poster, key art) gets `data-et-carries-title` on its `<img>`; `sketch check` warns when a heading or an
|
|
166
|
-
`<img>` with alt text draws the title again next to it. A backdrop without the title gets no marker. A stylesheet, the product's
|
|
167
|
-
`styles.css` or a part's, uses `url('@assets/<file>')`, for example in an `@font-face`. A foundation
|
|
168
|
-
part may wrap an asset in a named export. A product finds its base product's assets too. A sketch
|
|
169
|
-
variant adds or changes an asset in its own `<variant>/assets/` folder (`sketch new` and `sketch variant`
|
|
170
|
-
print it next to the part file), and a merge copies it into the product's. Size an inline SVG with
|
|
171
|
-
`svgAsset(mark, { size: 32 })` from `@design-system`, never by replacing its `width`/`height` as a
|
|
172
|
-
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
|
|
173
|
-
`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
|
|
174
|
-
the assets a part uses.
|
|
175
|
-
|
|
176
|
-
Every change to a merged part goes through a sketch, also a small one: new copy, sample data, an
|
|
177
|
-
added state. When there is nothing to choose, the sketch has one variant (`--variants a`), and the
|
|
178
|
-
user merges it or comments on it. Never edit a merged part directly, or the user cannot compare or
|
|
179
|
-
comment on the change in Studio. `design check` warns, and Studio marks the part "changed", when a
|
|
180
|
-
merged part changed outside a sketch; only a merged sketch on that part clears it.
|
|
181
|
-
|
|
182
|
-
A sketch on a foundations part such as `foundations/tokens` keeps the part's overview drawing: the
|
|
183
|
-
variant adds its token group as a state, or extends that group's state. It never replaces the
|
|
184
|
-
drawing with a demo scene, since the merge would drop every other group. A demo may be an extra state.
|
|
185
|
-
|
|
186
|
-
Name the variant you work on with `--variant`. Studio marks it as drawing, and hides its frames,
|
|
187
|
-
while the latest report names it. `sketch new` starts no report, so `report --done` follows only a report
|
|
188
|
-
of your own; it prints the next steps. `sketch new`, `sketch variant` and each report record your
|
|
189
|
-
model id as an author of the variants they write, and `sketch ready` records it on every variant
|
|
190
|
-
that has no author yet. A merge adds the picked variant's authors to the `madeBy` the part file
|
|
191
|
-
already holds, and never removes it.
|
|
192
|
-
|
|
193
|
-
### Combine variants in a new round
|
|
194
|
-
|
|
195
|
-
Studio never combines variants. When the user asks for one in a comment ("solid like a, outline
|
|
196
|
-
like b"), draw it as a new variant in a new round:
|
|
197
|
-
|
|
198
|
-
```bash
|
|
199
|
-
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"
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
`--from` copies a variant into the new one, sets the sketch back to in progress and clears the
|
|
203
|
-
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
|
|
204
|
-
goes on the running round: what it showed and why its variants lost. Older variants stay pickable.
|
|
205
|
-
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.
|
|
206
|
-
Letters continue across rounds (r1: a, b; r2: c, d). `sketch variant <layer>/<name> c,d --from a` adds
|
|
207
|
-
several variants at once; with `--round` they all start the new round. On a new part, the round after the pick of a base variant draws its interactions (see `INTERACTION-ROUND`). A new round answers the comments on the
|
|
208
|
-
`--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
|
|
209
|
-
variant and mark the sketch `ready` again. `sketch new --round <title> --note <text>` names
|
|
210
|
-
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`.
|
|
211
|
-
`sketch ready` also shoots every state of every variant and of the product's part: when not one pixel differs
|
|
212
|
-
in any of them, it merges the sketch itself. Any difference or failed shot leaves it `ready`.
|
|
213
|
-
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.
|
|
214
|
-
Run `sketch ready` again on a `ready` sketch to repeat the check and the auto merge.
|
|
215
|
-
|
|
216
|
-
Mark a sketch `ready` only when no change to it waits on anything: no open decision, no helper still to
|
|
217
|
-
land, no "once X is decided I adapt the sketch". A pending change keeps the sketch in work and out of the
|
|
218
|
-
merge queue: ask first, make the change, then mark it `ready`. Record the wait with
|
|
219
|
-
`et design sketch hold <layer>/<name> --until "<what it waits on>" --by <model id>` (a `ready` sketch goes back
|
|
220
|
-
in progress) and `sketch release` it once the change is in.
|
|
221
|
-
|
|
222
|
-
The pick of another sketch is not a wait. A sketch that uses a part another open sketch changes draws that part
|
|
223
|
-
as merged now, and goes `ready`. When the user merges the other sketch, the next design commit rebases this one.
|
|
224
|
-
A hold on it leaves the user nothing to choose until the other pick.
|
|
225
|
-
|
|
226
|
-
### Your model id: `--by`
|
|
227
|
-
|
|
228
|
-
Every command that writes takes `--by <model id>` and fails without it: `sketch new`, `variant`, `report`,
|
|
229
|
-
`ready`, `rebase`, `merge`, `discard`, `inbox done` and `comment reply`. The id is the exact model
|
|
230
|
-
id as free text, for example `claude-opus-5-5`, `gpt-6.1-sol` or `gemini-3-argon`. Studio shows it
|
|
231
|
-
on the variant, the reply and the part, so the user sees which model made what.
|
|
232
|
-
|
|
233
|
-
**Never guess your id.** Use the one your prompt names. If your prompt names none and you do not
|
|
234
|
-
know your own exact id, ask the coordinator or the user before you write.
|
|
235
|
-
|
|
236
|
-
### The user decides, Studio merges
|
|
237
|
-
|
|
238
|
-
The user picks a variant, or discards the sketch, in Studio. **Studio merges on the user's click.
|
|
239
|
-
Never run `sketch merge` or `sketch discard` yourself, and never pick a variant.** Both mark
|
|
240
|
-
the open comments on the sketch's variants addressed: the user's click answers them. Comments on the
|
|
241
|
-
product's parts stay. If a part the variant replaces changed
|
|
242
|
-
in the product since the sketch was created, the merge refuses: bring each variant up to date, run
|
|
243
|
-
`et design sketch rebase <layer>/<name>`, and mark it `ready` again. `sketch preview <layer>/<name>
|
|
244
|
-
<variant>` lists the elements and pages a merge changes. The note on a part records why it has its
|
|
245
|
-
current shape. The user's reason is optional: with one, the merge sets the note from it; without
|
|
246
|
-
one, the part keeps the `note` the picked variant file holds, so write that note while you draw.
|
|
247
|
-
|
|
248
|
-
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.
|
|
249
|
-
|
|
250
|
-
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.
|