@anthropologies/claudestory 0.1.56 → 0.1.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/cli.js +115 -38
- package/dist/mcp.js +48 -36
- package/package.json +6 -1
- package/src/skill/SKILL.md +6 -0
- package/src/skill/autonomous-mode.md +2 -0
- package/src/skill/design/design.md +311 -0
- package/src/skill/design/references/android.md +132 -0
- package/src/skill/design/references/ios.md +132 -0
- package/src/skill/design/references/macos.md +109 -0
- package/src/skill/design/references/web.md +104 -0
- package/src/skill/reference.md +14 -0
- package/src/skill/setup-flow.md +6 -0
package/src/skill/SKILL.md
CHANGED
|
@@ -21,6 +21,8 @@ claudestory tracks tickets, issues, roadmap, and handovers in a `.story/` direct
|
|
|
21
21
|
- `/story export` -> export project for sharing. Ask the user whether to export the current phase or the full project, then call `claudestory_export` with either `phase` or `all` set
|
|
22
22
|
- `/story status` -> quick status check (call `claudestory_status` MCP tool)
|
|
23
23
|
- `/story settings` -> manage project settings (see Settings section below)
|
|
24
|
+
- `/story design` -> evaluate frontend design (read `design/design.md` in the same directory as this skill file; if not found, tell user to run `claudestory setup-skill`)
|
|
25
|
+
- `/story design <platform>` -> evaluate for specific platform: web, ios, macos, android (read `design/design.md` in the same directory as this skill file)
|
|
24
26
|
- `/story help` -> show all capabilities (read `reference.md` in the same directory as this skill file; if not found, tell user to run `claudestory setup-skill`)
|
|
25
27
|
|
|
26
28
|
If the user's intent doesn't match any of these, use the full context load.
|
|
@@ -132,6 +134,7 @@ Example: "Rules: integer cents for money, billing engine is pure logic, TDD for
|
|
|
132
134
|
Tip: You can also use these modes anytime:
|
|
133
135
|
/story guided T-XXX One ticket end-to-end with planning and code review
|
|
134
136
|
/story review T-XXX Review code you already wrote
|
|
137
|
+
/story design Evaluate frontend against platform best practices
|
|
135
138
|
```
|
|
136
139
|
|
|
137
140
|
Show this once or twice, then never again.
|
|
@@ -182,6 +185,8 @@ When working on a task and you encounter a bug, inconsistency, or improvement op
|
|
|
182
185
|
|
|
183
186
|
When starting work on a ticket, update its status to `inprogress`. When done, update to `complete` in the same commit as the code change.
|
|
184
187
|
|
|
188
|
+
**Frontend design guidance:** When working on UI or frontend tickets, read `design/design.md` in the same directory as this skill file for design principles and platform-specific best practices. Follow its priority order (clarity > hierarchy > platform correctness > accessibility > state completeness) and load the relevant platform reference. This applies to any ticket involving components, layouts, styling, or visual design.
|
|
189
|
+
|
|
185
190
|
## Managing Tickets and Issues
|
|
186
191
|
|
|
187
192
|
Ticket and issue create/update operations are available via both CLI and MCP tools. Delete remains CLI-only.
|
|
@@ -361,3 +366,4 @@ Additional skill documentation, loaded on demand:
|
|
|
361
366
|
- **`setup-flow.md`** -- Project detection and AI-Assisted Setup Flow (new project initialization)
|
|
362
367
|
- **`autonomous-mode.md`** -- Autonomous mode, review, plan, and guided execution tiers
|
|
363
368
|
- **`reference.md`** -- Full CLI command and MCP tool reference
|
|
369
|
+
- **`design/design.md`** -- Frontend design evaluation and implementation guidance, with platform references in `design/references/`
|
|
@@ -14,6 +14,8 @@ This file is referenced from SKILL.md for `/story auto`, `/story review`, `/stor
|
|
|
14
14
|
4. The guide advances through: PICK_TICKET -> PLAN -> PLAN_REVIEW -> IMPLEMENT -> CODE_REVIEW -> FINALIZE -> COMPLETE -> loop
|
|
15
15
|
5. Continue until the guide returns SESSION_END
|
|
16
16
|
|
|
17
|
+
**Frontend design:** If the current ticket involves UI, frontend, components, layouts, or styling, read `design/design.md` in the same directory as the skill file for design principles. Load the relevant platform reference from `design/references/`. Apply the priority order (clarity > hierarchy > platform correctness > accessibility > state completeness) during both planning and implementation.
|
|
18
|
+
|
|
17
19
|
**Critical rules for autonomous mode:**
|
|
18
20
|
- Do NOT use Claude Code's plan mode -- write plans as markdown files
|
|
19
21
|
- Do NOT ask the user for confirmation or approval
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
# Frontend Design -- Evaluation & Implementation Guide
|
|
2
|
+
|
|
3
|
+
This file is referenced from SKILL.md for `/story design` commands and when working on UI tickets.
|
|
4
|
+
|
|
5
|
+
**Skill command name:** When this file references `/story` in user-facing output, use the actual command that invoked you (e.g., `/story design` for standalone install, `/story:go design` for plugin install).
|
|
6
|
+
|
|
7
|
+
## Evaluation Mode (/story design)
|
|
8
|
+
|
|
9
|
+
When invoked via `/story design`:
|
|
10
|
+
|
|
11
|
+
1. **Detect platform** from project code:
|
|
12
|
+
- package.json with react/next/vue/angular/svelte deps -> web
|
|
13
|
+
- .xcodeproj or SwiftUI imports -> macOS (check for iOS targets -> ios)
|
|
14
|
+
- build.gradle.kts + AndroidManifest.xml -> android
|
|
15
|
+
- pubspec.yaml -> flutter (ask which platform target)
|
|
16
|
+
- **Multi-platform**: If multiple platform indicators found, ask via AskUserQuestion which platform(s) to evaluate. Allow multiple passes. Scope scanning to the relevant app/package paths, not the whole repo.
|
|
17
|
+
- If no frontend code detected, tell the user and exit gracefully.
|
|
18
|
+
|
|
19
|
+
2. **Accept platform override**: `/story design web`, `/story design ios`, `/story design macos`, `/story design android`.
|
|
20
|
+
|
|
21
|
+
3. **Load platform reference**: Read `references/<platform>.md` in the same directory as this file. If not found, tell the user to run `claudestory setup-skill` to update skill files.
|
|
22
|
+
|
|
23
|
+
4. **Check existing design issues**: Before creating new issues, list existing open issues with component "design" (via `claudestory_issue_list` MCP tool or `claudestory issue list --component design` CLI). Match findings against existing issues by title and location. Update existing issues instead of creating duplicates. Mark resolved issues when the underlying code no longer violates the rule.
|
|
24
|
+
|
|
25
|
+
5. **Scan UI code**: Read component files, layout files, style files, routing. Evaluate against the principles in this file AND the loaded platform reference. Check: hierarchy, state completeness, accessibility, design system consistency, typography, color system, layout, motion, anti-patterns.
|
|
26
|
+
|
|
27
|
+
6. **Output findings** (three-tier fallback):
|
|
28
|
+
- If claudestory MCP tools available: create/update issues via `claudestory_issue_create` and `claudestory_issue_update` (severity based on priority order, components: `["design", "<platform>"]`, location: file paths with line numbers)
|
|
29
|
+
- If MCP unavailable but claudestory CLI installed: use `claudestory issue create` and `claudestory issue update` via Bash
|
|
30
|
+
- If neither available: output markdown checklist grouped by severity
|
|
31
|
+
|
|
32
|
+
7. **Present summary**: Show a table of findings grouped by severity (critical, high, medium, low), then use AskUserQuestion:
|
|
33
|
+
- question: "What would you like to do?"
|
|
34
|
+
- header: "Design"
|
|
35
|
+
- options:
|
|
36
|
+
- "Fix the most critical issue (Recommended)" -- start working on the highest-severity finding
|
|
37
|
+
- "See detailed rationale for a finding" -- explain why a specific finding matters
|
|
38
|
+
- "Done for now" -- return to normal session
|
|
39
|
+
|
|
40
|
+
## Implementation Guidance Mode
|
|
41
|
+
|
|
42
|
+
When working on UI tickets (not explicit `/story design` invocation), use the principles below and the relevant platform reference to guide implementation. Do not output the design reasoning unless the user explicitly asks for a design review or rationale. Go straight to high-quality implementation.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Platform Routing
|
|
47
|
+
|
|
48
|
+
After reading this file, also read the platform-specific reference for the target:
|
|
49
|
+
|
|
50
|
+
- **Web** -> `references/web.md`
|
|
51
|
+
- **macOS / Desktop** -> `references/macos.md`
|
|
52
|
+
- **iOS** -> `references/ios.md`
|
|
53
|
+
- **Android** -> `references/android.md`
|
|
54
|
+
- **Flutter** -> ask which target platform(s), then read the corresponding reference(s): `references/ios.md` for iOS, `references/android.md` for Android, `references/web.md` for web
|
|
55
|
+
- **React Native** -> read both `references/ios.md` and `references/android.md`
|
|
56
|
+
|
|
57
|
+
If the platform is ambiguous, infer from context. Default to web only when the request is clearly browser or UI artifact oriented. If multi-platform, read all relevant references.
|
|
58
|
+
|
|
59
|
+
## Stack Handling
|
|
60
|
+
|
|
61
|
+
Implementation stacks are handled in this file. Platform-specific behavior is handled in references/*.md. Do not let cross-platform code-sharing override target platform fit.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Prime Directive
|
|
66
|
+
|
|
67
|
+
Clarity before flair.
|
|
68
|
+
|
|
69
|
+
A user must quickly understand: where they are, what matters most, what they can do next, what changed, and what to do when something goes wrong.
|
|
70
|
+
|
|
71
|
+
If the interface looks impressive but creates hesitation, confusion, or false affordances, it failed.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Operating Mode
|
|
76
|
+
|
|
77
|
+
Before designing, determine silently:
|
|
78
|
+
|
|
79
|
+
- **Product goal** -- What problem is this interface solving?
|
|
80
|
+
- **Primary user** -- Who is using it, and in what context?
|
|
81
|
+
- **Main task** -- What is the single most important thing the user needs to accomplish here?
|
|
82
|
+
- **Target platform** -- Web, macOS/desktop, iOS, Android, or multi-platform?
|
|
83
|
+
- **Implementation stack** -- Native, React Native, Flutter, Web React/Next, or other?
|
|
84
|
+
- **Content shape** -- Workflow-heavy, content-heavy, form-heavy, data-dense, utility-focused, or brand-heavy?
|
|
85
|
+
- **Tone** -- What visual and emotional direction best fits the product? (restrained minimal, technical/instrumented, warm tactile, editorial, premium, playful, industrial, brutalist, retro-futurist, calm healthcare, sharp geometric, etc.)
|
|
86
|
+
- **Signature idea** -- One memorable design move that gives the interface identity without reducing clarity, ergonomics, or performance.
|
|
87
|
+
|
|
88
|
+
Do not output this reasoning unless the user explicitly asks for a design review or rationale. Go straight to high-quality implementation.
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Priority Order
|
|
93
|
+
|
|
94
|
+
When principles conflict, obey this order:
|
|
95
|
+
|
|
96
|
+
1. Clarity
|
|
97
|
+
2. Hierarchy
|
|
98
|
+
3. Platform correctness
|
|
99
|
+
4. Accessibility
|
|
100
|
+
5. State completeness
|
|
101
|
+
6. System consistency
|
|
102
|
+
7. Content-fit
|
|
103
|
+
8. Visual distinction
|
|
104
|
+
9. Motion and atmosphere
|
|
105
|
+
10. Novelty
|
|
106
|
+
|
|
107
|
+
A distinctive visual idea must be discarded if it harms comprehension, native behavior, accessibility, or maintainability.
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Core Design Principles
|
|
112
|
+
|
|
113
|
+
### 1. Strong hierarchy
|
|
114
|
+
|
|
115
|
+
Every screen must have a clear order of attention: primary action -> primary content -> supporting information -> secondary controls -> background/chrome.
|
|
116
|
+
|
|
117
|
+
Use size, weight, spacing, contrast, color, grouping, and placement to make priority unmistakable. Avoid flat layouts where everything competes equally.
|
|
118
|
+
|
|
119
|
+
### 2. Design systems, not one-off decoration
|
|
120
|
+
|
|
121
|
+
Build with repeatable rules: spacing scale (e.g., 4/8/12/16/24/32/48/64), type scale with clear roles, color roles (not swatches), radius system, elevation/surface rules, border logic, interaction patterns, component states.
|
|
122
|
+
|
|
123
|
+
Use tokens or CSS variables wherever possible. A screen that looks good once but cannot scale is not production-grade.
|
|
124
|
+
|
|
125
|
+
### 3. Content-first composition
|
|
126
|
+
|
|
127
|
+
Shape the UI around real tasks and real information, not fashionable patterns.
|
|
128
|
+
|
|
129
|
+
Use realistic sample content that stress-tests the layout: long names and short names, empty lists and dense lists, real validation messages, realistic dates, statuses, tags, and actions. Never rely on fake-perfect placeholder content to make the design look cleaner than it is. No "Lorem ipsum," "John Doe," or "Acme Corp."
|
|
130
|
+
|
|
131
|
+
### 4. Restraint
|
|
132
|
+
|
|
133
|
+
Being distinctive does not mean adding more. One strong idea, executed precisely, beats ten decorative tricks.
|
|
134
|
+
|
|
135
|
+
Bold maximalism is valid. Refined minimalism is valid. Both fail if they are vague, noisy, or shallow. Match implementation complexity to the aesthetic vision: maximalist designs need elaborate code with layered effects; minimal designs need surgical precision in spacing, type, and subtle detail.
|
|
136
|
+
|
|
137
|
+
### 5. State completeness
|
|
138
|
+
|
|
139
|
+
Never design only the happy path.
|
|
140
|
+
|
|
141
|
+
For all meaningful screens and components, account for: default, hover/pressed/focused (where relevant), selected/active, disabled, loading/skeleton, empty, error (with real messages, not "Something went wrong"), success/confirmation, destructive action confirmation, offline/stale/retry (when relevant).
|
|
142
|
+
|
|
143
|
+
At minimum, every meaningful interface must include: default, loading or skeleton, empty, and error.
|
|
144
|
+
|
|
145
|
+
### 6. Accessibility is design quality
|
|
146
|
+
|
|
147
|
+
Always include: sufficient contrast (4.5:1 body text, 3:1 large text/UI), visible focus states for keyboard navigation, semantic structure (headings, landmarks, labels), keyboard support where relevant, screen reader labeling where needed, touch targets >= 44pt on iOS / >= 48dp on Android, prefers-reduced-motion support, support for text scaling / Dynamic Type where relevant.
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Typography
|
|
152
|
+
|
|
153
|
+
Typography must serve readability first, identity second.
|
|
154
|
+
|
|
155
|
+
**The hybrid rule:** For native Apple platforms, use system fonts (San Francisco) for body text and dense data UI to maintain native feel and respect Dynamic Type. Reserve distinctive, characterful fonts for headings, hero sections, key metrics, and branded accents.
|
|
156
|
+
|
|
157
|
+
For web, font choice should support tone, performance, and readability. Pair a distinctive display font with a refined body font. Contrast in style, harmony in tone.
|
|
158
|
+
|
|
159
|
+
Define clear type roles and use them consistently: display, page title, section title, body, secondary/meta, label/button, caption.
|
|
160
|
+
|
|
161
|
+
The problem is never "system font." The problem is generic thinking.
|
|
162
|
+
|
|
163
|
+
## Color
|
|
164
|
+
|
|
165
|
+
Build a semantic color system, not a mood board.
|
|
166
|
+
|
|
167
|
+
Define roles: background, elevated surface, primary text, secondary text, accent, border/divider, success, warning, error, disabled, selection, focus.
|
|
168
|
+
|
|
169
|
+
Dominant color + sharp accent outperforms timid, evenly distributed palettes. But the palette must serve the product, not just look attractive in isolation.
|
|
170
|
+
|
|
171
|
+
Dark and light themes are both valid. Choose intentionally based on product context, not habit.
|
|
172
|
+
|
|
173
|
+
## Layout and Spatial Composition
|
|
174
|
+
|
|
175
|
+
Maintain a consistent spacing system. Group related controls and content clearly. Use whitespace intentionally -- generous space and controlled density are both valid. Allow density where the workflow benefits from it. Avoid empty spaciousness that wastes viewport.
|
|
176
|
+
|
|
177
|
+
Use asymmetry, overlap, diagonal flow, or broken-grid composition only when it improves the concept and preserves clarity. Unexpected layout is welcome. Confusing layout is not.
|
|
178
|
+
|
|
179
|
+
## Visual Direction
|
|
180
|
+
|
|
181
|
+
Choose a specific aesthetic direction that fits the product, audience, and platform: restrained minimal, premium/luxury, editorial/magazine, technical/instrumented, calm healthcare, industrial/utilitarian, playful consumer, retro-futurist, warm tactile, sharp geometric, brutalist/raw, soft organic, maximalist chaos.
|
|
182
|
+
|
|
183
|
+
Commit consistently across typography, spacing, surfaces, color, borders, iconography, shadow/elevation, motion, and illustration style.
|
|
184
|
+
|
|
185
|
+
Do not default to the same visual recipe across unrelated products. Vary between light and dark, different fonts, different spatial logic, different atmospheric treatments. Never converge on the same recipe across generations.
|
|
186
|
+
|
|
187
|
+
## Atmosphere and Surface Treatment
|
|
188
|
+
|
|
189
|
+
Use visual atmosphere when it supports the concept: subtle gradient fields, noise/grain, layered translucency, geometric patterns, restrained glow, tactile or dramatic shadows, sharp or decorative borders, material surfaces, depth through contrast and layering, custom cursors on web.
|
|
190
|
+
|
|
191
|
+
But: never apply glassmorphism by default, never use blur as a substitute for hierarchy, never add texture just to avoid simplicity, never make the background more interesting than the content. A clean surface is a valid aesthetic choice.
|
|
192
|
+
|
|
193
|
+
## Components and Interaction
|
|
194
|
+
|
|
195
|
+
Components should feel like part of one system, not isolated design exercises. Ensure consistency across: buttons, inputs, navigation, cards, lists, tables, tabs, sheets/modals, banners, alerts, tooltips, menus, progress/loading states.
|
|
196
|
+
|
|
197
|
+
Affordances must be obvious. Feedback must be timely. States must be visually distinct.
|
|
198
|
+
|
|
199
|
+
## Motion and Feedback
|
|
200
|
+
|
|
201
|
+
Good uses: staged content reveal with staggered animation-delay, page/screen transitions, expanding detail panels, feedback on action completion, preserving continuity between states, subtle hover/press/tap response, scroll-triggered reveals on web.
|
|
202
|
+
|
|
203
|
+
Avoid: looping ambient motion that distracts, theatrical transitions in utility workflows, motion that slows down repeated actions, decorative animation without meaning.
|
|
204
|
+
|
|
205
|
+
One well-orchestrated page entrance with staggered reveals creates more delight than scattered micro-interactions everywhere. Always respect prefers-reduced-motion.
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## Anti-Patterns
|
|
210
|
+
|
|
211
|
+
Avoid generic AI UI failure modes:
|
|
212
|
+
|
|
213
|
+
- trendy gradients with no product fit
|
|
214
|
+
- flat hierarchy where everything competes equally
|
|
215
|
+
- oversized rounded cards everywhere
|
|
216
|
+
- meaningless glassmorphism or blur effects
|
|
217
|
+
- random pills and badges on everything
|
|
218
|
+
- dashboards that look rich but hide the task
|
|
219
|
+
- decorative charts with fake data
|
|
220
|
+
- overly spacious desktop layouts / shrunk desktop UI on iPhone
|
|
221
|
+
- overdesigned empty states that steal focus from recovery actions
|
|
222
|
+
- a perfect default state with no loading/error/empty coverage
|
|
223
|
+
- placeholder content chosen only because it looks neat
|
|
224
|
+
- forcing quirky typography into dense utility interfaces
|
|
225
|
+
- using the same visual recipe for every product
|
|
226
|
+
- cookie-cutter component patterns with no context-specific character
|
|
227
|
+
|
|
228
|
+
The failure is not a font, color, or style by itself. The failure is defaulting instead of designing.
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## Implementation Environment
|
|
233
|
+
|
|
234
|
+
### React / JSX (.jsx)
|
|
235
|
+
- Single-file component with default export, no required props
|
|
236
|
+
- Tailwind core utility classes for styling (no compiler -- only pre-defined classes)
|
|
237
|
+
- Available: React hooks, lucide-react@0.383.0, recharts, d3, Three.js (r128), lodash, mathjs, Plotly, shadcn/ui, Chart.js, Tone, Papaparse, SheetJS, mammoth, tensorflow
|
|
238
|
+
- Import external fonts via `<style>` block with `@import url()` from Google Fonts
|
|
239
|
+
- No localStorage or sessionStorage -- use React state
|
|
240
|
+
- Motion library for animation when it materially improves the result
|
|
241
|
+
|
|
242
|
+
### HTML (.html)
|
|
243
|
+
- Single self-contained file: HTML + CSS + JS
|
|
244
|
+
- Load fonts from Google Fonts via `<link>`, libraries from cdnjs.cloudflare.com
|
|
245
|
+
- CSS-only animations preferred
|
|
246
|
+
- Keep JS focused on interaction, not decoration
|
|
247
|
+
|
|
248
|
+
### SwiftUI / UIKit (iOS, macOS)
|
|
249
|
+
- Use SwiftUI as default for new UI; UIKit when required for specific controls or legacy integration
|
|
250
|
+
- Respect platform navigation patterns (NavigationStack, TabView, sheets)
|
|
251
|
+
- Use system typography (SF Pro) for body and data UI; custom fonts for headings and brand moments
|
|
252
|
+
- Support Dynamic Type via system text styles or custom styles that scale
|
|
253
|
+
- Use semantic system colors or a custom semantic palette that supports light/dark/high-contrast
|
|
254
|
+
- Prefer native controls -- do not rebuild standard components unless the product demands it
|
|
255
|
+
- Use `withAnimation` and spring-based timing for transitions
|
|
256
|
+
- Mark interactive elements with proper accessibility labels, traits, and hints
|
|
257
|
+
|
|
258
|
+
### Jetpack Compose (Android)
|
|
259
|
+
- Use Material 3 theming as the structural baseline (color scheme, typography, shapes)
|
|
260
|
+
- Build with `Modifier` chains for layout, spacing, semantics, and interaction
|
|
261
|
+
- Hoist state for reusable and testable composables
|
|
262
|
+
- Use `WindowSizeClass` for adaptive layout decisions across phones, tablets, foldables
|
|
263
|
+
- Use `sp` for text (respects accessibility scaling), `dp` for spacing and sizing
|
|
264
|
+
- Support dark theme via `MaterialTheme` color scheme switching
|
|
265
|
+
- Apply `semantics` modifier for TalkBack / screen reader labeling
|
|
266
|
+
- Use Material motion patterns (container transform, shared axis) for navigation transitions
|
|
267
|
+
|
|
268
|
+
### React Native
|
|
269
|
+
- Share product structure across platforms, but allow platform-specific refinements
|
|
270
|
+
- Use `Platform.select` or platform-specific files where controls, spacing, navigation, or feedback should differ
|
|
271
|
+
- Respect native interaction patterns: iOS springs and haptics, Android ripple and system back
|
|
272
|
+
- Use native modules or native surfaces when product quality demands them
|
|
273
|
+
- Do not design one mobile UI and skin it twice -- the app should feel at home on each OS
|
|
274
|
+
- Test on both platforms; do not assume iOS behavior works on Android or vice versa
|
|
275
|
+
|
|
276
|
+
### Flutter
|
|
277
|
+
- Use Material 3 theming as the baseline; apply Cupertino or platform-adaptive controls where they materially improve platform fit
|
|
278
|
+
- Build adaptive layouts using `LayoutBuilder`, `MediaQuery`, or window size breakpoints
|
|
279
|
+
- Use platform-appropriate navigation, feedback, density, and control treatment
|
|
280
|
+
- Support phones, tablets, desktop windows, and web surfaces when relevant
|
|
281
|
+
- One product system with target-aware variations -- shared code is fine, shared UX must be intentional
|
|
282
|
+
- Do not use Flutter as an excuse to ignore platform conventions
|
|
283
|
+
|
|
284
|
+
### Shared rules
|
|
285
|
+
- Use design tokens or semantic theme values appropriate to the stack
|
|
286
|
+
- Realistic sample content that stress-tests the layout
|
|
287
|
+
- At minimum: default state, one loading or empty state, and basic error handling
|
|
288
|
+
- Self-contained and immediately functional on render
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## Output Standards
|
|
293
|
+
|
|
294
|
+
Unless the user explicitly asks for a design critique or rationale first, go straight to implementation. Do not output a design brief, component inventory, or process summary unless asked.
|
|
295
|
+
|
|
296
|
+
Produce code that is: production-grade, accessible, platform-appropriate, organized, realistic, visually polished without becoming fragile, state-aware, free of placeholder nonsense.
|
|
297
|
+
|
|
298
|
+
For web: semantic HTML, focus states, contrast, ARIA where needed.
|
|
299
|
+
For native: accessibility labels, traits/semantics, focus/navigation behavior, platform-appropriate text scaling and interaction feedback.
|
|
300
|
+
|
|
301
|
+
Include: reusable tokens/CSS variables, spacing and type scales, key state variants, realistic sample content, semantic structure, focus states and keyboard support where relevant.
|
|
302
|
+
|
|
303
|
+
Do not generate dead ornamental markup.
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
## Final Standard
|
|
308
|
+
|
|
309
|
+
The result should feel like a strong product designer led it, a design system supports it, a real team could ship it, users would understand it quickly, the visual identity is specific and intentional, the platform was respected, and the interface is memorable without trying too hard.
|
|
310
|
+
|
|
311
|
+
Have taste. Have restraint. Have a point of view. Earn it through clarity.
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# Android Platform Reference
|
|
2
|
+
|
|
3
|
+
Read this alongside the core design.md when building Android native apps (Jetpack Compose/XML), React Native for Android, Flutter for Android, or any interface targeting Android phones, tablets, and foldables.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Android Interaction Model
|
|
8
|
+
|
|
9
|
+
Android is a touch-first platform with a broader hardware spectrum than iOS -- varying screen sizes, densities, aspect ratios, foldable states, and manufacturer customizations. Design must be adaptive, not fixed.
|
|
10
|
+
|
|
11
|
+
Design for:
|
|
12
|
+
- Touch-first interaction with Android-native feedback patterns (ripple, state overlays)
|
|
13
|
+
- System back behavior as a first-class navigation rule -- predictive back gesture on Android 14+
|
|
14
|
+
- Adaptive layouts that respond to actual window size, not just device type
|
|
15
|
+
- Edge-to-edge rendering that properly respects system bars and insets
|
|
16
|
+
- Touch targets >= 48dp for all interactive elements
|
|
17
|
+
- Variable screen densities (mdpi through xxxhdpi)
|
|
18
|
+
|
|
19
|
+
## Navigation Patterns
|
|
20
|
+
|
|
21
|
+
Android navigation differs meaningfully from iOS. Do not port iOS patterns directly.
|
|
22
|
+
|
|
23
|
+
- **Bottom navigation**: For 3-5 top-level destinations. Persistent, with clear active state. Equivalent to iOS tab bar but follows Material conventions.
|
|
24
|
+
- **Navigation rail**: For tablets, foldables, and large-window layouts. Vertical strip on the leading edge -- replaces bottom nav at wider breakpoints.
|
|
25
|
+
- **Navigation drawer**: For apps with many top-level sections or infrequent navigation. Can be modal or persistent depending on screen width.
|
|
26
|
+
- **Top app bar**: Title, navigation icon, and actions. Scrolling behavior (lift on scroll, collapse) should match content type.
|
|
27
|
+
- **System back**: Must work correctly everywhere. Back should dismiss sheets, close dialogs, pop navigation, and ultimately exit the app. Never trap the user.
|
|
28
|
+
- **Predictive back**: On Android 14+, users can preview the back destination with a swipe gesture. Ensure back targets are correct and meaningful.
|
|
29
|
+
|
|
30
|
+
Do not use iOS-style swipe-from-left-edge as the primary back mechanism. Android users rely on the system back gesture or button.
|
|
31
|
+
|
|
32
|
+
## Adaptive Layout
|
|
33
|
+
|
|
34
|
+
Android runs on phones, tablets, foldables, Chromebooks, and desktop-mode windows. Layout must adapt.
|
|
35
|
+
|
|
36
|
+
- **Compact width** (<600dp): Single-column, bottom navigation, focused flows
|
|
37
|
+
- **Medium width** (600-840dp): List-detail side-by-side, navigation rail, two-column content
|
|
38
|
+
- **Expanded width** (840dp+): Three-pane layouts, persistent navigation, dense information display
|
|
39
|
+
|
|
40
|
+
Use window size classes, not device type, to drive layout decisions. A foldable in half-open posture and a small tablet may share the same layout.
|
|
41
|
+
|
|
42
|
+
Content should reflow smoothly -- not snap between discrete phone and tablet layouts.
|
|
43
|
+
|
|
44
|
+
## Material Design Baseline
|
|
45
|
+
|
|
46
|
+
Material Design is the native design language for Android. Use it as the structural baseline.
|
|
47
|
+
|
|
48
|
+
- **Surfaces and elevation**: Material uses tonal elevation (surface color shifts) rather than drop shadows as the primary depth cue. Understand the surface hierarchy.
|
|
49
|
+
- **Color system**: Material 3 uses dynamic color derived from a source color. Define primary, secondary, tertiary, error, surface, and on-surface roles. Support Material You dynamic theming where appropriate.
|
|
50
|
+
- **Shape**: Material 3 uses a shape scale (none, extra-small, small, medium, large, extra-large, full). Apply consistently to containers, buttons, chips, cards.
|
|
51
|
+
- **Typography**: Material 3 type scale -- display, headline, title, body, label. Map these to your content roles.
|
|
52
|
+
|
|
53
|
+
You can customize Material heavily -- the point is not to look like stock Material, but to use its structural logic (color roles, elevation model, shape system, type scale) as the foundation.
|
|
54
|
+
|
|
55
|
+
## Typography for Android
|
|
56
|
+
|
|
57
|
+
- System sans-serif (Roboto on most devices) is the safe native baseline for body text and dense data UI.
|
|
58
|
+
- Custom brand typography is valid and encouraged for headings, hero sections, and branded moments -- provided readability and density remain strong.
|
|
59
|
+
- Support text scaling -- users can set system font size from small to very large. Test at 200% and ensure layouts don't break.
|
|
60
|
+
- Minimum body text: 14sp. Labels and captions: 12sp. Use sp (scale-independent pixels) to respect user preferences.
|
|
61
|
+
- Do not use fixed dp for text sizes -- this ignores accessibility scaling.
|
|
62
|
+
|
|
63
|
+
## Color and Theming
|
|
64
|
+
|
|
65
|
+
- Support both light and dark themes -- test both thoroughly
|
|
66
|
+
- Use Material color roles semantically: primary for key actions, secondary for less prominent elements, surface for containers, error for problems
|
|
67
|
+
- Support **Material You** dynamic color where it adds value (user wallpaper-derived palette)
|
|
68
|
+
- Ensure contrast ratios meet WCAG guidelines in both themes
|
|
69
|
+
- Do not rely on color alone -- pair with icons, text labels, or shape changes
|
|
70
|
+
|
|
71
|
+
## States and Feedback
|
|
72
|
+
|
|
73
|
+
Android has its own feedback language. Respect it.
|
|
74
|
+
|
|
75
|
+
- **Ripple effect**: The standard touch feedback. Apply to all tappable surfaces. Do not replace with iOS-style opacity changes.
|
|
76
|
+
- **State overlays**: Hovered, focused, pressed, dragged states use semi-transparent overlays on the surface color. Material defines specific opacity values for each.
|
|
77
|
+
- **Snackbars**: For lightweight, transient feedback ("Message sent", "Item deleted" with undo). Appear at the bottom, auto-dismiss.
|
|
78
|
+
- **Loading**: Progress indicators (linear or circular) with context. Skeleton screens for content loading. Pull-to-refresh for list content.
|
|
79
|
+
- **Empty states**: Clear illustration or icon + explanation + primary action
|
|
80
|
+
- **Error states**: Inline for form fields, banners for page-level errors, snackbar for transient failures with retry
|
|
81
|
+
|
|
82
|
+
## Android-Specific Motion
|
|
83
|
+
|
|
84
|
+
- Use Material motion principles: container transforms, shared axis, fade through, fade
|
|
85
|
+
- **Container transform**: An element expands into its detail view -- maintains spatial continuity
|
|
86
|
+
- **Shared axis**: Forward/backward, up/down transitions for navigation within a hierarchy
|
|
87
|
+
- **Fade through**: For transitions between unrelated content
|
|
88
|
+
- Respect `Settings > Accessibility > Remove animations` -- provide instant fallbacks
|
|
89
|
+
- Keep transitions under 300ms for utility flows
|
|
90
|
+
- Spring physics are acceptable but less idiomatic than Material easing curves
|
|
91
|
+
|
|
92
|
+
## Forms on Android
|
|
93
|
+
|
|
94
|
+
- Use appropriate `inputType` for each field (text, number, email, phone, password)
|
|
95
|
+
- Autofill hints via `autofillHints` for common fields
|
|
96
|
+
- Material text fields: outlined or filled variants with clear label, helper text, error text, character counter
|
|
97
|
+
- Validation: inline, specific messages, shown on focus loss or submit attempt
|
|
98
|
+
- Keyboard should not obscure the active field -- manage `windowSoftInputMode` or scroll behavior
|
|
99
|
+
- Use dropdowns, date pickers, and time pickers where appropriate instead of free text
|
|
100
|
+
|
|
101
|
+
## Foldable and Large Screen Considerations
|
|
102
|
+
|
|
103
|
+
- Test on foldable emulators (fold/unfold transitions, tabletop posture, book posture)
|
|
104
|
+
- Content should not be lost or hidden during fold state changes
|
|
105
|
+
- Use the hinge area intentionally -- do not place interactive elements across it
|
|
106
|
+
- In tabletop posture (half-folded): consider split layout with content above and controls below the fold
|
|
107
|
+
- Support multi-window and picture-in-picture where appropriate
|
|
108
|
+
|
|
109
|
+
## Jetpack Compose Notes
|
|
110
|
+
|
|
111
|
+
When implementing with Compose:
|
|
112
|
+
|
|
113
|
+
- Use `Modifier` chains intentionally for layout, spacing, semantics, and interaction
|
|
114
|
+
- Hoist state for reusable and testable composables
|
|
115
|
+
- Use `Material3` theme and components as the baseline
|
|
116
|
+
- Prefer `WindowSizeClass` for adaptive layout decisions
|
|
117
|
+
- Use `semantics` modifier for accessibility labeling
|
|
118
|
+
- Support dark theme via `MaterialTheme` color scheme switching
|
|
119
|
+
- Test with font scale, display size, and TalkBack
|
|
120
|
+
|
|
121
|
+
## Android Anti-Patterns
|
|
122
|
+
|
|
123
|
+
- iOS navigation patterns (swipe-from-edge back, bottom sheets as primary navigation)
|
|
124
|
+
- iOS-style toggle switches and segmented controls without adaptation
|
|
125
|
+
- Ignoring system back behavior or trapping the user
|
|
126
|
+
- Fixed layouts that break on non-standard aspect ratios or foldables
|
|
127
|
+
- Ripple-free tap targets (feels broken on Android)
|
|
128
|
+
- Snackbar-less error handling (overusing dialogs for transient messages)
|
|
129
|
+
- Ignoring Material elevation and surface model (everything flat or everything shadowed)
|
|
130
|
+
- One rigid phone layout that doesn't adapt to tablet or foldable
|
|
131
|
+
- Text in dp instead of sp, breaking accessibility scaling
|
|
132
|
+
- Testing only on Pixel -- Samsung, OnePlus, and others have meaningful differences
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# iOS Platform Reference
|
|
2
|
+
|
|
3
|
+
Read this alongside the core design.md when building iOS native apps (SwiftUI/UIKit), React Native for iOS, or any interface targeting iPhone and iPad.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## iOS Interaction Model
|
|
8
|
+
|
|
9
|
+
iOS is a touch-first, single-focus platform. Users interact with thumbs on a handheld device in variable contexts -- walking, one-handed, distracted.
|
|
10
|
+
|
|
11
|
+
Design for:
|
|
12
|
+
- Touch-first interaction -- no hover states as primary affordance
|
|
13
|
+
- Thumb-reach ergonomics -- primary actions in the bottom third of the screen
|
|
14
|
+
- Single-task focus -- one primary action per screen, not competing panels
|
|
15
|
+
- Motion and transitions that maintain spatial orientation
|
|
16
|
+
- Concise flows -- minimize steps, maximize clarity per step
|
|
17
|
+
- Gesture restraint -- only use gestures that are obvious and discoverable
|
|
18
|
+
|
|
19
|
+
## Navigation Patterns
|
|
20
|
+
|
|
21
|
+
iOS has strong navigation conventions. Respect them.
|
|
22
|
+
|
|
23
|
+
- **Navigation stack** (push/pop): For hierarchical drill-down. Title in nav bar, back button preserves context. This is the primary pattern.
|
|
24
|
+
- **Tab bar**: For top-level app sections (2-5 tabs). Persistent at bottom, always accessible.
|
|
25
|
+
- **Sheets and modals**: For focused sub-tasks, creation flows, or settings. Half-sheet for quick actions, full sheet for complex tasks.
|
|
26
|
+
- **Segmented controls**: For switching views within a single context (e.g., list/grid, day/week/month).
|
|
27
|
+
- **Action sheets**: For contextual choices triggered by user action.
|
|
28
|
+
- **Swipe actions**: For list item operations (delete, archive, pin). Use sparingly and for common actions only.
|
|
29
|
+
|
|
30
|
+
Do not invent custom navigation paradigms when standard patterns work. Users have strong muscle memory for iOS navigation.
|
|
31
|
+
|
|
32
|
+
## Safe Areas and Layout
|
|
33
|
+
|
|
34
|
+
- Respect safe area insets on all edges (status bar, home indicator, notch/Dynamic Island)
|
|
35
|
+
- Content should not hide behind system UI
|
|
36
|
+
- Scrollable content should extend edge-to-edge behind the nav bar and tab bar with proper insets
|
|
37
|
+
- Landscape orientation: adjust layout for wide-and-short viewport if supported
|
|
38
|
+
- iPad: consider split view, sidebar, and adaptive layout for larger canvas
|
|
39
|
+
|
|
40
|
+
## Touch Targets
|
|
41
|
+
|
|
42
|
+
- Minimum 44x44pt tap targets for all interactive elements
|
|
43
|
+
- Adequate spacing between adjacent tap targets to prevent mis-taps
|
|
44
|
+
- Primary actions should be large, obvious, and reachable by thumb
|
|
45
|
+
- Destructive actions should require deliberate targeting -- not placed where accidental taps happen
|
|
46
|
+
|
|
47
|
+
## Thumb Zone Ergonomics
|
|
48
|
+
|
|
49
|
+
On iPhone, design with the thumb-reach heat map in mind:
|
|
50
|
+
|
|
51
|
+
- **Easy reach** (bottom center): Place primary actions, main navigation, frequently used controls
|
|
52
|
+
- **Moderate reach** (middle of screen): Content display, lists, secondary actions
|
|
53
|
+
- **Hard reach** (top corners): Search, settings, infrequent actions -- or use pull-down gestures to make them accessible
|
|
54
|
+
|
|
55
|
+
Tab bars, bottom toolbars, and floating action areas take advantage of easy reach. Top nav bars are standard but should not house primary repeated actions.
|
|
56
|
+
|
|
57
|
+
## Typography for iOS
|
|
58
|
+
|
|
59
|
+
- **SF Pro** (system font) is the correct choice for body text, labels, list content, and dense data UI on iOS. It respects Dynamic Type scaling, integrates with system accessibility, and matches platform expectations.
|
|
60
|
+
- Reserve custom/characterful fonts for headings, hero sections, onboarding, branding moments, and marketing surfaces.
|
|
61
|
+
- Support **Dynamic Type** -- text should scale with the user's system text size preference. Use system text styles (`.body`, `.headline`, `.caption`, etc.) or custom styles that scale proportionally.
|
|
62
|
+
- Do not use fixed font sizes that ignore accessibility scaling.
|
|
63
|
+
- Minimum body text size: 17pt (system body default). Metadata and captions can go to 13pt.
|
|
64
|
+
|
|
65
|
+
## Color and Appearance
|
|
66
|
+
|
|
67
|
+
- Support both light and dark mode using semantic system colors or a custom semantic palette
|
|
68
|
+
- Use high contrast between text and backgrounds (system colors handle this well)
|
|
69
|
+
- Tint colors should have a clear accent role -- not spread across every surface
|
|
70
|
+
- Respect the `UIAccessibility` increased contrast setting
|
|
71
|
+
- Avoid relying on color alone to convey meaning -- pair with icons, labels, or shape
|
|
72
|
+
|
|
73
|
+
## States and Feedback
|
|
74
|
+
|
|
75
|
+
iOS users expect immediate, tactile feedback:
|
|
76
|
+
|
|
77
|
+
- **Tap feedback**: Highlight state on press, subtle scale or opacity change
|
|
78
|
+
- **Haptics**: Use for meaningful moments -- successful action, toggle, destructive confirmation, selection change. Not for every tap.
|
|
79
|
+
- **Loading**: Skeleton screens or activity indicators with context ("Loading your messages" not just a spinner)
|
|
80
|
+
- **Empty states**: Clear explanation + primary action to resolve ("No conversations yet -- Start a new chat")
|
|
81
|
+
- **Error states**: Specific message + recovery action, not generic alerts
|
|
82
|
+
- **Pull-to-refresh**: Standard pattern for list content where data can be stale
|
|
83
|
+
- **Swipe-to-delete**: With confirmation for destructive actions
|
|
84
|
+
|
|
85
|
+
## iOS-Specific Motion
|
|
86
|
+
|
|
87
|
+
- Use **spring animations** for transitions -- iOS motion feels physical, not eased
|
|
88
|
+
- Navigation pushes and pops should feel like spatial movement
|
|
89
|
+
- Sheet presentation: slide up from bottom with spring settle
|
|
90
|
+
- Dismiss: swipe down gesture with velocity-based completion
|
|
91
|
+
- Content transitions: crossfade for in-place changes, slide for spatial changes
|
|
92
|
+
- Respect `UIAccessibility.isReduceMotionEnabled` -- provide instant transitions as fallback
|
|
93
|
+
|
|
94
|
+
Avoid:
|
|
95
|
+
- Web-style fade-in-from-nothing animations
|
|
96
|
+
- Excessive parallax
|
|
97
|
+
- Decorative motion on utility screens
|
|
98
|
+
- Animations that delay task completion
|
|
99
|
+
|
|
100
|
+
## Forms on iOS
|
|
101
|
+
|
|
102
|
+
- Use appropriate keyboard types for each field (email, number, phone, URL)
|
|
103
|
+
- Use `textContentType` hints for autofill (name, email, password, address)
|
|
104
|
+
- Inline validation -- mark fields as invalid with specific messages
|
|
105
|
+
- Respect the keyboard safe area -- content should scroll or adjust to remain visible above the keyboard
|
|
106
|
+
- Group related fields into logical sections
|
|
107
|
+
- Use pickers, date pickers, and segmented controls where appropriate instead of free-text input
|
|
108
|
+
|
|
109
|
+
## iPad Considerations
|
|
110
|
+
|
|
111
|
+
When targeting iPad as well:
|
|
112
|
+
|
|
113
|
+
- Support multitasking (Split View, Slide Over) where appropriate
|
|
114
|
+
- Use sidebar navigation on iPad (collapsible, adapts to compact width)
|
|
115
|
+
- Two-column or three-column layouts for master-detail patterns
|
|
116
|
+
- Support pointer/trackpad interaction (hover states, right-click menus)
|
|
117
|
+
- Keyboard shortcut support for productivity workflows
|
|
118
|
+
- Adapt layout for regular and compact size classes
|
|
119
|
+
|
|
120
|
+
## iOS Anti-Patterns
|
|
121
|
+
|
|
122
|
+
- Desktop-density layouts crammed onto a 390pt-wide screen
|
|
123
|
+
- Custom navigation that fights the back gesture
|
|
124
|
+
- Tab bars with more than 5 items
|
|
125
|
+
- Primary actions placed in hard-to-reach top corners
|
|
126
|
+
- Text that doesn't scale with Dynamic Type
|
|
127
|
+
- Alerts and modals for every error instead of inline feedback
|
|
128
|
+
- Hamburger menus hiding primary navigation
|
|
129
|
+
- Gesture-only interactions with no visible affordance
|
|
130
|
+
- Ignoring the home indicator safe area
|
|
131
|
+
- Fixed font sizes that break at larger accessibility sizes
|
|
132
|
+
- Loading states with no contextual information
|