1---
2name: polish
3description: Performs a final quality pass fixing alignment, spacing, consistency, and micro-detail issues before shipping. Use when the user mentions polish, finishing touches, pre-launch review, something looks off, or wants to go from good to great.
4version: 2.1.1
5user-invocable: true
6argument-hint: "[target]"
7---
8
9## MANDATORY PREPARATION
10
11Invoke /impeccable — it contains design principles, anti-patterns, and the **Context Gathering Protocol**. Follow the protocol before proceeding — if no design context exists yet, you MUST run /impeccable teach first. Additionally gather: quality bar (MVP vs flagship).
12
13---
14
15Perform a meticulous final pass to catch all the small details that separate good work from great work. The difference between shipped and polished.
16
17## Design System Discovery
18
19Before polishing, understand the system you are polishing toward:
20
211. **Find the design system**: Search for design system documentation, component libraries, style guides, or token definitions. Study the core patterns: color tokens, spacing scale, typography styles, component API.
222. **Note the conventions**: How are shared components imported? What spacing scale is used? Which colors come from tokens vs hard-coded values? What motion and interaction patterns are established?
233. **Identify drift**: Where does the target feature deviate from the system? Hard-coded values that should be tokens, custom components that duplicate shared ones, spacing that doesn't match the scale.
24
25If a design system exists, polish should align the feature with it. If none exists, polish against the conventions visible in the codebase.
26
27## Pre-Polish Assessment
28
29Understand the current state and goals:
30
311. **Review completeness**:
32 - Is it functionally complete?
33 - Are there known issues to preserve (mark with TODOs)?
34 - What's the quality bar? (MVP vs flagship feature?)
35 - When does it ship? (How much time for polish?)
36
372. **Identify polish areas**:
38 - Visual inconsistencies
39 - Spacing and alignment issues
40 - Interaction state gaps
41 - Copy inconsistencies
42 - Edge cases and error states
43 - Loading and transition smoothness
44
45**CRITICAL**: Polish is the last step, not the first. Don't polish work that's not functionally complete.
46
47## Polish Systematically
48
49Work through these dimensions methodically:
50
51### Visual Alignment & Spacing
52
53- **Pixel-perfect alignment**: Everything lines up to grid
54- **Consistent spacing**: All gaps use spacing scale (no random 13px gaps)
55- **Optical alignment**: Adjust for visual weight (icons may need offset for optical centering)
56- **Responsive consistency**: Spacing and alignment work at all breakpoints
57- **Grid adherence**: Elements snap to baseline grid
58
59**Check**:
60- Enable grid overlay and verify alignment
61- Check spacing with browser inspector
62- Test at multiple viewport sizes
63- Look for elements that "feel" off
64
65### Typography Refinement
66
67- **Hierarchy consistency**: Same elements use same sizes/weights throughout
68- **Line length**: 45-75 characters for body text
69- **Line height**: Appropriate for font size and context
70- **Widows & orphans**: No single words on last line
71- **Hyphenation**: Appropriate for language and column width
72- **Kerning**: Adjust letter spacing where needed (especially headlines)
73- **Font loading**: No FOUT/FOIT flashes
74
75### Color & Contrast
76
77- **Contrast ratios**: All text meets WCAG standards
78- **Consistent token usage**: No hard-coded colors, all use design tokens
79- **Theme consistency**: Works in all theme variants
80- **Color meaning**: Same colors mean same things throughout
81- **Accessible focus**: Focus indicators visible with sufficient contrast
82- **Tinted neutrals**: No pure gray or pure black—add subtle color tint (0.01 chroma)
83- **Gray on color**: Never put gray text on colored backgrounds—use a shade of that color or transparency
84
85### Interaction States
86
87Every interactive element needs all states:
88
89- **Default**: Resting state
90- **Hover**: Subtle feedback (color, scale, shadow)
91- **Focus**: Keyboard focus indicator (never remove without replacement)
92- **Active**: Click/tap feedback
93- **Disabled**: Clearly non-interactive
94- **Loading**: Async action feedback
95- **Error**: Validation or error state
96- **Success**: Successful completion
97
98**Missing states create confusion and broken experiences**.
99
100### Micro-interactions & Transitions
101
102- **Smooth transitions**: All state changes animated appropriately (150-300ms)
103- **Consistent easing**: Use ease-out-quart/quint/expo for natural deceleration. Never bounce or elastic—they feel dated.
104- **No jank**: 60fps animations, only animate transform and opacity
105- **Appropriate motion**: Motion serves purpose, not decoration
106- **Reduced motion**: Respects `prefers-reduced-motion`
107
108### Content & Copy
109
110- **Consistent terminology**: Same things called same names throughout
111- **Consistent capitalization**: Title Case vs Sentence case applied consistently
112- **Grammar & spelling**: No typos
113- **Appropriate length**: Not too wordy, not too terse
114- **Punctuation consistency**: Periods on sentences, not on labels (unless all labels have them)
115
116### Icons & Images
117
118- **Consistent style**: All icons from same family or matching style
119- **Appropriate sizing**: Icons sized consistently for context
120- **Proper alignment**: Icons align with adjacent text optically
121- **Alt text**: All images have descriptive alt text
122- **Loading states**: Images don't cause layout shift, proper aspect ratios
123- **Retina support**: 2x assets for high-DPI screens
124
125### Forms & Inputs
126
127- **Label consistency**: All inputs properly labeled
128- **Required indicators**: Clear and consistent
129- **Error messages**: Helpful and consistent
130- **Tab order**: Logical keyboard navigation
131- **Auto-focus**: Appropriate (don't overuse)
132- **Validation timing**: Consistent (on blur vs on submit)
133
134### Edge Cases & Error States
135
136- **Loading states**: All async actions have loading feedback
137- **Empty states**: Helpful empty states, not just blank space
138- **Error states**: Clear error messages with recovery paths
139- **Success states**: Confirmation of successful actions
140- **Long content**: Handles very long names, descriptions, etc.
141- **No content**: Handles missing data gracefully
142- **Offline**: Appropriate offline handling (if applicable)
143
144### Responsiveness
145
146- **All breakpoints**: Test mobile, tablet, desktop
147- **Touch targets**: 44x44px minimum on touch devices
148- **Readable text**: No text smaller than 14px on mobile
149- **No horizontal scroll**: Content fits viewport
150- **Appropriate reflow**: Content adapts logically
151
152### Performance
153
154- **Fast initial load**: Optimize critical path
155- **No layout shift**: Elements don't jump after load (CLS)
156- **Smooth interactions**: No lag or jank
157- **Optimized images**: Appropriate formats and sizes
158- **Lazy loading**: Off-screen content loads lazily
159
160### Code Quality
161
162- **Remove console logs**: No debug logging in production
163- **Remove commented code**: Clean up dead code
164- **Remove unused imports**: Clean up unused dependencies
165- **Consistent naming**: Variables and functions follow conventions
166- **Type safety**: No TypeScript `any` or ignored errors
167- **Accessibility**: Proper ARIA labels and semantic HTML
168
169## Polish Checklist
170
171Go through systematically:
172
173- [ ] Visual alignment perfect at all breakpoints
174- [ ] Spacing uses design tokens consistently
175- [ ] Typography hierarchy consistent
176- [ ] All interactive states implemented
177- [ ] All transitions smooth (60fps)
178- [ ] Copy is consistent and polished
179- [ ] Icons are consistent and properly sized
180- [ ] All forms properly labeled and validated
181- [ ] Error states are helpful
182- [ ] Loading states are clear
183- [ ] Empty states are welcoming
184- [ ] Touch targets are 44x44px minimum
185- [ ] Contrast ratios meet WCAG AA
186- [ ] Keyboard navigation works
187- [ ] Focus indicators visible
188- [ ] No console errors or warnings
189- [ ] No layout shift on load
190- [ ] Works in all supported browsers
191- [ ] Respects reduced motion preference
192- [ ] Code is clean (no TODOs, console.logs, commented code)
193
194**IMPORTANT**: Polish is about details. Zoom in. Squint at it. Use it yourself. The little things add up.
195
196**NEVER**:
197- Polish before it's functionally complete
198- Spend hours on polish if it ships in 30 minutes (triage)
199- Introduce bugs while polishing (test thoroughly)
200- Ignore systematic issues (if spacing is off everywhere, fix the system)
201- Perfect one thing while leaving others rough (consistent quality level)
202- Create new one-off components when design system equivalents exist
203- Hard-code values that should use design tokens
204
205## Final Verification
206
207Before marking as done:
208
209- **Use it yourself**: Actually interact with the feature
210- **Test on real devices**: Not just browser DevTools
211- **Ask someone else to review**: Fresh eyes catch things
212- **Compare to design**: Match intended design
213- **Check all states**: Don't just test happy path
214
215## Clean Up
216
217After polishing, ensure code quality:
218
219- **Replace custom implementations**: If the design system provides a component you reimplemented, switch to the shared version.
220- **Remove orphaned code**: Delete unused styles, components, or files made obsolete by polish.
221- **Consolidate tokens**: If you introduced new values, check whether they should be tokens.
222- **Verify DRYness**: Look for duplication introduced during polishing and consolidate.
223
224Remember: You have impeccable attention to detail and exquisite taste. Polish until it feels effortless, looks intentional, and works flawlessly. Sweat the details - they matter.