Chromatic label¶
Do not start unless the current request names this skill or asks to add the chromatic label.
Opening a PR, or a diff that can move pixels, is not that request.
storybook-chromatic.yml runs on a PR only when the chromatic label is added. Each run bills
snapshots, so the label goes on a PR whose diff can move pixels, and nowhere else.
Procedure¶
- Read the PR labels.
chromaticalready there → stop. Never remove it: removing then re-adding it starts a second run. - Fetch the base branch, then list the candidates from the repo root, PR head checked out:
git fetch origin <base-branch>
.cursor/skills/chromatic-label/chromatic-label-reasons.sh origin/<base-branch>
Output: one <reason>\t<path> line per file. Empty output → stop, no label, no comment.
| Reason | Matches |
|---|---|
story |
a .stories.tsx |
design-system |
uimmo src/, theme src/, projects/storybook/.storybook/ |
classname |
an app .tsx whose diff touches className, rendered by a story within 4 imports |
Ignored: i18n JSON (untraced in the Chromatic workflow), API, .md, .mdc, tests.
3. Read the diff of each story and classname line. Drop a line when the change cannot move a
pixel: imports, types, comments, renames, or the same classes reordered. Keep every
design-system line.
4. No line left → stop. Otherwise add the label once and post one comment, in French:
Label `chromatic` posé : ce diff peut changer des snapshots Storybook.
- `story` — `projects/.../Foo.stories.tsx`
- `classname` — `projects/.../Bar.tsx`
Automation setup¶
- Trigger: GitHub "Pull request opened" (also fires when a draft is marked ready). Not "Pull
request pushed": later commits do not restart Chromatic, the workflow ignores
synchronize. - Prompt:
Apply .cursor/skills/chromatic-label/SKILL.md to this pull request.Naming this file is the explicit request; the agent opening the PR does not run the skill. - Secret
GH_TOKEN: fine-grained token,Pull requests: writeon this repo. A label added with a workflowGITHUB_TOKENdoes not trigger other workflows, so Chromatic would never start.