@pugi/cli 1.0.0-alpha.24 → 1.0.0-alpha.241
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 +1 -1
- package/THIRD_PARTY_NOTICES.md +39 -0
- package/bin/pugi +19 -5
- package/models.json +1 -0
- package/package.json +20 -6
- package/skills/a11y/SKILL.md +27 -0
- package/skills/ab-test-analysis/SKILL.md +15 -0
- package/skills/ai-sdk/SKILL.md +27 -0
- package/skills/api-integration/SKILL.md +27 -0
- package/skills/architecture-review/SKILL.md +19 -0
- package/skills/brand-voice/SKILL.md +27 -0
- package/skills/ci-cd-pipeline/SKILL.md +15 -0
- package/skills/code-review/SKILL.md +27 -0
- package/skills/competitor-analysis/SKILL.md +27 -0
- package/skills/content-design/SKILL.md +35 -0
- package/skills/css-tailwind/SKILL.md +39 -0
- package/skills/css-tailwind/quirks.md +86 -0
- package/skills/db-vector/SKILL.md +27 -0
- package/skills/design-radix/SKILL.md +35 -0
- package/skills/design-system/SKILL.md +35 -0
- package/skills/detecting-data-anomalies/SKILL.md +15 -0
- package/skills/docker-deploy/SKILL.md +15 -0
- package/skills/edge-case-finder/SKILL.md +27 -0
- package/skills/fonts/SKILL.md +34 -0
- package/skills/framework-grammy/SKILL.md +27 -0
- package/skills/framework-mastra/SKILL.md +27 -0
- package/skills/framework-nestjs/SKILL.md +27 -0
- package/skills/framework-prisma/SKILL.md +27 -0
- package/skills/funnel-optimization/SKILL.md +19 -0
- package/skills/ha-prototype-web/LICENSE-APACHE-2.0 +201 -0
- package/skills/ha-prototype-web/NOTICE.md +85 -0
- package/skills/ha-prototype-web/SKILL.md +25 -0
- package/skills/icons/SKILL.md +34 -0
- package/skills/landing-templates/SKILL.md +35 -0
- package/skills/market-research/SKILL.md +27 -0
- package/skills/metrics-dashboard/SKILL.md +19 -0
- package/skills/monitoring-setup/SKILL.md +15 -0
- package/skills/motion/SKILL.md +27 -0
- package/skills/nestjs-api/SKILL.md +38 -0
- package/skills/nestjs-api/quirks.md +36 -0
- package/skills/nextjs-page/SKILL.md +27 -0
- package/skills/od-craft/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-craft/NOTICE.md +85 -0
- package/skills/od-craft/SKILL.md +58 -0
- package/skills/od-craft/references/README.md +108 -0
- package/skills/od-craft/references/accessibility-baseline.md +203 -0
- package/skills/od-craft/references/animation-discipline.md +156 -0
- package/skills/od-craft/references/anti-ai-slop.md +86 -0
- package/skills/od-craft/references/color.md +90 -0
- package/skills/od-craft/references/form-validation.md +223 -0
- package/skills/od-craft/references/laws-of-ux.md +298 -0
- package/skills/od-craft/references/rtl-and-bidi.md +188 -0
- package/skills/od-craft/references/state-coverage.md +136 -0
- package/skills/od-craft/references/typography-hierarchy-editorial.md +184 -0
- package/skills/od-craft/references/typography-hierarchy.md +167 -0
- package/skills/od-craft/references/typography.md +124 -0
- package/skills/od-reference-design-contract/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-reference-design-contract/NOTICE.md +85 -0
- package/skills/od-reference-design-contract/SKILL.md +131 -0
- package/skills/od-reference-design-contract/references/checklist.md +26 -0
- package/skills/od-web-prototype/LICENSE-APACHE-2.0 +201 -0
- package/skills/od-web-prototype/NOTICE.md +85 -0
- package/skills/od-web-prototype/SKILL.md +102 -0
- package/skills/od-web-prototype/assets/template.html +348 -0
- package/skills/od-web-prototype/references/checklist.md +47 -0
- package/skills/od-web-prototype/references/layouts.md +247 -0
- package/skills/orchestrating-multi-agent-systems/SKILL.md +19 -0
- package/skills/preprocessing-data/SKILL.md +15 -0
- package/skills/project-memory-keeper/SKILL.md +19 -0
- package/skills/public-apis/SKILL.md +27 -0
- package/skills/pugi-patterns/SKILL.md +19 -0
- package/skills/react-component/SKILL.md +27 -0
- package/skills/sprint-planning/SKILL.md +19 -0
- package/skills/stack-selection/SKILL.md +15 -0
- package/skills/standup-summary/SKILL.md +15 -0
- package/skills/task-decomposition/SKILL.md +19 -0
- package/skills/team-routing/SKILL.md +15 -0
- package/skills/tech-survey/SKILL.md +15 -0
- package/skills/test-plan/SKILL.md +15 -0
- package/skills/typescript-refactor/SKILL.md +15 -0
- package/skills/ui-components/SKILL.md +35 -0
- package/skills/ux-patterns/SKILL.md +35 -0
- package/skills/web-platform/SKILL.md +27 -0
- package/skills/web-scrape/SKILL.md +27 -0
- package/skills/web-search/SKILL.md +15 -0
- package/skills/webapp-testing/SKILL.md +37 -0
- package/skills/webapp-testing/quirks.md +26 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
<!-- Vendored from nexu-io/open-design@78d5637cb49d (craft/accessibility-baseline.md), Apache-2.0, Copyright 2026 Open Design contributors. Modified by Pugi: this header line added; the text below is otherwise verbatim. Paths it names (apps/daemon/src/lint-artifact.ts, pnpm lint:craft, od.craft.requires) are upstream's, not Pugi's: the Pugi port of the linter is packages/opencode/src/session/design-lint.ts. See NOTICE.md in the skill root. -->
|
|
2
|
+
|
|
3
|
+
# Accessibility baseline craft rules
|
|
4
|
+
|
|
5
|
+
Universal rules for the legal floor of accessibility plus the craft
|
|
6
|
+
commitments that go beyond it. The active `DESIGN.md` decides brand
|
|
7
|
+
appearance; this file decides which rules an artifact has to clear
|
|
8
|
+
before it ships.
|
|
9
|
+
|
|
10
|
+
> Grounded in primary sources: WCAG 2.2 Understanding pages,
|
|
11
|
+
> ISO/IEC 40500:2025, ADA Title II 2024 + 2026 IFR, EN 301 549 v3.2.1,
|
|
12
|
+
> WAI-ARIA 1.3 + AccName 1.2 + Core AAM 1.2, WebAIM Million 2026
|
|
13
|
+
> (February 2026 crawl), A11yn (arXiv 2510.13914), APCA W3C silver
|
|
14
|
+
> branch.
|
|
15
|
+
|
|
16
|
+
## Prior art and scope
|
|
17
|
+
|
|
18
|
+
Existing OSS a11y guidance for AI agents (`fecarrico/A11Y.md`,
|
|
19
|
+
`awesome-copilot agents/accessibility.agent.md`,
|
|
20
|
+
`Community-Access/accessibility-agents`) tends to inline a checklist of
|
|
21
|
+
WCAG SCs without versioning the legal floor or specifying which
|
|
22
|
+
constraints survive on iOS / Android / Flutter. This file scopes
|
|
23
|
+
narrower: the compliance floor an OD artifact must clear, with
|
|
24
|
+
jurisdiction notes and native-mobile parity. Heuristic rules and
|
|
25
|
+
linter-checked items live in sibling craft files
|
|
26
|
+
(`anti-ai-slop.md`, `state-coverage.md`); WCAG SC numbers map to
|
|
27
|
+
specific rules below rather than being re-listed.
|
|
28
|
+
|
|
29
|
+
## The legal floor changes by jurisdiction
|
|
30
|
+
|
|
31
|
+
- **EU (EAA, enforcement live 2025-06-28):** EN 301 549 v3.2.1 is the OJ-cited harmonised standard; it references **WCAG 2.1 AA**. EN 301 549 v4.1.1 (which incorporates WCAG 2.2's nine new SCs) is OJ-citation-targeted late 2026 / 2027. Until then, EAA references WCAG 2.1. The Web Accessibility Directive (WAD, EU 2016/2102) covers public-sector bodies separately and also points at EN 301 549.
|
|
32
|
+
- **US public sector — ADA Title II 2024 final rule:** **WCAG 2.1 AA**. The 2026-04-20 IFR slipped deadlines: 2027-04-26 for jurisdictions with population ≥ 50,000; 2028-04-26 for sub-50,000 and special districts.
|
|
33
|
+
- **US federal procurement — Section 508 (Revised 508 Standards):** harmonised with EN 301 549 → references **WCAG 2.0 AA** in the current published rev. The Access Board has WCAG 2.x updates in flight; until they ship, federal IT procurement floor is WCAG 2.0.
|
|
34
|
+
- **US private sector — ADA Title III:** no federal regulation specifies a technical standard. Settlements and DOJ guidance routinely cite **WCAG 2.1 AA** as the de-facto target, but the legal mechanism is case-by-case, not rule-based.
|
|
35
|
+
- **ISO/IEC 40500:2025** (October 2025) ratified WCAG 2.2 verbatim. Does not by itself change EU or US legal floors.
|
|
36
|
+
|
|
37
|
+
**Practical rule for craft:** target **WCAG 2.2 AA** as the working
|
|
38
|
+
ceiling. It clears the WCAG 2.1 AA legal floor in both jurisdictions
|
|
39
|
+
and prepares for v4.1.1. Anything below 2.2 AA is craft debt.
|
|
40
|
+
|
|
41
|
+
## Color contrast
|
|
42
|
+
|
|
43
|
+
| Pair | WCAG 2.x AA minimum |
|
|
44
|
+
|---|---|
|
|
45
|
+
| Normal text below 18 pt regular / 14 pt bold (covers most body and UI text) | 4.5:1 |
|
|
46
|
+
| Large text (≥18 *pt* regular ≈24 px, or ≥14 *pt* bold ≈18.5 px) | 3:1 |
|
|
47
|
+
| Non-text UI components and graphical objects | 3:1 |
|
|
48
|
+
| Focus indicator vs adjacent and unfocused state | 3:1 |
|
|
49
|
+
|
|
50
|
+
Thresholds are **inclusive** — exactly 4.5:1 or 3:1 passes. Don't round
|
|
51
|
+
up: 2.999:1 fails because rounding is not a permitted mechanism.
|
|
52
|
+
|
|
53
|
+
"Large text" means **18 pt** regular, not 18 px. 18 px regular needs
|
|
54
|
+
4.5:1; 14 pt bold (≈18.5 px) qualifies for 3:1, 14 px bold does not.
|
|
55
|
+
|
|
56
|
+
**APCA as a parallel design check.** APCA's Lc value catches font-weight
|
|
57
|
+
and stem-thickness effects that WCAG 2.x luminance ratios miss. Body
|
|
58
|
+
copy at Lc ≥60 is a reasonable parallel pass; APCA's actual lookup
|
|
59
|
+
table is size- and weight-dependent (heavier weights at larger sizes
|
|
60
|
+
clear at lower Lc, thin small text needs Lc ≥75+). APCA is not part
|
|
61
|
+
of WCAG, EN 301 549, ADA, or Section 508 compliance as of 2026-05 —
|
|
62
|
+
keep WCAG 2.2 AA as the compliance floor and treat APCA as
|
|
63
|
+
design-review only. If you ship APCA tooling, use the `apca-w3`
|
|
64
|
+
package; the SAPC repo is non-commercial.
|
|
65
|
+
|
|
66
|
+
## Touch targets
|
|
67
|
+
|
|
68
|
+
| Bar | SC | Size |
|
|
69
|
+
|---|---|---|
|
|
70
|
+
| AA (legal floor) | 2.5.8 Target Size (Minimum) | **24×24 CSS px** |
|
|
71
|
+
| AAA (craft commitment) | 2.5.5 Target Size (Enhanced) | 44×44 CSS px |
|
|
72
|
+
| iOS HIG | — | 44×44 pt |
|
|
73
|
+
| Material 3 | — | 48×48 dp |
|
|
74
|
+
|
|
75
|
+
WCAG 2.5.8 lists five exceptions where the 24×24 minimum doesn't
|
|
76
|
+
apply: **Spacing** (a 24-CSS-px exclusion circle around the target
|
|
77
|
+
doesn't intersect adjacent ones), **Equivalent** (an alternative
|
|
78
|
+
control of sufficient size achieves the same function), **Inline**
|
|
79
|
+
(target sits inside a sentence, e.g. links in body copy), **User
|
|
80
|
+
agent control** (browser default like a native scrollbar), and
|
|
81
|
+
**Essential** (the smaller size is required to convey information,
|
|
82
|
+
e.g. a map pin). The Spacing exception is the one icon-button
|
|
83
|
+
toolbars rely on; the others are narrower than they read and
|
|
84
|
+
shouldn't be used to justify undersized primary actions.
|
|
85
|
+
|
|
86
|
+
## Focus visibility
|
|
87
|
+
|
|
88
|
+
Removing the focus outline via CSS is a **triple failure**: 1.4.11
|
|
89
|
+
Non-text Contrast, 2.4.7 Focus Visible, and 2.4.13 Focus Appearance
|
|
90
|
+
(AAA). Use `:focus-visible` for keyboard users; suppress the outline
|
|
91
|
+
for mouse clicks only when an alternative non-color affordance exists.
|
|
92
|
+
|
|
93
|
+
For AAA (2.4.13): indicator area must equal at least a 2 CSS px
|
|
94
|
+
perimeter of the component, contrast ≥3:1 between focused and
|
|
95
|
+
unfocused states. A 1-px outline at 3:1 doesn't qualify.
|
|
96
|
+
|
|
97
|
+
## Form input labels
|
|
98
|
+
|
|
99
|
+
WebAIM Million 2026 (which uses WAVE, not axe-core): **51% of top 1M
|
|
100
|
+
home pages have at least one missing form-input label; 33.1% of all
|
|
101
|
+
6.9M inputs are unlabeled**. The page-level rate moved from 48.2%
|
|
102
|
+
(2025) to 51% (2026) — missing-label prevalence is one of the few
|
|
103
|
+
categories WebAIM explicitly calls out as rising in 2026, against an
|
|
104
|
+
overall errors-per-page count of 56.1.
|
|
105
|
+
|
|
106
|
+
Default form-error wiring (WCAG 2.2 + ARIA APG):
|
|
107
|
+
|
|
108
|
+
```html
|
|
109
|
+
<label for="email">Email</label>
|
|
110
|
+
<input id="email" type="email" required
|
|
111
|
+
aria-describedby="email-hint email-error"
|
|
112
|
+
aria-invalid="true">
|
|
113
|
+
<span id="email-hint">Used for receipts only.</span>
|
|
114
|
+
<span id="email-error" role="alert">Email must include @ and a domain.</span>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
`aria-describedby` is the production default; `aria-errormessage` has
|
|
118
|
+
incomplete screen-reader support as of 2026-05 (full on NVDA, partial
|
|
119
|
+
on JAWS / VoiceOver / TalkBack) — treat as progressive enhancement.
|
|
120
|
+
|
|
121
|
+
WCAG 3.3.7 Redundant Entry is **Level A** (legal floor). Re-asking for
|
|
122
|
+
data the user already entered "in the same process" fails unless the
|
|
123
|
+
site auto-populates or offers a selectable shortcut. Browser autofill
|
|
124
|
+
does not satisfy it.
|
|
125
|
+
|
|
126
|
+
## Keyboard operability and semantic structure
|
|
127
|
+
|
|
128
|
+
Visual contrast and labelled inputs don't matter if a keyboard or
|
|
129
|
+
screen-reader user can't reach the control or parse the page. The
|
|
130
|
+
bullets below are Level A / AA WCAG essentials plus a small set of
|
|
131
|
+
structural conventions OD treats as craft commitments. WCAG levels
|
|
132
|
+
are noted per item.
|
|
133
|
+
|
|
134
|
+
- **Tab reachability** (2.1.1 Keyboard, Level A): every interactive element must be reachable and operable via keyboard. `tabindex="-1"` removes from the tab order; `tabindex` values >0 break document order and should not be used. (2.1.3 No Exception extends 2.1.1 to AAA by removing the underlying-function exception.)
|
|
135
|
+
- **Activation keys** (2.1.1, Level A): `<button>` activates on Enter and Space; `<a href="…">` activates on Enter. A bare `<a>` without `href` is not a link, not focusable, and not keyboard-operable — use `<a href="…">` for navigation or `<button>` for actions, never a placeholder anchor. Custom controls must implement the matching key handlers and `role`.
|
|
136
|
+
- **No keyboard trap** (2.1.2, Level A): focus must be able to leave any component via the same standard keys it entered with. Modal dialogs are a focus-trap *by design*, not a violation — they trap until dismissed by Escape or the close button.
|
|
137
|
+
- **Focus order** (2.4.3, Level A): tab order must follow the meaningful reading order. Don't rely on positive `tabindex` to fix DOM that's out of order; fix the DOM.
|
|
138
|
+
- **Native control first** (craft convention, anchored on 4.1.2 Name/Role/Value Level A): a `<button>` is keyboard-operable, focusable, name-resolvable, and announced as a button by every AT for free. `<div role="button" tabindex="0">` requires you to re-implement all of that and most reimplementations miss `aria-pressed`, disabled state, or Space-on-keyup. Reach for ARIA only when no native element fits.
|
|
139
|
+
- **Document language** (3.1.1, Level A): `<html lang="...">` is required. Sub-tree language switches use `lang` on the inner element.
|
|
140
|
+
- **Heading hierarchy** (1.3.1 Info and Relationships Level A; 2.4.6 Headings and Labels Level AA): WCAG requires programmatically-determined structure and descriptive headings, not a specific outline shape. OD craft convention layers on: prefer one `<h1>` per page and don't skip levels (`<h1>` → `<h3>` without `<h2>`). Visual size and heading level are independent.
|
|
141
|
+
- **Landmarks** (1.3.1, 2.4.1 Bypass Blocks Level A): use `<header>` `<nav>` `<main>` `<aside>` `<footer>` rather than `<div role="banner">` etc. AT users navigate by landmark; a page with no landmarks is a wall of divs.
|
|
142
|
+
- **Text alternatives** (1.1.1 Non-text Content, Level A): `<img alt="...">` for content images, `alt=""` for decorative; `aria-label` on icon-only buttons; long-form description for charts and SVG data viz. A chart without a text alternative is unreadable to a screen reader.
|
|
143
|
+
|
|
144
|
+
## ARIA discipline
|
|
145
|
+
|
|
146
|
+
WebAIM Million 2026 shows ARIA pages average **59.1 errors** vs
|
|
147
|
+
**42** on non-ARIA pages — about 17 extra errors on the ARIA side.
|
|
148
|
+
The gap was 30 in 2025 (57 vs 27) and 15 in 2024; YoY direction is
|
|
149
|
+
noisy, but ARIA usage is up (82.7% of home pages in 2026 vs 79.4% in
|
|
150
|
+
2025) while correctness lags. ARIA deployment outpaces ARIA
|
|
151
|
+
correctness.
|
|
152
|
+
|
|
153
|
+
Decision order, per ARIA APG:
|
|
154
|
+
|
|
155
|
+
1. Native HTML element with the right semantics.
|
|
156
|
+
2. Native element under custom visuals if restyling is required.
|
|
157
|
+
3. APG pattern verbatim if neither fits.
|
|
158
|
+
4. Closest APG pattern + documented deviation. Last resort.
|
|
159
|
+
|
|
160
|
+
Never invent ARIA.
|
|
161
|
+
|
|
162
|
+
## Reduced motion and flashing
|
|
163
|
+
|
|
164
|
+
See `animation-discipline.md` for the full rule set. The non-negotiable
|
|
165
|
+
that anchors here: WCAG 2.3.1 (Level A) — flashing more than three
|
|
166
|
+
times per one-second period is non-conformant unless the flash area
|
|
167
|
+
stays below the general and red flash thresholds. Photosensitive
|
|
168
|
+
epilepsy is the protected concern.
|
|
169
|
+
|
|
170
|
+
## Native mobile parity
|
|
171
|
+
|
|
172
|
+
Web ARIA does not auto-translate. Each platform has its own labelling API.
|
|
173
|
+
|
|
174
|
+
| Platform | Label | Role |
|
|
175
|
+
|---|---|---|
|
|
176
|
+
| iOS UIKit | `accessibilityLabel` | `accessibilityTraits` |
|
|
177
|
+
| iOS SwiftUI | `.accessibilityLabel(…)` | `.accessibilityAddTraits(.isButton)` |
|
|
178
|
+
| Android Compose | `Modifier.semantics { contentDescription = … }` | `Modifier.semantics { role = Role.Button }` |
|
|
179
|
+
| Flutter | `Semantics(label: …)` | `Semantics(button: true, …)` |
|
|
180
|
+
| React Native | `accessibilityLabel` | `accessibilityRole` |
|
|
181
|
+
|
|
182
|
+
Use the platform API for each target. AI-generated mobile UI that
|
|
183
|
+
mirrors web ARIA verbatim usually misses the platform-native screen
|
|
184
|
+
reader path.
|
|
185
|
+
|
|
186
|
+
## Common mistakes (lint these)
|
|
187
|
+
|
|
188
|
+
- "Target Size 44×44" cited as the AA bar. 44×44 is **AAA** (2.5.5). AA is **24×24** (2.5.8).
|
|
189
|
+
- "18 px = large text" — wrong. Threshold is 18 *pt* regular (~24 px) or 14 pt bold (~18.5 px).
|
|
190
|
+
- "EAA = WCAG 2.2 AA" — wrong. EN 301 549 v3.2.1 is anchored to WCAG 2.1.
|
|
191
|
+
- "Section 508 = WCAG 2.1 AA" — wrong as of 2026-05. Revised 508 still references WCAG 2.0 AA; the Access Board update is in flight, not shipped.
|
|
192
|
+
- "Tabindex fixes focus order" — `tabindex` >0 reorders against DOM and almost always makes it worse. Fix the DOM.
|
|
193
|
+
- "Modal traps focus → keyboard trap" — confusing 2.1.2. A modal trapping focus until Escape / close is correct behaviour, not a violation.
|
|
194
|
+
- "Heading size = heading level" — visual hierarchy and `<h1>`/`<h2>`/`<h3>` are independent. Style the level you mean.
|
|
195
|
+
- "WebAIM Million uses axe-core" — uses WAVE.
|
|
196
|
+
- "WCAG 3 will use APCA" — APCA was dropped from WCAG 3 in July 2023.
|
|
197
|
+
- "Adding ARIA improves accessibility" — empirically the opposite. WebAIM Million 2026: ARIA pages average 59.1 errors, non-ARIA pages 42.
|
|
198
|
+
- "Bare `<a>` with click handler is a link" — wrong. `<a>` without `href` is not focusable, not keyboard-operable, and not a link. Use `<a href="…">` for navigation, `<button>` for actions.
|
|
199
|
+
- Removing the focus outline via `outline: none` without a replacement. Triple failure: 1.4.11, 2.4.7, 2.4.13.
|
|
200
|
+
- Placeholder text as the only label for a form input. Fails 1.3.1 and 3.3.2; placeholder disappears on input.
|
|
201
|
+
- Using `aria-description` as the sole state-carrier on `role="row"`. JAWS 2025/2026 silently drops it ([FreedomScientific standards-support #927](https://github.com/FreedomScientific/standards-support/issues/927)).
|
|
202
|
+
- Native HTML `<button>` reimplemented as `<div role="button">` without keyboard handling, focus, or `aria-pressed`.
|
|
203
|
+
- A11y treated as web-only. Flutter / iOS / Android have their own labelling APIs that web ARIA doesn't reach.
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
<!-- Vendored from nexu-io/open-design@78d5637cb49d (craft/animation-discipline.md), Apache-2.0, Copyright 2026 Open Design contributors. Modified by Pugi: this header line added; the text below is otherwise verbatim. Paths it names (apps/daemon/src/lint-artifact.ts, pnpm lint:craft, od.craft.requires) are upstream's, not Pugi's: the Pugi port of the linter is packages/opencode/src/session/design-lint.ts. See NOTICE.md in the skill root. -->
|
|
2
|
+
|
|
3
|
+
# Animation discipline craft rules
|
|
4
|
+
|
|
5
|
+
Universal rules for when motion earns its place in a UI and what numbers
|
|
6
|
+
constrain it. The active `DESIGN.md` decides brand-specific motion
|
|
7
|
+
personality; this file decides whether motion should run at all and at
|
|
8
|
+
what duration, easing, and accessibility floor.
|
|
9
|
+
|
|
10
|
+
> Grounded in primary sources: Tversky/Morrison/Bétrancourt 2002
|
|
11
|
+
> (IJHCS), Heer & Robertson TVCG 2007, Harrison/Yeo/Hudson CHI 2010,
|
|
12
|
+
> Doherty & Thadani IBM Systems Journal 1982, Chang & Ungar UIST 1993,
|
|
13
|
+
> Material 3 motion tokens, IBM `@carbon/motion`, Apple SwiftUI
|
|
14
|
+
> Animation API, W3C View Transitions, WCAG 2.2.2 + 2.3.3, WebKit's
|
|
15
|
+
> 2017 `prefers-reduced-motion` rationale.
|
|
16
|
+
|
|
17
|
+
## When motion earns its place
|
|
18
|
+
|
|
19
|
+
Tversky/Morrison/Bétrancourt's 2002 meta-analysis (IJHCS 57, pp. 247-262)
|
|
20
|
+
found that every study claiming animation aids comprehension had a
|
|
21
|
+
broken control — the static version had less information, different
|
|
22
|
+
procedures, or hidden interactivity. When equalised, animation does
|
|
23
|
+
**not** beat static for teaching complex systems. The single use case
|
|
24
|
+
the paper endorses is real-time spatial or temporal reorientation:
|
|
25
|
+
page transitions, container morphs, viewpoint changes, progress
|
|
26
|
+
indicators (p. 257).
|
|
27
|
+
|
|
28
|
+
A follow-on hazard: Palmiter & Elkerton found animation-trained users
|
|
29
|
+
*declined* one week after training, while text-trained users *improved*
|
|
30
|
+
(Tversky 2002, p. 255). Animation's apparent short-term parity hides
|
|
31
|
+
worse retention.
|
|
32
|
+
|
|
33
|
+
So animate when the user is moving through space, time, or state —
|
|
34
|
+
navigation, container expansion, progress feedback, gesture
|
|
35
|
+
follow-through. Don't animate to teach, decorate, signal "premium",
|
|
36
|
+
or fill silence.
|
|
37
|
+
|
|
38
|
+
## Duration thresholds
|
|
39
|
+
|
|
40
|
+
The cross-design-system convergence is **150 ms** — Material 3 `short3`,
|
|
41
|
+
IBM Carbon `moderate-01`, Shopify Polaris `150`, Tailwind default,
|
|
42
|
+
SLDS `duration-fast` all land here. Use it as the default duration for
|
|
43
|
+
state-confirmation feedback.
|
|
44
|
+
|
|
45
|
+
| Duration | Use |
|
|
46
|
+
|---|---|
|
|
47
|
+
| 50–100 ms | Instant feedback (button press, toggle commit, hover) |
|
|
48
|
+
| 150 ms | Default for state-confirmation |
|
|
49
|
+
| 200–300 ms | Entering UI (modals, sheets, dropdowns) |
|
|
50
|
+
| 300–500 ms | Cross-screen transitions, container morphs |
|
|
51
|
+
| > 500 ms | Reserved for cross-screen, staged, or platform-native transitions (e.g. M3 `long2`-`extraLong4`, Heer & Robertson 2007's per-stage recommendation). |
|
|
52
|
+
|
|
53
|
+
Non-navigation microinteractions — hover, press, toggle, validation,
|
|
54
|
+
chip selection, row expansion — should stay under 500 ms. Past that the
|
|
55
|
+
user notices the motion as motion and waits on the UI rather than
|
|
56
|
+
working through it. Two qualifications: frequent animations (a hover
|
|
57
|
+
effect seen 50 times per session) need to stay ≤200 ms; mobile
|
|
58
|
+
animations should run 20–30% shorter than desktop equivalents because
|
|
59
|
+
travel distances are shorter.
|
|
60
|
+
|
|
61
|
+
## Curve vs spring
|
|
62
|
+
|
|
63
|
+
Use a curve for opacity, color, and any property that changes value
|
|
64
|
+
between two known points. Use a spring for position, scale, rotation,
|
|
65
|
+
and gesture-driven motion — anything that should feel physical.
|
|
66
|
+
|
|
67
|
+
Material 3 standard easing is `cubic-bezier(0.2, 0, 0, 1)` — front-loaded;
|
|
68
|
+
the trailing zero makes the curve hit its target instantly and settle.
|
|
69
|
+
M2 standard was the symmetric `cubic-bezier(0.4, 0, 0.2, 1)`, preserved
|
|
70
|
+
in M3 under the name `legacy`. Anyone shipping the M2 curve and calling
|
|
71
|
+
it "M3" is on legacy tokens. M3 `emphasized` is a **two-segment Bézier
|
|
72
|
+
path**, not a single cubic-bezier; single-cubic approximations silently
|
|
73
|
+
lose the front-loaded character. CSS `linear()` (Chrome 113+) is the
|
|
74
|
+
only way to replicate it on a single property.
|
|
75
|
+
|
|
76
|
+
Apple's published SwiftUI default spring is
|
|
77
|
+
`(response: 0.5, dampingFraction: 0.825, blendDuration: 0)`. The widely
|
|
78
|
+
cited `.snappy = 0.25 s, .smooth = 0.35 s` numbers are wrong — Apple's
|
|
79
|
+
docs assign all three presets a 0.5 s base, differing only in bounce
|
|
80
|
+
(0 / 0.15 / 0.3).
|
|
81
|
+
|
|
82
|
+
Spring framework defaults disagree. motion.dev's physics-mode default
|
|
83
|
+
is ζ ≈ 0.5 (bouncy). React Spring's `default` is ζ = 0.997 (critically
|
|
84
|
+
damped). Same word "default", opposite feel — React Spring's `wobbly`
|
|
85
|
+
is the actual feel-equivalent of motion.dev's `default`. Pick
|
|
86
|
+
consciously.
|
|
87
|
+
|
|
88
|
+
## Reduced motion
|
|
89
|
+
|
|
90
|
+
Every animation that translates, scales, rotates, or parallaxes must
|
|
91
|
+
respect `@media (prefers-reduced-motion: reduce)`. WebKit shipped this
|
|
92
|
+
in 2017 to address vestibular triggers; the W3C MQ5 spec lets the UA
|
|
93
|
+
or author **strip motion entirely or substitute static imagery** —
|
|
94
|
+
the spec does not mandate which.
|
|
95
|
+
|
|
96
|
+
Working rule: strip motion-on-an-axis (translate, scale, rotate,
|
|
97
|
+
parallax). Keep opacity/color crossfades as substitutes when a state
|
|
98
|
+
change still needs to be conveyed. Be explicit — the View Transitions
|
|
99
|
+
API does **not** apply `prefers-reduced-motion` automatically; the
|
|
100
|
+
author must add a query override on the pseudo-elements or skip
|
|
101
|
+
`startViewTransition` entirely.
|
|
102
|
+
|
|
103
|
+
WCAG calibration: 2.2.2 (Pause/Stop/Hide) is Level A — the legal floor
|
|
104
|
+
under ADA Title II 2024 / EN 301 549 / EAA — but it names cognitive,
|
|
105
|
+
attentional, and reading populations, not vestibular. Vestibular
|
|
106
|
+
language lives in 2.3.3, which is **AAA**. Don't conflate the two.
|
|
107
|
+
Building for vestibular users is a craft commitment beyond the legal
|
|
108
|
+
floor, not a WCAG mandate.
|
|
109
|
+
|
|
110
|
+
**Flashing limits.** WCAG 2.3.1 (Level A) permits flashing only when
|
|
111
|
+
there are no more than three flashes within any one-second period, or
|
|
112
|
+
the flashing area stays below the general and red flash thresholds.
|
|
113
|
+
WCAG 2.3.2 (AAA) forbids flashing more than three times within any
|
|
114
|
+
one-second period, regardless of area or brightness. The protected
|
|
115
|
+
concern is photosensitive epilepsy; the legal floor isn't negotiable. For gamified UI, onboarding celebrations, sparkles,
|
|
116
|
+
confetti, level-up bursts, and shimmer: avoid rapid flashing unless
|
|
117
|
+
tested against the thresholds, and prefer one-shot animations over
|
|
118
|
+
loops.
|
|
119
|
+
|
|
120
|
+
## Repeated and ambient motion
|
|
121
|
+
|
|
122
|
+
The rules above target one-shot transitions. Looping motion (skeleton
|
|
123
|
+
shimmer, idle backgrounds, autoplay, reward bursts) has different
|
|
124
|
+
constraints.
|
|
125
|
+
|
|
126
|
+
- Cap iteration count: carousels at 3-5 cycles then pause; skeleton shimmer until content lands, never indefinitely.
|
|
127
|
+
- WCAG 2.2.2 (Level A) requires a pause control for any motion running longer than 5 seconds — moving, blinking, or scrolling content, not only video.
|
|
128
|
+
- Cancel ambient motion on route change.
|
|
129
|
+
- Reward animations are one-shot. Confetti, sparkles, level-up bursts fire once and dismiss; no looping timer.
|
|
130
|
+
- Spinners must not run indefinitely. Escalate to progress/cancel states and stop animation at 60 s, matching `state-coverage.md`.
|
|
131
|
+
|
|
132
|
+
## Cross-platform handoff
|
|
133
|
+
|
|
134
|
+
Native conventions diverge.
|
|
135
|
+
|
|
136
|
+
- **iOS** uses spring physics with perceptual `(response, dampingFraction)` parameters. Apple HIG documents principles, not numerical curves; the SwiftUI Animation API JSON is the source for actual numbers. UIView curve cubic-beziers commonly cited online are reverse-engineered, not Apple-published.
|
|
137
|
+
- **Android** uses cubic-bezier curves through M3 motion tokens (50–1000 ms range, 16 named durations). Predictive back is a *gesture-progress primitive*, not a transition primitive — `BackEvent.progress` is sampled per-frame from the touch stream and the destination is rendered behind the current surface while still on it. Cancellation is a first-class lifecycle state.
|
|
138
|
+
- **Web** has the View Transitions API (default 0.25 s, no easing specified by the spec — falls through to CSS `ease`). Same-document support 90.94%; cross-document 87.82%. Cross-document is same-origin and user-initiated only.
|
|
139
|
+
|
|
140
|
+
A "one curve fits all platforms" approach loses on each. If the brief
|
|
141
|
+
specifies platform fidelity, follow the platform; if it specifies brand
|
|
142
|
+
consistency, pick one motion vocabulary and apply it everywhere.
|
|
143
|
+
|
|
144
|
+
## Common mistakes (lint these)
|
|
145
|
+
|
|
146
|
+
- "Skeleton screens feel 11% faster" — Harrison/Yeo/Hudson CHI 2010 measured *backwards-decelerating ribbed determinate progress bars* (n=16). The induced-motion mechanism doesn't transfer to skeletons.
|
|
147
|
+
- "Heer & Robertson recommend 300–1000 ms eased transitions" — they tested 1.25 s and 2 s only. Their recommendation is "~1 second per stage".
|
|
148
|
+
- "Doherty Threshold = 400 ms" — the 1982 paper does not contain "400". The lowest threshold actually measured is 300 ms.
|
|
149
|
+
- M2 standard easing `cubic-bezier(0.4, 0, 0.2, 1)` labelled as "Material 3". M3's standard is `cubic-bezier(0.2, 0, 0, 1)`.
|
|
150
|
+
- Animations that *perform* a state change rather than *confirming* one that has already happened. Optimistic UI first; motion second.
|
|
151
|
+
- More than 500 ms on any non-cross-screen transition.
|
|
152
|
+
- Animation as the only signal of state change. Reduced-motion users miss it; always pair with a static affordance (color, position, label).
|
|
153
|
+
- Ignoring `prefers-reduced-motion` on transform-based animations — the highest-cost vestibular triggers.
|
|
154
|
+
- Curve-based animation on a `transform: scale()` that should feel physical. Use a spring.
|
|
155
|
+
- Hero choreography in productivity tools. Motion budget belongs inside the product on functional micro-feedback, not on landing-page sequences.
|
|
156
|
+
- Decorative motion in the working canvas of a productivity tool.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<!-- Vendored from nexu-io/open-design@78d5637cb49d (craft/anti-ai-slop.md), Apache-2.0, Copyright 2026 Open Design contributors. Modified by Pugi: this header line added; the text below is otherwise verbatim. Paths it names (apps/daemon/src/lint-artifact.ts, pnpm lint:craft, od.craft.requires) are upstream's, not Pugi's: the Pugi port of the linter is packages/opencode/src/session/design-lint.ts. See NOTICE.md in the skill root. -->
|
|
2
|
+
|
|
3
|
+
# Anti-AI-slop rules
|
|
4
|
+
|
|
5
|
+
Concrete, checkable rules that distinguish "designed by a human who has
|
|
6
|
+
shipped product" from "default LLM output." Several rules below are
|
|
7
|
+
auto-enforced by the daemon's `lint-artifact` linter — failing an
|
|
8
|
+
enforced rule is not a style preference, it is a regression. The
|
|
9
|
+
rest are guidance for agents and reviewers and are flagged inline as
|
|
10
|
+
"(guidance, not auto-checked)" so the contract with the linter stays
|
|
11
|
+
honest.
|
|
12
|
+
|
|
13
|
+
> Adapted from [refero_skill](https://github.com/referodesign/refero_skill)
|
|
14
|
+
> (MIT), tightened to match OpenDesign's lint surface.
|
|
15
|
+
|
|
16
|
+
## The seven cardinal sins
|
|
17
|
+
|
|
18
|
+
These are the patterns the linter blocks at P0 (must-fix):
|
|
19
|
+
|
|
20
|
+
1. **Default Tailwind indigo as accent** — exactly `#6366f1`, `#4f46e5`,
|
|
21
|
+
`#4338ca`, `#3730a3`, `#8b5cf6`, `#7c3aed`, `#a855f7`. The active
|
|
22
|
+
`DESIGN.md` provides `--accent`; use it. Indigo is the textbook AI
|
|
23
|
+
tell. (The daemon's `lint-artifact` flags any of these as a solid
|
|
24
|
+
accent; keep this list in sync with `AI_DEFAULT_INDIGO` in
|
|
25
|
+
`apps/daemon/src/lint-artifact.ts`.)
|
|
26
|
+
2. **Two-stop "trust" gradient on the hero** — purple→blue, blue→cyan,
|
|
27
|
+
indigo→pink. A flat surface + intentional type beats this every
|
|
28
|
+
time.
|
|
29
|
+
3. **Emoji as feature icons** — `✨`, `🚀`, `🎯`, `⚡`, `🔥`, `💡`
|
|
30
|
+
inside `<h*>`, `<button>`, `<li>`, or `class*="icon"`. Use
|
|
31
|
+
1.6–1.8px-stroke monoline SVG with `currentColor`.
|
|
32
|
+
4. **Sans-serif on display text when the seed binds a serif** — h1/h2
|
|
33
|
+
must use `var(--font-display)`, not a hardcoded Inter / Roboto /
|
|
34
|
+
`system-ui`.
|
|
35
|
+
5. **Rounded card with a colored left-border accent** — the canonical
|
|
36
|
+
"AI dashboard tile" shape. Drop either the radius or the left
|
|
37
|
+
border.
|
|
38
|
+
6. **Invented metrics** — "10× faster", "99.9% uptime", "3× more
|
|
39
|
+
productive". Either pull from a real source or use a labelled
|
|
40
|
+
placeholder.
|
|
41
|
+
7. **Filler copy** — `lorem ipsum`, `feature one / two / three`,
|
|
42
|
+
`placeholder text`, `sample content`. An empty section is a design
|
|
43
|
+
problem to solve with composition, not by inventing words.
|
|
44
|
+
|
|
45
|
+
## Soft tells (P1 — should fix)
|
|
46
|
+
|
|
47
|
+
- **Standard "Hero → Features → Pricing → FAQ → CTA" sequence with no
|
|
48
|
+
variation** *(guidance, not auto-checked)*. This is the AI-template
|
|
49
|
+
skeleton; introduce at least one unconventional section (testimonial
|
|
50
|
+
wall as full-bleed quote, pricing as comparison-against-status-quo,
|
|
51
|
+
an inline mini-product-demo).
|
|
52
|
+
- **External placeholder image CDNs** (`unsplash.com`, `placehold.co`,
|
|
53
|
+
`placekitten.com`, `picsum.photos`). Fragile and obvious. Use the
|
|
54
|
+
shipped `.ph-img` placeholder class.
|
|
55
|
+
- **More than ~12 raw hex values outside `:root`.** Tokens were not
|
|
56
|
+
honoured.
|
|
57
|
+
- **`var(--accent)` used 6+ times in the rendered body.** Cap at 2
|
|
58
|
+
visible uses per screen.
|
|
59
|
+
|
|
60
|
+
## Polish tells (P2 — nice to fix)
|
|
61
|
+
|
|
62
|
+
- **Sections without `data-od-id`** — comment mode can't target them.
|
|
63
|
+
- **Decorative blob / wave SVG backgrounds** *(guidance, not
|
|
64
|
+
auto-checked)* — meaningless geometry.
|
|
65
|
+
- **Perfect symmetric layout with no visual tension** *(guidance, not
|
|
66
|
+
auto-checked)* — alternating density (one tight section, one
|
|
67
|
+
breathing section) reads as intentional.
|
|
68
|
+
|
|
69
|
+
## How to add soul without breaking the rules
|
|
70
|
+
|
|
71
|
+
Aim for **~80% proven patterns + ~20% distinctive choice**. The 20%
|
|
72
|
+
should live in:
|
|
73
|
+
|
|
74
|
+
- One bold visual move — a typography choice, a single color decision,
|
|
75
|
+
an unexpected proportion.
|
|
76
|
+
- Voice and microcopy — a button that says "Start tracking" beats one
|
|
77
|
+
that says "Get started".
|
|
78
|
+
- One micro-interaction the user will remember — a button press that
|
|
79
|
+
moves 2px, a number that counts up.
|
|
80
|
+
- One detail that could only have been put there by someone who used
|
|
81
|
+
the product (a subtle kbd shortcut hint, a status badge with
|
|
82
|
+
product-specific phrasing).
|
|
83
|
+
|
|
84
|
+
If a reviewer screenshots the artifact and someone outside the project
|
|
85
|
+
can identify which product it's from — you have soul. If not, you
|
|
86
|
+
shipped a template.
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<!-- Vendored from nexu-io/open-design@78d5637cb49d (craft/color.md), Apache-2.0, Copyright 2026 Open Design contributors. Modified by Pugi: this header line added; the text below is otherwise verbatim. Paths it names (apps/daemon/src/lint-artifact.ts, pnpm lint:craft, od.craft.requires) are upstream's, not Pugi's: the Pugi port of the linter is packages/opencode/src/session/design-lint.ts. See NOTICE.md in the skill root. -->
|
|
2
|
+
|
|
3
|
+
# Color craft rules
|
|
4
|
+
|
|
5
|
+
Universal color rules applied on top of the active `DESIGN.md`. The
|
|
6
|
+
design system supplies the palette tokens; this file enforces how to
|
|
7
|
+
*use* them.
|
|
8
|
+
|
|
9
|
+
> Adapted from [refero_skill](https://github.com/referodesign/refero_skill)
|
|
10
|
+
> (MIT). All examples reference OpenDesign's standard tokens
|
|
11
|
+
> (`--bg`, `--surface`, `--fg`, `--muted`, `--border`, `--accent`).
|
|
12
|
+
|
|
13
|
+
## Palette structure
|
|
14
|
+
|
|
15
|
+
A coherent palette has four layers. Plan all four before writing any CSS.
|
|
16
|
+
|
|
17
|
+
| Layer | Share of pixels | Tokens |
|
|
18
|
+
|---|---|---|
|
|
19
|
+
| **Neutrals** | 70–90% | `--bg`, `--surface`, `--fg`, `--muted`, `--border` |
|
|
20
|
+
| **Accent** (one) | 5–10% | `--accent` only — never invent a second accent |
|
|
21
|
+
| **Semantic** | 0–5% | `--success`, `--warn`, `--danger` |
|
|
22
|
+
| **Effect** | <1% | gradients, glows; rarely justified |
|
|
23
|
+
|
|
24
|
+
## Accent discipline
|
|
25
|
+
|
|
26
|
+
The single biggest readability failure in AI-generated UIs is accent
|
|
27
|
+
overuse. Hard caps:
|
|
28
|
+
|
|
29
|
+
- **At most 2 visible uses of `--accent` per screen.** Typical pair:
|
|
30
|
+
one eyebrow / chip + one primary CTA. Or one accent card + one tab
|
|
31
|
+
pill. Pick a pair, not a flood.
|
|
32
|
+
- Links count as accent; demote to `--fg` underline if you also have a
|
|
33
|
+
CTA on the same screen.
|
|
34
|
+
- Hover/focus rings count as accent. Ration accordingly.
|
|
35
|
+
|
|
36
|
+
## Contrast minimums
|
|
37
|
+
|
|
38
|
+
Run these as gates, not goals:
|
|
39
|
+
|
|
40
|
+
| Pair | Minimum |
|
|
41
|
+
|---|---|
|
|
42
|
+
| Body text (≤16 px) on background | **4.5:1** |
|
|
43
|
+
| Large text (>18 px or 14 px bold) | **3:1** |
|
|
44
|
+
| UI components against adjacent surfaces | **3:1** |
|
|
45
|
+
|
|
46
|
+
When the brand color clashes (low-contrast indigo on light background is
|
|
47
|
+
common), darken the accent to a `600`-level shade for text use; reserve
|
|
48
|
+
the brand-bright variant for fills only.
|
|
49
|
+
|
|
50
|
+
## Dark themes
|
|
51
|
+
|
|
52
|
+
Avoid pure black and pure white — both cause vibration and eye strain.
|
|
53
|
+
|
|
54
|
+
| Token | Dark theme | Light theme |
|
|
55
|
+
|---|---|---|
|
|
56
|
+
| Background | `#0f0f0f` (not `#000`) | `#fafafa` (not `#fff`) |
|
|
57
|
+
| Foreground | `#f0f0f0` (not `#fff`) | `#111111` (not `#000`) |
|
|
58
|
+
|
|
59
|
+
On dark surfaces, prefer **semi-transparent white borders** over solid
|
|
60
|
+
dark borders — a 1px `rgba(255,255,255,0.08)` reads as structure
|
|
61
|
+
without adding visual noise.
|
|
62
|
+
|
|
63
|
+
## Semantic color naming
|
|
64
|
+
|
|
65
|
+
Always name tokens by **purpose**, never by hue:
|
|
66
|
+
|
|
67
|
+
```css
|
|
68
|
+
/* good */
|
|
69
|
+
--accent: #2f6feb;
|
|
70
|
+
--success: #17a34a;
|
|
71
|
+
|
|
72
|
+
/* bad — locks you out of theming */
|
|
73
|
+
--blue-500: #2f6feb;
|
|
74
|
+
--green-500: #17a34a;
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Anti-defaults
|
|
78
|
+
|
|
79
|
+
- **Indigo `#6366f1`** (Tailwind `indigo-500`) is the most reliable
|
|
80
|
+
AI-slop tell. The active `DESIGN.md` provides `--accent`; use it. If
|
|
81
|
+
the brief truly needs indigo, make the user say so explicitly. If
|
|
82
|
+
your `DESIGN.md` encodes indigo as `--accent`, that is intentional —
|
|
83
|
+
the linter only flags hardcoded hex, so `var(--accent)` uses are
|
|
84
|
+
unaffected even when the resolved color happens to be `#6366f1`.
|
|
85
|
+
- **Two-stop "trust" gradient** (purple → blue, blue → cyan, etc.) on a
|
|
86
|
+
hero is the second most reliable tell. A flat surface + one
|
|
87
|
+
type-driven hierarchy beats it every time.
|
|
88
|
+
- **Decorative gradients with no functional purpose**. Gradients should
|
|
89
|
+
separate hierarchies (header → body, primary CTA → secondary), not
|
|
90
|
+
decorate empty space.
|