@su-record/vibe 2.7.22 → 2.8.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 (35) hide show
  1. package/CLAUDE.md +4 -0
  2. package/agents/ui/ui-antipattern-detector.md +8 -0
  3. package/dist/cli/commands/upgrade.d.ts.map +1 -1
  4. package/dist/cli/commands/upgrade.js +14 -4
  5. package/dist/cli/commands/upgrade.js.map +1 -1
  6. package/dist/cli/postinstall/constants.d.ts.map +1 -1
  7. package/dist/cli/postinstall/constants.js +17 -13
  8. package/dist/cli/postinstall/constants.js.map +1 -1
  9. package/dist/infra/lib/SkillFrontmatter.d.ts +1 -0
  10. package/dist/infra/lib/SkillFrontmatter.d.ts.map +1 -1
  11. package/dist/infra/lib/SkillFrontmatter.js +4 -0
  12. package/dist/infra/lib/SkillFrontmatter.js.map +1 -1
  13. package/package.json +1 -1
  14. package/skills/claude-md-guide/SKILL.md +350 -0
  15. package/skills/commit-push-pr/SKILL.md +1 -0
  16. package/skills/create-prd/SKILL.md +89 -0
  17. package/skills/design-audit/SKILL.md +151 -0
  18. package/skills/design-critique/SKILL.md +138 -0
  19. package/skills/design-distill/SKILL.md +129 -0
  20. package/skills/design-normalize/SKILL.md +132 -0
  21. package/skills/design-polish/SKILL.md +130 -0
  22. package/skills/design-teach/SKILL.md +181 -0
  23. package/skills/exec-plan/SKILL.md +1 -0
  24. package/skills/parallel-research/SKILL.md +1 -0
  25. package/skills/prioritization-frameworks/SKILL.md +86 -0
  26. package/skills/techdebt/SKILL.md +1 -0
  27. package/skills/ui-ux-pro-max/SKILL.md +14 -0
  28. package/skills/ui-ux-pro-max/reference/color-and-contrast.md +517 -0
  29. package/skills/ui-ux-pro-max/reference/interaction-design.md +544 -0
  30. package/skills/ui-ux-pro-max/reference/motion-design.md +591 -0
  31. package/skills/ui-ux-pro-max/reference/responsive-design.md +463 -0
  32. package/skills/ui-ux-pro-max/reference/spatial-design.md +390 -0
  33. package/skills/ui-ux-pro-max/reference/typography.md +455 -0
  34. package/skills/ui-ux-pro-max/reference/ux-writing.md +469 -0
  35. package/skills/user-personas/SKILL.md +74 -0
@@ -0,0 +1,89 @@
1
+ ---
2
+ name: create-prd
3
+ description: "Create a Product Requirements Document using a comprehensive 8-section template covering problem, objectives, segments, value propositions, solution, and release planning."
4
+ triggers: [prd, product requirements, feature spec, requirements document]
5
+ priority: 60
6
+ chain-next: [user-personas, prioritization-frameworks]
7
+ ---
8
+
9
+ # Create a Product Requirements Document
10
+
11
+ > Based on the PRD template from [Product Compass](https://www.productcompass.pm/p/prd-template) by Pawel Huryn (MIT License).
12
+
13
+ ## Purpose
14
+
15
+ You are an experienced product manager responsible for creating a comprehensive Product Requirements Document (PRD) for $ARGUMENTS. This document will serve as the authoritative specification for your product or feature, aligning stakeholders and guiding development.
16
+
17
+ ## Context
18
+
19
+ A well-structured PRD clearly communicates the what, why, and how of your product initiative. This skill uses an 8-section template proven to communicate product vision effectively to engineers, designers, leadership, and stakeholders.
20
+
21
+ ## Instructions
22
+
23
+ 1. **Gather Information**: If the user provides files, read them carefully. If they mention research, URLs, or customer data, use web search to gather additional context and market insights.
24
+
25
+ 2. **Think Step by Step**: Before writing, analyze:
26
+ - What problem are we solving?
27
+ - Who are we solving it for?
28
+ - How will we measure success?
29
+ - What are our constraints and assumptions?
30
+
31
+ 3. **Apply the PRD Template**: Create a document with these 8 sections:
32
+
33
+ **1. Summary** (2-3 sentences)
34
+ - What is this document about?
35
+
36
+ **2. Contacts**
37
+ - Name, role, and comment for key stakeholders
38
+
39
+ **3. Background**
40
+ - Context: What is this initiative about?
41
+ - Why now? Has something changed?
42
+ - Is this something that just recently became possible?
43
+
44
+ **4. Objective**
45
+ - What's the objective? Why does it matter?
46
+ - How will it benefit the company and customers?
47
+ - How does it align with vision and strategy?
48
+ - Key Results: How will you measure success? (Use SMART OKR format)
49
+
50
+ **5. Market Segment(s)**
51
+ - For whom are we building this?
52
+ - What constraints exist?
53
+ - Note: Markets are defined by people's problems/jobs, not demographics
54
+
55
+ **6. Value Proposition(s)**
56
+ - What customer jobs/needs are we addressing?
57
+ - What will customers gain?
58
+ - Which pains will they avoid?
59
+ - Which problems do we solve better than competitors?
60
+ - Consider the Value Curve framework
61
+
62
+ **7. Solution**
63
+ - 7.1 UX/Prototypes (wireframes, user flows)
64
+ - 7.2 Key Features (detailed feature descriptions)
65
+ - 7.3 Technology (optional, only if relevant)
66
+ - 7.4 Assumptions (what we believe but haven't proven)
67
+
68
+ **8. Release**
69
+ - How long could it take?
70
+ - What goes in the first version vs. future versions?
71
+ - Avoid exact dates; use relative timeframes
72
+
73
+ 4. **Use Accessible Language**: Write for a primary school graduate. Avoid jargon. Use clear, short sentences.
74
+
75
+ 5. **Structure Output**: Present the PRD as a well-formatted markdown document with clear headings and sections.
76
+
77
+ 6. **Save the Output**: Save the PRD as `PRD-[product-name].md` in the project root or docs directory.
78
+
79
+ ## Notes
80
+
81
+ - Be specific and data-driven where possible
82
+ - Link each section back to the overall strategy
83
+ - Flag assumptions clearly so the team can validate them
84
+ - Keep the document concise but complete
85
+
86
+ ## Further Reading
87
+
88
+ - [How to Write a Product Requirements Document? The Best PRD Template.](https://www.productcompass.pm/p/prd-template)
89
+ - [A Proven AI PRD Template by Miqdad Jaffer (Product Lead @ OpenAI)](https://www.productcompass.pm/p/ai-prd-template)
@@ -0,0 +1,151 @@
1
+ ---
2
+ name: design-audit
3
+ description: "Design technical quality audit — a11y, performance, responsive, theming, AI slop detection with 5-dimension scoring. Use when design-audit, ui-audit, a11y-check, design-check."
4
+ triggers: [design-audit, ui-audit, a11y-check, design-check]
5
+ priority: 50
6
+ ---
7
+
8
+ # Design Audit — Technical Quality Inspection
9
+
10
+ Perform a read-only technical quality audit across 5 dimensions. No code modifications — report only.
11
+
12
+ ## Usage
13
+
14
+ ```
15
+ /design-audit <target> # Audit specific component/page
16
+ /design-audit . # Audit all changed UI files
17
+ ```
18
+
19
+ ## 5-Dimension Scoring
20
+
21
+ Each dimension scored 0–4:
22
+
23
+ | Score | Meaning |
24
+ |-------|---------|
25
+ | 0 | Critical failures — unusable |
26
+ | 1 | Major issues — degraded experience |
27
+ | 2 | Moderate issues — functional but rough |
28
+ | 3 | Minor issues — good with polish needed |
29
+ | 4 | Excellent — production ready |
30
+
31
+ ### 1. Accessibility (a11y)
32
+
33
+ - [ ] All interactive elements keyboard-reachable (`tabIndex`, focus order)
34
+ - [ ] ARIA roles and labels on custom widgets
35
+ - [ ] Color contrast ≥ 4.5:1 (text), ≥ 3:1 (large text, UI components)
36
+ - [ ] Images have meaningful `alt` text (not "image" or filename)
37
+ - [ ] Form inputs linked to `<label>` or `aria-label`
38
+ - [ ] Focus indicator visible on all interactive elements
39
+ - [ ] Screen reader announcements for dynamic content (`aria-live`)
40
+ - [ ] Skip-to-content link present on pages with navigation
41
+
42
+ ### 2. Performance
43
+
44
+ - [ ] Images: `loading="lazy"` on below-fold, `srcset` for responsive, WebP/AVIF formats
45
+ - [ ] Fonts: `font-display: swap`, subset if possible, ≤3 font files
46
+ - [ ] CSS: No unused large frameworks, critical CSS inlined or above-fold prioritized
47
+ - [ ] JS: Code-split at route level, no blocking scripts in `<head>`
48
+ - [ ] Layout shifts: Explicit `width`/`height` on media, skeleton placeholders
49
+ - [ ] Bundle: No duplicate dependencies, tree-shaking enabled
50
+
51
+ ### 3. Responsive
52
+
53
+ - [ ] Breakpoints use `min-width` (mobile-first) or consistent direction
54
+ - [ ] Touch targets ≥ 44×44px on mobile
55
+ - [ ] No horizontal scroll at any breakpoint
56
+ - [ ] Typography scales appropriately (clamp or breakpoint-based)
57
+ - [ ] `@container` queries where component-level responsiveness needed
58
+ - [ ] Navigation adapts (hamburger, drawer, or tab bar on mobile)
59
+
60
+ ### 4. Theming
61
+
62
+ - [ ] Colors use CSS custom properties (not hardcoded hex/rgb)
63
+ - [ ] Dark mode support or explicit opt-out documented
64
+ - [ ] Spacing uses design tokens (not arbitrary pixel values)
65
+ - [ ] Border radius, shadows consistent via tokens
66
+ - [ ] Component variants use data attributes or CSS classes, not inline styles
67
+
68
+ ### 5. AI Slop Detection
69
+
70
+ - [ ] No cyan-on-dark or neon accent color schemes without brand justification
71
+ - [ ] No purple-to-blue gradient backgrounds as default aesthetic
72
+ - [ ] No hero metric template (oversized number + tiny label) without data purpose
73
+ - [ ] No identical card grids (3-up with icon + title + description)
74
+ - [ ] No glassmorphism applied as default surface treatment
75
+ - [ ] No bounce/elastic easing on functional animations
76
+ - [ ] No Inter/Roboto as lazy font choice (match brand personality instead)
77
+ - [ ] No gradient text on metrics or statistics
78
+
79
+ ## Severity Tagging
80
+
81
+ | Severity | Meaning | Example |
82
+ |----------|---------|---------|
83
+ | P0 | Blocker — breaks functionality | Missing focus trap on modal |
84
+ | P1 | Critical — significant UX impact | No keyboard navigation |
85
+ | P2 | Important — noticeable quality gap | Touch targets too small |
86
+ | P3 | Minor — polish opportunity | Inconsistent border radius |
87
+
88
+ ## Platform Adaptation
89
+
90
+ When running on mobile stacks (React Native, Flutter, iOS, Android):
91
+ - Skip web-specific items: CSS variables, `@container`, `srcset`, `font-display`
92
+ - Focus on: visual hierarchy, cognitive load, accessibility, AI slop detection
93
+ - Adapt responsive checks to platform conventions (safe areas, orientation)
94
+
95
+ ## Output Format
96
+
97
+ ```markdown
98
+ ## Design Audit Report: {target}
99
+
100
+ ### Scores
101
+ | Dimension | Score | Grade |
102
+ |-----------|-------|-------|
103
+ | Accessibility | 3/4 | Good |
104
+ | Performance | 2/4 | Moderate |
105
+ | Responsive | 4/4 | Excellent |
106
+ | Theming | 1/4 | Major Issues |
107
+ | AI Slop | 3/4 | Good |
108
+ | **Overall** | **13/20** | **65%** |
109
+
110
+ ### Findings
111
+
112
+ #### P0 (Blocker)
113
+ - None
114
+
115
+ #### P1 (Critical)
116
+ - [A11Y] Modal missing focus trap — {file}:{line}
117
+ - [THEME] 12 hardcoded color values — should use CSS variables
118
+
119
+ #### P2 (Important)
120
+ - [PERF] Images without lazy loading — {file}:{line}
121
+
122
+ #### P3 (Minor)
123
+ - [SLOP] Purple-to-blue gradient matches AI template aesthetic
124
+
125
+ ### Recommendations
126
+ 1. {Priority-ordered actionable items}
127
+ ```
128
+
129
+ ## Preparation
130
+
131
+ Before running the audit:
132
+
133
+ 1. **Read** `.claude/vibe/design-context.json`
134
+ - If missing → display: "Run `/design-teach` first for better results" → proceed with defaults
135
+ - If parse error → display warning → proceed with defaults → recommend `/design-teach`
136
+ - If present → weight findings by `audience.context`, `constraints.accessibility`, `brand.personality`
137
+ 2. **Read** `.claude/vibe/design-system/*/MASTER.md` (if exists) for token reference
138
+
139
+ ## Next Steps
140
+
141
+ | If Result Shows | Recommended Next |
142
+ |----------------|-----------------|
143
+ | Design system inconsistencies | `/design-normalize` — align tokens |
144
+ | UX/usability concerns | `/design-critique` — deeper UX review |
145
+ | Ship-ready (score ≥ 16/20) | `/design-polish` — final micro-details |
146
+
147
+ ## Important
148
+
149
+ - **Read-only**: This skill produces a report. It does NOT modify code.
150
+ - **Context-aware**: If `.claude/vibe/design-context.json` exists, findings are weighted by project brand and audience.
151
+ - **Incremental**: When run on `.` (changed files), only audits files in current diff.
@@ -0,0 +1,138 @@
1
+ ---
2
+ name: design-critique
3
+ description: "UX design review — Nielsen heuristics scoring, 5-persona red flag analysis. Use when design-critique, ux-review, design-review."
4
+ triggers: [design-critique, ux-review, design-review]
5
+ priority: 50
6
+ ---
7
+
8
+ # Design Critique — UX Design Review
9
+
10
+ Evaluate design quality through Nielsen's 10 usability heuristics and 5 persona lenses. Report only — no code modifications.
11
+
12
+ ## Usage
13
+
14
+ ```
15
+ /design-critique <target> # Critique specific page/flow
16
+ /design-critique . # Critique all changed UI files
17
+ ```
18
+
19
+ ## Nielsen's 10 Heuristics (0–4 Score Each)
20
+
21
+ | # | Heuristic | What to Check |
22
+ |---|-----------|---------------|
23
+ | H1 | Visibility of system status | Loading indicators, progress bars, state feedback |
24
+ | H2 | Match between system and real world | Natural language, familiar icons, logical groupings |
25
+ | H3 | User control and freedom | Undo/redo, cancel actions, exit paths |
26
+ | H4 | Consistency and standards | Same action = same pattern, platform conventions |
27
+ | H5 | Error prevention | Confirmation dialogs, input constraints, disabled states |
28
+ | H6 | Recognition rather than recall | Visible options, contextual help, breadcrumbs |
29
+ | H7 | Flexibility and efficiency | Keyboard shortcuts, defaults, power user paths |
30
+ | H8 | Aesthetic and minimalist design | Signal-to-noise ratio, essential info only |
31
+ | H9 | Help users recognize and recover from errors | Clear error messages, suggested fixes |
32
+ | H10 | Help and documentation | Tooltips, onboarding, contextual guidance |
33
+
34
+ ### Scoring
35
+
36
+ | Score | Meaning |
37
+ |-------|---------|
38
+ | 0 | Violated — causes real user problems |
39
+ | 1 | Weak — frequent friction points |
40
+ | 2 | Adequate — works but not smooth |
41
+ | 3 | Good — minor friction only |
42
+ | 4 | Excellent — delightful experience |
43
+
44
+ ## 5-Persona Red Flag Analysis
45
+
46
+ Test the design through these persona lenses:
47
+
48
+ ### 1. Power User
49
+ - Can they complete tasks quickly?
50
+ - Are there keyboard shortcuts or bulk actions?
51
+ - Is information density appropriate (not too sparse)?
52
+
53
+ ### 2. First-Time User
54
+ - Is the entry point obvious?
55
+ - Can they complete the primary task without documentation?
56
+ - Is progressive disclosure used (not overwhelming)?
57
+
58
+ ### 3. Accessibility-Dependent User
59
+ - Screen reader navigation makes sense?
60
+ - Color is not the only information channel?
61
+ - Text is resizable without breaking layout?
62
+
63
+ ### 4. Stressed / Distracted User
64
+ - Can they recover from mistakes easily?
65
+ - Are destructive actions clearly guarded?
66
+ - Is critical information scannable (not buried in paragraphs)?
67
+
68
+ ### 5. Mobile-Only User
69
+ - Touch targets adequate?
70
+ - Key actions reachable with one thumb?
71
+ - Forms don't require excessive typing?
72
+
73
+ ## Platform Adaptation
74
+
75
+ When running on mobile stacks (React Native, Flutter, iOS, Android):
76
+ - Focus on platform-specific UX conventions (gestures, navigation patterns)
77
+ - Evaluate against platform HIG (Human Interface Guidelines / Material Design)
78
+ - Skip web-specific heuristic items (breadcrumbs, URL-based navigation)
79
+
80
+ ## Output Format
81
+
82
+ ```markdown
83
+ ## Design Critique: {target}
84
+
85
+ ### Heuristic Scores
86
+ | # | Heuristic | Score | Key Issue |
87
+ |---|-----------|-------|-----------|
88
+ | H1 | Visibility of system status | 2/4 | No loading state on form submit |
89
+ | H2 | Match real world | 4/4 | — |
90
+ | H3 | User control | 1/4 | No undo on delete |
91
+ | ... | ... | ... | ... |
92
+ | **Total** | | **28/40** | **70%** |
93
+
94
+ ### Persona Red Flags
95
+
96
+ #### Power User 🔴
97
+ - No keyboard shortcut for primary action
98
+ - Table lacks bulk selection
99
+
100
+ #### First-Time User 🟡
101
+ - CTA is clear but secondary options are confusing
102
+
103
+ #### Accessibility-Dependent User 🔴
104
+ - Color-only status indicators (red/green dots)
105
+
106
+ #### Stressed User 🟢
107
+ - Confirmation dialog on destructive actions ✓
108
+
109
+ #### Mobile-Only User 🟡
110
+ - Settings buried 3 levels deep
111
+
112
+ ### Top Recommendations
113
+ 1. {Priority-ordered design improvements}
114
+ ```
115
+
116
+ ## Preparation
117
+
118
+ Before running the critique:
119
+
120
+ 1. **Read** `.claude/vibe/design-context.json`
121
+ - If missing → display: "Run `/design-teach` first for better results" → proceed with defaults
122
+ - If parse error → display warning → proceed with defaults → recommend `/design-teach`
123
+ - If present → adjust persona priorities by `audience.primary` and `audience.expertise`
124
+ 2. **Read** brand personality to calibrate aesthetic expectations
125
+
126
+ ## Next Steps
127
+
128
+ | If Result Shows | Recommended Next |
129
+ |----------------|-----------------|
130
+ | Visual complexity / clutter | `/design-distill` — remove unnecessary elements |
131
+ | Token inconsistencies noted | `/design-normalize` — align to design system |
132
+ | Good overall, minor polish needed | `/design-polish` — final pass |
133
+
134
+ ## Important
135
+
136
+ - **Read-only**: Produces design critique report. No code modifications.
137
+ - **Context-aware**: Uses `.claude/vibe/design-context.json` for brand/audience context if available.
138
+ - **Complementary**: Pairs with `/design-audit` (technical) — critique focuses on UX quality.
@@ -0,0 +1,129 @@
1
+ ---
2
+ name: design-distill
3
+ description: "Remove unnecessary visual complexity — strip decorative clutter, apply progressive disclosure, simplify UI to essentials. Use when design-distill, simplify-ui, ui-simplify, strip-ui."
4
+ triggers: [design-distill, simplify-ui, ui-simplify, strip-ui]
5
+ priority: 50
6
+ ---
7
+
8
+ # Design Distill — Remove Visual Complexity
9
+
10
+ Strip unnecessary visual elements. Every remaining element must justify its existence. Applies the principle: **if it doesn't help the user complete their task, remove it.**
11
+
12
+ ## Usage
13
+
14
+ ```
15
+ /design-distill <target> # Distill specific page/component
16
+ /design-distill . # Distill all changed UI files
17
+ ```
18
+
19
+ ## What Gets Distilled
20
+
21
+ ### 1. Decorative Clutter
22
+
23
+ - Gradient backgrounds that don't convey hierarchy
24
+ - Decorative dividers between already-spaced sections
25
+ - Background patterns or textures without purpose
26
+ - Ornamental icons (icons that don't aid comprehension)
27
+ - Excessive border/shadow stacking on nested containers
28
+
29
+ ### 2. Redundant Information
30
+
31
+ - Headings that repeat the page title or parent context
32
+ - Labels that duplicate placeholder text
33
+ - "Welcome to {App}" banners on authenticated pages
34
+ - Empty state illustrations when a simple message suffices
35
+ - Descriptions restating what the UI element obviously does
36
+
37
+ ### 3. Over-Wrapped Containers
38
+
39
+ - Cards wrapping single elements (card containing only a button)
40
+ - Nested cards (card inside card inside card)
41
+ - Wrapper divs with only cosmetic purpose
42
+ - Sections with only one child element
43
+
44
+ ### 4. Excessive Animation
45
+
46
+ - Entry animations on every element (staggered fade-ins on list items)
47
+ - Hover animations on non-interactive elements
48
+ - Transitions > 300ms for feedback (feels sluggish)
49
+ - Parallax effects on content pages
50
+ - Decorative loading animations when a spinner suffices
51
+
52
+ ### 5. Progressive Disclosure Opportunities
53
+
54
+ - Settings pages showing all options at once → group and collapse
55
+ - Forms with 10+ fields visible → break into steps
56
+ - Dashboards showing every metric → show top 3, expandable for rest
57
+ - Navigation with 8+ top-level items → group into categories
58
+
59
+ ## Distillation Principles
60
+
61
+ | Principle | Question to Ask |
62
+ |-----------|----------------|
63
+ | **Purpose** | Does this element help the user complete a task? |
64
+ | **Duplication** | Is this information available elsewhere on screen? |
65
+ | **Cognitive load** | Would removing this reduce decision fatigue? |
66
+ | **Visual weight** | Does this element compete with more important content? |
67
+ | **Progressive disclosure** | Can this be hidden until needed? |
68
+
69
+ ## Process
70
+
71
+ 1. Read target files fully
72
+ 2. Identify elements matching distillation categories
73
+ 3. For each candidate:
74
+ - Verify removal won't break functionality
75
+ - Check if element carries semantic meaning
76
+ - Confirm removal improves signal-to-noise ratio
77
+ 4. Apply removals and simplifications
78
+ 5. Report changes with before/after rationale
79
+
80
+ ## Output Format
81
+
82
+ ```markdown
83
+ ## Design Distill: {target}
84
+
85
+ ### Removed
86
+ - ✂️ {file}:{line} — Decorative gradient background (no hierarchy purpose)
87
+ - ✂️ {file}:{line} — Wrapper card around single button
88
+ - ✂️ {file}:{line} — Heading repeating parent page title
89
+
90
+ ### Simplified
91
+ - 🔄 {file}:{line} — Collapsed 3 nested divs into 1 flex container
92
+ - 🔄 {file}:{line} — Replaced staggered animation with single fade-in
93
+
94
+ ### Progressive Disclosure Applied
95
+ - 📦 {file}:{line} — Settings grouped into collapsible sections (was 15 flat options)
96
+
97
+ ### Preserved (Justified)
98
+ - ✓ {file}:{line} — Decorative illustration on empty state (brand expression)
99
+
100
+ ### Summary
101
+ - Elements reviewed: {N}
102
+ - Removed: {N}
103
+ - Simplified: {N}
104
+ - Progressive disclosure: {N}
105
+ - Net complexity reduction: {percentage}
106
+ ```
107
+
108
+ ## Preparation
109
+
110
+ Before running distillation:
111
+
112
+ 1. **Read** `.claude/vibe/design-context.json`
113
+ - If missing → display: "Run `/design-teach` first for better results" → proceed with defaults
114
+ - If parse error → display warning → proceed with defaults → recommend `/design-teach`
115
+ - If present → preserve elements that match `brand.personality` (e.g., "playful" brand may justify decorative elements)
116
+ 2. Use `aesthetic.style` to calibrate aggressiveness (minimal → more aggressive, bold → more lenient)
117
+
118
+ ## Next Steps
119
+
120
+ | If Result Shows | Recommended Next |
121
+ |----------------|-----------------|
122
+ | Elements removed/simplified | `/design-normalize` — align remaining tokens |
123
+ | Already minimal | `/design-polish` — final pre-ship pass |
124
+
125
+ ## Important
126
+
127
+ - **Modifying**: Directly removes and simplifies identified elements.
128
+ - **Conservative**: Only removes elements that clearly don't serve user tasks. Brand-expressive elements preserved.
129
+ - **Reversible**: All removals listed in report for easy review and revert if needed.
@@ -0,0 +1,132 @@
1
+ ---
2
+ name: design-normalize
3
+ description: "Normalize hardcoded values to design system tokens — colors, typography, spacing, shadows aligned to MASTER.md. Use when design-normalize, design-system, token-align."
4
+ triggers: [design-normalize, design-system, token-align]
5
+ priority: 50
6
+ ---
7
+
8
+ # Design Normalize — Design System Token Alignment
9
+
10
+ Replace hardcoded design values with design system tokens from MASTER.md. Ensures visual consistency across the project.
11
+
12
+ ## Usage
13
+
14
+ ```
15
+ /design-normalize # Normalize all changed UI files
16
+ /design-normalize <target> # Normalize specific component/page
17
+ ```
18
+
19
+ ## Process
20
+
21
+ ### Step 1: Load Design System
22
+
23
+ Load token source in priority order:
24
+
25
+ 1. `.claude/vibe/design-system/{project}/MASTER.md` (project-specific)
26
+ 2. `.claude/vibe/design-context.json` (from `/design-teach`)
27
+ 3. If neither exists → prompt: "Run `/design-teach` or create MASTER.md first. Proceeding with default token detection."
28
+
29
+ ### Step 2: Scan for Hardcoded Values
30
+
31
+ Detect these categories:
32
+
33
+ | Category | Pattern | Example |
34
+ |----------|---------|---------|
35
+ | Colors | Hex `#xxx`, `#xxxxxx`, `rgb()`, `hsl()` | `#3B82F6` → `var(--color-primary)` |
36
+ | Typography | `font-size: 14px`, `font-weight: 600` | `14px` → `var(--text-sm)` |
37
+ | Spacing | `margin: 16px`, `padding: 24px`, `gap: 12px` | `16px` → `var(--space-4)` |
38
+ | Shadows | `box-shadow: 0 2px 4px ...` | Inline → `var(--shadow-sm)` |
39
+ | Border Radius | `border-radius: 8px` | `8px` → `var(--radius-md)` |
40
+
41
+ ### Step 3: Map to Tokens
42
+
43
+ For each hardcoded value:
44
+
45
+ 1. Find closest matching token in MASTER.md
46
+ 2. If exact match → replace directly
47
+ 3. If close match (within 2px/similar hue) → replace + note the mapping
48
+ 4. If no match → flag for manual review (may need new token)
49
+
50
+ ### Step 4: Apply Replacements
51
+
52
+ Replace values in source files, preserving:
53
+ - Intentional one-off values (commented with `/* intentional */`)
54
+ - Animation keyframe values
55
+ - SVG path data
56
+ - Third-party library overrides
57
+
58
+ ## Token Mapping Example
59
+
60
+ ```css
61
+ /* Before */
62
+ .card {
63
+ background: #ffffff;
64
+ border: 1px solid #e5e7eb;
65
+ border-radius: 8px;
66
+ padding: 24px;
67
+ box-shadow: 0 1px 3px rgba(0,0,0,0.1);
68
+ }
69
+
70
+ /* After */
71
+ .card {
72
+ background: var(--color-surface);
73
+ border: 1px solid var(--color-border);
74
+ border-radius: var(--radius-lg);
75
+ padding: var(--space-6);
76
+ box-shadow: var(--shadow-sm);
77
+ }
78
+ ```
79
+
80
+ ## Output Format
81
+
82
+ ```markdown
83
+ ## Design Normalize: {target}
84
+
85
+ ### Token Source
86
+ - Using: MASTER.md / design-context.json / default detection
87
+
88
+ ### Replacements Applied
89
+ | File | Line | Before | After | Confidence |
90
+ |------|------|--------|-------|------------|
91
+ | Card.tsx | 12 | #3B82F6 | var(--color-primary) | exact |
92
+ | Card.tsx | 15 | 16px | var(--space-4) | exact |
93
+ | Card.tsx | 18 | 7px | var(--radius-md) (8px) | close |
94
+
95
+ ### New Tokens Suggested
96
+ - `--color-accent-light: #DBEAFE` — used 4 times, no matching token
97
+
98
+ ### Skipped (Manual Review)
99
+ - {file}:{line} — animation keyframe value
100
+ - {file}:{line} — no matching token found
101
+
102
+ ### Summary
103
+ - Scanned: {N} files
104
+ - Replaced: {N} values
105
+ - New tokens suggested: {N}
106
+ - Skipped: {N}
107
+ ```
108
+
109
+ ## Preparation
110
+
111
+ Before running normalization:
112
+
113
+ 1. **Read** `.claude/vibe/design-context.json`
114
+ - If missing → display: "Run `/design-teach` first for better results" → proceed with defaults
115
+ - If parse error → display warning → proceed with defaults → recommend `/design-teach`
116
+ - If present → use `detectedStack.styling` to determine token format (CSS vars, Tailwind, etc.)
117
+ 2. **Read** `.claude/vibe/design-system/*/MASTER.md`
118
+ - If missing → display: "Run `/design-teach` or create MASTER.md first. Proceeding with default token detection."
119
+ - If present → use as authoritative token source for replacements
120
+
121
+ ## Next Steps
122
+
123
+ | If Result Shows | Recommended Next |
124
+ |----------------|-----------------|
125
+ | Tokens aligned successfully | `/design-polish` — final pre-ship pass |
126
+ | New tokens suggested | Add to MASTER.md, then re-run `/design-normalize` |
127
+
128
+ ## Important
129
+
130
+ - **Modifying**: Directly replaces hardcoded values with token references.
131
+ - **MASTER.md required**: Works best with a defined design system. Falls back to auto-detection if missing.
132
+ - **Safe**: Preserves intentional overrides and third-party styles.