@anthropologies/claudestory 0.1.56 → 0.1.57

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 CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  An agentic development framework. Track tickets, issues, and progress for your project in a `.story/` directory that AI tools read and write natively.
4
4
 
5
+ **[claudestory.com](https://claudestory.com)** | **[Documentation](https://claudestory.com/cli)** | **[Privacy Policy](https://claudestory.com/privacy)**
6
+
5
7
  ## Installation
6
8
 
7
9
  ```bash
@@ -201,4 +203,4 @@ Everything else in `.story/` should be tracked.
201
203
 
202
204
  ## License
203
205
 
204
- MIT
206
+ [PolyForm Noncommercial 1.0.0](https://polyformproject.org/licenses/noncommercial/1.0.0/) -- free for personal and noncommercial use. For commercial licensing, contact shayegh@me.com.
package/dist/cli.js CHANGED
@@ -2634,6 +2634,20 @@ function formatReference(commands, mcpTools, format) {
2634
2634
  lines.push(`- **${tool.name}**${params} \u2014 ${tool.description}`);
2635
2635
  }
2636
2636
  lines.push("");
2637
+ lines.push("## /story design");
2638
+ lines.push("");
2639
+ lines.push("Evaluate frontend code against platform-specific design best practices.");
2640
+ lines.push("");
2641
+ lines.push("```");
2642
+ lines.push("/story design # Auto-detect platform, evaluate frontend");
2643
+ lines.push("/story design web # Evaluate against web best practices");
2644
+ lines.push("/story design ios # Evaluate against iOS HIG");
2645
+ lines.push("/story design macos # Evaluate against macOS HIG");
2646
+ lines.push("/story design android # Evaluate against Material Design");
2647
+ lines.push("```");
2648
+ lines.push("");
2649
+ lines.push("Creates issues automatically when claudestory MCP tools or CLI are available. Checks for existing design issues to avoid duplicates on repeated runs. Outputs markdown checklist as fallback when neither MCP nor CLI is available.");
2650
+ lines.push("");
2637
2651
  lines.push("## Common Workflows");
2638
2652
  lines.push("");
2639
2653
  lines.push("### Session Start");
@@ -8358,7 +8372,7 @@ function getInstalledVersion() {
8358
8372
  }
8359
8373
  }
8360
8374
  function getRunningVersion() {
8361
- return "0.1.56";
8375
+ return "0.1.57";
8362
8376
  }
8363
8377
  var init_version_check = __esm({
8364
8378
  "src/autonomous/version-check.ts"() {
@@ -10955,7 +10969,7 @@ var init_mcp = __esm({
10955
10969
  init_init();
10956
10970
  ENV_VAR2 = "CLAUDESTORY_PROJECT_ROOT";
10957
10971
  CONFIG_PATH2 = ".story/config.json";
10958
- version = "0.1.56";
10972
+ version = "0.1.57";
10959
10973
  main().catch((err) => {
10960
10974
  process.stderr.write(`Fatal: ${err instanceof Error ? err.message : String(err)}
10961
10975
  `);
@@ -11559,6 +11573,7 @@ var init_reference = __esm({
11559
11573
  // src/cli/commands/setup-skill.ts
11560
11574
  var setup_skill_exports = {};
11561
11575
  __export(setup_skill_exports, {
11576
+ copyDirRecursive: () => copyDirRecursive,
11562
11577
  handleSetupSkill: () => handleSetupSkill,
11563
11578
  registerPreCompactHook: () => registerPreCompactHook,
11564
11579
  registerSessionStartHook: () => registerSessionStartHook,
@@ -11566,7 +11581,7 @@ __export(setup_skill_exports, {
11566
11581
  removeHook: () => removeHook,
11567
11582
  resolveSkillSourceDir: () => resolveSkillSourceDir
11568
11583
  });
11569
- import { mkdir as mkdir5, writeFile as writeFile3, readFile as readFile5, rm, rename as rename2, unlink as unlink3 } from "fs/promises";
11584
+ import { mkdir as mkdir5, writeFile as writeFile3, readFile as readFile5, readdir as readdir4, copyFile, rm, rename as rename2, unlink as unlink3 } from "fs/promises";
11570
11585
  import { existsSync as existsSync12 } from "fs";
11571
11586
  import { join as join21, dirname as dirname5 } from "path";
11572
11587
  import { homedir } from "os";
@@ -11587,6 +11602,43 @@ function resolveSkillSourceDir() {
11587
11602
  ${sourcePath}`
11588
11603
  );
11589
11604
  }
11605
+ async function copyDirRecursive(srcDir, destDir) {
11606
+ const tmpDir = destDir + ".tmp";
11607
+ const bakDir = destDir + ".bak";
11608
+ if (!existsSync12(destDir) && existsSync12(bakDir)) {
11609
+ await rename2(bakDir, destDir);
11610
+ }
11611
+ if (existsSync12(tmpDir)) await rm(tmpDir, { recursive: true, force: true });
11612
+ if (existsSync12(bakDir)) await rm(bakDir, { recursive: true, force: true });
11613
+ await mkdir5(tmpDir, { recursive: true });
11614
+ const entries = await readdir4(srcDir, { withFileTypes: true, recursive: true });
11615
+ const written = [];
11616
+ for (const entry of entries) {
11617
+ if (!entry.isFile()) continue;
11618
+ const parent = entry.parentPath ?? entry.path ?? srcDir;
11619
+ const relativePath = join21(parent, entry.name).slice(srcDir.length + 1);
11620
+ const srcPath = join21(srcDir, relativePath);
11621
+ const destPath = join21(tmpDir, relativePath);
11622
+ await mkdir5(dirname5(destPath), { recursive: true });
11623
+ await copyFile(srcPath, destPath);
11624
+ written.push(relativePath);
11625
+ }
11626
+ if (existsSync12(destDir)) {
11627
+ await rename2(destDir, bakDir);
11628
+ }
11629
+ try {
11630
+ await rename2(tmpDir, destDir);
11631
+ } catch (err) {
11632
+ if (existsSync12(bakDir)) await rename2(bakDir, destDir).catch(() => {
11633
+ });
11634
+ await rm(tmpDir, { recursive: true, force: true }).catch(() => {
11635
+ });
11636
+ throw err;
11637
+ }
11638
+ await rm(bakDir, { recursive: true, force: true }).catch(() => {
11639
+ });
11640
+ return written;
11641
+ }
11590
11642
  function isHookWithCommand(entry, command) {
11591
11643
  if (typeof entry !== "object" || entry === null) return false;
11592
11644
  const e = entry;
@@ -11772,6 +11824,19 @@ async function handleSetupSkill(options = {}) {
11772
11824
  missingFiles.push(filename);
11773
11825
  }
11774
11826
  }
11827
+ const designSrcDir = join21(srcSkillDir, "design");
11828
+ if (existsSync12(designSrcDir)) {
11829
+ const designDestDir = join21(skillDir, "design");
11830
+ try {
11831
+ const designFiles = await copyDirRecursive(designSrcDir, designDestDir);
11832
+ for (const f of designFiles) writtenFiles.push(`design/${f}`);
11833
+ } catch (err) {
11834
+ const msg = err instanceof Error ? err.message : String(err);
11835
+ process.stderr.write(`Warning: design skill copy failed: ${msg}
11836
+ `);
11837
+ missingFiles.push("design/");
11838
+ }
11839
+ }
11775
11840
  log(`${existed ? "Updated" : "Installed"} /story skill at ${skillDir}/`);
11776
11841
  log(` ${writtenFiles.join(" + ")} written`);
11777
11842
  if (missingFiles.length > 0) {
@@ -14386,7 +14451,7 @@ async function runCli() {
14386
14451
  registerSessionCommand: registerSessionCommand2,
14387
14452
  registerRepairCommand: registerRepairCommand2
14388
14453
  } = await Promise.resolve().then(() => (init_register(), register_exports));
14389
- const version2 = "0.1.56";
14454
+ const version2 = "0.1.57";
14390
14455
  class HandledError extends Error {
14391
14456
  constructor() {
14392
14457
  super("HANDLED_ERROR");
package/dist/mcp.js CHANGED
@@ -7816,7 +7816,7 @@ function getInstalledVersion() {
7816
7816
  }
7817
7817
  }
7818
7818
  function getRunningVersion() {
7819
- return "0.1.56";
7819
+ return "0.1.57";
7820
7820
  }
7821
7821
 
7822
7822
  // src/autonomous/guide.ts
@@ -10087,7 +10087,7 @@ async function ensureGitignoreEntries(gitignorePath, entries) {
10087
10087
  // src/mcp/index.ts
10088
10088
  var ENV_VAR2 = "CLAUDESTORY_PROJECT_ROOT";
10089
10089
  var CONFIG_PATH2 = ".story/config.json";
10090
- var version = "0.1.56";
10090
+ var version = "0.1.57";
10091
10091
  function tryDiscoverRoot() {
10092
10092
  const envRoot = process.env[ENV_VAR2];
10093
10093
  if (envRoot) {
package/package.json CHANGED
@@ -1,8 +1,13 @@
1
1
  {
2
2
  "name": "@anthropologies/claudestory",
3
- "version": "0.1.56",
3
+ "version": "0.1.57",
4
4
  "license": "PolyForm-Noncommercial-1.0.0",
5
5
  "description": "An agentic development framework. Track tickets, issues, and progress for your project so every session builds on the last.",
6
+ "homepage": "https://claudestory.com",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/AmirShayegh/ClaudeStory"
10
+ },
6
11
  "keywords": [
7
12
  "claudestory",
8
13
  "claude-code",
@@ -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
@@ -0,0 +1,109 @@
1
+ # macOS / Desktop Platform Reference
2
+
3
+ Read this alongside the core design.md when building macOS native apps, Electron/Tauri desktop apps, or any interface intended for keyboard-and-pointer desktop use.
4
+
5
+ ---
6
+
7
+ ## Desktop Interaction Model
8
+
9
+ Desktop users operate with a keyboard, mouse/trackpad, and large viewport. They expect precision, density, and simultaneous context.
10
+
11
+ Design for:
12
+ - Denser information display -- desktop users expect more content per screen
13
+ - Multi-pane layouts (sidebar + content + inspector where appropriate)
14
+ - Resizable, adaptable windows that reflow content intelligently
15
+ - Keyboard-first usage (shortcuts, tab order, arrow-key navigation within lists/tables)
16
+ - Hover precision (tooltips, hover states, right-click/context menus)
17
+ - Drag and drop where it serves the workflow (files, list reordering, canvas objects)
18
+
19
+ Desktop users tolerate and often expect more density and more direct control than mobile users.
20
+
21
+ ## Layout Patterns
22
+
23
+ Desktop excels at showing multiple panels of related information simultaneously.
24
+
25
+ Common effective patterns:
26
+ - **Sidebar + content** -- navigation or filtering on the left, main content area
27
+ - **Sidebar + content + inspector** -- three-pane with detail panel (e.g., mail, Xcode, Finder column view)
28
+ - **Toolbar + canvas** -- creative/productivity apps with tools above a workspace
29
+ - **Source list + detail** -- master-detail for collections
30
+ - **Tab-based workspaces** -- for multi-document or multi-context workflows
31
+
32
+ Window resizing should degrade gracefully: inspector can collapse, sidebar can become compact icons, content can reflow.
33
+
34
+ Do not waste desktop space with oversized cards, giant padding, or mobile-like stacking unless the product explicitly calls for it.
35
+
36
+ ## Keyboard and Shortcuts
37
+
38
+ Desktop interfaces must be navigable without a mouse.
39
+
40
+ - Tab moves between focusable elements in logical order
41
+ - Arrow keys navigate within lists, tables, menus, tab groups
42
+ - Enter/Return confirms, Escape cancels/dismisses
43
+ - Common shortcuts (Cmd+S, Cmd+Z, Cmd+F, Cmd+N) should work where semantically appropriate
44
+ - Display keyboard shortcuts in menus and tooltips where relevant
45
+ - Focus states must be clearly visible
46
+
47
+ For native macOS: respect the system menu bar, Cmd+Q, Cmd+W, Cmd+comma for preferences.
48
+
49
+ ## Information Density
50
+
51
+ Desktop gives you viewport. Use it.
52
+
53
+ - Rows in tables can be compact (28-36px height)
54
+ - Lists can show metadata inline rather than requiring drill-down
55
+ - Sidebars can display tree structures and nested navigation
56
+ - Multi-column layouts are expected, not unusual
57
+ - Secondary information can coexist with primary content rather than hiding behind tabs or disclosure
58
+
59
+ Dense does not mean cluttered. Group related information, maintain consistent spacing, and use borders or subtle surface differences to separate regions.
60
+
61
+ ## Context Menus and Direct Manipulation
62
+
63
+ - Right-click / context menu on actionable items (files, list rows, selections)
64
+ - Drag and drop for reordering, moving between panes, and file operations
65
+ - Double-click to open/edit where semantically appropriate
66
+ - Multi-select with Cmd+click and Shift+click in lists and tables
67
+ - Inline editing where it reduces friction (rename, quick value changes)
68
+
69
+ ## Typography for Desktop
70
+
71
+ - For native macOS: SF Pro is often the correct choice for body text, labels, and dense data UI. It integrates with system rendering, supports Dynamic Type, and matches platform expectations.
72
+ - Reserve custom/characterful fonts for headings, branding, hero sections, or marketing surfaces within the app.
73
+ - Dense UI text can go smaller than mobile (13px body is comfortable on desktop, 11-12px for metadata).
74
+ - Use font weight variation (regular, medium, semibold) to create hierarchy within dense layouts rather than relying solely on size changes.
75
+
76
+ ## Desktop-Specific Motion
77
+
78
+ - Sidebar reveal/collapse with smooth transitions
79
+ - Panel resize animations
80
+ - List item reorder with spring physics
81
+ - Sheet/dialog presentation with subtle scale or slide
82
+ - Avoid heavy page-level transitions -- desktop navigation should feel instant
83
+ - Respect system `prefers-reduced-motion`
84
+
85
+ For native macOS: use spring-style animation curves that match system behavior. Avoid web-style easing functions that feel foreign on the platform.
86
+
87
+ ## macOS Native Considerations
88
+
89
+ When building for macOS specifically:
90
+
91
+ - Respect the traffic light window controls (close/minimize/fullscreen)
92
+ - Support full-screen mode gracefully
93
+ - Toolbar items should be appropriately sized and spaced for mouse precision
94
+ - Preferences/Settings should use the standard Cmd+comma shortcut
95
+ - Menu bar integration where appropriate
96
+ - NSToolbar patterns for native toolbar behavior
97
+ - Sidebar selection states should match system conventions (highlight color, rounded selection)
98
+ - Vibrancy and translucency are valid atmospheric tools on macOS -- use sparingly and purposefully
99
+
100
+ ## Desktop Anti-Patterns
101
+
102
+ - Mobile-width content centered in a wide window with empty gutters
103
+ - Oversized touch-target buttons that waste space
104
+ - Single-column layouts that ignore available horizontal space
105
+ - Navigation patterns that require many clicks to access parallel information
106
+ - Hiding commonly-used actions behind hamburger menus
107
+ - Ignoring keyboard navigation entirely
108
+ - Modals that block all other interaction when a panel or inspector would serve better
109
+ - Toast notifications that stack up and obscure content
@@ -0,0 +1,104 @@
1
+ # Web Platform Reference
2
+
3
+ Read this alongside the core design.md when building web apps, websites, landing pages, dashboards, or any browser-rendered interface.
4
+
5
+ ---
6
+
7
+ ## Web Interaction Model
8
+
9
+ Web is the most flexible platform. That flexibility must still feel intentional.
10
+
11
+ Design for:
12
+ - Responsive layout across breakpoints (mobile-first or desktop-first, but tested at both extremes)
13
+ - Semantic HTML (`<nav>`, `<main>`, `<section>`, `<article>`, proper heading hierarchy)
14
+ - Clear link vs. button distinction (links navigate, buttons act)
15
+ - Keyboard navigation and focus management
16
+ - Screen reader compatibility via semantic structure and ARIA where needed
17
+ - Efficient loading and progressive rendering
18
+
19
+ ## Layout and Responsiveness
20
+
21
+ Web layouts must adapt gracefully across viewport sizes.
22
+
23
+ - Use flexible grids and content reflow -- not just stacking at breakpoints
24
+ - Define at least 3 breakpoints: compact (~375-640px), medium (~641-1024px), wide (~1025px+)
25
+ - Content should remain readable and scannable at every width
26
+ - Navigation should collapse or adapt rather than disappear
27
+ - Avoid horizontal scroll on content unless it serves a specific UX pattern (e.g., carousel, data table)
28
+
29
+ Do not make the web feel like a blown-up phone app. Desktop web should use horizontal space purposefully -- multi-column content, sidebars, split views where appropriate.
30
+
31
+ ## Scroll Rhythm and Reading Flow
32
+
33
+ Web is a scrolling medium. Use that well.
34
+
35
+ - Structure content into clear visual sections with distinct rhythm
36
+ - Use scroll-triggered reveals and staggered entrances for editorial or marketing pages
37
+ - Keep utility/app-shell pages focused -- not everything needs scroll animation
38
+ - Anchor navigation or sticky headers for long-form content
39
+ - Manage scroll position on navigation and state changes
40
+
41
+ ## Forms and Validation
42
+
43
+ Forms are one of the most common web patterns and one of the most neglected by AI-generated UI.
44
+
45
+ - Inline validation with specific, helpful error messages
46
+ - Clear visual distinction between valid, invalid, focused, and disabled states
47
+ - Logical tab order
48
+ - Submit button states: default, loading/submitting, disabled, success
49
+ - Accessible labels -- never rely on placeholder text alone as label
50
+ - Group related fields logically
51
+ - Support for keyboard submission (Enter key)
52
+
53
+ ## Browser Behavior
54
+
55
+ Respect the browser as a platform:
56
+ - URLs should be meaningful and shareable where applicable
57
+ - Back/forward navigation should work predictably
58
+ - Opening in new tab should work for links
59
+ - Loading states should account for network latency
60
+ - Error states should offer recovery, not dead ends
61
+ - Favor progressive enhancement -- core functionality should survive missing JS where possible
62
+
63
+ ## Web Visual Freedom
64
+
65
+ Web has creative latitude that native platforms constrain. Use it.
66
+
67
+ Web is well-suited for:
68
+ - Rich page composition and editorial storytelling
69
+ - Scroll-triggered structure and parallax (when purposeful)
70
+ - Custom cursors and hover effects
71
+ - Experimental typography and layout
72
+ - Full-bleed hero sections and atmospheric backgrounds
73
+ - Dashboard shells with flexible panel arrangements
74
+ - Marketing-to-app transitions on landing pages
75
+
76
+ This freedom does not override the priority order in design.md. Clarity and hierarchy still come first.
77
+
78
+ ## Web-Specific Motion
79
+
80
+ - CSS transitions and animations preferred for performance
81
+ - Use Motion library for React when orchestration complexity justifies it
82
+ - Intersection Observer for scroll-triggered reveals
83
+ - Hover states should provide meaningful feedback, not just decoration
84
+ - Page transitions: keep fast for utility, allow cinematic for editorial/marketing
85
+ - Always include `prefers-reduced-motion` fallback
86
+
87
+ ## Web Typography
88
+
89
+ - Import fonts from Google Fonts via `<link>` or `@import`
90
+ - Choose fonts that balance character with web performance (WOFF2, font-display: swap)
91
+ - Body text should be highly readable at all viewport sizes (16px minimum on mobile)
92
+ - Use clamp() or responsive type scales for fluid sizing
93
+ - Pair a distinctive display font with a refined, readable body font
94
+ - Do not default to the same web font every time -- the font should fit the product's tone
95
+
96
+ ## Web Anti-Patterns
97
+
98
+ - Single-column phone-width layouts filling a 1440px screen
99
+ - Hover-only interactions with no touch/keyboard fallback
100
+ - Infinite scroll with no way to reach footer content
101
+ - Forms with no validation states
102
+ - Links that look like buttons and buttons that look like links
103
+ - Loading an entire SPA shell before showing any content
104
+ - Full-page overlays that break browser navigation
@@ -328,6 +328,20 @@ claudestory setup-skill
328
328
  - **claudestory_lesson_reinforce** (id) — Reinforce lesson — increment count and update lastValidated
329
329
  - **claudestory_selftest** — Integration smoke test — create/update/delete cycle
330
330
 
331
+ ## /story design
332
+
333
+ Evaluate frontend code against platform-specific design best practices.
334
+
335
+ ```
336
+ /story design # Auto-detect platform, evaluate frontend
337
+ /story design web # Evaluate against web best practices
338
+ /story design ios # Evaluate against iOS HIG
339
+ /story design macos # Evaluate against macOS HIG
340
+ /story design android # Evaluate against Material Design
341
+ ```
342
+
343
+ Creates issues automatically when claudestory MCP tools or CLI are available. Checks for existing design issues to avoid duplicates on repeated runs. Outputs markdown checklist as fallback when neither MCP nor CLI is available.
344
+
331
345
  ## Common Workflows
332
346
 
333
347
  ### Session Start
@@ -570,6 +570,12 @@ Present a brief completion message and tell the user how to start:
570
570
 
571
571
  Keep it to 2-3 sentences. The system teaches itself through use -- `/story` loads context, shows status, and suggests next work. No need for a manual.
572
572
 
573
+ **Design evaluation hint** (show only when project surface is Web app, Mobile app, or Desktop app):
574
+
575
+ Add one more line after the completion message: "Tip: Run `/story design` anytime to evaluate your frontend against [detected platform] best practices and generate improvement issues."
576
+
577
+ Note: Use the actual command that invoked this flow (e.g., `/story design` for standalone, `/story:go design` for plugin).
578
+
573
579
  ---
574
580
 
575
581
  ## Appendix: Default Stack Recommendations