@srobroek/pi-design 0.0.0 → 0.11.1

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.
Files changed (59) hide show
  1. package/CHANGELOG.md +174 -0
  2. package/LICENSE +202 -0
  3. package/README.md +438 -2
  4. package/_kit/prereqs.json +41 -0
  5. package/_kit/prereqs.ts +374 -0
  6. package/agents/a11y-auditor.md +107 -0
  7. package/agents/council-user.md +25 -0
  8. package/agents/council-ux.md +25 -0
  9. package/agents/design-critic.md +80 -0
  10. package/agents/ui-implementer.md +75 -0
  11. package/agents/ui-ux-specialist.md +133 -0
  12. package/commands/council-product.md +26 -0
  13. package/commands/design-review.md +17 -0
  14. package/extensions/design.js +438 -0
  15. package/formulas/design-surface.formula.toml +344 -0
  16. package/formulas/design-system.formula.toml +509 -0
  17. package/formulas/design-touch.formula.toml +188 -0
  18. package/formulas/mol-design-a11y.formula.toml +128 -0
  19. package/formulas/mol-design-component.formula.toml +122 -0
  20. package/formulas/mol-design-iterate.formula.toml +187 -0
  21. package/formulas/mol-design-motion.formula.toml +138 -0
  22. package/formulas/mol-design-responsive.formula.toml +135 -0
  23. package/formulas/mol-design-tokens.formula.toml +165 -0
  24. package/mcp-servers.ts +49 -0
  25. package/package.json +61 -4
  26. package/skills/accessibility-audit/SKILL.md +92 -0
  27. package/skills/accessibility-audit/references/upstream.md +78 -0
  28. package/skills/design-component-truth/SKILL.md +41 -0
  29. package/skills/design-evidence/SKILL.md +21 -0
  30. package/skills/design-guide/SKILL.md +26 -0
  31. package/skills/design-md/LICENSE +21 -0
  32. package/skills/design-md/NOTICE +31 -0
  33. package/skills/design-md/SKILL.md +79 -0
  34. package/skills/design-md/references/create-design-md.md +254 -0
  35. package/skills/design-md/references/upstream.md +60 -0
  36. package/skills/design-no-slop/SKILL.md +32 -0
  37. package/skills/design-prototype/SKILL.md +84 -0
  38. package/skills/design-prototype/references/in-app-variants.md +47 -0
  39. package/skills/design-prototype/references/upstream.md +43 -0
  40. package/skills/design-system-audit/SKILL.md +62 -0
  41. package/skills/design-system-audit/references/token-carriers.md +106 -0
  42. package/skills/design-system-audit/references/token-pipeline.md +115 -0
  43. package/skills/design-system-audit/references/upstream.md +52 -0
  44. package/skills/design-token-discipline/SKILL.md +24 -0
  45. package/skills/design-upstream-preflight/SKILL.md +60 -0
  46. package/skills/motion-design/SKILL.md +60 -0
  47. package/skills/ui-microcopy/LICENSE +212 -0
  48. package/skills/ui-microcopy/NOTICE +28 -0
  49. package/skills/ui-microcopy/SKILL.md +50 -0
  50. package/skills/ui-microcopy/references/copy-guidance.md +86 -0
  51. package/skills/ui-microcopy/references/upstream.md +11 -0
  52. package/skills/ui-review/SKILL.md +92 -0
  53. package/skills/ui-review/references/probes.md +446 -0
  54. package/skills/ui-review/references/storybook.md +217 -0
  55. package/skills/ui-review/references/tools.md +269 -0
  56. package/skills/ui-review/references/viewport-checks.md +184 -0
  57. package/skills/wireloom/LICENSE +21 -0
  58. package/skills/wireloom/NOTICE +30 -0
  59. package/skills/wireloom/SKILL.md +95 -0
@@ -0,0 +1,78 @@
1
+ # Upstream routes for accessibility-audit
2
+
3
+ The primary measurement route is not a skill at all: it is the `accessibility-scanner` MCP
4
+ server, configured as the design plugin's README shows. The upstream skill below carries the criteria coverage that a
5
+ scanner does not.
6
+
7
+ | Upstream skill | Repo | Install |
8
+ |---|---|---|
9
+ | `accessibility` | `addyosmani/web-quality-skills` | `web-quality-skills@addy-web-quality-skills`, via the `design-upstream-preflight` skill |
10
+
11
+ `web-quality-skills` is MIT with a LICENSE file (Copyright 2026 Addy Osmani). Because
12
+ skill granularity is the whole plugin, it also installs `best-practices`,
13
+ `core-web-vitals`, `performance`, `seo`, and `web-quality-audit`. Those are adjacent
14
+ tooling rather than design routes, and no wrapper here routes to them.
15
+
16
+ ## Routes that need no skill
17
+
18
+ The `accessibility-scanner` MCP server needs only a config entry, no skill install, and it
19
+ is the PRIMARY measurement route. It runs axe-core in a real browser: its own tool description reads "Requires Google
20
+ Chrome installed locally (or set the CHROME_PATH environment variable)". What it removes is
21
+ the ChromeDriver version pairing that stopped the CLI below, not the browser. With no Chrome
22
+ and no `CHROME_PATH`, a scan tests nothing. A server that failed to connect stays
23
+ unavailable until the user reconnects it through the harness (in OpenCode, `/mcps`); an
24
+ agent cannot reconnect it.
25
+
26
+ The axe CLI is the documented FALLBACK, for a multi-URL CI gate only. It needs no install
27
+ either: `npx --yes` resolves it on demand and caches it. Pass `--package`, because the bin is named
28
+ `axe` and cannot be expressed as the package spec:
29
+
30
+ ```
31
+ npx --yes --package=@axe-core/cli axe "<url>" --stdout --exit
32
+ ```
33
+
34
+ It drives a real Chrome through ChromeDriver, and the two must match. Installing the pair is
35
+ not sufficient: the manager downloads them and puts neither on axe's path, so read the paths
36
+ back and pass both.
37
+
38
+ ```
39
+ npx --yes browser-driver-manager install chrome
40
+ eval "$(npx --yes browser-driver-manager which)"
41
+ npx --yes --package=@axe-core/cli axe "<url>" --stdout --exit \
42
+ --chrome-path "$CHROME_TEST_PATH" \
43
+ --chromedriver-path "$CHROMEDRIVER_TEST_PATH"
44
+ ```
45
+
46
+ `which` takes no positional argument and prints `KEY="value"` lines, which is why the
47
+ shell's eval builtin sets both variables.
48
+
49
+ Measured without that step, the run exits 2 having tested nothing:
50
+
51
+ ```
52
+ session not created: This version of ChromeDriver only supports Chrome version 152.
53
+ Current browser version is 151.0.7922.174
54
+ ```
55
+
56
+ Which is the second caveat in one line: an environment failure and an accessibility
57
+ violation both exit non-zero, so the exit code cannot tell them apart. Read the JSON on
58
+ `--stdout` and judge the findings. A gate built on the exit code alone reports a broken
59
+ driver as a failing audit.
60
+
61
+ `@axe-core/cli` is 4.13.0, MPL-2.0, with a LICENSE file. This package advertises it as a
62
+ pointer and never vendors it.
63
+
64
+ ## Why these and not the others
65
+
66
+ `ss-a11y` from `bitjaru/styleseed` is displaced by `accessibility`, which is the deeper
67
+ treatment of the same topic.
68
+
69
+ `pa11y` is single-URL and displaced by the axe CLI. `pa11y-ci` is LGPL-3.0-only and
70
+ excluded on licence. `ramzesenok/iOS-Accessibility-Audit-Skill` declares no licence
71
+ anywhere and is excluded entirely; absent a declaration, all rights are reserved.
72
+
73
+ ## What the browser already covers
74
+
75
+ Never reach for an external tool for these, because a driven browser already provides them:
76
+ ARIA snapshots, the accessibility tree, computed styles, screenshots, keyboard input,
77
+ viewport sizing, and request interception. The axe-core routes exist for the WCAG 2.2 rule
78
+ engine and the gradient-aware contrast resolution, not for DOM access.
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: design-component-truth
3
+ description: Use when passing component props or writing Storybook stories, to check each prop against the component's docs first.
4
+ metadata:
5
+ opencode/autoinvoke: false
6
+ ---
7
+
8
+ Prop hallucination is its own failure mode. A plausible-sounding prop such as
9
+ `shadow`, `size`, or `variant` compiles in a loose codebase, renders nothing, and passes
10
+ review because the name reads correct. No token, slop, or evidence rule catches it. Where
11
+ a Storybook exists, it publishes the ground truth.
12
+
13
+ MUST Verify a prop against documentation before using it, including one whose name reads as certain.
14
+ MUST Read `http://localhost:6006/manifests/components.json` when it serves, then index `components` by id and select the engine-specific payload based on `meta.docgen`. The key is not the engine string: engine `react-docgen` puts its payload under `reactDocgen`, whose `props` carry `required`, a `tsType`, and a `description`.
15
+ MUST Use the Storybook MCP `list-all-documentation` then `get-documentation` instead when that server is connected.
16
+ MUST Fetch `get-storybook-story-instructions`, or read the project's existing stories, before writing or updating a story.
17
+ DEFAULT Check the work with the project's existing story test route: the Vitest addon where the project runs it, `run-story-tests` when the MCP is connected, otherwise `npx --yes --package=@storybook/test-runner test-storybook`. Pass `--package`: an unrelated `test-storybook` package exists on npm.
18
+ NOT Infer a prop from a naming convention or from another library's API. Two component libraries agreeing on a name is a coincidence, not a contract.
19
+ NOT Trust a story name to reflect a prop name. Verify through the manifest, the ArgTypes block, or an example snippet.
20
+ NOT Pass a prop no documentation names. Return the question to whoever holds the conversation: a subagent returns it to its caller and never asks the user. Inventing one ships dead markup.
21
+
22
+ | situation | where prop truth comes from |
23
+ |---|---|
24
+ | `manifests/components.json` serves | `components[<id>].reactDocgen.props` |
25
+ | that route 404s, or no Storybook exists | the component source and its type declaration |
26
+ | a Storybook exists but is not React | the rendered Autodocs `ArgTypes` block, or the source |
27
+ | the prop is absent wherever you looked | do not pass it; return the question to the conversation owner |
28
+
29
+ The prop-table manifest is React-only in practice, measured on Storybook 10.5.10 with
30
+ `@storybook/addon-mcp` installed in both a React and a Vue project: React serves it, Vue
31
+ returns `Manifest "components" not found`. `manifests/docs.json` serves on both. `ArgTypes`
32
+ is supported in all ten frameworks Storybook documents, which makes it the cross-framework
33
+ fallback.
34
+
35
+ Three packages share the work, verified in each package's `dist/preset.js`:
36
+ `@storybook/addon-mcp` sets the `features.componentsManifest` flag, `@storybook/react`
37
+ generates the components payload, and `@storybook/addon-docs` generates the docs manifest.
38
+ A framework package that generates no payload leaves the route absent even with the flag on.
39
+
40
+ An empty `components` map is inconclusive rather than empty-by-fact: under
41
+ `features.experimentalDocgenServer` the generator returns an empty map by design.
@@ -0,0 +1,21 @@
1
+ ---
2
+ name: design-evidence
3
+ description: Use when making any claim about a rendered UI, to cite ARIA, computed-style or screenshot evidence with the viewport.
4
+ metadata:
5
+ opencode/autoinvoke: false
6
+ ---
7
+
8
+ MUST Cite, per claim, the ONE kind that fits it: an ARIA snapshot (the browser's accessibility snapshot, such as Playwright's `ariaSnapshot()` YAML), a computed-style value read with page-side JavaScript, or a screenshot path. This governs citation. Collection order is separate and lives in the phase map of the `ui-review` skill's `references/tools.md`: snapshot the tree once per pass before claiming anything, then cite whichever kind the claim needs.
9
+ MUST Name the viewport width on every layout claim: `1440`, `768`, or `375`, or `320` for a 1.4.10 Reflow claim, which WCAG specifies at 320 CSS px.
10
+ MUST Re-verify only the assertion that changed after a fix. Unchanged assertions stay cited from the prior pass.
11
+ NOT Close VERIFY, CRITIQUE, or RECONCILE with "looks good", "should work", or "appears correct".
12
+ NOT Use a screenshot diff as the sole evidence for a claim.
13
+ NOT Infer a native-app result from a web snapshot, or the reverse.
14
+
15
+ | situation | choice |
16
+ |---|---|
17
+ | claim about roles, names, or focus | ARIA snapshot first |
18
+ | claim about color, size, or spacing | computed style |
19
+ | claim about appearance only | screenshot path, after the two above |
20
+ | layout at a breakpoint | same evidence plus the width |
21
+ | fix landed | re-run that one assertion |
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: design-guide
3
+ description: "Use for UI/design work: DESIGN.md, wireframes, prototypes, tokens, WCAG, motion, UX copy, UI review or UI claims."
4
+ ---
5
+
6
+ # Design guide
7
+
8
+ This guide only routes. Before you answer or act, load the matching skill with the skill
9
+ tool, by id, in this same turn, and every other row the task spans. Answer from the loaded
10
+ skill, not from this table.
11
+
12
+ | Situation | Load skill |
13
+ | --- | --- |
14
+ | Write or lint a DESIGN.md, document the design | `design-md` |
15
+ | What tokens, scales and primitives does this project use; before UI work | `design-system-audit` |
16
+ | Wireframe, mockup, prototype or deck request: route to the right producer | `design-prototype` |
17
+ | Mock up a dialog or draw a wireframe as inline SVG (fenced `wireloom` block) | `wireloom` |
18
+ | Adding or changing animation: durations, easings, reduced motion | `motion-design` |
19
+ | Writing or reviewing UX copy: errors, empty states, CTAs, confirmations, onboarding | `ui-microcopy` |
20
+ | Review this UI: ARIA snapshot, computed styles, keyboard walk | `ui-review` |
21
+ | Is this accessible, check accessibility, WCAG 2.2 AA | `accessibility-audit` |
22
+ | Critiquing or building a rendered UI: generated-UI tells, missing interaction states | `design-no-slop` |
23
+ | Any claim about a rendered UI: cite ARIA, computed style or screenshot plus viewport | `design-evidence` |
24
+ | Styling a component or editing tokens | `design-token-discipline` |
25
+ | Passing component props or writing Storybook stories | `design-component-truth` |
26
+ | Before routing to an upstream design skill or CLI | `design-upstream-preflight` |
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Julien Thibeaut
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,31 @@
1
+ design-md
2
+ =========
3
+
4
+ references/create-design-md.md is vendored, unmodified, from:
5
+
6
+ Project: UI Skills
7
+ Repository: https://github.com/ibelick/ui-skills
8
+ Source path: skills/create-design-md/SKILL.md
9
+ Commit: 587ea305b948ad34f0c2d5c2ea4211d428f66ed8
10
+ Blob: 1aa15726985929fe8d95624767cdc9a524418925 (16,208 bytes)
11
+ Copied: 2026-10-08
12
+ Licence: MIT License, Copyright (c) 2026 Julien Thibeaut
13
+
14
+ The full licence text is in the LICENSE file beside this one, copied from
15
+ https://raw.githubusercontent.com/ibelick/ui-skills/587ea305b948ad34f0c2d5c2ea4211d428f66ed8/LICENSE
16
+
17
+ The MIT licence requires that the copyright notice and permission notice appear in all
18
+ copies or substantial portions of the software. The LICENSE file satisfies that.
19
+
20
+ Modifications: none. The file is byte-identical to the blob above, so
21
+ `git hash-object references/create-design-md.md` reproduces it. It names no harness tool
22
+ and no skill path, so nothing needed rewriting for OMP. Its `npx @google/design.md`
23
+ commands run without `--yes` under OMP's non-interactive bash: npm 11.19.0 installed and
24
+ ran `spec` from an empty cache with stdin closed. Two OMP adjustments live in
25
+ `SKILL.md` instead of the copy: it is read as `skill://design-md/references/create-design-md.md`,
26
+ and its bare `lint DESIGN.md` path is replaced there with the repository-root path.
27
+
28
+ Why vendored rather than installed: upstream ships no marketplace or plugin manifest, so
29
+ it installed only through the `ui-skills` entry in this catalog. That entry tracks
30
+ unpinned `main` and brings six more skills that nothing here routes to. One pinned file
31
+ removes the install step from `design-md`.
@@ -0,0 +1,79 @@
1
+ ---
2
+ name: design-md
3
+ description: Routes DESIGN.md extraction to create-design-md and lints it; triggers on write a DESIGN.md or document the design.
4
+ metadata:
5
+ opencode/autoinvoke: false
6
+ ---
7
+
8
+ # DESIGN.md
9
+
10
+ Phase SPECIFY. Route the extraction of durable visual decisions into one linted artifact.
11
+ This skill does not author the file: the routed upstream extracts it, and this skill gates
12
+ the result.
13
+
14
+ TRIGGER
15
+ + "write a DESIGN.md", "document the design system", "record these design decisions"
16
+ + a design decision was just made that a later session must not relitigate
17
+ - discovering what the system already is -> `design-system-audit`
18
+ - the machine-readable token source -> the `design-system-audit` skill's `references/token-pipeline.md`
19
+ - judging an implemented surface -> `ui-review`
20
+
21
+ ## Workflow
22
+
23
+ 1. Establish the precondition first: name the repository path or the public URL this run
24
+ will inspect. -> a real inspectable source is named. With nothing to extract from, STOP
25
+ and say so, then ask for the repository, the URL, screenshots, or source files. The
26
+ routed `create-design-md` EXTRACTS a DESIGN.md from something that already exists. It
27
+ defines exactly two modes, Repository mode and URL mode, and its own restriction reads:
28
+ "If rendered inspection is unavailable, ask for screenshots or source files. Do not
29
+ create a DESIGN.md from copy, metadata, or HTML structure alone."
30
+ 2. Read `references/create-design-md.md`, vendored from
31
+ `ibelick/ui-skills`. -> its two modes and section order are loaded.
32
+ 3. Ground every value in the audit, not in invention: run the `design-system-audit` skill
33
+ and hand the routed skill its `file:line` evidence. -> every `{group.token}` reference
34
+ resolves against a real carrier.
35
+ 4. Follow `create-design-md`'s section order on the named source. -> a DESIGN.md
36
+ extracted from that source, with undecided items under `Known Gaps`. Its own lint step
37
+ passes a bare `DESIGN.md`; replace that with the root-derived path in step 5.
38
+ 5. Validate the result, passing a path derived from the repository root, never a bare
39
+ filename. -> `npx --yes @google/design.md lint "$(git rev-parse --show-toplevel)/DESIGN.md"`
40
+ exits zero. A bare `DESIGN.md` resolves against the session cwd, so it exits 2 with
41
+ "not found" whenever the cwd is not the directory holding the file.
42
+ 6. When editing an existing DESIGN.md, gate the change. -> `npx --yes @google/design.md
43
+ diff "<before>" "<after>"` exits zero, meaning the edit added no new error or warning.
44
+
45
+ Upstream provenance, the linter's full rule list, and its measured limits:
46
+ `references/upstream.md`.
47
+
48
+ ## Rules
49
+
50
+ MUST Treat DESIGN.md as authored intent and rationale, not as the compiler input. The
51
+ machine source is the project's token carrier, which for a new pipeline is layered DTCG
52
+ under `tokens/`; see the `design-system-audit` skill's `references/token-pipeline.md` for why
53
+ the export is lossy.
54
+ MUST Resolve every `{group.token}` reference. `broken-ref` is error-level and blocks.
55
+ MUST Expect more than one error-level failure. An invalid dimension is also error-level,
56
+ measured: `clamp(2.5rem, 7vw, 4.5rem)` exits 1 as "not a valid dimension", carrying no
57
+ rule id. So a clean `broken-ref` count does not mean the file passes.
58
+ MUST Put anything undecided under `Known Gaps` with the question left open.
59
+ MUST STOP when there is nothing to extract from. Ask for the repository, the URL,
60
+ screenshots, or source files and wait.
61
+ A DESIGN.md written from anything else is indistinguishable from an extracted one,
62
+ which is what makes improvising it worse than returning nothing.
63
+ DEFAULT Cite the audit's `file:line` beside any value the reader cannot trace to a carrier.
64
+ NOT Leave `TODO` or `TO_FILL` in the file. An unfilled placeholder is worse than an
65
+ acknowledged gap, because it reads as done.
66
+ NOT Route to `impeccable document` for this. Its Seed mode authors a DESIGN.md for a
67
+ project with no implementation, and its prompt asks for a creative north star and mood
68
+ language, which the extract-only precondition forbids. Its sample frontmatter also fails
69
+ the current linter, measured at 0.4.0: `clamp(...)` and `letterSpacing: normal` are
70
+ invalid dimensions, and `{colors.primary-deep}` is a broken ref. It never runs the linter.
71
+ NOT Trust the linter's `contrast-ratio` rule as a contrast gate. It warns only below
72
+ 4.5:1 and only on component `backgroundColor` and `textColor` pairs, with no 3:1
73
+ UI-boundary rule and no theme matrix.
74
+
75
+ OUTPUT
76
+ L1 DESIGN.md: written | updated -- sections touched, plus the route that extracted it.
77
+ Lint -- the `lint` result, and the `diff` result on an edit.
78
+ Gaps -- `Known Gaps` entries added.
79
+ CAP 120w
@@ -0,0 +1,254 @@
1
+ ---
2
+ name: create-design-md
3
+ description: Create or update a DESIGN.md from an existing product repository or public website. Use when asked to document an interface's design language, reconstruct its visual system, extract design tokens and guidance from current evidence, or give coding agents persistent UI context. Do not modify product source or promote accidental implementation patterns into design decisions.
4
+ ---
5
+
6
+ # Create DESIGN.md
7
+
8
+ Create a `DESIGN.md` for one product or coherent website. Record the design language that governs it, not every value that happens to exist.
9
+
10
+ ## Boundaries
11
+
12
+ - Modify only `DESIGN.md`. Do not change product source, dependencies, configuration, or generated files.
13
+ - Use the DESIGN.md format contract below. Do not invent a competing schema.
14
+ - Do not copy every discovered token or component into the document.
15
+ - Do not convert repetition, local styling, or visual preference into product intent.
16
+
17
+ ## 1. Choose the mode
18
+
19
+ ### Repository mode
20
+
21
+ Use when a local product repository is available. Create or update `DESIGN.md` at the root of the selected product.
22
+
23
+ If the repository contains multiple deployable products, select the one named by the user. If the request does not identify one and ownership is ambiguous, ask before writing.
24
+
25
+ Repository evidence may establish normative values, token names, component ownership, and documented rationale.
26
+
27
+ ### URL mode
28
+
29
+ Use when the user provides a public URL without its source repository. Create a reconstructed `DESIGN.md` draft in the current workspace.
30
+
31
+ URL mode requires rendered browser access. Inspect the DOM, computed styles, and publicly loaded stylesheets at desktop and mobile widths. Screenshots may support interpretation but cannot establish exact values by themselves.
32
+
33
+ Inspect the supplied page and shared chrome. For a site-wide request, sample up to three same-origin pages that represent distinct templates.
34
+
35
+ URL evidence may establish only observable visual patterns and computed values. It cannot establish internal token names, component ownership, undocumented rationale, or whether a pattern is intentionally canonical.
36
+
37
+ If rendered inspection is unavailable, ask for screenshots or source files. Do not create a DESIGN.md from copy, metadata, or HTML structure alone.
38
+
39
+ Choose repository mode whenever source is available. A supplied URL may verify rendered presentation but does not replace repository evidence.
40
+
41
+ ## Shared evidence pipeline
42
+
43
+ The modes differ only in how they collect evidence. They must use the same record and output pipeline:
44
+
45
+ ```text
46
+ role → value → source → scope → recurrence → confidence
47
+ ```
48
+
49
+ 1. Collect evidence using the selected mode.
50
+ 2. Record the source, scope, and recurrence for each candidate.
51
+ 3. Normalize candidates into the DESIGN.md schema.
52
+ 4. Omit candidates that are uncertain, local without a contract, or not implementation-relevant.
53
+ 5. Validate frontmatter shape and export compatibility.
54
+ 6. Write Markdown only after the normalized frontmatter passes.
55
+
56
+ Never let repository or URL evidence introduce a second token schema. The same flat token names, mapping-shaped typography, omission rules, and export gates apply to both modes.
57
+
58
+ The generated document is private until validation passes. Never return, display, or summarize a DESIGN.md draft before lint and export succeed. If validation reports an invalid shape or missing export category, rewrite the frontmatter and rerun; if the category cannot be repaired, remove it and report it as omitted.
59
+
60
+ ## 2. Trace the evidence
61
+
62
+ In repository mode, inspect in this order:
63
+
64
+ 1. Existing `DESIGN.md` and explicit repository guidance
65
+ 2. Tokens, themes, variables, and global styles
66
+ 3. Shared primitives and their variants
67
+ 4. Representative routes and rendered consumers
68
+ 5. Surface-local implementations
69
+
70
+ A source participates only when the selected product imports, references, inherits, or renders it. Exclude proposals, migrations, examples, generated outputs, legacy implementations, and similarly named packages unless the selected product uses them.
71
+
72
+ In URL mode, sample representative elements for:
73
+
74
+ - colors and surface roles
75
+ - typography roles
76
+ - spacing and layout
77
+ - borders, radii, and elevation
78
+ - navigation, buttons, inputs, cards, and repeated content structures
79
+ - desktop and mobile presentation
80
+
81
+ Prefer computed values and loaded CSS declarations over visual estimation.
82
+
83
+ Before drafting URL-mode prose or YAML, build a private evidence ledger for each sampled page and viewport. For each candidate, record: page, viewport, element role, computed property/value, and the matching loaded-CSS declaration or custom property when available. Inspect the public stylesheets loaded by the page, including custom properties and media-query rules; a stylesheet value is usable only when it is connected to a rendered element or recurs across the sampled pages.
84
+
85
+ Promote a URL value into DESIGN.md when either (a) the rendered computed value and a loaded declaration/custom property agree, or (b) the same computed value recurs for the same role across the required samples. If neither condition holds, omit the value. You may preserve an exposed custom-property name only when its declaration and rendered use are directly observable; do not invent semantic aliases from a raw value.
86
+
87
+ For every URL-mode claim, require all three proofs before writing it:
88
+
89
+ 1. Observation: the pattern or value is visible or computed on the rendered page.
90
+ 2. Basis: it is measured, or recurs across the required sampled pages/viewports.
91
+ 3. Consequence: it changes a concrete implementation choice in DESIGN.md.
92
+
93
+ If any proof is missing, omit the claim. Do not turn a visual impression into a token, a single occurrence into a site-wide rule, or a guessed value into YAML. Exact values require computed styles or loaded CSS; otherwise describe the role without a value or omit it.
94
+
95
+ ## 3. Decide what belongs
96
+
97
+ In repository mode, find explicit product intent or a design reference before describing product character. In URL mode, do not invent product character; the Overview may state only the site's observable purpose and presentation, and must identify the document as reconstructed.
98
+
99
+ Write YAML only from named shared tokens and roles in governing sources. Do not turn utility classes, repeated literals, or component values into token scales.
100
+
101
+ Treat frontmatter shape as a hard gate, not a stylistic choice: a value that is a token group must be a mapping whose children are the schema's fields. Never emit scalar typography entries (`sans: Geist`), arbitrary nested source objects (`font-family: { mono: ... }`), or rounded keys copied from CSS variable names (`radius-sm`, `radius-md`, etc.).
102
+
103
+ Use mappings, never sequences, for token groups. When a governing source defines one group-level token such as `--radius`, normalize it to `base`; otherwise preserve the source token names.
104
+
105
+ Map source values into DESIGN.md schema fields. Preserve semantic token names, not source object nesting. For example, write `typography.mono.fontFamily: Geist Mono`, never `typography.mono: Geist Mono`; write `rounded.base: 0.625rem` when the source has only `--radius`, never `rounded.radius` or derived radius steps.
106
+
107
+ Resolve framework utilities through the active theme or configuration before writing exact values.
108
+
109
+ Identify the repository's export target before writing frontmatter: `css-tailwind` for Tailwind v4, `json-tailwind` for Tailwind v3, and `dtcg` otherwise. Token names must be valid for that target.
110
+
111
+ Check the installed DESIGN.md specification before encoding theme modes:
112
+
113
+ ```bash
114
+ npx @google/design.md spec
115
+ ```
116
+
117
+ If the specification supports `themes` and `default-theme`, use its theme-aware token syntax. Otherwise, put the default-theme value under each canonical semantic token and preserve exact alternate-theme values in a `## Themes` table. Do not create parallel `-light` and `-dark` token names, discard alternate-theme values, or use unreleased syntax. A fallback Themes table is documentation only; do not pretend it makes the frontmatter theme-aware.
118
+
119
+ In repository mode, every prose rule must be supported by explicit guidance, a named shared token or variant, or a shared owner used by at least two audited surfaces. Otherwise omit it.
120
+
121
+ In URL mode, every prose rule must be directly observable. A site-wide rule must recur across at least two sampled templates; otherwise scope it to the inspected page. Use reconstructed role-based names and label the document as a draft.
122
+
123
+ URL-mode YAML is intentionally sparse, but not empty when measured evidence exists. Add a category when at least one supported value or role survives the three-proof gate. Colors may use computed values or verified public custom properties, but must remain flat and export-safe; typography must use canonical fields such as `fontFamily`, `fontSize`, `lineHeight`, and `fontWeight`; rounded and spacing values must come from computed styles or loaded declarations. Do not create aliases such as `primary`, `elevated`, or `display` merely to organize observations. A component section requires the same interaction or surface treatment to recur across at least two sampled pages and to change a concrete implementation choice.
124
+
125
+ URL reconstruction does not change the frontmatter schema. Use only these typography property names: `fontFamily`, `fontSize`, `lineHeight`, `fontWeight`, and `letterSpacing`. For example:
126
+
127
+ ```yaml
128
+ typography:
129
+ sans:
130
+ fontFamily: Inter Variable
131
+ display:
132
+ fontFamily: Inter Variable
133
+ fontSize: 64px
134
+ lineHeight: 64px
135
+ fontWeight: 510
136
+ ```
137
+
138
+ Never emit URL-specific aliases such as `family`, `size`, `weight`, `mobile-display`, or nested `sans`/`mono` values inside a typography scale. Reconstructed role names may vary; schema field names may not.
139
+
140
+ For URL output, use `css-tailwind` as the compatibility export target unless the user specifies another target. Flatten reconstructed color roles into valid token names. Use `background-primary`, `foreground-secondary`, or `border-muted`, not nested keys such as `background.primary` or `foreground.secondary`. Every emitted token name must match `^[a-zA-Z0-9][a-zA-Z0-9-]*$`; reject and rewrite any key that would fail this test.
141
+
142
+ Normalize URL frontmatter before writing any Markdown. The order is: collect evidence, choose the export target, map evidence into the canonical schema, reject invalid shapes, then write the document. Never draft prose first and retrofit the YAML afterward.
143
+
144
+ URL frontmatter must satisfy these shape rules:
145
+
146
+ - `colors` is a flat mapping of valid token names to values.
147
+ - `typography` is a mapping of named scales; each scale is a mapping using only canonical fields.
148
+ - `rounded` and `spacing` are flat mappings of valid token names to values.
149
+ - `components` may reference canonical token paths but may not introduce a second token schema.
150
+
151
+ If normalization would require inventing a token name, field, scale, or semantic relationship, omit the candidate.
152
+
153
+ Outside the Overview, every Markdown sentence must change an implementation choice. Delete component inventories, generic design advice, and prose that only restates YAML.
154
+
155
+ Preserve the scope and direction of every rule. When implementation conflicts with explicit guidance, document the guidance and report the conflict outside `DESIGN.md`.
156
+
157
+ ## 4. Write the document
158
+
159
+ Start with the smallest valid frontmatter:
160
+
161
+ ```yaml
162
+ ---
163
+ version: alpha
164
+ name: <string>
165
+ description: <string>
166
+ ---
167
+ ```
168
+
169
+ Only `name` is required. Add `colors`, `typography`, `rounded`, `spacing`, or `components` only when a governing source already defines that named system or contract. Do not create token names to organize implementation values. Token references use `{path.to.token}`.
170
+
171
+ Use schema-shaped mappings, not copied source nesting. A typography scale is always named and maps its properties beneath it:
172
+
173
+ ```yaml
174
+ typography:
175
+ sans:
176
+ fontFamily: Geist
177
+ mono:
178
+ fontFamily: Geist Mono
179
+ ```
180
+
181
+ If the source defines only `--radius`, write `rounded.base`, not `rounded.radius`; do not derive `sm`, `md`, `lg`, or `xl` from utility classes or repeated values. Before saving, inspect the parsed frontmatter and reject it yourself if any `typography` child is scalar or if `rounded` contains keys not present in the governing source.
182
+
183
+ Start with `## Overview`. State only the product's purpose and evidenced design direction. Do not summarize pages, components, tokens, or implementation. Add only supported sections from this order:
184
+
185
+ 1. Colors
186
+ 2. Themes
187
+ 3. Typography
188
+ 4. Layout
189
+ 5. Elevation & Depth
190
+ 6. Shapes
191
+ 7. Components
192
+ 8. Do's and Don'ts
193
+
194
+ Do not create a section merely because it exists in the format. Do not reorder or duplicate included sections. Add an unknown section only when supported guidance cannot fit a standard section.
195
+
196
+ Markdown records design intent and application guidance. Except for the fallback `## Themes` table, do not put token inventories, component configuration, source syntax, or documentation methodology in Markdown.
197
+
198
+ Include a Don't only when a governing source states an explicit prohibition.
199
+
200
+ - Put exact normative values in YAML frontmatter, except alternate-theme values when the installed specification cannot represent modes.
201
+ - Put supported rationale and application guidance in Markdown.
202
+ - Preserve accepted decisions from an existing `DESIGN.md` unless the user or current governing evidence replaces them.
203
+ - Do not invent brand personality, audience, or emotional rationale.
204
+ - Do not include citations, audit notes, rejected candidates, conflicts, or unresolved questions inside `DESIGN.md`.
205
+
206
+ Before saving, delete:
207
+
208
+ - any YAML token not already named by a governing source
209
+ - any page-local behavior presented as a product-wide rule
210
+ - any implementation pattern that conflicts with explicit guidance
211
+ - any prohibition not explicitly stated
212
+ - any exact implementation value outside YAML frontmatter or the fallback `## Themes` table
213
+ - any component configuration or documentation methodology in Markdown
214
+ - any sentence that does not change the resulting DESIGN.md
215
+
216
+ Run one final no-op pass: remove vague advice such as “be thorough,” “keep it polished,” or “use good judgment.” Keep only evidence gates, schema constraints, or application rules that change the document.
217
+
218
+ ## 5. Validate
219
+
220
+ Run structural linting:
221
+
222
+ ```bash
223
+ npx @google/design.md lint DESIGN.md
224
+ ```
225
+
226
+ Then run one compatibility export using the target selected above:
227
+
228
+ ```bash
229
+ npx @google/design.md export --format <format> DESIGN.md
230
+ ```
231
+
232
+ Inspect the output. Every populated frontmatter category supported by the target must emit its corresponding token category; an empty or missing category is a schema failure even when the command exits successfully. Rewrite the frontmatter and rerun validation until the category is emitted, unless the target genuinely cannot represent it. Do not report success while any populated category is missing from the export. Do not return the document while lint or export fails. Do not remove supported design information solely to satisfy an exporter limitation; report that limitation instead. Do not create or retain exported files.
233
+
234
+ For `css-tailwind`, verify these output families: `colors` → `--color-*`, `typography.<name>.fontFamily` → `--font-*`, `typography.<name>.fontSize` → `--text-*`, `rounded` → `--radius-*`, and `spacing` → `--spacing-*`. Typography entries are named scales; put `fontFamily`, `fontSize`, and `lineHeight` inside each scale, never under arbitrary source nesting such as `font-family`. If `typography` is populated but the export contains neither `--font-*` nor `--text-*`, the document is invalid and must be rewritten before reporting.
235
+
236
+ When updating an existing document, preserve its original contents temporarily and run:
237
+
238
+ ```bash
239
+ npx @google/design.md diff <previous-file> DESIGN.md
240
+ ```
241
+
242
+ Restore any removed accepted decision unless current governing evidence or the user explicitly replaces it.
243
+
244
+ ## 6. Report
245
+
246
+ Return:
247
+
248
+ - mode and audited product or URL
249
+ - created or updated `DESIGN.md`
250
+ - governing sources used
251
+ - conflicts or unsupported areas omitted from the document
252
+ - final lint and export results
253
+
254
+ In URL mode, label the output as a reconstructed draft.
@@ -0,0 +1,60 @@
1
+ # Upstream routes for design-md
2
+
3
+ | Upstream skill | What it does | Repo | Install |
4
+ |---|---|---|---|
5
+ | `create-design-md` | Extracts a DESIGN.md from an existing repository or public URL | `ibelick/ui-skills` | none: vendored at `587ea305` as `create-design-md.md` |
6
+
7
+ ## It extracts, it does not author
8
+
9
+ Its own frontmatter reads "Create or update a DESIGN.md from an existing product repository
10
+ or public website". It has no greenfield mode, which is why step 1 of the skill stops when
11
+ there is no source to inspect. The `@google/design.md` CLI below validates a file that
12
+ already exists and is not a way around that.
13
+
14
+ ## What the upstream ships
15
+
16
+ MIT with a LICENSE file (Copyright 2026 Julien Thibeaut). The upstream repository also
17
+ ships `baseline-ui`, `fixing-accessibility`, `fixing-metadata`,
18
+ `fixing-motion-performance`, `improve-ui`, and a root skill. None
19
+ of those is routed to here: `fixing-accessibility` is displaced by
20
+ the `accessibility-audit` skill, `fixing-motion-performance` by the `motion-design` skill,
21
+ and `baseline-ui` and `improve-ui` by `impeccable`.
22
+
23
+ `fixing-metadata` is the closest call. It covers Open Graph, favicons, canonical URLs,
24
+ robots, Twitter cards, manifests, theme colour, and JSON-LD, which nothing else here
25
+ audits. It is not routed to because it is a prose checklist that emits no located
26
+ finding, and `web-asset-generator` covers the production half of the same ground by
27
+ generating and validating the assets.
28
+
29
+ ## The CLI needs no install
30
+
31
+ `npx` resolves it on demand and caches it. `@google/design.md` is 0.4.0, Apache-2.0, and
32
+ installs two bins, `design.md` and `designmd`. Neither matches the package name, so naming
33
+ the scoped package as the `npx` spec is what makes the skill's `lint` and `diff`
34
+ invocations safe. Its npm metadata declares no `license` field; the licence comes from the
35
+ LICENSE file at `google-labs-code/design.md`.
36
+
37
+ It has exactly four subcommands: `lint`, `diff`, `export`, `spec`. `export` writes to
38
+ stdout, so a file comes from redirection, and its formats are `json-tailwind`,
39
+ `css-tailwind`, `tailwind`, `dtcg`, and `css-vars`. The last is present in the source and
40
+ absent from the README.
41
+
42
+ `diff "<before>" "<after>"` exits 1 when the after file carries more errors or warnings than the
43
+ before file, which is what makes it a review gate rather than a report.
44
+
45
+ ## The eleven lint rules, and two limits
46
+
47
+ Error: `broken-ref`. Warnings: `missing-primary`, `contrast-ratio`, `orphaned-tokens`,
48
+ `missing-typography`, `section-order`, `unknown-key`, `token-like-ignored`. Info:
49
+ `token-summary`, `missing-sections`, `omitted-rules`.
50
+
51
+ The skill body states the two limits that invite false confidence. The detail behind them:
52
+
53
+ - `contrast-ratio` measured on a `#222222` on `#111111` pair reports `1.19:1, below WCAG
54
+ AA minimum of 4.5:1` as a WARNING, not an error.
55
+ - The dimension pattern is `^(-?\d*\.?\d+)([a-zA-Z%]+)$`, capped at 64 characters, so
56
+ `clamp(2.5rem, 7vw, 4.5rem)` fails it with `is not a valid dimension` and NO rule id. An
57
+ error with no rule id cannot be suppressed by rule name.
58
+
59
+ `https://github.com/VoltAgent/awesome-design-md` is MIT and is a corpus of DESIGN.md
60
+ files rather than a plugin, so it is a reading reference and not an install.
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: design-no-slop
3
+ description: Use when critiquing or building a rendered UI, to reject generated-UI visual tells and missing interaction states.
4
+ metadata:
5
+ opencode/autoinvoke: false
6
+ ---
7
+
8
+ MUST Cover loading, empty, and error on every data-backed surface. A missing state is a miss.
9
+ MUST Style one primary action per view. A second button using the primary variant is a miss.
10
+ MUST Give each heading a distinct job. A heading that restates the paragraph below it is a miss.
11
+ MUST Set a typeface explicitly. The default web stack chosen by omission is a miss.
12
+
13
+ DEFAULT Treat every tell below as a finding unless the project's approved tokens, its DESIGN.md, or the brief sanctions that choice. A token set that defines pure `#fff`, or an approved metric layout, is the system, not slop.
14
+ DEFAULT Avoid decorative glassmorphism, glow borders, or blur-on-card chrome.
15
+ DEFAULT Avoid cyan-on-dark palettes with purple gradients.
16
+ DEFAULT Avoid gradient text on headings or metrics.
17
+ DEFAULT Avoid uniform card grids of icon-heading-text.
18
+ DEFAULT Avoid nested cards.
19
+ DEFAULT Avoid large rounded icons above every heading.
20
+ DEFAULT Avoid hero metric layouts (big number, small label, three-up).
21
+ DEFAULT Avoid uniform spacing with no rhythm (every gap the same token).
22
+ DEFAULT Avoid centering every block on the page.
23
+ DEFAULT Avoid modals as the default disclosure when an inline, popover, or page works.
24
+ DEFAULT Avoid pure `#000` or `#fff` instead of tinted neutrals.
25
+ DEFAULT Avoid bounce or elastic easing.
26
+
27
+ | situation | choice |
28
+ |---|---|
29
+ | extra chrome for depth | drop it; use elevation tokens |
30
+ | many peers of equal weight | list or table, not a card grid |
31
+ | secondary action | ghost or text variant |
32
+ | disclosure of details | inline first; modal last |