wize-dev-kit 0.1.3 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,62 @@ Format inspired by [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [0.1.5] — 2026-06-01
9
+
10
+ ### Added — promises kept
11
+
12
+ All files that previous releases declared in `module.yaml` but never shipped are now in the kit, with real content (not placeholders).
13
+
14
+ **Web overlay playbooks** (`src/web-overlay/playbooks/`):
15
+
16
+ - `wcag-aa.md` — WCAG 2.2 AA checklist for Mantis, with the newer SCs (2.4.11, 2.5.7, 2.5.8, 3.2.6, 3.3.7, 3.3.8) and an audit toolchain.
17
+ - `responsive-breakpoints.md` — mobile-first stack with container queries, fluid typography (`clamp`), layout primitives (Stack/Cluster/Switcher/Sidebar/Grid/Cover/Frame), image strategy.
18
+ - `semantic-html.md` — landmarks, headings, the 12 must-reach-first elements, ARIA rules, common widget patterns with minimum ARIA, anti-patterns.
19
+ - `playwright-vitest.md` — Hawkeye's split (70/20/10), Vitest + Testing Library + MSW setup, Playwright POM pattern, selector hierarchy (role → label → text → testid), CI sketch, anti-patterns.
20
+ - `web-perf-budgets.md` — Core Web Vitals targets, baseline budgets per resource class, image/font strategy, third-party audit checklist, critical rendering path snippet, lighthouse-ci config, field measurement via `web-vitals` beacon.
21
+
22
+ **App overlay playbooks** (`src/app-overlay/playbooks/`):
23
+
24
+ - `apple-hig.md` — POUR-equivalent four principles, layout (status bar/nav/tab/safe-area), navigation patterns, SF Symbols, Dynamic Type, motion, common idioms, iPad specifics, do-not list.
25
+ - `material-design-3.md` — pillars, color/type/shape tokens, elevation-by-color, component starter set, adaptive windows (Compact/Medium/Expanded/Large), motion + reduced motion, Material You theming.
26
+ - `touch-targets-and-gestures.md` — minimums per platform (iOS 44pt / Android 48dp / web 24px), hit-area snippets per stack, thumb reach zones, reserved gestures, multi-touch, drag-and-drop with keyboard fallback, haptics, reduce-motion.
27
+ - `permissions-ux.md` — the four states (not-determined/granted/denied/limited), pre-flight pattern, per-permission guidance (camera/photos/location/notifications/contacts/BLE/health/tracking), denied-state UI + Settings deep-link, copy template.
28
+ - `detox-maestro.md` — when to pick each, Maestro YAML + cloud, Detox config + `testID` discipline, cross-platform CI sketch, flakiness rules, critical journeys to cover.
29
+ - `mobile-perf-budgets.md` — cold/warm start, TTI, FPS, jank, app size, memory, battery; per-platform targets; size reductions that work; build-time + field measurement.
30
+ - `device-matrix.md` — three buckets (floor/volume/ceiling), 2026 iOS + Android matrices, cloud farm comparison, accessibility runs, network conditions, locale coverage.
31
+
32
+ **Stack catalogs**:
33
+
34
+ - `src/web-overlay/stack-catalog.md` — Tony's reference for the web architecture interview: frameworks (Next/Nuxt/SvelteKit/Astro/Remix/SPA/Laravel-Inertia), back-end (Supabase/PlanetScale/Drizzle/Prisma/tRPC/GraphQL), auth, hosting, styling, state, forms; ADR record path.
35
+ - `src/app-overlay/stack-catalog.md` — Tony's mobile architecture reference: frameworks (RN+Expo / RN bare / Flutter / SwiftUI / Compose / Compose-Multiplatform / Capacitor / native+KMP), build & release, auth, data/sync, state, storage, push, analytics, anti-patterns; ADR record path.
36
+
37
+ ### Added — tests
38
+
39
+ - `test/playbooks-and-catalogs.test.js`: guards that every playbook declared in an overlay `module.yaml` exists on disk, has frontmatter, and is non-trivial (> 400 chars). Stack catalog presence + size also asserted. Total tests now: **39** (was 33).
40
+
41
+ ### Notes
42
+
43
+ This release closes Category 1 of the backlog ("promessas vazias"). Categories 2–6 (workflow bodies, `update`/`sync`/`agent create` CLI, polish, Node-24 CI, OIDC return, monorepo & TEA-enforcing) remain on the roadmap.
44
+
45
+ ## [0.1.4] — 2026-06-01
46
+
47
+ ### Added
48
+
49
+ - **`user_name` prompt at install time.** The installer asks "How should the agents call you?" (default = `$USER`), and persists the answer to `.wize/config/user.toml` under `[user] name`. Wizer and `wize-help` read this file and greet the user by name (e.g., *"Welcome back, [USER_NAME]. {project} — {profiles}. Next: …"*).
50
+ - **Opt-in suggested `.gitignore` block.** The installer asks whether to apply the suggested entries. When accepted, an idempotent block is injected between `# >>> wize-dev-kit (managed) >>>` and `# <<< wize-dev-kit (managed) <<<` markers covering: per-developer files (`user.toml`, `scratch/`, `.local/`, `quick-dev-log.md`) and the generated IDE adapter outputs (`.claude/skills/wize-*`, `.agent/skills/wize-*`, `.cursor/rules/wize-*.mdc`, etc.). Re-running install only updates lines between the markers; everything outside is untouched. Declining keeps `.gitignore` exactly as it was.
51
+ - `tools/installer/setup-helpers.js`: pure-ish helpers for `applyGitignore()` (create / append / replace / unchanged) and `generateUserToml()`.
52
+ - 8 new unit tests covering gitignore idempotency (create, append, idempotent re-run, stale-block replace, dry-run) and user.toml generation (name, escaping, optional role). Total: 33 passing.
53
+
54
+ ### Changed
55
+
56
+ - Wizer (orchestrator) persona and `wize-help` skill now instruct the agent to read `.wize/config/user.toml` and use `[user] name` when greeting.
57
+ - `project.toml` template comment clarifies "personal preferences live in user.toml".
58
+
59
+ ### Recommended layout (for a team repo)
60
+
61
+ Commit: `.wize/config/project.toml`, `.wize/config/tea.toml`, `.wize/planning/`, `.wize/solutioning/`, `.wize/implementation/tea/`, `.wize/implementation/retrospective/`, `.wize/knowledge/`, `.wize/custom/`, `AGENTS.md`.
62
+ Ignore (handled by the suggested block): `.wize/config/user.toml`, `.wize/scratch/`, `.wize/.local/`, `.wize/implementation/quick-dev-log.md`, and all generated adapter outputs (each developer runs `npx wize-dev-kit install` for their own IDE target).
63
+
8
64
  ## [0.1.3] — 2026-06-01
9
65
 
10
66
  ### Added
@@ -83,7 +139,9 @@ Format inspired by [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
83
139
  - Inspired by [BMAD Method v6.8.0](https://github.com/bmad-code-org/BMAD-METHOD).
84
140
  - WDS module inspired by [bmad-method-wds-expansion](https://github.com/bmad-code-org/bmad-method-wds-expansion).
85
141
 
86
- [Unreleased]: https://github.com/qwize-br/wize-development-kit/compare/v0.1.3...HEAD
142
+ [Unreleased]: https://github.com/qwize-br/wize-development-kit/compare/v0.1.5...HEAD
143
+ [0.1.5]: https://github.com/qwize-br/wize-development-kit/compare/v0.1.4...v0.1.5
144
+ [0.1.4]: https://github.com/qwize-br/wize-development-kit/compare/v0.1.3...v0.1.4
87
145
  [0.1.3]: https://github.com/qwize-br/wize-development-kit/compare/v0.1.2...v0.1.3
88
146
  [0.1.2]: https://github.com/qwize-br/wize-development-kit/compare/v0.1.1...v0.1.2
89
147
  [0.1.1]: https://github.com/qwize-br/wize-development-kit/compare/v0.1.0...v0.1.1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "wize-dev-kit",
4
- "version": "0.1.3",
4
+ "version": "0.1.5",
5
5
  "description": "Full-lifecycle AI-assisted development kit with Test Architect and Whiteport Design Studio embedded. Inspired by BMAD Method and WDS.",
6
6
  "keywords": [
7
7
  "ai",
@@ -0,0 +1,112 @@
1
+ ---
2
+ playbook: apple-hig
3
+ owner: wize-agent-ux-designer # Mantis
4
+ applies_when: app-overlay active (iOS / iPadOS / macOS)
5
+ status: ready
6
+ ---
7
+
8
+ # Apple HIG — Mantis Playbook (iOS / iPadOS)
9
+
10
+ The HIG isn't a rulebook to memorize — it's a vocabulary. Design so the app feels native first, branded second.
11
+
12
+ ## 1. The four design principles to lead with
13
+
14
+ 1. **Hierarchy** — one primary action per screen. Demote everything else.
15
+ 2. **Harmony** — visual language aligned with the system: SF Symbols, system colors, dynamic type.
16
+ 3. **Consistency** — same gesture, same outcome, across the app.
17
+ 4. **Deference** — content over chrome; let the OS chrome breathe.
18
+
19
+ ## 2. Layout fundamentals
20
+
21
+ | Region | Rule |
22
+ |---|---|
23
+ | Status bar | Never overlap critical content. Match content scheme (light/dark). |
24
+ | Navigation bar | Use the system component. Title sits in `Large Title` on top, collapses on scroll. |
25
+ | Tab bar | 3–5 tabs. Each is a top-level destination, not a flow step. |
26
+ | Safe area | Always respect; never paint behind home indicator unless intentional. |
27
+ | Touch targets | **44×44 pt minimum** (HIG SC). Spacing ≥ 8 pt between adjacent targets. |
28
+
29
+ ## 3. Navigation patterns
30
+
31
+ | Pattern | Use when |
32
+ |---|---|
33
+ | **Tab bar** | 3–5 distinct content areas (Home/Search/Library/Profile). |
34
+ | **Navigation stack** | Hierarchical drill-down. Back gesture must work. |
35
+ | **Modal sheet** | Self-contained task (compose, settings detail). Dismissible with swipe-down. |
36
+ | **Full-screen modal** | Multi-step task that needs focus (onboarding, payment flow). |
37
+ | **Page sheet** (iPad) | Inspector-like UI alongside content. |
38
+ | **Popover** (iPad/Mac) | Contextual options anchored to a control. |
39
+
40
+ ## 4. SF Symbols (use them)
41
+
42
+ - 6000+ glyphs with weights, hierarchical variants, and palette modes.
43
+ - Match symbol weight to your text weight.
44
+ - Use multicolor sparingly — only when meaning depends on color.
45
+ - Never embed glyphs as PNG; SwiftUI/UIKit handle scaling.
46
+
47
+ ```swift
48
+ Image(systemName: "heart.fill")
49
+ .font(.system(size: 24, weight: .semibold))
50
+ .foregroundStyle(.tint)
51
+ ```
52
+
53
+ ## 5. Typography — Dynamic Type
54
+
55
+ - Use semantic text styles (`.title`, `.headline`, `.body`, `.callout`, `.footnote`). Never hardcode `font-size`.
56
+ - Support all 7 default text sizes and the 5 accessibility sizes (xxxL → A11Y_XXXL).
57
+ - Test at the largest accessibility size: critical UI must reflow, not clip.
58
+
59
+ ## 6. Color
60
+
61
+ - Start from **system colors** (`.label`, `.systemBackground`, `.systemBlue`). They handle light/dark/contrast.
62
+ - Brand color stays as a single accent (`tintColor`). Don't recolor system controls.
63
+ - Run in dark mode + Increase Contrast + Reduce Transparency at least once per epic.
64
+
65
+ ## 7. Motion
66
+
67
+ - Respect `Reduce Motion`. Replace `slide`/`scale` with `cross-fade`.
68
+ - Standard durations: 0.25s (transient), 0.35s (navigation), 0.4s (modal present).
69
+ - Springs over linear curves; physics > eased linear.
70
+
71
+ ## 8. Common idioms
72
+
73
+ | Idiom | When |
74
+ |---|---|
75
+ | **Pull-to-refresh** | Lists where freshness matters (mail, feed). |
76
+ | **Swipe actions** | Quick row actions (archive, delete). Always pair with a tap-reveal alternative. |
77
+ | **Context menu (long press)** | Secondary actions on a tile. Never the only path. |
78
+ | **Action sheet** | 2–6 mutually exclusive choices on a small screen. |
79
+ | **Confirmation dialog** | Destructive actions — always confirm; phrase the verb on the button. |
80
+
81
+ ## 9. Permissions
82
+
83
+ - Ask in context, not at launch. (See `permissions-ux.md`.)
84
+ - Provide a pre-flight UI explaining the *why* before the system prompt.
85
+
86
+ ## 10. Privacy nutrition + tracking
87
+
88
+ - `App Tracking Transparency` prompt is mandatory if you track across other apps/sites.
89
+ - Privacy nutrition label is required on the App Store.
90
+ - Mantis writes the user-facing explanations; Tony coordinates the technical entries.
91
+
92
+ ## 11. iPad specifics
93
+
94
+ - **Sidebar + content split** when content is hierarchical and lateral nav matters.
95
+ - Support Stage Manager + multitasking (responsive layout, no fixed pixel widths).
96
+ - Apple Pencil hover (iPad Pro) — design hover affordances even for touch-only apps.
97
+
98
+ ## 12. Don'ts
99
+
100
+ - Custom back arrows. Use the platform's.
101
+ - Hidden gestures as the only path to a feature. Provide a visible tap.
102
+ - Splash screen with branding for > 1 second. Use the launch screen, not a "loading" splash.
103
+ - Reinventing the share sheet. Use `UIActivityViewController` / `ShareLink`.
104
+ - Toast notifications. iOS doesn't have them; use sheets, banners, or system notifications.
105
+
106
+ ## 13. Cross-platform note
107
+
108
+ If the project also ships Android, **build to platform**, not lowest common denominator. Each idiom (back button vs back gesture, tab bar vs bottom nav, alert vs dialog) belongs to its OS. See `material-design-3.md`.
109
+
110
+ ## 14. Hand-off
111
+
112
+ Mantis annotates each screen spec with the Apple system component name (`UIKit` or `SwiftUI`), Dynamic Type style, system color tokens. Tony picks UIKit vs SwiftUI vs React Native; Shuri implements against the named components.
@@ -0,0 +1,179 @@
1
+ ---
2
+ playbook: detox-maestro
3
+ owner: wize-agent-test-architect # Hawkeye
4
+ applies_when: app-overlay active
5
+ status: ready
6
+ ---
7
+
8
+ # Mobile E2E — Detox + Maestro Playbook
9
+
10
+ Two tools, different angles. **Detox** integrates deep into RN/Expo with a real JS bridge and runs on real devices/simulators. **Maestro** is YAML-declarative, multi-platform (RN, Flutter, native), and exceptional for smoke + visual flows. Most teams want one of each, not both heavy.
11
+
12
+ ## 1. Pick one (or both, lean)
13
+
14
+ | Need | Pick |
15
+ |---|---|
16
+ | RN / Expo only, deep state introspection, fastest iteration | **Detox** |
17
+ | Native, Flutter, RN — mixed shop | **Maestro** |
18
+ | Smoke flow you run on every PR | **Maestro** |
19
+ | Detailed assertions on bridge state, mocks at JS layer | **Detox** |
20
+ | Cross-platform visual regression | **Maestro** snapshots (Cloud) |
21
+ | Tight CI matrix (iOS sim + Android emulator + cloud devices) | **Maestro Cloud** or **MagicPod / BrowserStack** |
22
+
23
+ Default split (Hawkeye `tea-design.md`):
24
+
25
+ - **Vitest / Jest** for unit + component (≥ 70%).
26
+ - **Maestro** for smoke (3–8 critical flows on every PR).
27
+ - **Detox** for RN-specific deep flows (auth, deep links, push handling).
28
+
29
+ ## 2. Maestro — getting started
30
+
31
+ ```yaml
32
+ # .maestro/flows/sign-in.yml
33
+ appId: com.qwize.app
34
+ ---
35
+ - launchApp
36
+ - assertVisible: "Sign in"
37
+ - tapOn:
38
+ text: "Email"
39
+ - inputText: "qa@qwize.io"
40
+ - tapOn:
41
+ text: "Password"
42
+ - inputText: "test1234"
43
+ - tapOn: "Sign in"
44
+ - assertVisible:
45
+ id: "home-tab"
46
+ timeout: 10000
47
+ ```
48
+
49
+ Run locally:
50
+
51
+ ```bash
52
+ maestro test .maestro/flows/sign-in.yml
53
+ maestro studio # record flows visually
54
+ maestro cloud .maestro/ # run on Maestro Cloud
55
+ ```
56
+
57
+ Tips:
58
+
59
+ - One flow per file. Compose with `runFlow` for shared steps (sign-in fixture).
60
+ - Prefer `id`-based selectors over text — text changes with locale.
61
+ - Wrap network-dependent waits in `extendedWaitUntil` so they fail loud, not flaky.
62
+ - Snapshots: `takeScreenshot` then commit baseline; Maestro Cloud handles diffing.
63
+
64
+ ## 3. Detox — getting started (RN / Expo)
65
+
66
+ ```bash
67
+ npx detox init -L jest
68
+ ```
69
+
70
+ ```jsonc
71
+ // .detoxrc.js (sketch)
72
+ module.exports = {
73
+ testRunner: 'jest',
74
+ apps: {
75
+ 'ios.debug': { type: 'ios.app', binaryPath: 'ios/build/Build/Products/Debug-iphonesimulator/App.app', build: 'xcodebuild ...' },
76
+ 'android.debug': { type: 'android.apk', binaryPath: 'android/app/build/outputs/apk/debug/app-debug.apk', build: 'cd android && ./gradlew assembleDebug assembleAndroidTest' }
77
+ },
78
+ devices: {
79
+ 'ios.sim': { type: 'ios.simulator', device: { type: 'iPhone 15 Pro' } },
80
+ 'android.emu': { type: 'android.emulator', device: { avdName: 'Pixel_7_API_34' } }
81
+ },
82
+ configurations: {
83
+ 'ios.debug': { device: 'ios.sim', app: 'ios.debug' },
84
+ 'android.debug': { device: 'android.emu', app: 'android.debug' }
85
+ }
86
+ };
87
+ ```
88
+
89
+ ```ts
90
+ // e2e/sign-in.test.ts
91
+ describe('Sign in', () => {
92
+ beforeAll(async () => { await device.launchApp(); });
93
+ beforeEach(async () => { await device.reloadReactNative(); });
94
+
95
+ it('lets a known user in', async () => {
96
+ await element(by.id('email')).typeText('qa@qwize.io');
97
+ await element(by.id('password')).typeText('test1234');
98
+ await element(by.id('signin-cta')).tap();
99
+ await expect(element(by.id('home-tab'))).toBeVisible();
100
+ });
101
+ });
102
+ ```
103
+
104
+ Hawkeye rules for Detox:
105
+
106
+ - Always use `testID`. Never text selectors.
107
+ - Reset state between tests (`device.reloadReactNative()`); never share login state silently.
108
+ - Network: prefer **MSW-RN** or in-app mock layer. Don't hit prod.
109
+ - Set `Detox.setReachability` to simulate offline scenarios.
110
+
111
+ ## 4. Cross-platform CI sketch
112
+
113
+ ```yaml
114
+ # .github/workflows/mobile-e2e.yml (sketch)
115
+ jobs:
116
+ maestro-ios:
117
+ runs-on: macos-14
118
+ steps:
119
+ - uses: actions/checkout@v4
120
+ - run: brew tap mobile-dev-inc/tap && brew install maestro
121
+ - run: yarn install --frozen-lockfile
122
+ - run: yarn build:ios
123
+ - run: maestro test .maestro/flows/
124
+ maestro-android:
125
+ runs-on: ubuntu-latest
126
+ steps:
127
+ - uses: actions/checkout@v4
128
+ - uses: reactivecircus/android-emulator-runner@v2
129
+ with:
130
+ api-level: 34
131
+ target: google_apis
132
+ arch: x86_64
133
+ profile: pixel_7
134
+ script: |
135
+ curl -Ls "https://get.maestro.mobile.dev" | bash
136
+ maestro test .maestro/flows/
137
+ detox-ios:
138
+ runs-on: macos-14
139
+ steps:
140
+ - uses: actions/checkout@v4
141
+ - run: yarn install --frozen-lockfile
142
+ - run: brew tap wix/brew && brew install applesimutils
143
+ - run: yarn detox build -c ios.debug && yarn detox test -c ios.debug --headless
144
+ ```
145
+
146
+ ## 5. Flakiness — non-negotiable rules
147
+
148
+ 1. **No `sleep(N)`.** Use built-in waits (`waitFor`, `extendedWaitUntil`).
149
+ 2. Tests must pass 50× in a row in CI before they're trusted.
150
+ 3. Reset app state between tests; don't share login.
151
+ 4. Don't depend on network for unit/component layer — mock at the boundary.
152
+ 5. If a test is flaky once, fix or quarantine it the same day. Don't `retries: 5`.
153
+
154
+ ## 6. Critical journeys to cover (always)
155
+
156
+ Even MVPs should ship E2E for:
157
+
158
+ - First-run onboarding through to the home tab.
159
+ - Sign-up + sign-in + sign-out.
160
+ - Primary "value moment" action (the one PRD success criterion exists for).
161
+ - Push notification deep link.
162
+ - Network-failure UX (offline mode, retry).
163
+
164
+ Everything else is nice-to-have until the team has signal that the critical flows are stable.
165
+
166
+ ## 7. Device matrix
167
+
168
+ See `device-matrix.md`. Maestro Cloud and BrowserStack expose matrices Hawkeye can declare in YAML and run weekly.
169
+
170
+ ## 8. Don'ts
171
+
172
+ - E2E tests in the same job as unit tests (slow, blocks faster signal).
173
+ - Selectors by visible text in a multilingual app.
174
+ - Running E2E only at release; broken paths get found at the worst time.
175
+ - "Manual smoke" replacing automated smoke. Maestro flows take a day to write and save weeks per year.
176
+
177
+ ## 9. Hand-off
178
+
179
+ Tony picks RN / native / Flutter; that decides the Detox feasibility. Hawkeye writes the Maestro flow files alongside the story `tea-design.md`. Shuri owns the `testID`s and accessibility identifiers and treats them as a public API of the app — renaming one is a contract change.
@@ -0,0 +1,121 @@
1
+ ---
2
+ playbook: device-matrix
3
+ owner: wize-agent-test-architect # Hawkeye
4
+ applies_when: app-overlay active
5
+ status: ready
6
+ ---
7
+
8
+ # Device Matrix — Hawkeye Playbook
9
+
10
+ You can't test on every device. You can test on the right ones. Decide the matrix once per release; rotate quarterly.
11
+
12
+ ## 1. The three buckets
13
+
14
+ Every release ships on three device classes:
15
+
16
+ | Bucket | Why |
17
+ |---|---|
18
+ | **Floor** (oldest supported / lowest-spec) | Performance & memory pressure catches regressions invisible on flagship. |
19
+ | **Volume** (most-used by your audience) | Where users actually live. Drive default UX decisions here. |
20
+ | **Ceiling** (latest flagship + newest OS) | New-feature opportunity (Live Activities, Predictive Back, etc.) + verify no flagship-only assumption breaks. |
21
+
22
+ ## 2. iOS matrix (2026, generic SaaS audience)
23
+
24
+ | Bucket | Device | iOS | Notes |
25
+ |---|---|---|---|
26
+ | Floor | iPhone SE (2nd gen, A13) | iOS 17 | 4.7" non-Retina XDR, no Dynamic Island. |
27
+ | Floor | iPhone 11 | iOS 17 | Wide audience tail. |
28
+ | Volume | iPhone 14 | iOS 18 | Mid-range volume sweet spot. |
29
+ | Volume | iPhone 15 | iOS 18 | Dynamic Island, USB-C. |
30
+ | Ceiling | iPhone 17 Pro | iOS 26 (current dev) | ProMotion, latest APIs. |
31
+ | iPad floor | iPad (10th gen) | iPadOS 17 | Non-ProMotion. |
32
+ | iPad ceiling | iPad Pro M4 | iPadOS 18 | Stage Manager, hover, Pencil hover. |
33
+
34
+ **Min OS:** iOS 17 (cuts ~5% of installed base; recovers a lot of API surface). Adjust per audience.
35
+
36
+ ## 3. Android matrix (2026, generic SaaS audience)
37
+
38
+ | Bucket | Device | OS | Notes |
39
+ |---|---|---|---|
40
+ | Floor | Pixel 6a or Samsung A14 | Android 13 | 4 GB RAM, Snapdragon 6-series. |
41
+ | Volume | Samsung Galaxy A55 | Android 14 | Mid-range. Big volume in emerging markets. |
42
+ | Volume | Pixel 8 | Android 14 / 15 | Reference device for API behavior. |
43
+ | Ceiling | Pixel 9 Pro / Galaxy S25 Ultra | Android 15 | Foldable / large-screen, edge gestures. |
44
+ | Foldable | Samsung Galaxy Z Fold 6 | Android 14 / 15 | Adaptive layout signal. |
45
+ | Tablet | Pixel Tablet | Android 14 | Window-size-class testing. |
46
+
47
+ **Min OS:** Android 13 (API 33) — covers ~85% of active devices. Verify via Play Console statistics for your audience.
48
+
49
+ ## 4. Hybrid / web-in-app matrix
50
+
51
+ If the app uses webviews (Capacitor, Ionic, embedded web docs):
52
+
53
+ - iOS: WKWebView (always system Safari engine).
54
+ - Android: System WebView (Chromium-based, updated separately). Test on **last 3 Chromium versions**.
55
+
56
+ ## 5. Choosing the volume tier
57
+
58
+ Don't guess. Pull from:
59
+
60
+ - **App Store Connect → Analytics → Sources → Devices** (after release).
61
+ - **Google Play Console → Statistics → Devices**.
62
+ - For pre-release: pick the top 3 devices in your target market via StatCounter / DeviceAtlas / Crashlytics-baseline market data.
63
+
64
+ Rotate volume devices every two quarters as field data shifts.
65
+
66
+ ## 6. How to run the matrix in CI
67
+
68
+ ### Cloud farms
69
+
70
+ | Provider | iOS | Android | Notes |
71
+ |---|---|---|---|
72
+ | BrowserStack App Live / Automate | ✓ | ✓ | Largest catalog; integrates Detox + Maestro. |
73
+ | Sauce Labs Mobile | ✓ | ✓ | Strong on Appium; price ladder. |
74
+ | Maestro Cloud | ✓ | ✓ | YAML-native; visual diff included. |
75
+ | Firebase Test Lab | (limited) | ✓ | Android-first; cheap, large. |
76
+ | AWS Device Farm | ✓ | ✓ | Real devices; AWS billing. |
77
+ | LambdaTest | ✓ | ✓ | Mid-tier price. |
78
+
79
+ ### Local
80
+
81
+ - iOS: Xcode simulators for development; **at least one real device per bucket** before release.
82
+ - Android: emulators (`avdmanager` + `system-images;android-34;google_apis;x86_64`); real device per bucket.
83
+
84
+ ### What runs where
85
+
86
+ - **Every PR:** smoke flow (Maestro) on emulator iOS + Android (volume bucket).
87
+ - **Every merge to main:** full smoke matrix (floor + volume + ceiling).
88
+ - **Nightly:** full E2E suite (Detox + Maestro) on real devices via cloud farm.
89
+ - **Weekly:** perf benchmark suite (cold start, memory, FPS) on the floor + volume buckets.
90
+
91
+ ## 7. Accessibility runs
92
+
93
+ Add to the device matrix:
94
+
95
+ - iOS: VoiceOver + Dynamic Type at largest accessibility size.
96
+ - Android: TalkBack + 130% font scale.
97
+ - Color contrast checks at the OS level (Smart Invert / Dark Mode forced).
98
+ - Switch Control (iOS) / Switch Access (Android) on the most-used flow.
99
+
100
+ ## 8. Network conditions
101
+
102
+ Hawkeye samples network at:
103
+
104
+ | Condition | Tool |
105
+ |---|---|
106
+ | Offline | Airplane mode flag in CI. |
107
+ | 3G slow | Charles / Proxyman / Maestro `setProxy` + bandwidth throttle. |
108
+ | Lossy WiFi | `tc qdisc` on Linux runner; Network Link Conditioner on Mac. |
109
+ | Captive portal | Manual on weekly cycle. |
110
+
111
+ A surprising % of production crashes come from network edge cases. Cover at least offline + slow.
112
+
113
+ ## 9. Locale
114
+
115
+ - Always test **English + the two largest non-English locales** for the audience.
116
+ - RTL (Arabic or Hebrew) at least once per release if the app ships in those markets.
117
+ - Date / number / currency formatting in the relevant locales.
118
+
119
+ ## 10. Hand-off
120
+
121
+ The device matrix lives at `.wize/planning/app/device-matrix.md` once Mantis + Tony agree on the audience. Hawkeye references it in every `tea-design.md`; CI configs (Maestro / Detox / BrowserStack) read the same matrix to avoid drift.
@@ -0,0 +1,135 @@
1
+ ---
2
+ playbook: material-design-3
3
+ owner: wize-agent-ux-designer # Mantis
4
+ applies_when: app-overlay active (Android)
5
+ status: ready
6
+ ---
7
+
8
+ # Material Design 3 (Material You) — Mantis Playbook
9
+
10
+ M3 is a design system that adapts to the user, not the other way around. Tokens drive everything.
11
+
12
+ ## 1. The four pillars
13
+
14
+ 1. **Personal** — colors derive from user wallpaper (Material You).
15
+ 2. **Adaptive** — same UI, different layouts on phone / foldable / tablet / desktop.
16
+ 3. **Expressive** — bigger type, richer motion, branded but readable.
17
+ 4. **Inclusive** — built-in accessibility floor: contrast tiers, large touch targets, dynamic type.
18
+
19
+ ## 2. Tokens (the only acceptable way to ship styles)
20
+
21
+ ### Color roles
22
+
23
+ | Role | Use for |
24
+ |---|---|
25
+ | `primary` | Brand primary action color, FABs, prominent buttons. |
26
+ | `onPrimary` | Foreground on `primary`. |
27
+ | `primaryContainer` | Tonal surfaces using primary hue. |
28
+ | `onPrimaryContainer` | Foreground on `primaryContainer`. |
29
+ | `secondary` / `tertiary` | Lower-emphasis accents. |
30
+ | `surface` / `surfaceVariant` | Cards, sheets, containers. |
31
+ | `surfaceContainer*` (M3) | New tiers: low, mid, high, highest. Use for elevation-by-color. |
32
+ | `error` / `onError` | Error states. |
33
+ | `outline` / `outlineVariant` | Borders, dividers. |
34
+
35
+ Never use raw hex. Always tokens. Color is regenerated from the user's seed (dynamic) — hex won't recolor.
36
+
37
+ ### Type scale (M3)
38
+
39
+ | Token | Use |
40
+ |---|---|
41
+ | `displayLarge` / `Medium` / `Small` | Hero text, rarely. |
42
+ | `headlineLarge` / `Medium` / `Small` | Page-level titles. |
43
+ | `titleLarge` / `Medium` / `Small` | Section, dialog titles. |
44
+ | `bodyLarge` / `Medium` / `Small` | Body content. |
45
+ | `labelLarge` / `Medium` / `Small` | Buttons, chips, captions. |
46
+
47
+ ### Shape
48
+
49
+ `shape.small` (4dp) / `medium` (12dp) / `large` (16dp) / `extraLarge` (28dp). Cards: medium. Bottom sheets: large. FAB: extraLarge.
50
+
51
+ ### Elevation by color (M3 change)
52
+
53
+ M3 prefers tonal elevation (surface color tier) over shadow. Use `surfaceContainerLow` → `surfaceContainerHighest` to express depth. Drop shadows are still allowed but secondary.
54
+
55
+ ## 3. Components (a starter set)
56
+
57
+ | Component | Default | Notes |
58
+ |---|---|---|
59
+ | Top app bar | Small (default) | Center-aligned, medium, large variants for hero pages. |
60
+ | Navigation bar (bottom) | 3–5 destinations | Phones default. |
61
+ | Navigation rail | tablets / foldable open | Side rail for medium widths. |
62
+ | Navigation drawer | tablets / desktops | Persistent sidebar pattern. |
63
+ | FAB | Primary action | 1 per screen max. |
64
+ | Extended FAB | Action + label | When the action is non-obvious. |
65
+ | Cards | Filled / Outlined / Elevated | Pick one variant per surface family. |
66
+ | Chips | Assist / Filter / Input / Suggestion | Match the use-case verb. |
67
+ | Buttons | Elevated / Filled / Tonal / Outlined / Text | Pick by hierarchy, not aesthetics. |
68
+ | Bottom sheet | Modal (standalone) / Standard (inline) | Standard is the new big M3 pattern. |
69
+
70
+ ## 4. Adaptive layouts
71
+
72
+ Material breakpoints:
73
+
74
+ | Window class | Width | Layout |
75
+ |---|---|---|
76
+ | Compact | < 600dp | Bottom nav, single pane. |
77
+ | Medium | 600–839dp | Nav rail, list-detail with detail-on-tap. |
78
+ | Expanded | 840–1199dp | Nav rail/drawer, two-pane list-detail. |
79
+ | Large | 1200dp+ | Persistent drawer, multi-pane. |
80
+
81
+ Mantis designs **at minimum compact + expanded**. Tony picks the technique (foldable awareness, window-size-class) for the chosen stack.
82
+
83
+ ## 5. Motion
84
+
85
+ | Motion | Duration | Easing |
86
+ |---|---|---|
87
+ | Standard | 300ms | `motion.easingStandard` |
88
+ | Emphasized | 500ms | `motion.easingEmphasized` |
89
+ | Decelerate | 250ms | for incoming |
90
+ | Accelerate | 200ms | for outgoing |
91
+
92
+ Reduced motion: replace transforms with fades. Test with system "Remove animations" enabled.
93
+
94
+ ## 6. Navigation idioms
95
+
96
+ - System Back is canonical. Don't reimplement back arrows that conflict with the gesture.
97
+ - Predictive back (Android 14+) needs `OnBackInvokedCallback` to preview the destination.
98
+ - Avoid hamburger menus on phones — use bottom nav.
99
+
100
+ ## 7. Accessibility floor
101
+
102
+ - Touch targets: **48×48 dp minimum** (HIG-equivalent rule).
103
+ - Talkback labels on every actionable element.
104
+ - `contentDescription` for icons-without-text.
105
+ - Dynamic type via `sp` (never `dp` for text). Support 130% font scale.
106
+ - Contrast follows WCAG AA tokens; M3 tooling validates contrast pairs by default.
107
+
108
+ ## 8. Theming with Material You
109
+
110
+ If the project allows wallpaper-derived theming:
111
+
112
+ ```kotlin
113
+ // Compose
114
+ val dynamicColors = if (Build.VERSION.SDK_INT >= 31)
115
+ dynamicColorScheme(LocalContext.current) else darkColorScheme()
116
+ MaterialTheme(colorScheme = dynamicColors) { /* ... */ }
117
+ ```
118
+
119
+ For brand-locked apps, ship a fixed seed but stay in tokens; this preserves accessibility-tier behavior.
120
+
121
+ ## 9. Don'ts
122
+
123
+ - Hex colors in components.
124
+ - Ignoring tonal elevation in favor of shadow.
125
+ - Bottom nav with > 5 items (use scrollable tabs instead).
126
+ - One FAB per app bar action (rate-limit to one FAB).
127
+ - Dialogs for non-blocking confirmations (use snackbar with undo).
128
+
129
+ ## 10. Cross-platform note
130
+
131
+ If iOS is shipped too: do not port Material to iOS, and vice versa. The Mantis design system separates **brand tokens** (shared) from **platform tokens** (per-OS). See `apple-hig.md`.
132
+
133
+ ## 11. Hand-off
134
+
135
+ Mantis annotates screens with Material component names and tokens (`md.sys.color.primary`, `md.sys.typescale.titleLarge`). Tony picks Compose / View system / cross-platform (Flutter, RN). Shuri implements against the component+token contract.