@blackbelt-technology/frontend-mockup-loop 0.5.4 → 0.6.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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: frontend-mockup-loop
|
|
3
|
-
description: Plan, build, and iterate UX-friendly frontend mockups via a ground→contract→mockup→test→fix→learn loop, acting as an expert UX designer who grounds every decision in externally documented public design rules (Nielsen heuristics, Laws of UX, WCAG, GOV.UK/USWDS/Material). Uses the bundled serve_mockup, score_mockup, and init_ui_contract tools plus a ui-contract.md design control plane to keep screens consistent. Works in any React/Tailwind/shadcn (or plain HTML) project. Use when designing new screens, adapting existing UI, enforcing cross-screen consistency, or doing a UX review. Triggers: "design a screen", "mockup this UI", "wireframe", "make the UI consistent", "adapt the existing design", "improve this layout", "UX review", "is this good UX".
|
|
3
|
+
description: "Plan, build, and iterate UX-friendly frontend mockups via a ground→contract→mockup→test→fix→learn loop, acting as an expert UX designer who grounds every decision in externally documented public design rules (Nielsen heuristics, Laws of UX, WCAG, GOV.UK/USWDS/Material). Uses the bundled serve_mockup, score_mockup, and init_ui_contract tools plus a ui-contract.md design control plane to keep screens consistent. Works in any React/Tailwind/shadcn (or plain HTML) project. Use when designing new screens, adapting existing UI, enforcing cross-screen consistency, or doing a UX review. Triggers: \"design a screen\", \"mockup this UI\", \"wireframe\", \"make the UI consistent\", \"adapt the existing design\", \"improve this layout\", \"UX review\", \"is this good UX\"."
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
6
|
author: blackbelt-technology
|
|
@@ -95,6 +95,16 @@ CC0; GOV.UK is OGL; NN/g + Laws of UX cite-with-attribution; Material/Carbon are
|
|
|
95
95
|
Apache-2.0). Adapt the *principle* to this product; never copy proprietary
|
|
96
96
|
assets/text (Apple HIG, Refactoring UI, Mobbin).
|
|
97
97
|
|
|
98
|
+
**Anti-slop companion (advisory).** For the *AI-tell* layer — the countable
|
|
99
|
+
signatures an undirected model defaults to (AI-purple, Inter-everywhere,
|
|
100
|
+
em-dashes, div-based fake screenshots, eyebrow-per-section, Jane Doe / Acme
|
|
101
|
+
data) — pull the `anti-slop-frontend` skill
|
|
102
|
+
(`@blackbelt-technology/anti-slop-frontend`). It is **advisory only**: its tells
|
|
103
|
+
feed the FIX step's defect list (step 5), but they NEVER override this loop's
|
|
104
|
+
hard gates. When an anti-slop tell conflicts with a cited public rule or the
|
|
105
|
+
WCAG-AA / severity-4 floor, the cited rule and the gate win. Apply its Part A
|
|
106
|
+
(universal) to any surface; skip its Part B (marketing-only) for product UI.
|
|
107
|
+
|
|
98
108
|
## When to Use
|
|
99
109
|
|
|
100
110
|
Designing or refining any frontend surface — new screens, redesigns, or a
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blackbelt-technology/frontend-mockup-loop",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Pi extension + skill for a ground→contract→mockup→test→fix→learn frontend design loop. Ships a live mockup server tool, a Playwright breakpoint-screenshot tool, and a design-contract scaffolder. Works in any React/Tailwind/shadcn project.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# ux-best-practices — index
|
|
2
|
+
|
|
3
|
+
Rule corpus for `frontend-mockup-loop` skill. Stance: act as expert UX designer; every decision grounded in externally documented public rule, name rule + cite source. Adapt principle, don't copy proprietary assets. Sections: source hierarchy, universal laws, component rules, eval protocol, rubric seed, sources index.
|
|
4
|
+
|
|
5
|
+
## §1 Source hierarchy — licensing-safe order
|
|
6
|
+
Tier 1: USWDS (CC0), GOV.UK Design System + Service Manual + Style Guide (MIT+OGL). Tier 2: NN/g heuristics (cite), Laws of UX (cite), Material 3 (Apache-2.0), IBM Carbon (Apache-2.0). Tier 3: Shopify Polaris content, Mailchimp Style Guide. Tier 4: Apple HIG, Refactoring UI, Mobbin (proprietary — never copy). Default: selected design system's guidance first; universal laws fill gaps.
|
|
7
|
+
|
|
8
|
+
## §2 Universal laws & heuristics
|
|
9
|
+
- §2a Nielsen's 10 heuristics: visibility of status, match real world, user control/freedom, consistency/standards, error prevention, recognition>recall, flexibility/efficiency, aesthetic/minimalist, help recognize/recover errors, help/docs.
|
|
10
|
+
- §2b Laws of UX: Jakob, Fitts (≥44px), Hick, Miller (7±2), Tesler, Postel, Von Restorff (one focal action), Doherty (<400ms), Goal-Gradient/Zeigarnik, Aesthetic-Usability.
|
|
11
|
+
- §2c Gestalt: proximity, similarity, common region, continuity, figure/ground.
|
|
12
|
+
- §2d Cognitive load: eliminate extraneous load, offload memory to interface, chunk, reuse patterns, <400ms.
|
|
13
|
+
|
|
14
|
+
## §3 Component pattern rules (do/don't)
|
|
15
|
+
- Forms & validation: label above field (never placeholder-as-label), single-column, validate on blur/submit not per-keystroke, mark optional, match input type, CTA = specific verb never "Submit".
|
|
16
|
+
- Navigation & IA: desktop nav visible, mobile tab bar 3–5, breadcrumbs = hierarchy not history (last unlinked), consistent placement + active marker, descriptive labels.
|
|
17
|
+
- Error handling: prevent first, plain language no raw codes (what+how to fix), inline at field + top summary linking fields, convey by more than color, prefer undo over confirm.
|
|
18
|
+
- Empty states & onboarding: name value not feature, ghost rows, one primary CTA, progressive disclosure, skippable onboarding.
|
|
19
|
+
- Loading & feedback: <0.1s no spinner, <1s preserves flow, >10s determinate percent + cancel, skeletons for layout / spinners for short blocking, optimistic UI with rollback.
|
|
20
|
+
- Data display: design around task, density as feature, pagination w/ position for find / infinite scroll only exploratory, sort+filter+search, sticky headers, right-align numbers.
|
|
21
|
+
- Modals/notifications/microcopy: modal only when must decide first, toasts transient ~4–6s never critical, button labels = outcome verbs, one primary action per dialog.
|
|
22
|
+
|
|
23
|
+
## §4 Expert-UX evaluation protocol (5 steps, scores derived in code not by model)
|
|
24
|
+
Step 1 accessibility floor (HARD GATE, deterministic): axe-core + target-size (≥24px AA/44px AAA), focus-visible, contrast 4.5:1, prefers-reduced-motion, zoom, color-not-sole. WCAG-AA fail = blocking severity ≥3. Step 2 heuristic boolean rubric (10 Nielsen yes/no + cognitive-walkthrough 4 Qs/step, multi-pass 3–5 evaluators). Step 3 PURE friction scoring (step 1/2/3, task color = worst step). Step 4 severity 0–4 per defect (Nielsen scale). Step 5 prioritized fix list (a11y-gate first, severity desc, frequency); block "pass" while any sev-4 or WCAG-AA fail.
|
|
25
|
+
|
|
26
|
+
## §5 UX rubric seed — 22 checkable rules (assert TRUE, score = passed/N in code)
|
|
27
|
+
Accessibility floor (gate) 1–5: contrast ≥4.5:1, targets ≥24/44px, visible focus, state by more than color, reduced-motion/zoom. Heuristics/layout 6–12: one dominant primary action, status <1s, reversible/confirm-gated, consistent pattern, proximity spacing, no element fails goal, platform conventions. Component 13–22: persistent label, single-column mobile, verb CTA, blur/submit validation, mobile nav ≤5, error states fix + summary, one empty-state CTA, >10s progress+cancel, sticky header + right-align numbers, multi-step progress indicator.
|
|
28
|
+
|
|
29
|
+
## §6 Sources index (public, citable)
|
|
30
|
+
Principles/laws: NN/g 10 heuristics, cognitive load, heuristic-eval + severity, Laws of UX, PURE. Task patterns/content: USWDS, GOV.UK DS + Service Manual + Content Style Guide, Material 3, Carbon, Polaris, Mailchimp, UI-Patterns. Component articles: NN/g web-form-design, Baymard inline-validation, NN/g error-message/empty-state/progressive-disclosure/response-times/skeleton/data-tables/hamburger/breadcrumbs/modal/UI-copy, GOV.UK error-summary. A11y: WCAG 2.2, ARIA APG, Microsoft Inclusive Design, GOV.UK inclusive.
|
package/src/AGENTS.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# DOX — packages/mockup-loop/src
|
|
2
|
+
|
|
3
|
+
Files in this directory. One row per source file.
|
|
4
|
+
|
|
5
|
+
| File | Purpose |
|
|
6
|
+
|------|---------|
|
|
7
|
+
| `extension.ts` | Pi extension entry `frontendMockupLoop(pi)`. Registers 3 tools: `serve_mockup{dir,port?,stop?}` (node:http static server on 0.0.0.0, returns local+LAN URL, `servers` Map keyed by port), `score_mockup{url,widths?,outDir?}` (dynamic-import playwright chromium, full-page screenshots at widths default [375,768,1440], returns paths + scoring rubric, falls back to install guidance if absent), `init_ui_contract{path?,force?}` (writes `CONTRACT_TEMPLATE` to `ui-contract.md`). Registers `/mockup-loop` command. `session_shutdown` closes all servers. Path-traversal guard in static handler. See change: add-frontend-mockup-loop. Now registers 5 tools: adds `list_design_systems{}` (enumerates registry) + `validate_mockup{system,url?,dir?}` (L1+L2 gates, L3+L4 advisory, returns {gates,advisory,pass}). `init_ui_contract` gains `system?`+`refresh?` (writes DTCG contract from preset snapshot; no system → blank template). `score_mockup` gains `system?` (swaps generic rubric for preset boolean rubric). Imports from src/presets/*. See change: add-selectable-design-systems. |
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# DOX — packages/mockup-loop/src/presets
|
|
2
|
+
|
|
3
|
+
Files in this directory. One row per source file.
|
|
4
|
+
|
|
5
|
+
| File | Purpose |
|
|
6
|
+
|------|---------|
|
|
7
|
+
| `contract.ts` | DTCG contract loader. `loadContract(id)` reads bundled presets-data/<id>/contract.tokens.json, asserts DTCG via `isDtcg`. `refreshContract(id)` re-fetches upstream (token systems only; rule-pack throws). `rubricPath`/`contractPath`/`PRESETS_DATA_DIR` resolvers. UPSTREAM_SOURCES map. See change: add-selectable-design-systems. |
|
|
8
|
+
| `registry.ts` | Design-system preset registry. `DesignSystemPreset` type (id,label,platform,substrate,contractSource,minTouchTarget,spacingScale,validators[]). 5 v1 presets: shadcn,mui,material-3,fluent-2,apple-hig. `listPresets`/`getPreset`/`resolvePreset` (rejects unknown id without throw). See change: add-selectable-design-systems. |
|
|
9
|
+
| `validators.ts` | Layered validators. `runL1` token-lint (built-in raw-hex scan, gate for bundled systems), `runL2` a11y floor (inline WCAG contrast scan + axe-if-present, hard gate), `runL3` named-system auditor (shell-out-if-present via `isToolAvailable`, advisory), `runL4` boolean rubric (score=pass/N in code, advisory), `validateMockup` orchestrator returns {gates,advisory,pass}; pass gate-only. Inline WCAG `contrastRatio`/`parseHex`. See change: add-selectable-design-systems. |
|