stitch2 0.13.1 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -6
- package/config.schema.json +5 -0
- package/dist/audit.js +11 -1
- package/dist/canvas.html +256 -38
- package/dist/check.js +24 -5
- package/dist/compare.js +39 -11
- package/dist/config.d.ts +10 -0
- package/dist/config.js +4 -0
- package/dist/consistency.js +10 -2
- package/dist/i18n-report.js +10 -3
- package/dist/i18n.js +15 -7
- package/dist/languages-page.js +18 -4
- package/dist/list.js +5 -3
- package/dist/report-filter.d.ts +7 -0
- package/dist/report-filter.js +23 -0
- package/dist/report.js +5 -3
- package/dist/serve.d.ts +14 -0
- package/dist/serve.js +35 -5
- package/dist/setup.js +11 -1
- package/dist/typecheck.d.ts +2 -0
- package/package.json +1 -1
- package/skills/stitch2/SKILL.md +10 -6
- package/skills/stitch2/references/screens.md +42 -14
- package/skills/{stitch2-variants → stitch2-alternatives}/SKILL.md +4 -4
- package/skills/stitch2-app-sync/SKILL.md +4 -1
- package/skills/stitch2-i18n/SKILL.md +2 -1
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
# Screens, versions and approval
|
|
2
2
|
|
|
3
|
-
The canvas and the agents share one model: an app **screen** (home, settings, …) has **versions**,
|
|
4
|
-
|
|
3
|
+
The canvas and the agents share one model: an app **screen** (home, settings, …) has **versions**, design
|
|
4
|
+
iterations numbered v1, v2, v3…, and each version has **variants**, its layouts for each device (mobile,
|
|
5
|
+
desktop, later tablet). Each variant has a **status**. The user decides; agents read the decision
|
|
5
6
|
and build on it. Meta tag names below use the project's prefix (`<p>`, from `stitch2.config.json`).
|
|
6
7
|
|
|
7
8
|
## Names and files
|
|
8
9
|
|
|
9
10
|
- Screen names are lowercase with hyphens and name what the user sees; one per step of a flow
|
|
10
11
|
(`checkout-1`, `checkout-2`). Reuse existing names (`stitch2 screens` lists them).
|
|
11
|
-
- A
|
|
12
|
+
- A variant is one file, `<screens dir>/<screen>/<device>-v<N>.html`; the variants of a version share N
|
|
13
|
+
(`mobile-v3.html` and `desktop-v3.html` are v3). A new version takes the next free N across the screen's
|
|
14
|
+
variants; a variant added to an existing version takes that version's N (a desktop for v3 is
|
|
15
|
+
`desktop-v3.html`, never v4). A version may start with one variant and get the others later.
|
|
12
16
|
Its head carries `<p>-screen`, `<p>-device` (mobile | desktop), `<p>-status`, `<p>-source` (stitch | lab),
|
|
13
17
|
`<p>-frame-width` (390 mobile, 1280 desktop) and, written by the user, `<p>-note`. Older files elsewhere
|
|
14
18
|
carry the same tags.
|
|
@@ -17,9 +21,13 @@ and build on it. Meta tag names below use the project's prefix (`<p>`, from `sti
|
|
|
17
21
|
|
|
18
22
|
- **New version** for every new attempt: a new direction, a regeneration, an export from a generator, a
|
|
19
23
|
redesign after feedback on an approved screen. It starts as `draft` and ends as `review`.
|
|
24
|
+
- **New variant** for a device the version lacks (its desktop, its tablet): a new file with the version's N,
|
|
25
|
+
`draft` then `review`, even when the version's other variants are approved.
|
|
20
26
|
- **Edit in place** only to finish your own draft, or to answer a note on a version still in `review` or
|
|
21
27
|
`draft`.
|
|
22
|
-
- **Never edit** an `approved` or `archived`
|
|
28
|
+
- **Never edit** an `approved` or `archived` variant: copy the version to the next number and change the copy.
|
|
29
|
+
The exception is the user's own request: a fix they ask for on a version they name ("it had to be on v3")
|
|
30
|
+
goes into that version, which keeps its status; say what changed.
|
|
23
31
|
|
|
24
32
|
## Statuses
|
|
25
33
|
|
|
@@ -28,7 +36,11 @@ and build on it. Meta tag names below use the project's prefix (`<p>`, from `sti
|
|
|
28
36
|
| `draft` | Work in progress | The agent, while working |
|
|
29
37
|
| `review` | Finished, waiting for the user ("Needs review") | The agent, when done |
|
|
30
38
|
| `approved` | The reference: build on it, match it, implement it | The user only |
|
|
31
|
-
| `archived` | History: superseded or rejected; hidden on the canvas | The user; approving a
|
|
39
|
+
| `archived` | History: superseded or rejected; hidden on the canvas | The user; approving a variant archives the previously approved variant of the same device |
|
|
40
|
+
|
|
41
|
+
The canvas shows each version with its variants side by side under one heading, and one status for the version:
|
|
42
|
+
needs review while any variant does. **Approve version** approves every variant in review at once; a single
|
|
43
|
+
variant can still be approved, archived or noted on its own.
|
|
32
44
|
|
|
33
45
|
## How to use them
|
|
34
46
|
|
|
@@ -55,21 +67,37 @@ the page needs a state first (an open sheet, a running workout), add a `prepare`
|
|
|
55
67
|
|
|
56
68
|
## Desktop
|
|
57
69
|
|
|
58
|
-
Desktop is a
|
|
59
|
-
frame width 1280, the same components and type levels, the layout from DESIGN.md (typically a sidebar instead
|
|
70
|
+
Desktop is a variant of a version, designed after the version's mobile variant is approved: `desktop-v<N>.html`
|
|
71
|
+
with the mobile's N, frame width 1280, the same components and type levels, the layout from DESIGN.md (typically a sidebar instead
|
|
60
72
|
of a tab bar, a content max width, two columns where it helps). Shared components get their desktop form in the
|
|
61
73
|
component, before the first desktop screen.
|
|
62
74
|
|
|
63
|
-
Widths
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
75
|
+
## Widths
|
|
76
|
+
|
|
77
|
+
A variant is drawn at one frame width but covers a range of windows: `widths` in `stitch2.config.json`, by
|
|
78
|
+
device, `[narrowest, widest]` in px. The defaults follow Google's window size classes ([google.md](google.md)):
|
|
79
|
+
mobile 360–599 (compact), tablet 600–1023 (medium), desktop 1024–1920 (expanded and up); a project sets the
|
|
80
|
+
width where its app actually changes layout (gymgym: mobile up to 1023, desktop from 1024).
|
|
81
|
+
|
|
82
|
+
Widths are a dimension like themes and languages, not more files: `stitch2 check` also renders every variant at
|
|
83
|
+
both ends of its range and reports what breaks there ("at 1024px: …"), and the canvas shows every frame at its
|
|
84
|
+
narrowest or widest (the width dropdown, W).
|
|
85
|
+
|
|
86
|
+
- A screen that breaks at an edge gets a **responsive rule inside the same variant**: a two-column grid that drops
|
|
87
|
+
to one, three cards across that become two, a side column that moves under the main one. Use the project's
|
|
88
|
+
breakpoints (Tailwind's `md:`, `lg:`, `xl:`), so the screen keeps one layout that adapts.
|
|
89
|
+
- Only when the **structure** has to change (a bar becomes a side navigation, one pane becomes list-detail) is it a
|
|
90
|
+
new variant: `tablet-v<N>` for 600–1023, with its own frame width (768) and range, the same N as the version.
|
|
91
|
+
- A desktop screen is a layout for its range, not a stretched phone: a side navigation instead of the bar,
|
|
92
|
+
list-detail with both panes, extra columns for feeds.
|
|
67
93
|
|
|
68
94
|
## The canvas
|
|
69
95
|
|
|
70
|
-
`stitch2 canvas` → http://localhost:4400. The sidebar lists DESIGN.md (drawn as tokens and rules),
|
|
71
|
-
|
|
72
|
-
|
|
96
|
+
`stitch2 canvas` → http://localhost:4400. The sidebar lists DESIGN.md (drawn as tokens and rules), Components
|
|
97
|
+
(the catalog for the variants the filter shows; a click steps through them), the consistency report and app
|
|
98
|
+
comparison (each with when it last ran, or how many covered screens changed since), Languages, and every screen
|
|
99
|
+
with its versions. Filters: status (active, approved, needs review, all), versions, variants, theme, width and
|
|
100
|
+
language. The reports and Languages follow the filters too: they show only the screens the canvas shows. Selecting a version opens the inspector: status, note, checks, and
|
|
73
101
|
Copy for its reference. Pick mode (`p`) highlights the element under the pointer; a click copies its reference,
|
|
74
102
|
Shift-click collects several (Copy all, Add to note). Keys: `/` search, `j`/`k` next and previous, `a` approve,
|
|
75
103
|
`p` pick, `f` fit, `0` actual size, double-click to use a frame, `Esc` to leave.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: stitch2-
|
|
2
|
+
name: stitch2-alternatives
|
|
3
3
|
description: Get fresh-eyes versions of a screen from agents that see no other versions (stitch2 sandbox), so alternatives are not anchored to what exists; or test a change to the skills on output only the rules produced. Use when the user wants alternatives or a new direction, feels stuck with a design, wants several options to choose from, or when a skill or DESIGN.md rule changed and you need evidence it helps.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Fresh-eyes
|
|
6
|
+
# Fresh-eyes alternatives with stitch2 sandboxes
|
|
7
7
|
|
|
8
8
|
An agent that can see a screen's existing versions copies them, even when asked for something new. A sandbox
|
|
9
9
|
is a folder with the project's design system, components, catalog, template and skills, and none of its screens,
|
|
@@ -16,8 +16,8 @@ the user to compare on the canvas.
|
|
|
16
16
|
and structure only: colours, fonts and shapes come from DESIGN.md. Name the file after the screen
|
|
17
17
|
(`history.md` designs `history`). For several directions, write one brief per direction with one sentence
|
|
18
18
|
on what differs (`history.md` in sandbox A: "a calendar first"; in sandbox B: "a list first").
|
|
19
|
-
2. **Create one sandbox per
|
|
20
|
-
`--context home stats` adds the approved versions of other screens, so the
|
|
19
|
+
2. **Create one sandbox per alternative**: `stitch2 sandbox create /tmp/<project>-<screen>-a <brief.md>`.
|
|
20
|
+
`--context home stats` adds the approved versions of other screens, so the alternative stays consistent with
|
|
21
21
|
them; `--device desktop` for desktop.
|
|
22
22
|
3. **Run a fresh agent in each**, with no shared conversation: a sub-agent started without forked history,
|
|
23
23
|
working only in that folder, told to read its AGENTS.md and follow the skills there. Without sub-agents, give
|
|
@@ -44,7 +44,10 @@ Slots are for wiring. If what goes into a slot changes how the component looks,
|
|
|
44
44
|
other, **controls overlapping each other**, small tap targets, contrast, type levels, reuse and consistency.
|
|
45
45
|
- `stitch2 compare` (the live app, against every approved version with a route): which components appear, in
|
|
46
46
|
what order, how the measured ones look, **and the same layout errors as check** (overflow, fixed-overlap,
|
|
47
|
-
control-overlap), so a control squeezed in the app shows up even when no screen drew it.
|
|
47
|
+
control-overlap), so a control squeezed in the app shows up even when no screen drew it. Each version runs at
|
|
48
|
+
its drawn width and at both edges of its width range; a finding seen only at an edge starts with "at <width>px:".
|
|
49
|
+
- Both reports are snapshots that run only when called. The canvas sidebar says "N changed since" once the
|
|
50
|
+
screens they cover have changed; run them again before relying on them.
|
|
48
51
|
- Give every approved screen a route, and every state a `prepare` module that puts the app into it (a sheet
|
|
49
52
|
open, a timer running, a form half filled). An unrouted screen is not compared at all.
|
|
50
53
|
|
|
@@ -44,7 +44,8 @@ Use the app's own files. Never copy messages into the design folder: two copies
|
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
A value with braces is a **template**: each `{key}` or `{key|name=value;name=value}` becomes its message and
|
|
47
|
-
the rest stays as written.
|
|
47
|
+
the rest stays as written. Templates nest, innermost first, for a message that takes another as an argument:
|
|
48
|
+
`data-t-title="{site.screens.title|workout={nav.workout};history={nav.history}}"`. Use it for lines the app builds from several messages and data (a meta line, a
|
|
48
49
|
list of `label=url` links: `data-t-links="{site.features}=#features,{site.docs}=/docs"`); sample data inside
|
|
49
50
|
it stays literal. Without braces, `data-t-<attr>` on a comma list takes one key per item.
|
|
50
51
|
|