@srobroek/pi-design 0.12.2 → 0.13.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 (81) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +51 -14
  3. package/_kit/prereqs.json +2 -2
  4. package/agents/ui-implementer.md +2 -2
  5. package/agents/ui-ux-specialist.md +3 -2
  6. package/extensions/design.js +10 -3
  7. package/formulas/design-surface.formula.toml +2 -2
  8. package/formulas/design-system.formula.toml +2 -2
  9. package/formulas/mol-design-iterate.formula.toml +2 -2
  10. package/package.json +1 -1
  11. package/skills/design-guide/SKILL.md +4 -2
  12. package/skills/design-prototype/SKILL.md +9 -0
  13. package/skills/design-prototype/references/upstream.md +3 -0
  14. package/skills/design-upstream-preflight/SKILL.md +31 -5
  15. package/skills/impeccable/LICENSE +191 -0
  16. package/skills/impeccable/LICENSE-platform-design-skills +21 -0
  17. package/skills/impeccable/NOTICE +87 -0
  18. package/skills/impeccable/REUSE.toml +26 -0
  19. package/skills/impeccable/SKILL.md +95 -0
  20. package/skills/impeccable/reference/adapt.md +318 -0
  21. package/skills/impeccable/reference/adapt.native.md +58 -0
  22. package/skills/impeccable/reference/android.md +46 -0
  23. package/skills/impeccable/reference/animate.md +108 -0
  24. package/skills/impeccable/reference/audit.md +159 -0
  25. package/skills/impeccable/reference/audit.native.md +152 -0
  26. package/skills/impeccable/reference/bolder.md +33 -0
  27. package/skills/impeccable/reference/clarify.md +94 -0
  28. package/skills/impeccable/reference/colorize.md +86 -0
  29. package/skills/impeccable/reference/component-review.md +65 -0
  30. package/skills/impeccable/reference/craft-floor.md +46 -0
  31. package/skills/impeccable/reference/craft.md +5 -0
  32. package/skills/impeccable/reference/critique-rubric.md +496 -0
  33. package/skills/impeccable/reference/critique.md +331 -0
  34. package/skills/impeccable/reference/degraded/asset-producer.md +44 -0
  35. package/skills/impeccable/reference/degraded/documenter.md +24 -0
  36. package/skills/impeccable/reference/degraded/finish-reviewer.md +38 -0
  37. package/skills/impeccable/reference/degraded/manual-edit-applier.md +93 -0
  38. package/skills/impeccable/reference/degraded/motion-reviewer.md +29 -0
  39. package/skills/impeccable/reference/delight.md +70 -0
  40. package/skills/impeccable/reference/distill.md +111 -0
  41. package/skills/impeccable/reference/doctor.md +60 -0
  42. package/skills/impeccable/reference/document.md +418 -0
  43. package/skills/impeccable/reference/extract.md +69 -0
  44. package/skills/impeccable/reference/foundations.md +46 -0
  45. package/skills/impeccable/reference/generate.md +103 -0
  46. package/skills/impeccable/reference/harden.md +362 -0
  47. package/skills/impeccable/reference/hooks.md +33 -0
  48. package/skills/impeccable/reference/init.md +133 -0
  49. package/skills/impeccable/reference/ios.md +51 -0
  50. package/skills/impeccable/reference/layout.md +86 -0
  51. package/skills/impeccable/reference/live-setup.md +106 -0
  52. package/skills/impeccable/reference/live.md +345 -0
  53. package/skills/impeccable/reference/mode-operate.md +21 -0
  54. package/skills/impeccable/reference/mode-persuade.md +19 -0
  55. package/skills/impeccable/reference/mode-read.md +21 -0
  56. package/skills/impeccable/reference/new-work-comp.md +26 -0
  57. package/skills/impeccable/reference/new-work-world.md +22 -0
  58. package/skills/impeccable/reference/new-work.md +125 -0
  59. package/skills/impeccable/reference/onboard.md +235 -0
  60. package/skills/impeccable/reference/operate.md +61 -0
  61. package/skills/impeccable/reference/optimize.md +257 -0
  62. package/skills/impeccable/reference/overdrive.md +127 -0
  63. package/skills/impeccable/reference/polish.md +107 -0
  64. package/skills/impeccable/reference/quieter.md +99 -0
  65. package/skills/impeccable/reference/region-map.md +28 -0
  66. package/skills/impeccable/reference/routing.md +26 -0
  67. package/skills/impeccable/reference/shape.md +59 -0
  68. package/skills/impeccable/reference/typeset.md +98 -0
  69. package/skills/impeccable/reference/visualize.md +49 -0
  70. package/skills/impeccable/scripts/VERSION +1 -0
  71. package/skills/impeccable/scripts/command-metadata.json +98 -0
  72. package/skills/impeccable/scripts/data/font-index-failures.json +121 -0
  73. package/skills/impeccable/scripts/data/font-index.json +1 -0
  74. package/skills/impeccable/scripts/engine-checksums.txt +9 -0
  75. package/skills/impeccable/scripts/impeccable +349 -0
  76. package/skills/impeccable/scripts/impeccable.cmd +371 -0
  77. package/skills/impeccable/scripts/live-browser-dom.js +320 -0
  78. package/skills/impeccable/scripts/live-browser-ignores.js +246 -0
  79. package/skills/impeccable/scripts/live-browser-session.js +183 -0
  80. package/skills/impeccable/scripts/live-browser.js +13925 -0
  81. package/skills/impeccable/scripts/modern-screenshot.umd.js +14 -0
@@ -0,0 +1,87 @@
1
+ impeccable
2
+ ==========
3
+
4
+ This skill is vendored, in modified form, from:
5
+
6
+ Project: Impeccable
7
+ Repository: https://github.com/pbakaus/impeccable
8
+ Release: skill-v4.12.0 (commit fa1bee0)
9
+ Tarball: https://api.github.com/repos/pbakaus/impeccable/tarball/refs/tags/skill-v4.12.0
10
+ sha256 cceb8edf2bb7ffe1349463999048c58668484d9474ff89c1faa3b6d6c7b132be
11
+ (approved in scripts/impeccable-pins.json, checked before extraction)
12
+ Source path: plugin/skills/impeccable (Claude Code), .opencode/skills/impeccable (OpenCode),
13
+ .pi/skills/impeccable (pi)
14
+ Licence: Apache License 2.0, Copyright 2025 Paul Bakaus
15
+
16
+ The full licence text is in the LICENSE file beside this one, copied from the same release.
17
+ REUSE.toml records the copyright and licence of every file here.
18
+
19
+ reference/ios.md and reference/android.md are, per upstream's NOTICE.md below, distilled from
20
+ ehmo's platform-design-skills (https://github.com/ehmo/platform-design-skills), MIT. They are
21
+ licensed Apache-2.0 AND MIT. That project's MIT licence, whose copyright line names no holder,
22
+ is in LICENSE-platform-design-skills, copied from commit 38dad6e1e3c7f0c430a87903b3237f52922e0f4c.
23
+
24
+ Every file in this directory is written by scripts/vendor-impeccable.ts in the
25
+ harness-plugins repository. To move to another release, check the new tarball's sha256
26
+ yourself, then run
27
+
28
+ bun scripts/vendor-impeccable.ts <version> --approve <sha256>
29
+
30
+ A file the three forms share ships under its plain name; a file that differs ships as
31
+ harness-kit variants (SKILL.claude.md, SKILL.pi.md, ...), each harness receiving its own.
32
+
33
+ Modifications (Apache-2.0 section 4(b)); each modified Markdown file carries a note below
34
+ its frontmatter, and each launcher a comment at the change:
35
+
36
+ - OpenCode and pi forms: the project install path (.opencode/skills/impeccable/ and
37
+ .pi/skills/impeccable/) became <skill-base-dir>/, upstream's own name for the directory
38
+ that holds SKILL.md, because a plugin installs the skill elsewhere.
39
+ - SKILL.md, every form: the description is cut to 160 characters, the listing limit of this
40
+ repository, and metadata opencode/autoinvoke: false is added so OpenCode lists it through
41
+ the design-guide router.
42
+ - scripts/impeccable and scripts/impeccable.cmd: the last-resort engine download runs only
43
+ with IMPECCABLE_ALLOW_DOWNLOAD=1. Without it the launcher prints the install command
44
+ (mise use -g npm:impeccable) and exits 127, so the engine is never fetched unasked.
45
+ - OpenCode and pi forms: reference/hooks.md is replaced by a page that routes to the
46
+ design_impeccable_scan tool, because the plugin installs no hook there; reference/doctor.md
47
+ says the plugin manager, not npx impeccable update, updates this copy.
48
+
49
+ Not vendored: upstream's Claude Code agents (impeccable-*) and its hooks. The skill falls back
50
+ to reference/degraded/ when those agents are absent, and the design plugin runs the detector
51
+ through its design_impeccable_scan tool instead of the hook.
52
+
53
+ Upstream NOTICE.md, verbatim:
54
+
55
+ # Third-Party Notices
56
+
57
+ This project includes content derived from third-party work, used under the terms of its original license.
58
+
59
+ ## Platform Design Skills
60
+
61
+ The `skill/reference/ios.md` and `skill/reference/android.md` platform reference files are distilled from ehmo's `platform-design-skills` (Apple Human Interface Guidelines and Material Design 3 rules), rewritten in Impeccable's voice.
62
+
63
+ **Original work:** https://github.com/ehmo/platform-design-skills
64
+ **Original license:** MIT
65
+ **Author:** ehmo
66
+
67
+ ## Fonts in the browser extension
68
+
69
+ The browser extension ships two fonts under `extension/fonts/`, each with its licence text beside it.
70
+
71
+ **Albert Sans** (`albertsans.ttf`)
72
+ **Original work:** https://github.com/usted/Albert-Sans
73
+ **Original license:** SIL Open Font License 1.1 (`albertsans-OFL.txt`)
74
+ **Copyright:** 2021 The Albert Sans Project Authors
75
+
76
+ **Alumni Sans** (`alumnisans.ttf`)
77
+ **Original work:** https://github.com/googlefonts/alumni
78
+ **Original license:** SIL Open Font License 1.1 (`alumnisans-OFL.txt`)
79
+ **Copyright:** 2015 The Alumni Sans Project Authors
80
+
81
+ ## Consent rules in the browser extension
82
+
83
+ The browser extension's journeys answer cookie and consent banners with DuckDuckGo's autoconsent: its engine and rule set, unmodified, ship in `extension/walks/consent-rules.js` behind a small bridge of our own.
84
+
85
+ **Original work:** https://github.com/duckduckgo/autoconsent (its `dist/autoconsent.playwright.js` and `rules/compact-rules.json`, at the version named on the first line of `consent-rules.js`)
86
+ **Original license:** Mozilla Public License 2.0, https://mozilla.org/MPL/2.0/ (the whole of `consent-rules.js`, our bridge included; the rest of this repository is Apache-2.0)
87
+ **Copyright:** DuckDuckGo, Inc.
@@ -0,0 +1,26 @@
1
+ version = 1
2
+
3
+ [[annotations]]
4
+ path = "**"
5
+ SPDX-FileCopyrightText = "2025 Paul Bakaus"
6
+ SPDX-License-Identifier = "Apache-2.0"
7
+
8
+ # platform-design-skills's MIT licence names no copyright holder (upstream credits ehmo as the
9
+ # author, not as the holder), so its share is NOASSERTION, not NONE.
10
+ [[annotations]]
11
+ path = ["reference/ios.md", "reference/ios.*.md", "reference/android.md", "reference/android.*.md"]
12
+ precedence = "override"
13
+ SPDX-FileCopyrightText = ["2025 Paul Bakaus", "NOASSERTION"]
14
+ SPDX-License-Identifier = "Apache-2.0 AND MIT"
15
+
16
+ [[annotations]]
17
+ path = "LICENSE-platform-design-skills"
18
+ precedence = "override"
19
+ SPDX-FileCopyrightText = "NOASSERTION"
20
+ SPDX-License-Identifier = "MIT"
21
+
22
+ [[annotations]]
23
+ path = "NOTICE"
24
+ precedence = "override"
25
+ SPDX-FileCopyrightText = ["2025 Paul Bakaus", "2026 Sjors Robroek"]
26
+ SPDX-License-Identifier = "Apache-2.0"
@@ -0,0 +1,95 @@
1
+ ---
2
+ name: impeccable
3
+ description: "Use to design, redesign, critique, audit, polish or animate a frontend: pages, dashboards, app UI, components, native screens or a design system (DESIGN.md)."
4
+ version: 4.12.0
5
+ license: Apache 2.0
6
+ allowed-tools:
7
+ - Bash(npx impeccable *)
8
+ - Bash(<skill-base-dir>/scripts/impeccable *)
9
+ metadata:
10
+ opencode/autoinvoke: false
11
+ ---
12
+
13
+ <!-- Vendored from pbakaus/impeccable skill-v4.12.0 (Apache-2.0) and modified by the design plugin; see NOTICE. Written by scripts/vendor-impeccable.ts; do not edit. -->
14
+
15
+ This skill gives you the tools and permission to make design that earns the name out-of-distribution craft. Work as an award-winning design director would: production-grade code, a clear POV, a deep grasp of what the client and its users need, and exceptional craft.
16
+
17
+ Core principles:
18
+ - Finish the job. No hedging, no shortcuts: the deliverable is complete, except assets the user must provide.
19
+ - Scale ambition to the surface's mode (see Modes). Persuade and Experience get full commitment: bold, distinct work with a point of view. On Operate and Read, ambition shows as precision and restraint, and patterns the visitor already knows earn their place.
20
+ - Verify by looking at the rendered result at the sizes it ships at (web: `<skill-base-dir>/scripts/impeccable shot <page>`), and batch the checks: fix what one look shows before looking again.
21
+
22
+ ## Setup
23
+
24
+ 1. Run `<skill-base-dir>/scripts/impeccable context` once per session, where `<skill-base-dir>` is the directory that contains this SKILL.md (the skill folder, not a plugin root two levels above it); keep cwd at the user's project. That base directory resolves every `<skill-base-dir>/scripts/impeccable <verb>` command in this skill and its references, and `<skill-base-dir>/scripts` is the fallback only when the runtime reports no base directory. On a Windows shell without `sh`, call `<skill-base-dir>/scripts/impeccable.cmd` instead. The launcher runs a self-contained binary that ships next to it or is downloaded once on first run; no Node or other runtime is required. Pass a named source file or route as `--target <path>`. It loads PRODUCT.md and DESIGN.md (long ones as a map: read the sections your task needs), the matching surface brief, and native-platform guidance when applicable; follow its directives and do not rerun it.
25
+ 2. Load the request's playbook: its Commands-table reference for an explicit/implied sub-command, or [reference/new-work.md](reference/new-work.md) for a new surface, a replacement visual world, or a build from an approved comp. Some playbooks come in parts; read the part this request needs in the same step: [reference/new-work-world.md](reference/new-work-world.md) when a visual world is created or replaced (a redesign, a new look, or no established world), [reference/new-work-comp.md](reference/new-work-comp.md) for a build from an approved comp or on a comp-led build path, and [reference/critique-rubric.md](reference/critique-rubric.md) for a critique whose Assessment A runs in this context (a native platform, or no sub-agent tool); a delegated Assessment A gets the rubric's path in its prompt instead. Inspect target and incumbent visual truth before editing. When the app cannot run, start with committed visual-regression goldens or screenshot fixtures; verify target and freshness against current tokens, CSS, components, or assets, resolve conflicts, and compare theme/variant captures.
26
+ 3. After resolving analysis and direction, read [reference/craft-floor.md](reference/craft-floor.md) immediately before any UI edit, including small refinements. It carries the quality floor, the absolute bans, and the reflexes no detector catches. Do not load it for planning-only work.
27
+
28
+ **Launcher unavailable:** On the first refusal or failure, don’t retry; send a separate message **before the next tool call**: “Context loading did not run; I’ll read the existing project context directly.” Then read existing PRODUCT.md and DESIGN.md without inventing missing context, follow applicable steps 2–3, including reading [reference/craft-floor.md](reference/craft-floor.md) immediately before any UI edit, and continue through permitted tools. This applies to planning and editing; launcher failure alone does not block either.
29
+
30
+ ## How to design
31
+
32
+ - **The brief wins.** Honor pinned aesthetics, eras, materials, fonts, and palettes even when they conflict with a saturated-pattern warning. Redirecting a clear brief toward your taste is failure.
33
+ - **Refinement preserves; redesign replaces.** Refinement keeps the incumbent identity, behavior, copy, and everything outside scope. Ask before replacing factual copy or adding claims. Redesign keeps product truth, content, function, native affordances, and constraints, but treats the old look as evidence and anti-reference; choose a replacement world in new-work and replace DESIGN.md. Never split the difference into polish on the discarded look.
34
+ - **Loaded symbols stay out of the decoration.** A subject's world does not license emblems tied to militarism, supremacy, or hate movements as motifs, badges, or ornament, such as the Rising Sun flag's rays, the Confederate battle flag, or Nazi-era insignia and their stylised variants; reach for that world's neutral forms instead. Content that documents such a symbol as fact stays as it is.
35
+ - **Visual authority is evidence, not a filename.** Missing DESIGN.md alone does not make a project greenfield; new-work decides whether to preserve, expand, or replace the incumbent world.
36
+
37
+ ## Modes
38
+
39
+ The mode names what the visitor's success looks like on this surface.
40
+
41
+ - **Persuade:** the visitor decides and acts; design is the product. Landing pages, marketing, campaigns, pricing. Earn attention and action. Ship real imagery when the brief needs it; follow the committed world, not category habit.
42
+ - **Operate:** the visitor completes a task. App UI, dashboards, editors, admin, settings, tools. Scanability, consistency, native expectations, and the real usage scene outrank expression. Brand lives in precise details.
43
+ - **Read:** the visitor understands something. Docs, articles, guides, help, changelogs. Structure for comprehension, then make the reading experience worth staying in.
44
+ - **Experience:** the visitor is inside the work itself. Portfolios, galleries, showcases. Let the artifact lead from the first viewport; the interface recedes.
45
+
46
+ Choose the mode from the requested surface, not the product, and persist it only in that surface brief. A tool's landing page is still Persuade; a fashion house's documentation is still Read; a docs index is Read, not Persuade. See [new-work.md](reference/new-work.md) for new surfaces and [operate.md](reference/operate.md) for deeper Operate/Read guidance.
47
+
48
+ ## Commands
49
+
50
+ | Command | Category | Description | Reference |
51
+ |---|---|---|---|
52
+ | `craft [feature]` | Build | Deprecated alias for an ordinary new-work request | [reference/craft.md](reference/craft.md) |
53
+ | `shape [feature]` | Build | Plan UX/UI before writing code | [reference/shape.md](reference/shape.md) |
54
+ | `init` | Build | Capture durable product context in PRODUCT.md | [reference/init.md](reference/init.md) |
55
+ | `document` | Build | Generate DESIGN.md from existing project code | [reference/document.md](reference/document.md) |
56
+ | `extract [target]` | Build | Pull reusable tokens and components into design system | [reference/extract.md](reference/extract.md) |
57
+ | `critique [target]` | Evaluate | UX design review with heuristic scoring | [reference/critique.md](reference/critique.md) |
58
+ | `audit [target]` | Evaluate | Technical quality checks (a11y, perf, responsive) | [reference/audit.md](reference/audit.md) · native: [reference/audit.native.md](reference/audit.native.md) |
59
+ | `polish [target]` | Refine | Final quality pass before shipping | [reference/polish.md](reference/polish.md) |
60
+ | `bolder [target]` | Refine | Amplify safe or bland designs | [reference/bolder.md](reference/bolder.md) |
61
+ | `quieter [target]` | Refine | Tone down aggressive or overstimulating designs | [reference/quieter.md](reference/quieter.md) |
62
+ | `distill [target]` | Refine | Strip to essence, remove complexity | [reference/distill.md](reference/distill.md) |
63
+ | `harden [target]` | Refine | Production-ready: errors, i18n, edge cases | [reference/harden.md](reference/harden.md) |
64
+ | `onboard [target]` | Refine | Design first-run flows, empty states, activation | [reference/onboard.md](reference/onboard.md) |
65
+ | `animate [target]` | Enhance | Add purposeful animations and motion | [reference/animate.md](reference/animate.md) |
66
+ | `colorize [target]` | Enhance | Add strategic color to monochromatic UIs | [reference/colorize.md](reference/colorize.md) |
67
+ | `typeset [target]` | Enhance | Improve typography hierarchy and fonts | [reference/typeset.md](reference/typeset.md) |
68
+ | `layout [target]` | Enhance | Fix spacing, rhythm, and visual hierarchy | [reference/layout.md](reference/layout.md) |
69
+ | `delight [target]` | Enhance | Add personality and memorable touches | [reference/delight.md](reference/delight.md) |
70
+ | `overdrive [target]` | Enhance | Push past conventional limits | [reference/overdrive.md](reference/overdrive.md) |
71
+ | `clarify [target]` | Fix | Improve UX copy, labels, and error messages | [reference/clarify.md](reference/clarify.md) |
72
+ | `adapt [target]` | Fix | Adapt for different devices and screen sizes | [reference/adapt.md](reference/adapt.md) · native: [reference/adapt.native.md](reference/adapt.native.md) |
73
+ | `optimize [target]` | Fix | Diagnose and fix UI performance | [reference/optimize.md](reference/optimize.md) |
74
+ | `live` | Iterate | Visual variant mode: pick elements in the browser, iterate on alternatives | [reference/live.md](reference/live.md) |
75
+ | `generate [n] [action] [element]` | Iterate | Variants, versions, or alternatives of a named element to choose from in the live browser; no manual picking | [reference/generate.md](reference/generate.md) |
76
+
77
+ Routing:
78
+
79
+ - **No argument:** read [routing.md](reference/routing.md) and present its context-aware menu; never auto-run a command.
80
+ - **Explicit or clearly implied request to run a command:** load its reference (native variant on native platforms) and follow it. Ask once if two commands fit.
81
+ - **Workflow or command-selection question:** read [Workflow questions](reference/routing.md#workflow-questions).
82
+ - **Otherwise:** treat the request as general design work. Missing PRODUCT.md routes a new surface or replacement world through init, then new-work; a narrow refinement of existing code proceeds on the incumbent implementation as `impeccable context` directs, offering init afterward rather than blocking on it.
83
+ - `teach` aliases `init`. `craft` is a deprecated alias for ordinary new-work and adds nothing. `shape` owns task discovery, then enters new-work only for visual-world and surface-concept decisions.
84
+
85
+ After init writes PRODUCT.md, resume without rerunning `impeccable context`; init loads the native platform reference itself when the platform it recorded is `ios`, `android`, or `adaptive`.
86
+
87
+ **Pin / Unpin:** `<skill-base-dir>/scripts/impeccable pin <pin|unpin> <command>` creates or removes a standalone `/<command>` shortcut. Report the script's result concisely; relay stderr verbatim on error.
88
+
89
+ **Hooks:** `/impeccable hooks <on|off|status|ignore-rule|ignore-file|ignore-value|reset>` manages the design detector hook for this project (auto-runs the detector after UI file edits and surfaces findings). Load [reference/hooks.md](reference/hooks.md) when the user invokes it with any argument.
90
+
91
+ **Doctor:** `/impeccable doctor` reports and repairs drift between this project's Impeccable artifacts (PRODUCT.md, DESIGN.md and its sidecar, config, surface briefs, the hook) and what this version reads. Load [reference/doctor.md](reference/doctor.md) when the user invokes it, or when they ask what is out of date, stale, or needs refreshing. A `CONTEXT_STALE` directive in Setup's output is the cheap subset of the same report; act on it there per its own instructions rather than running doctor unasked.
92
+
93
+ **Foundations:** `/impeccable foundations` runs `<skill-base-dir>/scripts/impeccable foundations` and walks the user through the product-foundations roadmap (secrets, 404 page, icons, CI and more); `/impeccable foundations <id>` fixes that one item. Load [reference/foundations.md](reference/foundations.md) when the user invokes it.
94
+
95
+ **Never repair drift as a side effect of a design task.** A `CONTEXT_STALE` finding is reported, not acted on, unless the user asks. The one exception is a finding marked `auto`, which the next write to that file performs anyway.
@@ -0,0 +1,318 @@
1
+ > **Additional context needed**: target platforms/devices and usage contexts.
2
+
3
+ Adapt an existing design to a different context: another screen size, device, platform, or use case. The trap is treating adaptation as scaling. The job is rethinking the experience for the new context.
4
+
5
+ **Web only** (mobile web included). Native platforms (`ios` / `android` / `adaptive`) route to [adapt.native.md](adapt.native.md) instead; if the project is native, switch to it now.
6
+
7
+ ---
8
+
9
+ ## Assess Adaptation Challenge
10
+
11
+ Understand what needs adaptation and why:
12
+
13
+ 1. **Identify the source context**:
14
+ - What was it designed for originally? (Desktop web? Mobile app?)
15
+ - What assumptions were made? (Large screen? Mouse input? Fast connection?)
16
+ - What works well in current context?
17
+
18
+ 2. **Understand target context**:
19
+ - **Device**: Mobile, tablet, desktop, TV, watch, print?
20
+ - **Input method**: Touch, mouse, keyboard, voice, gamepad?
21
+ - **Screen constraints**: Size, resolution, orientation?
22
+ - **Connection**: Fast wifi, slow 3G, offline?
23
+ - **Usage context**: On-the-go vs desk, quick glance vs focused reading?
24
+ - **User expectations**: What do users expect on this platform?
25
+
26
+ 3. **Identify adaptation challenges**:
27
+ - What won't fit? (Content, navigation, features)
28
+ - What won't work? (Hover states on touch, tiny touch targets)
29
+ - What's inappropriate? (Desktop patterns on mobile, mobile patterns on desktop)
30
+
31
+ Adaptation is rethinking the experience for the new context, not scaling pixels.
32
+
33
+ ## Plan Adaptation Strategy
34
+
35
+ Create context-appropriate strategy:
36
+
37
+ ### Mobile Adaptation (Desktop → Mobile)
38
+
39
+ **Layout Strategy**:
40
+ - Single column instead of multi-column
41
+ - Vertical stacking instead of side-by-side
42
+ - Full-width components instead of fixed widths
43
+ - Bottom navigation instead of top/side navigation
44
+
45
+ **Interaction Strategy**:
46
+ - Touch targets 44x44px minimum (not hover-dependent)
47
+ - Swipe gestures where appropriate (lists, carousels)
48
+ - Bottom sheets instead of dropdowns
49
+ - Thumbs-first design (controls within thumb reach)
50
+ - Larger tap areas with more spacing
51
+
52
+ **Content Strategy**:
53
+ - Progressive disclosure (don't show everything at once)
54
+ - Prioritize primary content (secondary content in tabs/accordions)
55
+ - Shorter text (more concise)
56
+ - Larger text (16px minimum)
57
+
58
+ **Navigation Strategy**:
59
+ - Hamburger menu or bottom navigation
60
+ - Reduce navigation complexity
61
+ - Sticky headers for context
62
+ - Back button in navigation flow
63
+
64
+ ### Tablet Adaptation (Hybrid Approach)
65
+
66
+ **Layout Strategy**:
67
+ - Two-column layouts (not single or three-column)
68
+ - Side panels for secondary content
69
+ - Master-detail views (list + detail)
70
+ - Adaptive based on orientation (portrait vs landscape)
71
+
72
+ **Interaction Strategy**:
73
+ - Support both touch and pointer
74
+ - Touch targets 44x44px but allow denser layouts than phone
75
+ - Side navigation drawers
76
+ - Multi-column forms where appropriate
77
+
78
+ ### Desktop Adaptation (Mobile → Desktop)
79
+
80
+ **Layout Strategy**:
81
+ - Multi-column layouts (use horizontal space)
82
+ - Side navigation always visible
83
+ - Multiple information panels simultaneously
84
+ - Fixed widths with max-width constraints (don't stretch to 4K)
85
+
86
+ **Interaction Strategy**:
87
+ - Hover states for additional information
88
+ - Keyboard shortcuts
89
+ - Right-click context menus
90
+ - Drag and drop where helpful
91
+ - Multi-select with Shift/Cmd
92
+
93
+ **Content Strategy**:
94
+ - Show more information upfront (less progressive disclosure)
95
+ - Data tables with many columns
96
+ - Richer visualizations
97
+ - More detailed descriptions
98
+
99
+ ### Print Adaptation (Screen → Print)
100
+
101
+ **Layout Strategy**:
102
+ - Page breaks at logical points
103
+ - Remove navigation, footer, interactive elements
104
+ - Black and white (or limited color)
105
+ - Proper margins for binding
106
+
107
+ **Content Strategy**:
108
+ - Expand shortened content (show full URLs, hidden sections)
109
+ - Add page numbers, headers, footers
110
+ - Include metadata (print date, page title)
111
+ - Convert charts to print-friendly versions
112
+
113
+ ### Email Adaptation (Web → Email)
114
+
115
+ **Layout Strategy**:
116
+ - Narrow width (600px max)
117
+ - Single column only
118
+ - Inline CSS (no external stylesheets)
119
+ - Table-based layouts (for email client compatibility)
120
+
121
+ **Interaction Strategy**:
122
+ - Large, obvious CTAs (buttons not text links)
123
+ - No hover states (not reliable)
124
+ - Deep links to web app for complex interactions
125
+
126
+ ## Implement Adaptations
127
+
128
+ Apply changes systematically:
129
+
130
+ ### Responsive Breakpoints
131
+
132
+ Choose appropriate breakpoints:
133
+ - Mobile: 320px-767px
134
+ - Tablet: 768px-1023px
135
+ - Desktop: 1024px+
136
+ - Or content-driven breakpoints (where design breaks)
137
+
138
+ ### Layout Adaptation Techniques
139
+
140
+ - **CSS Grid/Flexbox**: Reflow layouts automatically
141
+ - **Container Queries**: Adapt based on container, not viewport
142
+ - **`clamp()`**: Fluid sizing between min and max
143
+ - **Media queries**: Different styles for different contexts
144
+ - **Display properties**: Show/hide elements per context
145
+
146
+ ### Touch Adaptation
147
+
148
+ - Increase touch target sizes (44x44px minimum)
149
+ - Add more spacing between interactive elements
150
+ - Remove hover-dependent interactions
151
+ - Add touch feedback (ripples, highlights)
152
+ - Consider thumb zones (easier to reach bottom than top)
153
+
154
+ ### Content Adaptation
155
+
156
+ - Use `display: none` sparingly (still downloads)
157
+ - Progressive enhancement (core content first, enhancements on larger screens)
158
+ - Lazy loading for off-screen content
159
+ - Responsive images (`srcset`, `picture` element)
160
+
161
+ ### Navigation Adaptation
162
+
163
+ - Transform complex nav to hamburger/drawer on mobile
164
+ - Bottom nav bar for mobile web
165
+ - Persistent side navigation on desktop
166
+ - Breadcrumbs on smaller screens for context
167
+
168
+ Test on real devices. DevTools emulation is a useful first pass but misses real touch, performance, and browser chrome.
169
+
170
+ **Avoid**:
171
+ - Hide core functionality on mobile (if it matters, make it work)
172
+ - Assume desktop = powerful device (consider accessibility, older machines)
173
+ - Use different information architecture across contexts (confusing)
174
+ - Break user expectations for platform (mobile users expect mobile patterns)
175
+ - Forget landscape orientation on mobile/tablet
176
+ - Use generic breakpoints blindly (use content-driven breakpoints)
177
+ - Ignore touch on desktop (many desktop devices have touch)
178
+
179
+ ## Verify Adaptations
180
+
181
+ Test thoroughly across contexts:
182
+
183
+ - **Real devices**: Test on actual phones, tablets, desktops
184
+ - **Different orientations**: Portrait and landscape
185
+ - **Different browsers**: Safari, Chrome, Firefox, Edge
186
+ - **Different OS**: iOS, Android, Windows, macOS
187
+ - **Different input methods**: Touch, mouse, keyboard
188
+ - **Edge cases**: Very small screens (320px), very large screens (4K)
189
+ - **Slow connections**: Test on throttled network
190
+
191
+ **Custom controls** (sliders, drag surfaces, scrollable control strips): a before/after slider can pass every width check above and still refuse to drag on iOS, so exercise each one in scope in the same batched round as the checks above:
192
+
193
+ - **Primary gesture**: Tap it and confirm it responds as designed, then drag it with the target input method; the drag must complete, not just start
194
+ - **Scroll across it**: A swipe along the page's scroll axis across the control scrolls the page or container without activating it; a drag that starts on the control along its axis moves the control, not the page. Neither failure throws an error, so try both
195
+ - **Evidence**: Say what produced the evidence: an emulated viewport, synthesized touch input through a browser tool, which engine ran it (Chromium is not Safari), or a physical device. Screenshots and resized viewports verify layout, never a gesture. Name what stayed untested and move on; unreachable hardware is a reported gap, not a blocker
196
+
197
+ When the adaptation feels native to each context, hand off to `/impeccable polish` for the final pass.
198
+
199
+ ---
200
+
201
+ ## Reference Material
202
+
203
+ The sections below were previously `responsive-design.md` and live inline now so the adapt flow has its deep responsive reference in one place.
204
+
205
+ ### Responsive Design
206
+
207
+ #### Mobile-First: Write It Right
208
+
209
+ Start with base styles for mobile, use `min-width` queries to layer complexity. Desktop-first (`max-width`) means mobile loads unnecessary styles first.
210
+
211
+ #### Breakpoints: Content-Driven
212
+
213
+ Don't chase device sizes; let content tell you where to break. Start narrow, stretch until design breaks, add breakpoint there. Three breakpoints usually suffice (640, 768, 1024px). Use `clamp()` for fluid values without breakpoints.
214
+
215
+ #### Detect Input Method, Not Just Screen Size
216
+
217
+ **Screen size doesn't tell you input method.** A laptop with touchscreen, a tablet with keyboard. Use pointer and hover queries:
218
+
219
+ ```css
220
+ /* Fine pointer (mouse, trackpad) */
221
+ @media (pointer: fine) {
222
+ .button { padding: 8px 16px; }
223
+ }
224
+
225
+ /* Coarse pointer (touch, stylus) */
226
+ @media (pointer: coarse) {
227
+ .button { padding: 12px 20px; } /* Larger touch target */
228
+ }
229
+
230
+ /* Device supports hover */
231
+ @media (hover: hover) {
232
+ .card:hover .card-surface { transform: translateY(-2px); } /* Lift a child; the card stays the hit area */
233
+ }
234
+
235
+ /* Device doesn't support hover (touch) */
236
+ @media (hover: none) {
237
+ .card { /* No hover state - use active instead */ }
238
+ }
239
+ ```
240
+
241
+ **Critical**: Don't rely on hover for functionality. Touch users can't hover.
242
+
243
+ #### Safe Areas: Handle the Notch
244
+
245
+ Modern phones have notches, rounded corners, and home indicators. Use `env()`:
246
+
247
+ ```css
248
+ body {
249
+ padding-top: env(safe-area-inset-top);
250
+ padding-bottom: env(safe-area-inset-bottom);
251
+ padding-left: env(safe-area-inset-left);
252
+ padding-right: env(safe-area-inset-right);
253
+ }
254
+
255
+ /* With fallback */
256
+ .footer {
257
+ padding-bottom: max(1rem, env(safe-area-inset-bottom));
258
+ }
259
+ ```
260
+
261
+ **Enable viewport-fit** in your meta tag:
262
+ ```html
263
+ <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
264
+ ```
265
+
266
+ #### Responsive Images: Get It Right
267
+
268
+ ##### srcset with Width Descriptors
269
+
270
+ ```html
271
+ <img
272
+ src="hero-800.jpg"
273
+ srcset="
274
+ hero-400.jpg 400w,
275
+ hero-800.jpg 800w,
276
+ hero-1200.jpg 1200w
277
+ "
278
+ sizes="(max-width: 768px) 100vw, 50vw"
279
+ alt="Hero image"
280
+ >
281
+ ```
282
+
283
+ **How it works**:
284
+ - `srcset` lists available images with their actual widths (`w` descriptors)
285
+ - `sizes` tells the browser how wide the image will display
286
+ - Browser picks the best file based on viewport width AND device pixel ratio
287
+
288
+ ##### Picture Element for Art Direction
289
+
290
+ When you need different crops/compositions (not just resolutions):
291
+
292
+ ```html
293
+ <picture>
294
+ <source media="(min-width: 768px)" srcset="wide.jpg">
295
+ <source media="(max-width: 767px)" srcset="tall.jpg">
296
+ <img src="fallback.jpg" alt="...">
297
+ </picture>
298
+ ```
299
+
300
+ #### Layout Adaptation Patterns
301
+
302
+ **Navigation**: Three stages: hamburger + drawer on mobile, horizontal compact on tablet, full with labels on desktop. **Tables**: Transform to cards on mobile using `display: block` and `data-label` attributes. **Progressive disclosure**: Use `<details>/<summary>` for content that can collapse on mobile.
303
+
304
+ #### Testing: Don't Trust DevTools Alone
305
+
306
+ DevTools device emulation is useful for layout but misses:
307
+
308
+ - Actual touch interactions
309
+ - Real CPU/memory constraints
310
+ - Network latency patterns
311
+ - Font rendering differences
312
+ - Browser chrome/keyboard appearances
313
+
314
+ **Test on at least**: One real iPhone, one real Android, a tablet if relevant. Cheap Android phones reveal performance issues you'll never see on simulators.
315
+
316
+ ---
317
+
318
+ **Avoid**: Desktop-first design. Device detection instead of feature detection. Separate mobile/desktop codebases. Ignoring tablet and landscape. Assuming all mobile devices are powerful.
@@ -0,0 +1,58 @@
1
+ > **Additional context needed**: target platforms/devices and usage contexts.
2
+
3
+ Adapt an existing **native** design (`ios` / `android` / `adaptive`) to a different context: another device class, orientation, platform, or origin. The trap is treating adaptation as scaling. The job is rethinking the experience for the new context, inside the platform conventions of [ios.md](ios.md) / [android.md](android.md); read the target platform's reference before planning if Setup hasn't already.
4
+
5
+ ## Assess Adaptation Challenge
6
+
7
+ 1. **Source context**: what was it designed for, and what assumptions did it make? (Phone-only? Portrait-only? One platform's idioms? A website?)
8
+ 2. **Target context**: which device class (phone, tablet, foldable), orientation, platform, and usage posture (one-handed on the go vs two-handed at rest)?
9
+ 3. **What breaks**: navigation that doesn't fit the target, layouts that stretch instead of restructure, gestures or controls that don't exist there?
10
+
11
+ ## Adaptation Strategies
12
+
13
+ ### Phone → Tablet (iPad / large screens)
14
+
15
+ - **Restructure, don't stretch.** A scaled-up phone UI on a tablet is the failure mode. Use size classes (iOS) / window size classes (Android) to switch structure.
16
+ - **Navigation changes shape**: tab bar stays or becomes a sidebar on iPad; Android navigation bar becomes a rail or drawer on expanded width.
17
+ - **Use the width**: split view / master-detail (list + detail side by side), multi-column grids, popovers where phones used sheets.
18
+ - **Multitasking is a size, not an edge case**: iPad Split View and Android multi-window can hand you a phone-width window on a tablet; size-class-driven layout handles both for free.
19
+
20
+ ### Orientation & foldables
21
+
22
+ - Landscape restructures (side-by-side panes, repositioned controls); never clip or letterbox. Lock orientation only when the task truly demands it.
23
+ - Foldables (Android): react to posture and hinge via window size classes; test folded, unfolded, and tabletop.
24
+
25
+ ### Platform → platform (iOS ↔ Android)
26
+
27
+ Translate idioms; never transplant them:
28
+
29
+ | iOS | Android |
30
+ |---|---|
31
+ | Tab bar | Navigation bar / rail / drawer |
32
+ | Edge-swipe back, back chevron | Predictive Back gesture / button |
33
+ | Switch, segmented control, system pickers | Material switch, chips, Material pickers |
34
+ | Action sheet | Bottom sheet / Material dialog |
35
+ | SF Symbols, SF Pro, Dynamic Type | Material Symbols, Roboto, sp scaling |
36
+ | Semantic system colors, materials | Material color roles, tonal elevation |
37
+ | System push/sheet transitions | Container transform, shared-axis, fade-through |
38
+
39
+ Rebuild navigation and controls in the target's vocabulary; carry over the brand's expressive layer (palette intent, type accent, motion personality) through the target's theming system.
40
+
41
+ ### Web → native (porting a website or web app)
42
+
43
+ Reconform, don't reflow. Replace web navigation with the platform's model, HTML-shaped controls with platform controls, hover affordances with touch-first ones, and px-based type with Dynamic Type / sp. Then treat the result to the full platform reference; the slop test there is the acceptance bar.
44
+
45
+ ## Implement & Verify
46
+
47
+ - Drive structure from **size classes / window size classes**, never from device-model checks.
48
+ - Respect safe areas and window insets in every new configuration (notch, hinge, status bar, keyboard).
49
+ - Test on simulators for breadth, then real hardware for truth: at least one phone and one tablet per shipped platform, both orientations, split-screen where supported.
50
+
51
+ When the adaptation feels native to each context, hand off to `/impeccable polish` for the final pass.
52
+
53
+ **Avoid**:
54
+ - Ship a stretched phone layout on a tablet
55
+ - Port one platform's controls or navigation onto the other
56
+ - Hide core functionality on smaller devices (if it matters, make it work)
57
+ - Lock orientation to dodge a layout bug
58
+ - Trust simulators alone (posture, gestures, and performance need hardware)
@@ -0,0 +1,46 @@
1
+ # Android platform
2
+
3
+ For native Android apps: Jetpack Compose, Android Views, React Native, Expo, Flutter shipping to Android hardware.
4
+
5
+ On native, the visitor mode narrows what expression may override. Material Design 3 governs structure, navigation, and interaction in every mode; brand expresses through Material's theming (color roles, type scale, shape, motion). A Material-everywhere cross-platform app that also ships to iPhone still owes iOS its OS guarantees on that hardware: safe-area insets, Reduce Motion, edge-swipe back.
6
+
7
+ ## The Android slop test
8
+
9
+ Would a fluent Android user trust this app, or trip on off-spec components? The most common tell is an iOS app wearing Android's skin: a bottom-only navigation copied from iPhone, a back arrow that ignores the system Back gesture, Cupertino-shaped switches and dialogs. Material 3 is the rulebook; follow its components and theme the brand through it.
10
+
11
+ ## Layout & structure
12
+
13
+ - **Material navigation, matched to size.** Navigation bar (bottom, 3–5 destinations) on compact width; navigation rail or drawer on expanded width. Never ship a phone bottom-bar untouched on a tablet.
14
+ - **System Back always works.** Honor the predictive Back gesture and Back button; never trap the user or hijack the gesture.
15
+ - **Edge-to-edge with window insets.** Apply the status bar, navigation bar, display cutout, and IME insets so content never hides behind system bars or the keyboard.
16
+ - **Top app bar for screen context**; pair with a FAB when the screen has a single primary action.
17
+
18
+ ## Touch targets
19
+
20
+ - **48×48 dp minimum** for every touch target, with at least 8 dp between them.
21
+
22
+ ## Typography
23
+
24
+ - **Material type scale.** Display, Headline, Title, Body, Label roles (large/medium/small each). Map text to roles; never hand-pick sizes per screen.
25
+ - **Roboto is the system face**; theme a brand face in through the type scale, keeping body, labels, and controls legible and consistent.
26
+ - **sp units, never fixed px**, so type follows the system font-size setting.
27
+
28
+ ## Color & theming
29
+
30
+ - **Material color roles** (primary, on-primary, surface, surface-variant, secondary-container, outline, error). Role tokens resolve light/dark and contrast variants automatically; raw hex breaks there.
31
+ - **Dynamic Color (Material You)** where it fits: derive the scheme from the user's wallpaper on Android 12+, with a static fallback.
32
+ - **Dark theme is a first-class scheme.** Design and test it; never a quick invert.
33
+ - **Tonal elevation.** Convey elevation through the standard surface tonal levels (plus shadow where appropriate); no arbitrary drop shadows.
34
+
35
+ ## Components & motion
36
+
37
+ - **Material components.** Buttons (filled / tonal / outlined / text), FAB, switches, chips, snackbars, bottom sheets, Material dialogs, navigation bar/rail/drawer. Never port iOS controls or invent equivalents.
38
+ - **One FAB, one primary action.** Never stack FABs or spend one on a secondary task.
39
+ - **Snackbars for transient feedback** (actionable when useful, never a toast for that); dialogs only for decisions that must interrupt.
40
+ - **Material motion patterns.** Container transform, shared-axis, fade-through, with standard easing and durations; honor the system Remove animations setting with a crossfade or instant cut.
41
+
42
+ ## Verifying the build
43
+
44
+ - **Screenshots come from the emulator or a connected device, never a browser.** Build and install, then capture with `adb exec-out screencap -p > <path>` (pick a device with `adb -s <serial>` when several are attached). Capture every device class the app ships to, at least one phone and, when tablets are a target, one tablet, and write the files where the review flow expects them.
45
+ - **Dark theme and font scale belong in the pass.** `adb shell cmd uimode night yes` flips the theme; `adb shell settings put system font_scale 1.3` (read both settings first with `adb shell cmd uimode night` and `adb shell settings get system font_scale`, and restore them after) catches the clipped labels a fixed layout hides; with several targets attached, the capture's `-s <serial>` goes on these commands too.
46
+ - **Emulators give breadth; gestures, refresh rates, and performance need hardware.** Say which one produced the evidence.