@harness-engineering/cli 1.6.1 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/dist/agents/personas/planner.yaml +27 -0
  2. package/dist/agents/personas/verifier.yaml +30 -0
  3. package/dist/agents/skills/claude-code/enforce-architecture/SKILL.md +19 -0
  4. package/dist/agents/skills/claude-code/harness-accessibility/SKILL.md +274 -0
  5. package/dist/agents/skills/claude-code/harness-accessibility/skill.yaml +51 -0
  6. package/dist/agents/skills/claude-code/harness-autopilot/SKILL.md +111 -72
  7. package/dist/agents/skills/claude-code/harness-autopilot/skill.yaml +4 -2
  8. package/dist/agents/skills/claude-code/harness-dependency-health/skill.yaml +1 -1
  9. package/dist/agents/skills/claude-code/harness-design/SKILL.md +265 -0
  10. package/dist/agents/skills/claude-code/harness-design/skill.yaml +53 -0
  11. package/dist/agents/skills/claude-code/harness-design-mobile/SKILL.md +336 -0
  12. package/dist/agents/skills/claude-code/harness-design-mobile/skill.yaml +49 -0
  13. package/dist/agents/skills/claude-code/harness-design-system/SKILL.md +282 -0
  14. package/dist/agents/skills/claude-code/harness-design-system/skill.yaml +50 -0
  15. package/dist/agents/skills/claude-code/harness-design-web/SKILL.md +360 -0
  16. package/dist/agents/skills/claude-code/harness-design-web/skill.yaml +52 -0
  17. package/dist/agents/skills/claude-code/harness-hotspot-detector/skill.yaml +1 -1
  18. package/dist/agents/skills/claude-code/harness-impact-analysis/SKILL.md +16 -0
  19. package/dist/agents/skills/claude-code/harness-integrity/SKILL.md +19 -1
  20. package/dist/agents/skills/claude-code/harness-knowledge-mapper/skill.yaml +1 -1
  21. package/dist/agents/skills/claude-code/harness-onboarding/SKILL.md +19 -1
  22. package/dist/agents/skills/claude-code/harness-release-readiness/SKILL.md +13 -9
  23. package/dist/agents/skills/claude-code/harness-security-scan/skill.yaml +1 -1
  24. package/dist/agents/skills/claude-code/harness-verify/SKILL.md +26 -0
  25. package/dist/agents/skills/gemini-cli/harness-accessibility/SKILL.md +274 -0
  26. package/dist/agents/skills/gemini-cli/harness-accessibility/skill.yaml +51 -0
  27. package/dist/agents/skills/gemini-cli/harness-autopilot/SKILL.md +111 -72
  28. package/dist/agents/skills/gemini-cli/harness-autopilot/skill.yaml +4 -2
  29. package/dist/agents/skills/gemini-cli/harness-dependency-health/skill.yaml +1 -1
  30. package/dist/agents/skills/gemini-cli/harness-design/SKILL.md +265 -0
  31. package/dist/agents/skills/gemini-cli/harness-design/skill.yaml +53 -0
  32. package/dist/agents/skills/gemini-cli/harness-design-mobile/SKILL.md +336 -0
  33. package/dist/agents/skills/gemini-cli/harness-design-mobile/skill.yaml +49 -0
  34. package/dist/agents/skills/gemini-cli/harness-design-system/SKILL.md +282 -0
  35. package/dist/agents/skills/gemini-cli/harness-design-system/skill.yaml +50 -0
  36. package/dist/agents/skills/gemini-cli/harness-design-web/SKILL.md +360 -0
  37. package/dist/agents/skills/gemini-cli/harness-design-web/skill.yaml +52 -0
  38. package/dist/agents/skills/gemini-cli/harness-hotspot-detector/skill.yaml +1 -1
  39. package/dist/agents/skills/gemini-cli/harness-impact-analysis/SKILL.md +16 -0
  40. package/dist/agents/skills/gemini-cli/harness-knowledge-mapper/skill.yaml +1 -1
  41. package/dist/agents/skills/gemini-cli/harness-release-readiness/SKILL.md +13 -9
  42. package/dist/agents/skills/gemini-cli/harness-security-scan/skill.yaml +1 -1
  43. package/dist/agents/skills/node_modules/.bin/vitest +2 -2
  44. package/dist/agents/skills/shared/design-knowledge/anti-patterns/color.yaml +106 -0
  45. package/dist/agents/skills/shared/design-knowledge/anti-patterns/layout.yaml +109 -0
  46. package/dist/agents/skills/shared/design-knowledge/anti-patterns/motion.yaml +109 -0
  47. package/dist/agents/skills/shared/design-knowledge/anti-patterns/typography.yaml +112 -0
  48. package/dist/agents/skills/shared/design-knowledge/industries/creative.yaml +80 -0
  49. package/dist/agents/skills/shared/design-knowledge/industries/ecommerce.yaml +80 -0
  50. package/dist/agents/skills/shared/design-knowledge/industries/emerging-tech.yaml +83 -0
  51. package/dist/agents/skills/shared/design-knowledge/industries/fintech.yaml +80 -0
  52. package/dist/agents/skills/shared/design-knowledge/industries/healthcare.yaml +80 -0
  53. package/dist/agents/skills/shared/design-knowledge/industries/lifestyle.yaml +80 -0
  54. package/dist/agents/skills/shared/design-knowledge/industries/saas.yaml +80 -0
  55. package/dist/agents/skills/shared/design-knowledge/industries/services.yaml +80 -0
  56. package/dist/agents/skills/shared/design-knowledge/palettes/curated.yaml +234 -0
  57. package/dist/agents/skills/shared/design-knowledge/platform-rules/android.yaml +125 -0
  58. package/dist/agents/skills/shared/design-knowledge/platform-rules/flutter.yaml +144 -0
  59. package/dist/agents/skills/shared/design-knowledge/platform-rules/ios.yaml +106 -0
  60. package/dist/agents/skills/shared/design-knowledge/platform-rules/web.yaml +102 -0
  61. package/dist/agents/skills/shared/design-knowledge/typography/pairings.yaml +274 -0
  62. package/dist/bin/harness.js +3 -2
  63. package/dist/{chunk-3U5VZYR7.js → chunk-4WUGOJQ7.js} +6 -3
  64. package/dist/{chunk-O6NEKDYP.js → chunk-FFIX3QVG.js} +697 -349
  65. package/dist/chunk-GA6GN5J2.js +6150 -0
  66. package/dist/dist-C4J67MPP.js +242 -0
  67. package/dist/dist-N4D4QWFV.js +2809 -0
  68. package/dist/index.d.ts +79 -0
  69. package/dist/index.js +3 -2
  70. package/dist/validate-cross-check-WGXQ7K62.js +7 -0
  71. package/package.json +12 -8
  72. package/dist/validate-cross-check-LNIZ7KGZ.js +0 -6
@@ -0,0 +1,125 @@
1
+ description: "Android platform design rules — Jetpack Compose/Material 3 patterns, Material Design compliance, and platform-specific constraints"
2
+
3
+ platform: android
4
+ frameworks: ["Jetpack Compose", "XML Views"]
5
+ minimum_version: "API 26 (Android 8.0+)"
6
+ design_system: "Material Design 3 (Material You)"
7
+
8
+ token_binding:
9
+ description: "How design tokens map to Android platform primitives"
10
+ methods:
11
+ - name: "Material 3 ColorScheme"
12
+ priority: 1
13
+ example: "MaterialTheme.colorScheme.primary"
14
+ usage: "Map design tokens to Material 3 color roles via custom Theme composable"
15
+ - name: "Compose Theme Extension"
16
+ priority: 2
17
+ example: "AppTheme.colors.primary"
18
+ usage: "Custom theme object extending MaterialTheme for tokens that don't map to M3 roles"
19
+ - name: "XML Resource Values"
20
+ priority: 3
21
+ example: "@color/primary, @dimen/spacing_md"
22
+ usage: "For XML Views compatibility — define in res/values/colors.xml and dimens.xml"
23
+
24
+ component_patterns:
25
+ - name: "Material 3 components first"
26
+ rule: "Use Material 3 Compose components before building custom ones"
27
+ reason: "M3 components implement accessibility, theming, and state handling correctly out of the box"
28
+ exceptions: ["When the design token system requires visual customization beyond M3 theming", "When no M3 equivalent exists"]
29
+
30
+ - name: "Token-bound styling"
31
+ rule: "All colors, typography, and spacing must reference design tokens via the theme"
32
+ detect: "Search for Color(0xFF...), hardcoded sp/dp values, and fontFamily literals in composables"
33
+ example: |
34
+ // Correct:
35
+ Text(color = MaterialTheme.colorScheme.primary, style = MaterialTheme.typography.bodyLarge)
36
+ // Wrong:
37
+ Text(color = Color(0xFF2563EB), fontSize = 16.sp)
38
+
39
+ - name: "Adaptive layout"
40
+ rule: "Support phones, foldables, and tablets using window size classes"
41
+ approach: "Use WindowSizeClass (compact/medium/expanded) instead of hardcoded breakpoints"
42
+
43
+ material_compliance:
44
+ dynamic_color:
45
+ rule: "Support Material You dynamic color on Android 12+"
46
+ implementation: "Use dynamicLightColorScheme()/dynamicDarkColorScheme() with fallback to custom scheme"
47
+ fallback: "Devices below API 31 use the static token-based color scheme"
48
+
49
+ elevation:
50
+ rule: "Use tonal elevation (surface tint) instead of drop shadows for Material 3"
51
+ implementation: "Surface(tonalElevation = X.dp) instead of shadow-based elevation"
52
+ levels:
53
+ - level: 0
54
+ dp: 0
55
+ usage: "Default surface"
56
+ - level: 1
57
+ dp: 1
58
+ usage: "Cards, navigation rail"
59
+ - level: 2
60
+ dp: 3
61
+ usage: "Bottom sheets, FAB (lowered)"
62
+ - level: 3
63
+ dp: 6
64
+ usage: "Navigation drawer, FAB"
65
+ - level: 4
66
+ dp: 8
67
+ usage: "Top app bar (scrolled)"
68
+ - level: 5
69
+ dp: 12
70
+ usage: "Modal bottom sheet"
71
+
72
+ navigation:
73
+ rule: "Follow Material 3 navigation patterns based on window size class"
74
+ patterns:
75
+ compact: "Bottom navigation bar (NavigationBar) with 3-5 destinations"
76
+ medium: "Navigation rail (NavigationRail) with labels"
77
+ expanded: "Persistent navigation drawer (PermanentNavigationDrawer)"
78
+ avoid: "Hamburger menus on compact screens, custom tab implementations"
79
+
80
+ touch_targets:
81
+ rule: "All interactive elements must have minimum 48x48dp touch target"
82
+ implementation: "Use Modifier.minimumInteractiveComponentSize() or explicit Modifier.size(48.dp)"
83
+ reason: "Material Design and WCAG require minimum 48dp touch targets for accessibility"
84
+
85
+ accessibility:
86
+ talkback:
87
+ rule: "All interactive elements must be accessible to TalkBack"
88
+ requirements:
89
+ - "Set contentDescription on all Image and Icon composables"
90
+ - "Use semantics {} modifier for custom accessible descriptions"
91
+ - "Merge child semantics with Modifier.semantics(mergeDescendants = true) for grouped content"
92
+ - "Set Role.Button, Role.Checkbox, etc. in semantics blocks"
93
+
94
+ font_scaling:
95
+ rule: "All text must scale with system font size settings"
96
+ implementation: "Use MaterialTheme.typography styles (uses sp units). Never hardcode px text sizes."
97
+ testing: "Test at font scale 1.0, 1.3, and 2.0 (maximum system setting)"
98
+ constraints:
99
+ - "Layouts must not clip or overlap at 2.0x font scale"
100
+ - "Scrollable containers must accommodate expanded text"
101
+
102
+ color:
103
+ rule: "Support high contrast theme and ensure color is not the sole indicator"
104
+ implementation: "Test with Android high contrast text enabled in accessibility settings"
105
+
106
+ performance:
107
+ - rule: "Compose recomposition — avoid unnecessary recompositions"
108
+ implementation: "Use remember, derivedStateOf, and stable/immutable annotations"
109
+ measurement: "Use Layout Inspector recomposition counts"
110
+ - rule: "Startup time under 2 seconds (cold start to interactive)"
111
+ measurement: "Use Android Vitals and Macrobenchmark"
112
+ - rule: "LazyColumn/LazyRow for lists over 20 items"
113
+ reason: "Eager Column/Row with many children causes frame drops"
114
+ - rule: "Images loaded with Coil or Glide with proper caching"
115
+ reason: "Synchronous image loading causes jank and OOM on large images"
116
+
117
+ testing:
118
+ - type: "Screenshot"
119
+ tools: ["Roborazzi", "Paparazzi"]
120
+ rule: "Screenshot all component variants in light/dark mode and at 1.0x/2.0x font scale"
121
+ - type: "Accessibility"
122
+ tools: ["Accessibility Scanner", "Espresso accessibility checks"]
123
+ rule: "Run accessibility scanner on all screens"
124
+ - type: "Device matrix"
125
+ rule: "Test on small phone (360dp width), standard phone (412dp), foldable (inner: 600dp), and tablet (840dp+)"
@@ -0,0 +1,144 @@
1
+ description: "Flutter platform design rules — cross-platform patterns, Material/Cupertino adaptation, and platform-specific constraints"
2
+
3
+ platform: flutter
4
+ frameworks: ["Flutter"]
5
+ minimum_version: "Flutter 3.19+ / Dart 3.3+"
6
+ design_systems: ["Material 3", "Cupertino (adaptive)"]
7
+
8
+ token_binding:
9
+ description: "How design tokens map to Flutter platform primitives"
10
+ methods:
11
+ - name: "ThemeData / ColorScheme"
12
+ priority: 1
13
+ example: "Theme.of(context).colorScheme.primary"
14
+ usage: "Map design tokens to Material 3 ColorScheme and TextTheme via custom ThemeData"
15
+ - name: "App Theme Extension"
16
+ priority: 2
17
+ example: "context.appColors.primary"
18
+ usage: "ThemeExtension<T> for tokens that don't map to Material roles"
19
+ - name: "Generated Token Constants"
20
+ priority: 3
21
+ example: "AppTokens.colorPrimary"
22
+ usage: "Build-time generated Dart constants from tokens.json for type-safe access"
23
+
24
+ component_patterns:
25
+ - name: "Platform-adaptive components"
26
+ rule: "Use platform-adaptive widgets that render Material on Android and Cupertino on iOS"
27
+ approach: |
28
+ Use .adaptive constructors where available:
29
+ - Switch.adaptive()
30
+ - Slider.adaptive()
31
+ - CircularProgressIndicator.adaptive()
32
+ For complex components, use Platform.isIOS checks with CupertinoTheme wrapping.
33
+ reason: "Users expect platform-native interaction patterns — Android users expect Material, iOS users expect Cupertino"
34
+
35
+ - name: "Token-bound styling"
36
+ rule: "All colors, typography, and spacing must reference design tokens via the theme"
37
+ detect: "Search for Color(0xFF...), hardcoded fontSize doubles, and literal EdgeInsets values"
38
+ example: |
39
+ // Correct:
40
+ Text('Hello', style: Theme.of(context).textTheme.bodyLarge)
41
+ Container(color: Theme.of(context).colorScheme.surface)
42
+ // Wrong:
43
+ Text('Hello', style: TextStyle(fontSize: 16, color: Color(0xFF2563EB)))
44
+
45
+ - name: "Responsive layout"
46
+ rule: "Support phones, tablets, foldables, and web using LayoutBuilder and MediaQuery"
47
+ approach: "Define breakpoints matching the design system and use LayoutBuilder to switch between compact/expanded layouts"
48
+
49
+ platform_adaptation:
50
+ ios:
51
+ navigation: "Use CupertinoNavigationBar and swipe-to-go-back gesture"
52
+ scroll_physics: "BouncingScrollPhysics (iOS default)"
53
+ haptics: "HapticFeedback.lightImpact() for selections"
54
+ safe_area: "Use SafeArea widget for notch/Dynamic Island"
55
+ typography: "SF Pro via .cupertino text theme"
56
+
57
+ android:
58
+ navigation: "Use NavigationBar (M3 bottom nav) and predictive back gesture"
59
+ scroll_physics: "ClampingScrollPhysics (Android default)"
60
+ haptics: "HapticFeedback.mediumImpact() for confirmations"
61
+ edge_to_edge: "Use SystemChrome.setEnabledSystemUIMode for edge-to-edge"
62
+ typography: "Roboto via Material text theme"
63
+
64
+ web:
65
+ navigation: "Use NavigationRail or permanent drawer for wider layouts"
66
+ scroll_physics: "ClampingScrollPhysics with mouse wheel support"
67
+ hover_states: "Add MouseRegion and hover feedback for pointer devices"
68
+ text_selection: "Enable SelectionArea for text content"
69
+ font_loading: "Use GoogleFonts package with preloading"
70
+
71
+ material3:
72
+ color_roles:
73
+ rule: "Map design tokens to M3 color roles, not arbitrary colors"
74
+ mapping:
75
+ primary: "Brand primary — buttons, FAB, active indicators"
76
+ secondary: "Brand secondary — chips, filters, less prominent actions"
77
+ tertiary: "Complementary accent — badges, highlights"
78
+ surface: "Card and container backgrounds"
79
+ error: "Error states, destructive actions"
80
+ outline: "Borders, dividers"
81
+
82
+ elevation:
83
+ rule: "Use M3 tonal elevation via Surface widget"
84
+ implementation: "Set elevation in Material() or Card() — Flutter M3 auto-applies surface tint"
85
+
86
+ shape:
87
+ rule: "Use ShapeTheme for consistent corner radii"
88
+ scale:
89
+ extraSmall: 4
90
+ small: 8
91
+ medium: 12
92
+ large: 16
93
+ extraLarge: 28
94
+ full: 1000
95
+
96
+ accessibility:
97
+ semantics:
98
+ rule: "All interactive elements must have semantic labels"
99
+ requirements:
100
+ - "Set Semantics(label:) on all Icon and Image widgets"
101
+ - "Use Semantics(button: true) for custom tappable widgets"
102
+ - "Use MergeSemantics to group related content"
103
+ - "Use ExcludeSemantics for decorative elements"
104
+
105
+ text_scaling:
106
+ rule: "All text must scale with system accessibility settings"
107
+ implementation: "Use Theme textTheme styles. Never hardcode fontSize without textScaleFactor awareness."
108
+ testing: "Test at textScaleFactor 1.0, 1.5, and 2.0"
109
+ constraints:
110
+ - "Layouts must not overflow at 2.0x text scale"
111
+ - "Use Flexible/Expanded to accommodate variable text size"
112
+
113
+ touch_targets:
114
+ rule: "Minimum 48x48 logical pixels for all interactive elements"
115
+ implementation: "Use MaterialTapTargetSize.padded (default) or explicit SizedBox constraints"
116
+
117
+ screen_readers:
118
+ rule: "Test with TalkBack (Android) and VoiceOver (iOS)"
119
+ implementation: "Use semanticsLabel, Semantics widget, and SemanticsService.announce for dynamic content"
120
+
121
+ performance:
122
+ - rule: "Build with --release for performance testing (debug mode is 10x slower)"
123
+ - rule: "Use const constructors wherever possible to reduce widget rebuilds"
124
+ detect: "Lint rule prefer_const_constructors"
125
+ - rule: "ListView.builder for lists over 20 items (never ListView with children:[])"
126
+ reason: "ListView with children builds all items eagerly, causing jank and memory pressure"
127
+ - rule: "Cache images with CachedNetworkImage or precacheImage"
128
+ - rule: "Avoid rebuilds — use const, final, ValueListenableBuilder, and Selector for granular rebuilds"
129
+ measurement: "Use DevTools widget rebuild tracker"
130
+ - rule: "Shader compilation jank — use SkSL warmup for known animations"
131
+
132
+ testing:
133
+ - type: "Widget tests"
134
+ tools: ["flutter_test"]
135
+ rule: "All components must have widget tests covering default state, interactions, and edge cases"
136
+ - type: "Golden tests"
137
+ tools: ["golden_toolkit", "alchemist"]
138
+ rule: "Screenshot all component variants in light/dark mode, LTR/RTL, and at multiple text scales"
139
+ - type: "Integration"
140
+ tools: ["integration_test"]
141
+ rule: "Key user flows must have integration tests on both Android and iOS"
142
+ - type: "Accessibility"
143
+ tools: ["flutter_test Semantics matchers"]
144
+ rule: "Verify semantics tree for all screens using find.bySemanticsLabel and semantics matchers"
@@ -0,0 +1,106 @@
1
+ description: "iOS platform design rules — SwiftUI patterns, Human Interface Guidelines compliance, and platform-specific constraints"
2
+
3
+ platform: ios
4
+ frameworks: ["SwiftUI", "UIKit"]
5
+ minimum_version: "iOS 16+"
6
+
7
+ token_binding:
8
+ description: "How design tokens map to iOS platform primitives"
9
+ methods:
10
+ - name: "Asset Catalog Colors"
11
+ priority: 1
12
+ example: "Color('primary')"
13
+ usage: "Named colors in Assets.xcassets with light/dark variants"
14
+ - name: "SwiftUI Color Extension"
15
+ priority: 2
16
+ example: "Color.primary, Color.surface"
17
+ usage: "Static Color extension mapping token names to asset catalog entries"
18
+ - name: "UIKit UIColor Extension"
19
+ priority: 3
20
+ example: "UIColor.primary"
21
+ usage: "For UIKit compatibility layers"
22
+
23
+ component_patterns:
24
+ - name: "Native controls first"
25
+ rule: "Use standard UIKit/SwiftUI controls before building custom ones"
26
+ reason: "Native controls inherit accessibility, Dynamic Type, and platform behaviors automatically"
27
+ exceptions: ["When the design system explicitly defines a custom variant", "When the native control cannot be styled to match tokens"]
28
+
29
+ - name: "Token-bound styling"
30
+ rule: "All colors, fonts, and spacing must reference design tokens, never hardcoded values"
31
+ detect: "Search for Color(red:green:blue:), UIColor(red:green:blue:), and literal CGFloat spacing values"
32
+ example: |
33
+ // Correct:
34
+ .foregroundColor(.primary)
35
+ .font(.custom("Inter", size: Typography.body))
36
+ // Wrong:
37
+ .foregroundColor(Color(red: 0.15, green: 0.38, blue: 0.92))
38
+
39
+ - name: "Adaptive layout"
40
+ rule: "Support all device sizes from iPhone SE to iPad Pro"
41
+ approach: "Use GeometryReader sparingly, prefer native layout (VStack/HStack/LazyGrid) with size classes"
42
+
43
+ hig_compliance:
44
+ safe_areas:
45
+ rule: "Content must respect safe area insets on all devices"
46
+ context: "Notch, Dynamic Island, home indicator, status bar"
47
+ implementation: "Use .safeAreaInset() modifiers, never hardcode top/bottom padding"
48
+
49
+ navigation:
50
+ rule: "Follow iOS navigation patterns — push for drill-down, modal for focused tasks"
51
+ patterns:
52
+ - "NavigationStack for hierarchical content"
53
+ - ".sheet() for focused tasks that don't require full context"
54
+ - ".fullScreenCover() for immersive experiences (photo viewer, video player)"
55
+ avoid: "Custom hamburger menus, bottom tab bars with more than 5 items"
56
+
57
+ dynamic_type:
58
+ rule: "All text must scale with Dynamic Type settings"
59
+ implementation: "Use .font(.body), .font(.title) semantic styles, or .dynamicTypeSize() modifier"
60
+ testing: "Test at all Dynamic Type sizes, especially accessibility sizes (AX1-AX5)"
61
+ constraints:
62
+ - "Layouts must not break at the largest accessibility size"
63
+ - "Minimum touch target remains 44x44pt regardless of text size"
64
+
65
+ haptics:
66
+ rule: "Use appropriate haptic feedback for interactions"
67
+ patterns:
68
+ - "UIImpactFeedbackGenerator(.light) for toggles and selections"
69
+ - "UINotificationFeedbackGenerator for success/error/warning"
70
+ - "UISelectionFeedbackGenerator for picker scrolling"
71
+ avoid: "Haptics on every tap — reserve for meaningful state changes"
72
+
73
+ accessibility:
74
+ voiceover:
75
+ rule: "All interactive elements must be accessible to VoiceOver"
76
+ requirements:
77
+ - "Set .accessibilityLabel() on all images and icons"
78
+ - "Use .accessibilityHint() for non-obvious interactions"
79
+ - "Group related elements with .accessibilityElement(children: .combine)"
80
+ - "Set .accessibilityAddTraits() correctly (.isButton, .isHeader, etc.)"
81
+
82
+ color:
83
+ rule: "Support Increase Contrast and Differentiate Without Color settings"
84
+ implementation: "Check UIAccessibility.isDifferentiateWithoutColorEnabled and provide shape/icon alternatives"
85
+
86
+ motion:
87
+ rule: "Respect Reduce Motion setting"
88
+ implementation: "Check UIAccessibility.isReduceMotionEnabled; replace animations with crossfade or instant transitions"
89
+
90
+ performance:
91
+ - rule: "App launch to interactive in under 2 seconds"
92
+ measurement: "Use Instruments Time Profiler and MetricKit"
93
+ - rule: "Scroll at 60fps minimum (120fps on ProMotion devices)"
94
+ implementation: "Use LazyVStack/LazyHStack for long lists, avoid onAppear heavy work"
95
+ - rule: "Images loaded asynchronously with AsyncImage or custom cache"
96
+ reason: "Synchronous image loading blocks the main thread and causes scroll jank"
97
+
98
+ testing:
99
+ - type: "Snapshot"
100
+ tools: ["swift-snapshot-testing"]
101
+ rule: "Snapshot all component variants in light/dark mode and at standard/accessibility type sizes"
102
+ - type: "Accessibility audit"
103
+ tools: ["Xcode Accessibility Inspector", "XCUITest"]
104
+ rule: "Run accessibility audit on all screens"
105
+ - type: "Device matrix"
106
+ rule: "Test on iPhone SE, iPhone 15, iPhone 15 Pro Max, and iPad minimum"
@@ -0,0 +1,102 @@
1
+ description: "Web platform design rules — CSS, Tailwind, React/Vue/Svelte component patterns and constraints"
2
+
3
+ platform: web
4
+ frameworks: ["React", "Vue", "Svelte", "vanilla"]
5
+ styling: ["Tailwind CSS", "CSS Modules", "CSS-in-JS", "vanilla CSS"]
6
+
7
+ token_binding:
8
+ description: "How design tokens map to web platform primitives"
9
+ methods:
10
+ - name: "CSS Custom Properties"
11
+ priority: 1
12
+ example: "var(--color-primary)"
13
+ usage: "Default binding — works in all CSS contexts"
14
+ - name: "Tailwind Theme Extension"
15
+ priority: 2
16
+ example: "text-primary, bg-surface"
17
+ usage: "When project uses Tailwind — extend tailwind.config with token values"
18
+ - name: "CSS-in-JS Theme Object"
19
+ priority: 3
20
+ example: "theme.colors.primary"
21
+ usage: "When project uses styled-components, Emotion, or similar"
22
+
23
+ component_patterns:
24
+ - name: "Composition over configuration"
25
+ rule: "Prefer composable child components over prop-heavy monolithic components"
26
+ example: |
27
+ // Prefer:
28
+ <Card><CardHeader /><CardBody /><CardFooter /></Card>
29
+ // Over:
30
+ <Card header="..." body="..." footer="..." />
31
+ reason: "Composable components are more flexible, easier to test, and align with framework idioms"
32
+
33
+ - name: "Token-bound styling"
34
+ rule: "All visual properties must reference design tokens, never hardcoded values"
35
+ detect: "Grep for hex colors, px font sizes, and raw spacing values in component files"
36
+ example: |
37
+ // Correct:
38
+ className="text-primary bg-surface p-4"
39
+ // Wrong:
40
+ style={{ color: '#2563eb', padding: '16px' }}
41
+
42
+ - name: "Responsive-first"
43
+ rule: "Components must work at all breakpoints defined in the design system"
44
+ approach: "Mobile-first: base styles for mobile, progressive enhancement for larger screens"
45
+
46
+ - name: "Accessible by default"
47
+ rule: "Interactive components must include ARIA attributes, keyboard handlers, and focus management"
48
+ requirements:
49
+ - "All buttons and links have accessible names"
50
+ - "Focus is visible and follows a logical order"
51
+ - "Dynamic content changes are announced to screen readers"
52
+ - "Color is never the sole indicator of state"
53
+
54
+ css_guidelines:
55
+ custom_properties:
56
+ rule: "Define all design tokens as CSS custom properties on :root"
57
+ example: |
58
+ :root {
59
+ --color-primary: #2563eb;
60
+ --color-surface: #f8fafc;
61
+ --font-display: 'Inter', system-ui, sans-serif;
62
+ --spacing-4: 1rem;
63
+ }
64
+
65
+ tailwind:
66
+ rule: "Extend Tailwind config with token values rather than using arbitrary values"
67
+ example: |
68
+ // tailwind.config.js
69
+ theme: {
70
+ extend: {
71
+ colors: {
72
+ primary: 'var(--color-primary)',
73
+ surface: 'var(--color-surface)',
74
+ }
75
+ }
76
+ }
77
+ avoid: "Arbitrary value syntax like bg-[#2563eb] when a token exists"
78
+
79
+ dark_mode:
80
+ rule: "Support dark mode via CSS custom property overrides, not duplicate stylesheets"
81
+ approach: "Redefine token values inside a [data-theme='dark'] or @media (prefers-color-scheme: dark) block"
82
+
83
+ performance:
84
+ - rule: "Limit CSS bundle to 50KB gzipped"
85
+ reason: "CSS blocks rendering — large stylesheets delay first paint"
86
+ - rule: "Use content-visibility: auto for below-fold sections"
87
+ reason: "Reduces initial layout cost for long pages"
88
+ - rule: "Lazy-load web fonts with font-display: swap"
89
+ reason: "Prevents invisible text (FOIT) during font download"
90
+ - rule: "Prefer CSS transitions over JavaScript animations"
91
+ reason: "CSS animations run on the compositor thread, avoiding main thread jank"
92
+
93
+ testing:
94
+ - type: "Visual regression"
95
+ tools: ["Chromatic", "Percy", "Playwright screenshots"]
96
+ rule: "All component variants must have visual regression coverage"
97
+ - type: "Accessibility"
98
+ tools: ["axe-core", "Lighthouse", "pa11y"]
99
+ rule: "Run axe-core in CI on all component stories"
100
+ - type: "Responsive"
101
+ tools: ["Playwright", "Cypress"]
102
+ rule: "Test at 320px, 768px, 1024px, and 1440px viewports minimum"