Skip to content

Commit 8c03a7e

Browse files
committed
chore: add eight skills and carry into the shared ones what plant1t-web settled
New: design-system (the design source: minimal variety, balance, names, references), layout-stability (what may move, room held, scrollbars), native-overlays (dialogs, popovers and menus on the platform), form-states (busy, refusal, validation), ux-writing, ui-verification (the checks before a UI change is done), weekly-audit and item-by-item. Extended: react-component (React Compiler, the native dialog), ui-component (CSS and UX rules, composing components), nanoviews-component, storybook, css-mixin, css-light-dark, flat-layers-design, svg-sprite-icons, chrome-mcp (what headless Chrome cannot show), browserstack-mcp, unit-tests (`it.fails`) and project (every action pinned to a commit SHA).
1 parent 568322a commit 8c03a7e

21 files changed

Lines changed: 920 additions & 12 deletions

File tree

‎README.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ Scripts and configs for TrigenSoftware's projects.
2323

2424
- [`project`](skills/project/SKILL.md)
2525
- [`flat-layers-design`](skills/flat-layers-design/SKILL.md)
26+
- [`design-system`](skills/design-system/SKILL.md)
27+
- [`layout-stability`](skills/layout-stability/SKILL.md)
28+
- [`native-overlays`](skills/native-overlays/SKILL.md)
29+
- [`form-states`](skills/form-states/SKILL.md)
30+
- [`ux-writing`](skills/ux-writing/SKILL.md)
2631
- [`eslint-to-oxlint`](skills/eslint-to-oxlint/SKILL.md)
2732
- [`css-mixin`](skills/css-mixin/SKILL.md)
2833
- [`css-containers`](skills/css-containers/SKILL.md)
@@ -33,11 +38,14 @@ Scripts and configs for TrigenSoftware's projects.
3338
- [`svg-sprite-icons`](skills/svg-sprite-icons/SKILL.md)
3439
- [`storybook`](skills/storybook/SKILL.md)
3540
- [`unit-tests`](skills/unit-tests/SKILL.md)
41+
- [`ui-verification`](skills/ui-verification/SKILL.md)
3642
- [`tree-shaking`](skills/tree-shaking/SKILL.md)
3743
- [`size-limit`](skills/size-limit/SKILL.md)
3844
- [`codex`](skills/codex/SKILL.md)
3945
- [`chrome-mcp`](skills/chrome-mcp/SKILL.md)
4046
- [`browserstack-mcp`](skills/browserstack-mcp/SKILL.md)
47+
- [`item-by-item`](skills/item-by-item/SKILL.md)
48+
- [`weekly-audit`](skills/weekly-audit/SKILL.md)
4149

4250
## Available packages
4351

‎skills/browserstack-mcp/SKILL.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ BrowserStack runs real browsers on real macOS, Windows, iOS and Android machines
2121
## When to use it
2222

2323
- **Before stating how Safari, Firefox, Edge or a mobile browser behaves.** Run it there, at least on the oldest and the newest version that matter. Engine source, specs and caniuse explain a result but are not one: WebKit source once "proved" that Safari drops a read-only date field from the Tab order, and real Safari 16.5 to 27 kept it there.
24+
- **Before using a feature newer than the oldest browser the product supports.** Decide first what a reader of that browser gets, something that still works, and check it there and in the newest, for real.
2425
- **After UI work that depends on the engine or the OS.** Native controls (search, date, datalist), fonts and text metrics, scrollbars, focus rings, IME, touch and the on-screen keyboard all differ outside Chrome.
2526
- **When the user wants to see a page in another browser or OS.** Show screenshots per browser in one gallery, or open a Live session for the user.
2627
- **For an accessibility scan of a page**, with `startAccessibilityScan`. Like Live sessions, it opens the tunnel for localhost URLs itself.
@@ -114,11 +115,13 @@ try {
114115
- Desktop machines report `devicePixelRatio` 1. For 2 in Chrome or Edge, emulate it over CDP: `POST /session/{id}/goog/cdp/execute` (`ms/cdp/execute` in Edge) with `Emulation.setDeviceMetricsOverride`.
115116
- iOS Safari has no element screenshots, and its screenshot is the whole device screen: inject a marker of known size and crop by it. Android Chrome has element screenshots.
116117
- Safari on BrowserStack's macOS has "Press Tab to highlight each item" on, so Tab reaches every control.
118+
- A real iOS device runs WebDriver through Appium: `DELETE /session/{id}/actions` is not supported, so wrap it in a `catch`; pointer actions take device pixels, not CSS pixels; and an action with an element as its origin can hit a stale element. To press a spot, inject an element of a known size there and click it with `POST /session/{id}/element/{elementId}/click`.
117119
- An element inside a shadow root is screenshotted from the root: `findElement(host).getShadowRoot().findElement(selector).takeScreenshot()` in Selenium.
118120
- There are no Linux desktops.
119121
120122
### Hygiene
121123
124+
- End every session with its result, so the dashboard shows what passed: `execute/sync` with `browserstack_executor: {"action": "setSessionStatus", "arguments": {"status": "passed", "reason": "…"}}`, or `failed`, before the `DELETE`.
122125
- Credentials come only from the environment. Never print, echo or log them, and mask output that might contain them: `sed "s/$BROWSERSTACK_ACCESS_KEY/***/g"`.
123126
- The plan limits parallel sessions, and other agents and people share them. Run at most 3 at once, `DELETE` every session in a `finally`, and check at the end that `GET https://api.browserstack.com/automate/plan.json` shows none running.
124127
- A session can take minutes to start when machines are busy. Give `POST /session` a long timeout and every other command a short one, so a stuck browser fails the run instead of hanging it.

‎skills/chrome-mcp/SKILL.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Chrome is one engine. For Safari, Firefox, Edge and real mobile devices use the
4141
- **Screenshots go to files.** Save them with `filePath` into the scratchpad and `Read` them to look. Cover the widths that matter (1440, 375 and 320 through `emulate` or `resize_page`) and both color schemes.
4242
- **Hand the user the image, not a description.** When the user asks for a screenshot, reply with a markdown link to the file. Links to files in the workspace open right in the editor, so copy shots meant for the user from the scratchpad into the workspace, and keep them out of commits unless asked. `SendUserFile`, where available, reaches the user's other devices, not the editor.
4343
- **Measure performance on a quiet machine.** After a rebuild reload with `ignoreCache`, make a warm-up run and take the numbers from the second one, and never measure while builds or tests run.
44+
- **Know what this Chrome cannot show.** The headless instance hides classic scrollbars, so a scrollbar's width reads 0, and it has no pointer: `(hover: hover)`, `(pointer: fine)` and `(pointer: coarse)` all fail to match while `(hover: none)` matches, so a style behind `@media (hover: hover)` never shows. For a layout with a classic bar, a hover style or a sweep over every story, drive Chrome from a scratchpad script with `playwright-core` (see below), launched with `ignoreDefaultArgs: ['--hide-scrollbars']` for the bars, and check with `matchMedia` that the page sees the pointer the check needs.
4445
- **Heavy parallel rendering skips the MCP.** When many agents take many screenshots, let each one drive its own headless Chrome with `playwright-core`, using the binary and flags below, instead of queueing on the one shared browser.
4546

4647
## Setup

‎skills/css-light-dark/SKILL.md‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,22 @@ metadata:
6060
}
6161
```
6262

63+
## Roles in two themes
64+
65+
- The dark theme's neutral roles draw from a ramp of hue-less greys of their own, never from the light theme's tinted ramp: a tint that reads neutral beside white reads colored on a dark ground (the `design-system` skill's color rules).
66+
- Where the dark theme needs another step than the light one, the role says so, its pair taking different steps of the ramps. Never read another role because its light value happens to match: the two part in the dark.
67+
- A state that lifts reads the roles made for it, such as a hover's or a raised surface's, never the canvas or the surface because their light values match what it needs: in the dark theme the canvas and the surface sink below what stands on them.
68+
69+
```css
70+
:root {
71+
--colorBgSurface: light-dark(var(--colorWhite), var(--colorGray900));
72+
/* Not --colorBgCanvas, which matches it in the light theme and sinks in the dark */
73+
--colorBgSurfaceHover: light-dark(var(--colorNeutral50), var(--colorGray800));
74+
}
75+
```
76+
77+
- What stands on a photo keeps the light theme by `color-scheme: light` on itself: a glass bar, a white disc behind an icon, a chip over a hero picture, a photo viewer. Its tokens then resolve to their light half whatever the page's theme, and nothing on it inverts.
78+
6379
## A theme switch
6480

6581
A site's own theme switch forces the scheme on the root the same way, so the tokens stay `light-dark()` pairs. The choice is the browser's, kept in `localStorage`, never in a cookie or the account: the server renders one page for everyone, and a visitor without an account can choose too. The page's head sets it before the stylesheets arrive, so a server-rendered page opens in the chosen theme, never in the system's first:

‎skills/css-mixin/SKILL.md‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,30 @@ export function Button({
8282
)
8383
}
8484
```
85+
86+
A second mixin, a target a finger can press: at least 44 each way and centred on the element, while its look stays as drawn. Under a finger the element's `::after` reaches past its box and takes its presses. Its `position: relative` sits in `:where()`, at no specificity, so an element positioned for its own reasons keeps that, and a parameter lifts the target off the centre where the one below would meet it:
87+
88+
```css
89+
@media (pointer: coarse) {
90+
:where(.touchTarget) {
91+
position: relative;
92+
}
93+
94+
.touchTarget::after {
95+
position: absolute;
96+
inset: 50% auto auto 50%;
97+
border-radius: inherit;
98+
block-size: max(100%, var(--sizeControlMd));
99+
inline-size: max(100%, var(--sizeControlMd));
100+
content: '';
101+
translate: -50% calc(-50% - var(--sizeTouchTargetLift, 0px));
102+
}
103+
}
104+
```
105+
106+
## Rules
107+
108+
- Apply a mixin by its class, from the component's markup, as above. Never through `composes`: it brings the mixin's whole module into the composing sheet, and the later copy in the build overrides everything of equal specificity loaded before it.
109+
- The override point of a mixin is its custom property. A consumer sets the variable, `--colorFocusOutline` for the ring's color, rather than overriding the properties the mixin sets.
110+
- A mixin is one class for one concern any element may take: the focus ring, a touch target, a picture hidden in one theme. Once the shared part needs states or variants of its own, or a class the consumer must also put on an inner element, it is a base component: consumers render it and add only their layout. A selector such as `:has(.input:checked)` against a hashed class from another module silently matches nothing, which is the first sign.
111+
- The shared base of a known set of components is a component they render, even when it is one class with no states, as the `ui-component` skill says: a mixin is for what any element may take, not for the shared code of specific components. Importing another component's CSS module to take its classes is fine.

0 commit comments

Comments
 (0)