@ericrisco/rsc 3.3.1 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/README.md +3 -3
  2. package/manifest.json +43 -22
  3. package/package.json +1 -1
  4. package/scripts/lib/default-skill-floor.js +5 -1
  5. package/scripts/lib/domains.js +2 -2
  6. package/scripts/lib/retired-skills.js +4 -0
  7. package/scripts/rsc.js +1 -1
  8. package/skills/design/SKILL.md +4 -3
  9. package/skills/design/evals/cases.yaml +2 -2
  10. package/skills/ftd/SKILL.md +1 -1
  11. package/skills/react/SKILL.md +2 -1
  12. package/skills/ux/SKILL.md +149 -0
  13. package/skills/ux/THIRD_PARTY.md +32 -0
  14. package/skills/ux/evals/cases.yaml +40 -0
  15. package/skills/ux/references/flows.md +124 -0
  16. package/skills/ux/upstream/UPSTREAM.json +59 -0
  17. package/skills/ux/upstream/ux-designer/GUIDE.md +180 -0
  18. package/skills/ux/upstream/ux-designer/LICENSE +21 -0
  19. package/skills/ux/upstream/ux-designer/references/01-core-principles.md +251 -0
  20. package/skills/ux/upstream/ux-designer/references/02-laws-of-ux.md +330 -0
  21. package/skills/ux/upstream/ux-designer/references/03-accessibility.md +411 -0
  22. package/skills/ux/upstream/ux-designer/references/04-visual-design.md +433 -0
  23. package/skills/ux/upstream/ux-designer/references/05-information-architecture.md +432 -0
  24. package/skills/ux/upstream/ux-designer/references/06-interaction-design.md +495 -0
  25. package/skills/ux/upstream/ux-designer/references/07-forms-and-inputs.md +491 -0
  26. package/skills/ux/upstream/ux-designer/references/08-mobile-ux.md +539 -0
  27. package/skills/ux/upstream/ux-designer/references/09-ux-writing.md +493 -0
  28. package/skills/ux/upstream/ux-designer/references/10-user-research.md +533 -0
  29. package/skills/ux/upstream/ux-designer/references/11-design-systems.md +618 -0
  30. package/skills/ux/upstream/ux-designer/references/12a-presence-awareness.md +395 -0
  31. package/skills/ux/upstream/ux-designer/references/12b-conflict-resolution-sync.md +420 -0
  32. package/skills/ux/upstream/ux-designer/references/13a-canvas-navigation.md +388 -0
  33. package/skills/ux/upstream/ux-designer/references/13b-canvas-objects-performance.md +559 -0
  34. package/skills/ux/upstream/ux-designer/references/14-ai-ux-patterns.md +511 -0
  35. package/skills/ux/upstream/ux-designer/references/15-ethical-design.md +419 -0
  36. package/skills/ux/upstream/ux-designer/references/16-onboarding.md +430 -0
  37. package/skills/ux/upstream/ux-designer/references/17-notifications.md +461 -0
  38. package/skills/ux/upstream/ux-designer/references/18-data-visualization.md +453 -0
  39. package/skills/ux/upstream/ux-designer/references/19-search-ux.md +479 -0
  40. package/skills/ux/upstream/ux-designer/references/20-emotional-design.md +382 -0
  41. package/skills/ux/upstream/ux-designer/references/21-data-tables.md +629 -0
  42. package/skills/ux/upstream/ux-designer/references/22-performance-ux.md +626 -0
  43. package/skills/ux/upstream/ux-designer/references/23-internationalization.md +347 -0
  44. package/skills/ux/upstream/ux-designer/references/24-voice-and-multimodal.md +308 -0
  45. package/skills/ux/upstream/ux-designer/references/25a-barcode-camera-scanning.md +342 -0
  46. package/skills/ux/upstream/ux-designer/references/25b-barcode-scanner-workflows.md +412 -0
  47. package/skills/ux/upstream/ux-designer/references/25c-barcode-display.md +277 -0
  48. package/skills/ux/upstream/ux-usability-foundations/GUIDE.md +285 -0
  49. package/skills/ux/upstream/ux-usability-foundations/LICENSE +21 -0
  50. package/skills/ux/upstream/ux-usability-foundations/references/anti-patterns.md +267 -0
  51. package/skills/ux/upstream/ux-usability-foundations/references/checklists.md +130 -0
  52. package/skills/ux/upstream/ux-usability-foundations/references/decision-prompts.md +340 -0
  53. package/skills/ux/upstream/ux-usability-foundations/references/principle-cards.md +449 -0
  54. package/skills/worktrees/SKILL.md +19 -5
  55. package/targets/branch-guard.mjs +59 -4
  56. package/targets/clone-bootstrap.mjs +1 -1
  57. package/targets/session-memory-adapter.mjs +2 -2
  58. package/targets/team-safe-start.mjs +1 -0
  59. package/targets/worktree-reaper.mjs +14 -1
  60. package/skills/ui-engineering/SKILL.md +0 -113
  61. package/skills/ui-engineering/evals/cases.yaml +0 -38
@@ -0,0 +1,277 @@
1
+ # Displaying Barcodes & QR Codes
2
+
3
+ This file covers codes that *your* UI shows for someone else to scan: tickets, boarding
4
+ passes, loyalty cards, wallet passes, QR login and pairing, payment QR, kiosk and slide
5
+ codes, and printed labels and receipts. Most failures here are physical. The module is
6
+ too small, the quiet zone is clipped, the theme inverts the code, or the scanner at the
7
+ gate is a laser. The UX work is making the code big, clean, bright, and instantly
8
+ retrievable, plus a fallback for when it still won't scan.
9
+
10
+ > Scanning codes with the phone camera: [25a-barcode-camera-scanning.md](25a-barcode-camera-scanning.md).
11
+ > Hardware scanners and scan-driven apps, plus the symbology/GS1 primer:
12
+ > [25b-barcode-scanner-workflows.md](25b-barcode-scanner-workflows.md).
13
+ > Short version of the primer: QR/DataMatrix/Aztec are 2D and read by camera imagers;
14
+ > PDF417 is stacked-linear; EAN/UPC/Code 128 are 1D and the only kind a laser can read.
15
+
16
+ ---
17
+
18
+ ## Contents
19
+
20
+ - Choosing the Symbology & Payload
21
+ - Sizing: Modules, Quiet Zone, Distance
22
+ - Error Correction, Contrast & Polarity
23
+ - Presenting the Code on a Screen
24
+ - Brightness & Wake Lock
25
+ - Dark Mode & Forced Inversion
26
+ - Fast Retrieval & Offline Access
27
+ - Wallet Passes
28
+ - Security: Rotating Codes & Screenshots
29
+ - QR Login & Device Pairing
30
+ - Payment QR (EMVCo)
31
+ - Human-Readable Fallback
32
+ - Codes on Kiosks, Slides & Signage
33
+ - Print: Labels, Receipts, Boarding Passes
34
+ - Quick Checklist
35
+ - Common Mistakes
36
+ - Sources
37
+
38
+ ---
39
+
40
+ ## Choosing the Symbology & Payload
41
+
42
+ | Use | Symbology | Why |
43
+ |---|---|---|
44
+ | Phone screen, general | QR | Universal camera support, square, fits portrait screens |
45
+ | Boarding pass (mobile) | Aztec, QR or DataMatrix | IATA BCBP (Res. 792) allows all three with no preference; readers should support all three |
46
+ | Boarding pass (paper) | PDF417 (default) | IATA; 2D matrix allowed since BCBP v7 |
47
+ | Retail product, 2D | GS1 DataMatrix or QR with GS1 Digital Link | GS1 2D-in-retail |
48
+ | Must be read by legacy laser scanners | 1D (Code 128, EAN) **on paper** | Lasers can't read 2D and can't reliably read screens |
49
+ | Apple Watch | QR (square) | Rectangular codes get rotated; Code 128 is not shown on watchOS |
50
+
51
+ - **Encode an ID, not the data.** A short payload means a lower QR version, which means
52
+ bigger modules at the same physical size. Apple notes that the most common use of a
53
+ pass barcode is a unique ID that points to server records.
54
+ - For Wallet passes, send a **fallback array** of formats. The first one the OS supports is
55
+ shown (e.g. EAN-13 on iOS 27+, QR on older versions).
56
+ - Use `iso-8859-1` message encoding for pass barcodes. Scanners handle Unicode poorly.
57
+
58
+ ## Sizing: Modules, Quiet Zone, Distance
59
+
60
+ Size is set by the **module** (the smallest square or bar), not by the image. A bigger
61
+ image with a denser code doesn't help.
62
+
63
+ | Rule | Value | Source |
64
+ |---|---|---|
65
+ | QR quiet zone | **4 modules** on all sides | ISO/IEC 18004, DENSO WAVE, GS1 |
66
+ | Micro QR quiet zone | 2 modules | DENSO WAVE |
67
+ | DataMatrix quiet zone | 1 module | GS1 |
68
+ | Aztec quiet zone | none (central finder) | IATA BCBP guide |
69
+ | EAN-13 / EAN-8 / ITF-14 & GS1-128 quiet zone | 11X left + 7X right / 7X / 10X | GS1 |
70
+ | Module on a screen | **≥ 0.25 mm physical** | IATA BCBP guide |
71
+ | Module in print, standard scanners | ≥ 0.25 mm, ≥ 4 printer dots | DENSO WAVE |
72
+ | GS1 retail 2D X-dimension | min 0.396 / target 0.495 / max 0.990 mm | GS1 |
73
+ | Minimum printed QR | 2 × 2 cm | NN/g (heuristic) |
74
+ | Distance | +1 cm of code per 10 cm of scan distance (~10:1) | NN/g (heuristic, not in ISO) |
75
+
76
+ - **Screens:** high-density displays can make a code physically tiny. Size it in physical
77
+ units (mm/pt), not device pixels. Render with an **integer number of device pixels per
78
+ module** and no smoothing (`image-rendering: pixelated` when upscaling a bitmap; SVG
79
+ with `shape-rendering: crispEdges`). Fractional scaling blurs module edges. No
80
+ standard gives a minimum pixel count; the "≥150 px" figures online come from vendor blogs.
81
+ - **Scanner side:** camera decoders need the smallest module to cover about 2 camera
82
+ pixels or more (ML Kit). That's why a code that's fine up close fails from a distance.
83
+ - **Quiet zone** is part of the code. Anything that intrudes on it (a border, rounded
84
+ screen corner, notch, toast, cookie bar, home indicator) can break decoding.
85
+
86
+ ## Error Correction, Contrast & Polarity
87
+
88
+ - **QR error correction:** L 7%, M 15%, Q 25%, H 30% of codewords recoverable.
89
+ **Default to M** (DENSO: the most commonly chosen level). Use Q/H only for dirty or damaged
90
+ environments or a centre logo. Higher levels make the symbol denser.
91
+ - **Logos** use up error-correction capacity (GS1). If you add one, raise the level and test.
92
+ - **Contrast:** dark modules on a light background, two colours only. **Don't use red for
93
+ dark modules**, because scanners and verifiers use red light (GS1). Don't reshape modules
94
+ (dots, hearts) or warp the grid.
95
+ - **Inverted (light-on-dark):** ISO 18004 allows it and GS1 requires POS imagers to read
96
+ it, but many camera decoders don't (ZXing needs `TryInverted`, and ML Kit has open
97
+ issues). **Always render dark-on-light**, even in a dark UI.
98
+
99
+ ## Presenting the Code on a Screen
100
+
101
+ - Give the code a **dedicated screen or sheet**: the code as large as fits the width, the
102
+ holder's name and seat/gate/date above it, and nothing animated over it.
103
+ - In a dark theme, put the code on its **own white card that includes the quiet zone**.
104
+ - Keep the code clear of notches, rounded corners, sticky headers, toasts, and banners.
105
+ - Prefer portrait for QR/Aztec. A long 1D code may need a rotate-to-landscape option or
106
+ a 2D alternative.
107
+ - Several tickets: one per page with a pager ("2 of 4") and swipe, so staff can scan them
108
+ in sequence. Don't show them in a scrolling list of small codes.
109
+ - Decorative motion (Ticketmaster's sweeping line) is a visual anti-screenshot cue only.
110
+ The security comes from the rotating code underneath.
111
+
112
+ ## Brightness & Wake Lock
113
+
114
+ | Platform | Mechanism | Behaviour |
115
+ |---|---|---|
116
+ | iOS | `UIScreen.main.brightness = 1.0` | Persists **until device lock, even after the app closes**. Save the old value and restore it when the code screen closes or backgrounds |
117
+ | Android | `WindowManager.LayoutParams.screenBrightness = BRIGHTNESS_OVERRIDE_FULL` | Per window; reverts automatically when the window leaves the front |
118
+ | Web | **none** | The Screen Brightness API is only a WICG proposal. Ask the user: "Turn up brightness for faster scanning" |
119
+ | Web | `navigator.wakeLock.request('screen')` | Keeps the screen from dimming or locking (Baseline 2025, HTTPS). Released when the page is hidden; re-request on `visibilitychange`. Doesn't change brightness |
120
+
121
+ - Boost brightness **only while the code is visible**, and restore it on exit.
122
+ - Apple Wallet maxes brightness with no opt-out, and light-sensitive users complain
123
+ about it (community reports; not documented by Apple). Offer an in-app toggle if your
124
+ audience includes photosensitive users.
125
+
126
+ ## Dark Mode & Forced Inversion
127
+
128
+ - Chrome Auto Dark Theme, Vivaldi, and some email clients (Outlook for Windows) recolor
129
+ pages and can **invert QR codes**. Forced dark broke WhatsApp Web's login QR.
130
+ - Opt the code out with `color-scheme: only light` on its container (or
131
+ `<meta name="color-scheme" content="only light">` for the whole page).
132
+ - CSS, SVG, or canvas-drawn codes are more at risk than `<img>`. In email, bake a white
133
+ quiet zone into the image and preview it in dark mode.
134
+
135
+ ## Fast Retrieval & Offline Access
136
+
137
+ The code gets used at a turnstile, with a queue behind the user and bad signal.
138
+
139
+ - **Save for offline on first view** and say so ("Available offline"). Never make the
140
+ code depend on a network fetch at the gate.
141
+ - Offer **Add to Apple Wallet / Google Wallet**. Wallet passes can surface on the lock
142
+ screen near the right time or place.
143
+ - Put the next upcoming ticket **one tap from app launch** (home card or widget), not
144
+ behind Orders → Order → Ticket.
145
+ - Email is the weakest channel. IATA notes you have little control over how the code
146
+ renders there. Link from the email to the app, wallet, or a mobile-optimized page.
147
+ - Give a fallback path on the ticket screen: order number, and "show ID at the desk".
148
+
149
+ ## Wallet Passes
150
+
151
+ - Put the barcode through the pass APIs, **never baked into a pass image** (Apple HIG).
152
+ - **Apple:** `barcodes` array (QR, PDF417, Aztec, Code 128; iOS 27 adds Code 39, Codabar,
153
+ EAN-13, ITF). `altText` shows under the code, but **not on watchOS**. Lock-screen
154
+ relevance comes from `relevantDate` and up to 10 `locations`/`beacons`.
155
+ - **Google:** `BarcodeType` covers the common 1D and 2D types; `alternateText` is the
156
+ human-readable fallback. Rotating barcodes (below) exist for PDF417 and QR only.
157
+ - A signed payload lets a gate verify offline, but it can't carry changing state such
158
+ as balances or single-use coupons.
159
+
160
+ ## Security: Rotating Codes & Screenshots
161
+
162
+ - **Rotating codes are the real control.** Google Wallet rotating barcodes use TOTP
163
+ (RFC 6238), typically rotating every minute. Ticketmaster SafeTix rotates every 15 s
164
+ (vendor claim). The scanner accepts only the current value, plus a server-side
165
+ single-use check.
166
+ - **Screenshot blocking isn't security.** Someone can photograph the screen with another
167
+ phone. iOS has no public API to block screenshots; it can only detect them after the
168
+ fact (`userDidTakeScreenshotNotification`) or detect recording (`UIScreen.isCaptured`).
169
+ Android `FLAG_SECURE` blanks screenshots but is unreliable on older versions. The
170
+ Android 14 screenshot-detection API shows a system toast, so explain it in context.
171
+ - Don't block screenshots of codes users legitimately need to keep, such as boarding
172
+ passes and static loyalty cards. Blocking them breaks offline access and helps no one.
173
+ - If a static fallback exists for rotating codes, it undoes most of the protection (Google).
174
+
175
+ ## QR Login & Device Pairing
176
+
177
+ A QR that signs in or links a device is a phishing target: QRLJacking (OWASP),
178
+ "free Nitro" Discord QR scams, and device-code phishing (Microsoft's Storm-2372, 2024–26).
179
+
180
+ **Displaying device (TV, desktop, new device):**
181
+ - Say what the code does and which app scans it: "Scan with the *App* app on your phone
182
+ to sign in on this TV."
183
+ - Show the **short URL and a typed code** next to the QR. RFC 8628 requires the
184
+ `user_code` to be shown and recommends the text URL. Use a confusable-free alphabet in
185
+ dash-separated groups (e.g. `WDJB-MJHT`).
186
+ - Short lifetime, auto-refresh, and a visible countdown. Warn "Never scan a sign-in code
187
+ someone sent you."
188
+
189
+ **Approving device (the phone that scans):**
190
+ - Show what's being authorized: device type, app, approximate location or IP, and time.
191
+ - Require explicit confirmation plus re-authentication (WhatsApp asks for biometrics or
192
+ a passcode before linking a device).
193
+ - Make "This wasn't me" as prominent as "Approve".
194
+
195
+ ## Payment QR (EMVCo)
196
+
197
+ - **Merchant-presented (MPM):** the merchant shows the code and the payer's *payment app*
198
+ scans it. The OS camera usually can't handle it, so signage should name the accepted apps.
199
+ Static codes (`11`, a counter sticker) vs dynamic (`12`, per transaction with the amount).
200
+ - **Consumer-presented (CPM):** the payer's phone shows the code and the merchant's scanner
201
+ reads it. The display rules in this file apply: brightness, offline-generated if possible,
202
+ a short validity window.
203
+ - The payer app shows the **merchant name and amount before confirmation**.
204
+ - Payload ≤ 512 characters. EMVCo sets no size or error-correction rules of its own, so
205
+ use ISO 18004 and DENSO guidance.
206
+
207
+ ## Human-Readable Fallback
208
+
209
+ - Always pair the code with a **human-readable value** that staff can key in: Apple
210
+ `altText`, Google `alternateText`, a printed number under the code.
211
+ - Retail items with **only** a 2D code must print the 14-digit GTIN as HRI (GS1). GS1
212
+ logistics labels use HRI ≥ 3 mm high, in a legible font such as OCR-B.
213
+ - For marketing and login codes, show a short, typeable URL as well (NN/g).
214
+
215
+ ## Codes on Kiosks, Slides & Signage
216
+
217
+ - QR codes carry no information scent, so **label where the code goes and why to scan it**
218
+ (NN/g).
219
+ - Leave a slide or screen code up for **≥ 15 s** so people can find their phone (NN/g).
220
+ - Size for the farthest viewer with the 10:1 heuristic, and mount signage at a height
221
+ that doesn't force a steep camera angle.
222
+ - Kiosk printers and screens: test with the actual scanners and paper stock before launch.
223
+
224
+ ## Print: Labels, Receipts, Boarding Passes
225
+
226
+ - Print quality grades: ISO/IEC 15416 (1D) and 15415 (2D), A–F. The overall grade is the
227
+ worst parameter. GS1 retail 2D minimum is **1.5/12/660**; many distributors require B.
228
+ - Thermal printers: 200 dpi → 0.5–0.75 mm modules; 300 dpi → 0.33–0.5 mm (4–6 dots per module).
229
+ - Don't truncate 1D bar height (GS1 EAN-13 minimum height is 18.28 mm).
230
+ - Boarding pass PDF417: narrow element ≥ 0.25 mm, height ≥ 6.35 mm. Place it near the
231
+ page edge so a mounted scanner's foot doesn't cover it (IATA).
232
+ - During the retail 2D transition, keep the 1D and 2D codes within 50 mm of each other (GS1).
233
+
234
+ ---
235
+
236
+ ## Quick Checklist
237
+
238
+ - [ ] Payload is a short ID/URL; symbology fits the scanner and screen (QR default)
239
+ - [ ] Quiet zone intact (QR 4 modules) and clear of UI chrome, notches, and overlays
240
+ - [ ] Module ≥ 0.25 mm physical; integer device pixels per module; no smoothing
241
+ - [ ] Dark-on-light, two colours, not red; opted out of forced dark (`color-scheme: only light`)
242
+ - [ ] Error correction M by default; H only with a logo or harsh conditions, then tested
243
+ - [ ] Brightness boosted only while the code is shown and restored on exit (iOS!); wake lock on web
244
+ - [ ] Available offline, one tap from launch, Add to Wallet offered
245
+ - [ ] Human-readable value and a staff fallback (order number / ID) visible
246
+ - [ ] Anti-fraud uses rotating codes + server checks, not screenshot blocking
247
+ - [ ] Login/pairing QR: says what it does, has a typed code, expires; the approver sees device details and re-auths
248
+ - [ ] Printed codes verified to grade (GS1 ≥ 1.5, target B) with the real printer and stock
249
+
250
+ ## Common Mistakes
251
+
252
+ - Inverting the code with a dark theme, or letting the browser force-dark it
253
+ - Showing a dense code at a fixed pixel size that comes out physically tiny on a high-DPI phone
254
+ - Cropping the quiet zone with a card border or rounded corner
255
+ - Code only reachable online, or buried several screens deep
256
+ - Leaving the screen at full brightness after the user leaves (iOS persists it until lock)
257
+ - Expecting laser scanners to read a code from a phone screen
258
+ - Relying on screenshot blocking instead of rotating codes
259
+ - A login QR with no explanation, no typed alternative, and an approver screen that doesn't say what it's approving
260
+ - Stylized QR codes (coloured, rounded dots, big logos) shipped without testing on several decoders
261
+
262
+ ---
263
+
264
+ ## Sources
265
+
266
+ - [DENSO WAVE — QR Code quiet zone, module size, error correction](https://www.qrcode.com/en/howto/code.html) · [cell size](https://www.qrcode.com/en/howto/cell.html) · [error correction](https://www.qrcode.com/en/about/error_correction.html)
267
+ - [ISO/IEC 18004:2024 preview](https://cdn.standards.iteh.ai/samples/83389/dee29007cb62437f9767323e6af02f90/ISO-IEC-18004-2024.pdf)
268
+ - [GS1 — 2D barcodes in retail](https://ref.gs1.org/guidelines/2d-in-retail/) · [Solution provider 2D readiness](https://ref.gs1.org/sme-guidance/solution-provider-2d-readiness/) · [GS1 Sweden size guide](https://gs1.se/en/guides/how-to-guides/size-guide/)
269
+ - [IATA BCBP Implementation Guide v7](https://www.iata.org/contentassets/1dccc9ed041b4f3bbdcf8ee8682e75c4/2021_03_02-bcbp-implementation-guide-version-7-.pdf)
270
+ - [Apple HIG — Wallet](https://developer.apple.com/design/human-interface-guidelines/wallet) · [Wallet pass barcodes](https://developer.apple.com/documentation/walletpasses/pass/barcodes-data.dictionary) · [PassKit Programming Guide](https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/PassKit_PG/Creating.html) · [UIScreen.brightness](https://developer.apple.com/documentation/uikit/uiscreen/brightness)
271
+ - [Google Wallet — rotating barcodes](https://developers.google.com/wallet/tickets/events/resources/rotating-barcodes) · [BarcodeType](https://developers.google.com/wallet/reference/rest/v1/BarcodeType)
272
+ - [Android WindowManager.LayoutParams](https://developer.android.com/reference/android/view/WindowManager.LayoutParams) · [FLAG_SECURE guidance](https://developer.android.com/security/fraud-prevention/activities) · [Screenshot detection](https://developer.android.com/about/versions/14/features/screenshot-detection)
273
+ - [MDN — Screen Wake Lock API](https://developer.mozilla.org/en-US/docs/Web/API/Screen_Wake_Lock_API) · [WICG Screen Brightness proposal](https://github.com/WICG/proposals/issues/17) · [Chrome Auto Dark Theme](https://developer.chrome.com/blog/auto-dark-theme)
274
+ - [RFC 8628 — OAuth Device Authorization Grant](https://www.rfc-editor.org/rfc/rfc8628.html) · [OWASP QRLJacking](https://owasp.org/www-community/attacks/Qrljacking) · [Microsoft — Storm-2372 device code phishing](https://www.microsoft.com/en-us/security/blog/2025/02/13/storm-2372-conducts-device-code-phishing-campaign/)
275
+ - [EMVCo QR Codes](https://www.emvco.com/emv-technologies/qr-codes/) · [What, why and how of EMV QR](https://www.emvco.com/knowledge-hub/the-what-why-and-how-of-emv-qr-codes/)
276
+ - [NN/g — QR code guidelines](https://www.nngroup.com/articles/qr-code-guidelines/)
277
+ - [ML Kit barcode scanning — input image guidelines](https://developers.google.com/ml-kit/vision/barcode-scanning/android)
@@ -0,0 +1,285 @@
1
+ # UX Usability Foundations
2
+
3
+ ## Purpose
4
+
5
+ Help an agent make interfaces understandable, usable, forgiving, and aligned with user expectations. Treat usability as product behavior, not surface decoration. The agent should turn unclear or fragile UI into an interface where users can quickly answer: what is this, what can I do here, where am I, what happened, how do I recover, and is this worth the effort?
6
+
7
+ ## When to use this skill
8
+
9
+ Use this skill when the user asks you to critique, redesign, create, or specify a UI, flow, form, app screen, website, dashboard, onboarding, settings page, checkout, navigation model, state behavior, or component interaction for usability. Use it for affordances/signifiers, feedback, constraints, errors, empty/loading/success states, recognition over recall, task clarity, and frontend behavior.
10
+
11
+ ## When not to use this skill
12
+
13
+ Do not use as the primary skill for deep research operations, brand styling systems, visual polish, typography craft, frontend architecture, or persuasion/growth tactics unless those choices directly affect user understanding, control, or recovery.
14
+
15
+ ## Core principles
16
+
17
+ 1. **Start with goals, not screens.** Identify the user’s goal, task, context, and likely knowledge before changing controls or layout. Design requirements describe needs before widgets.
18
+ 2. **Make the next action obvious.** Prefer self-evident interfaces. If the task is inherently novel or complex, make it self-explanatory with structure, labels, examples, and feedback.
19
+ 3. **Show what is possible.** Interactive elements must look interactive. Read-only elements must not look editable. Hidden gestures need visible alternatives.
20
+ 4. **Match the user’s mental model.** Use the concepts, names, and sequence users understand; do not expose database tables, file paths, internal IDs, or arbitrary system states unless users need them.
21
+ 5. **Favor recognition over recall.** Keep needed options, context, examples, and state visible or easy to retrieve.
22
+ 6. **Reduce work and excise.** Remove tasks that serve the system rather than the user’s goal: retyping, transferring data, hunting for controls, configuring obvious defaults, or answering inferable questions.
23
+ 7. **Guide choices without overloading users.** Use progressive disclosure, sensible defaults, grouping, and prioritization.
24
+ 8. **Give immediate, informative feedback.** Every consequential action needs a response that says whether the system received it, what changed, whether waiting is required, and what can happen next.
25
+ 9. **Prevent errors before explaining them.** Use constraints, safe defaults, previews, tolerant input, inline validation, and undo where feasible.
26
+ 10. **Blame the design, not the user.** Errors reveal a mismatch in expectations or an unsupported edge case. Preserve work and guide recovery.
27
+ 11. **Respect platform and convention.** Use familiar patterns when they fit. Break convention only when the user’s goal clearly benefits and the new behavior can be discovered and recovered from.
28
+ 12. **Accessibility is usability under pressure.** Design for perceptibility, operability, simplicity, and forgiveness across varied abilities, devices, literacy, stress, and environments.
29
+
30
+ See [references/principle-cards.md](references/principle-cards.md) for each principle as a reusable card.
31
+
32
+ ## Default recommendations
33
+
34
+ ### Product goal
35
+ Default to optimizing the primary user task before secondary business asks. Override only for legal, safety, fraud, privacy, or business-critical requirements. Ask: “Which obligation must interrupt or constrain the primary task, and what is the consequence of hiding or delaying it?”
36
+
37
+ ### Audience
38
+ Default to motivated but distracted users with average domain knowledge and imperfect memory. Override for trained expert operators using the product frequently under stable conditions. Ask: “Is this primarily for first-time/infrequent users, frequent intermediates, or trained experts?”
39
+
40
+ ### Platform and input
41
+ Default to platform conventions and support pointer, touch, keyboard, and assistive technology where relevant. Ask when platform/input constraints are unknown.
42
+
43
+ ### Information density
44
+ Default to enough context for recognition and decision-making, while hiding rare advanced controls behind clear entry points. Override for comparison, monitoring, or expert workflows. Ask: “Do users need overview density for monitoring/comparison, or step-by-step focus for completion?”
45
+
46
+ ### Navigation
47
+ Default to clear location, current object/state, access to major areas, and a visible route back or onward. Override only for intentional guided flows. Ask: “Should users be free to move around, or should this flow intentionally constrain navigation?”
48
+
49
+ ### Labels and language
50
+ Default to plain, task-oriented labels from the user’s vocabulary. Ask before using internal, clever, legal, or domain-specific terms.
51
+
52
+ ### Forms
53
+ Default to persistent labels, appropriate input types, upfront constraints, inline validation where helpful, preserved data, and a clear primary action. Ask only when density/speed for experts may be more important than first-time clarity.
54
+
55
+ ### Error handling
56
+ Default to prevention first; if error occurs, explain what happened, why it matters, and how to fix it without losing work. Ask when error details are sensitive, regulated, or security-relevant.
57
+
58
+ ### Destructive actions
59
+ Default to visually secondary destructive actions until the final review/confirmation step. Prefer undo for reversible actions; use confirmation for irreversible, costly, legal, or safety actions. Ask about reversibility and harm.
60
+
61
+ ### Feedback and status
62
+ Default to instant receipt feedback, progress for delays, visible completion, and persistent state for long-running or consequential operations. Ask which status changes should interrupt.
63
+
64
+ ### Accessibility
65
+ Default to WCAG-oriented basics: semantic controls, keyboard operation, focus visibility, programmatic labels, sufficient contrast, no color-only meaning, readable copy, and screen-reader-friendly state updates. Do not override basics.
66
+
67
+ ## Required user questions
68
+
69
+ Do not ask routine best-practice questions. Ask one focused question only when the answer changes the recommendation:
70
+
71
+ - The primary user/task is unclear.
72
+ - The action has safety, financial, legal, privacy, medical, or irreversible consequences.
73
+ - Novices and experts need different behaviors.
74
+ - Platform/input constraints are unknown.
75
+ - Required terminology or compliance copy may apply.
76
+ - The user requests a nonstandard, hidden, or manipulative pattern.
77
+ - There is a real tradeoff between density and clarity or between guided flow and free navigation.
78
+
79
+ Use this pattern:
80
+
81
+ ```js
82
+ question({
83
+ question: "What is the primary task this interface must help users complete?",
84
+ recommended_default: "Optimize for the most common successful task first, then make secondary actions available but visually quieter.",
85
+ options: [
86
+ "Complete one focused task",
87
+ "Compare or monitor multiple items",
88
+ "Explore and choose among options",
89
+ "Other / custom"
90
+ ]
91
+ })
92
+ ```
93
+
94
+ Use the question-tool-ready prompts in [references/decision-prompts.md](references/decision-prompts.md) for the full decision set.
95
+
96
+ ## Workflow for critiquing an existing UI
97
+
98
+ Inspect in this order:
99
+
100
+ 1. User goal and task fit.
101
+ 2. First-glance comprehension.
102
+ 3. Orientation: current place, object, state, and path onward/back.
103
+ 4. Action discoverability.
104
+ 5. Choice quality and priority.
105
+ 6. Labels and language.
106
+ 7. Feedback and status.
107
+ 8. Error prevention and recovery.
108
+ 9. Recognition versus memory burden.
109
+ 10. Accessibility and input coverage.
110
+ 11. Frontend feasibility and edge states.
111
+ 12. Prioritization by task impact, frequency, severity, and fix effort.
112
+
113
+ Report critique as: highest-impact usability issues, quick wins, behavior/spec details, accessibility notes, and risks/tradeoffs.
114
+
115
+ ## Workflow for creating or improving an interface
116
+
117
+ 1. Clarify the user, goal, success condition, and risk.
118
+ 2. Choose the simplest useful flow.
119
+ 3. Map user concepts and vocabulary.
120
+ 4. Create visible structure and action hierarchy.
121
+ 5. Select standard patterns unless a task reason justifies custom behavior.
122
+ 6. Design default, hover, focus, active, loading, success, empty, validation, error, offline, disabled, and permission states.
123
+ 7. Add constraints, validation, and recovery.
124
+ 8. Support first use and repeated use.
125
+ 9. Verify accessibility.
126
+ 10. Explain decisions in terms of task progress, cognitive load, expectations, and risk.
127
+
128
+ ## Decision framework
129
+
130
+ Ask yourself:
131
+
132
+ 1. Is the problem comprehension, choice, control, feedback, navigation, or recovery?
133
+ 2. Can the design prevent the problem rather than explain it?
134
+ 3. Can the interface use recognition instead of recall?
135
+ 4. Can a standard pattern solve this without new learning?
136
+ 5. Which elements are primary, secondary, tertiary, or dangerous?
137
+ 6. Does the user need more information, fewer choices, or a better sequence?
138
+ 7. Will the user notice the state change?
139
+ 8. What happens if the user is distracted, rushed, using touch, using keyboard, using assistive tech, or recovering from an error?
140
+ 9. What is reversible, costly, or irreversible?
141
+ 10. Is this serving the user’s task or the system’s convenience?
142
+
143
+ ## Practical rules
144
+
145
+ ### Obviousness and scanning
146
+ - Make each screen’s purpose visible in its heading, structure, and primary action.
147
+ - Use descriptive buttons: “Send invoice,” “Save changes,” or “Book appointment,” not “Submit.”
148
+ - Make click/tap targets look like controls without relying on hover.
149
+ - Use headings, grouping, whitespace, and lists so users can scan.
150
+ - Remove copy and decorative elements that compete with the task.
151
+
152
+ ### Affordances, signifiers, and controls
153
+ - Use native controls when behavior fits.
154
+ - Use icons with labels for unfamiliar or consequential actions.
155
+ - Preserve distinctions between links, buttons, selected items, disabled items, editable fields, and static text.
156
+ - Do not hide essential actions behind gestures, long press, hover, or tiny overflow menus unless visible alternatives exist.
157
+
158
+ ### Choices and progressive disclosure
159
+ - Limit initial choices to the current decision.
160
+ - Use safe, likely defaults.
161
+ - Reveal advanced options near the point of need.
162
+ - Use comparison structures when users must choose among similar plans, products, records, or settings.
163
+
164
+ ### Feedback and state
165
+ - Give immediate micro-feedback for command receipt.
166
+ - Show progress for delays and async operations.
167
+ - Confirm completion when the result is not visible.
168
+ - Make current selection, current page, current filter, unsaved changes, and offline/sync status visible.
169
+ - Avoid noisy feedback for routine non-events.
170
+
171
+ ### Errors and recovery
172
+ - Validate constraints before submission when feasible.
173
+ - Keep invalid user input visible and editable.
174
+ - Place errors next to affected controls and summarize long-form errors.
175
+ - Use undo for reversible actions and confirmation for irreversible or high-risk actions.
176
+ - Never make users start over after a recoverable problem.
177
+
178
+ ### Navigation and orientation
179
+ - Show current section, object, state, and available next/back paths.
180
+ - Use breadcrumbs for deep hierarchy, not as a substitute for clear navigation.
181
+ - Use tabs only for peer sections of the same context.
182
+ - Use drawers/menus for infrequent or space-constrained actions; avoid hiding frequently needed primary navigation.
183
+ - Preserve route, filters, and scroll position when users return from detail to list.
184
+
185
+ ### Learnability
186
+ - Make first-run help temporary and task-focused.
187
+ - Prefer inline examples and empty-state guidance over separate help documents.
188
+ - Let repeated successful use reduce beginner guidance.
189
+ - Design for “perpetual intermediates”: users know the basics but do not remember everything.
190
+
191
+ ## Accessibility and inclusion requirements
192
+
193
+ - Use semantic HTML and native elements before custom widgets.
194
+ - Ensure all interactive elements have accessible names.
195
+ - Keep focus order aligned with visual/task order.
196
+ - Provide visible focus indicators.
197
+ - Support keyboard operation for all actions.
198
+ - Associate labels, hints, and errors with form controls.
199
+ - Do not rely on placeholder text as the only label.
200
+ - Do not rely on color alone.
201
+ - Announce async status and errors appropriately.
202
+ - Ensure dialogs trap focus while open and restore focus when closed.
203
+ - Respect reduced motion.
204
+ - Make target sizes suitable for touch and motor variability.
205
+ - Write at the simplest level compatible with the task and domain.
206
+
207
+ ## Frontend implementation guidance
208
+
209
+ ### Semantic structure
210
+ - Use `<button>` for actions and `<a>` for navigation.
211
+ - Use persistent programmatic labels for inputs.
212
+ - Use fieldsets/legends for related radio/checkbox groups.
213
+ - Use headings in logical order.
214
+ - Use tables for tabular data, not layout.
215
+
216
+ ### State and feedback
217
+ - Include default, hover, focus-visible, active, selected, expanded/collapsed, disabled, loading, success, warning, error, empty, offline, and read-only states where relevant.
218
+ - Use `aria-expanded`, `aria-controls`, `aria-selected`, `aria-current`, `aria-invalid`, `aria-describedby`, and live regions as needed.
219
+ - Disable controls only when the reason is obvious or explained; otherwise allow the action and guide the user.
220
+ - Prevent duplicate submissions with pending state and idempotent server handling.
221
+
222
+ ### Forms
223
+ - Use `type`, `autocomplete`, `inputmode`, `min`, `max`, `step`, and constraints appropriately.
224
+ - Keep input flexible when users may enter equivalent formats.
225
+ - Validate on blur or submit for complex fields; validate on input only when stable and helpful.
226
+ - Preserve entries across errors, refreshes, authentication interruptions, and network failures whenever possible.
227
+
228
+ ### Responsive and input behavior
229
+ - Do not assume hover.
230
+ - Keep primary actions reachable without hiding context on small screens.
231
+ - Ensure text can zoom/reflow without loss of function.
232
+ - Test with keyboard only, screen reader basics, touch, narrow viewport, slow network, and high zoom.
233
+
234
+ ## Quality checklist
235
+
236
+ - The primary user goal is stated.
237
+ - The screen’s purpose is clear at a glance.
238
+ - The primary action is stronger than secondary actions.
239
+ - Labels use user language.
240
+ - Interactive elements are discoverable without hover.
241
+ - Required choices are minimized and grouped.
242
+ - The interface provides status feedback after consequential actions.
243
+ - Errors are prevented where possible and recoverable where not.
244
+ - Destructive actions are reversible or clearly confirmed.
245
+ - Users do not lose work due to validation, auth, network, or navigation issues.
246
+ - Navigation answers “where am I?” and “where can I go?”
247
+ - Accessibility fundamentals are included.
248
+ - Frontend behavior is implementable.
249
+
250
+ Use the full checklists in [references/checklists.md](references/checklists.md).
251
+
252
+ ## Common mistakes to avoid
253
+
254
+ - Starting with app chrome before the task.
255
+ - Treating “easy to use” as a checklist item.
256
+ - Hiding primary actions behind menus, gestures, or icons.
257
+ - Using clever labels where obvious labels would work.
258
+ - Making all actions equally important.
259
+ - Asking users questions the system can infer safely.
260
+ - Forcing users to remember hidden instructions or state.
261
+ - Replacing undo with constant confirmations.
262
+ - Blaming the user in error copy.
263
+ - Using disabled controls without explanation.
264
+ - Relying on color alone.
265
+ - Designing custom controls without keyboard and assistive-tech behavior.
266
+ - Treating accessibility as a final audit.
267
+ - Confusing visual simplicity with reduced task complexity.
268
+
269
+ See [references/anti-patterns.md](references/anti-patterns.md) for the full anti-pattern list.
270
+ - Ignoring empty, loading, offline, validation, permission, and edge states.
271
+
272
+ ## How to explain recommendations to the user
273
+
274
+ Use this pattern:
275
+
276
+ ```markdown
277
+ I recommend [change] because users are likely trying to [goal]. The current version makes them [think/remember/guess/recover] unnecessarily. This change makes [action/state/recovery] visible and reduces [specific risk or effort]. The main tradeoff is [cost], which is acceptable unless [context that would change the decision].
278
+ ```
279
+
280
+ When disagreeing with a requested pattern:
281
+
282
+ ```markdown
283
+ I would not hide this behind an icon-only menu because it is the primary path for the task. A better default is a visible labeled action. Use the menu only for secondary or infrequent actions.
284
+ ```
285
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 hueyexe
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.