--- version: "1.0.0" evaluation: programmatic agent: claude-code model: claude-sonnet-4-6 snapshot: python312-uv origin: url: "https://skills.sh/pbakaus/impeccable/polish" source_host: "skills.sh" source_title: "Polish — Impeccable Design Skill" imported_at: "2026-05-01T02:59:42Z" imported_by: "skill-to-runbook-converter@1.0.0" attribution: collection_or_org: "pbakaus" skill_name: "polish" confidence: "medium" --- # Polish — Agent Runbook ## Objective Perform a meticulous final quality pass on a frontend interface to catch all the small details that separate good work from great work. This runbook guides an agent through systematic UI polish: visual alignment, typography, color/contrast, interaction states, micro-interactions, accessibility, responsiveness, and code quality. Polish is always the last step — the interface must be functionally complete before this runbook is applied. The agent must align all changes to the project's existing design system rather than introducing one-off implementations. ## REQUIRED OUTPUT FILES (MANDATORY) **You MUST write all of the following files to `/app/results`. The task is NOT complete until every file exists and is non-empty.** | File | Description | |------|-------------| | `/app/results/polish_report.md` | Itemized findings across all polish dimensions with severity and resolution notes | | `/app/results/checklist.md` | Completed polish checklist (every item marked pass/fail/na with notes) | | `/app/results/design_system_notes.md` | Design system conventions discovered during Step 2, including token names and drift classification | | `/app/results/summary.md` | Executive summary of polish session: issues found, fixed, deferred | | `/app/results/validation_report.json` | Structured validation results with stages, results, and `overall_passed` | ## Parameters | Parameter | Default | Description | |-----------|---------|-------------| | Results directory | `/app/results` | Output directory for all results | | Quality bar | `flagship` | `MVP` (functional, minimal polish) or `flagship` (exhaustive polish) | | Design context path | auto-detect | Path to `PRODUCT.md` / `DESIGN.md` or directory containing them | | Target feature | *(required)* | Name or path of the feature/component being polished | | Breakpoints to test | `mobile,tablet,desktop` | Comma-separated list of viewport sizes to verify | ## Dependencies | Dependency | Type | Required | Description | |------------|------|----------|-------------| | Functional codebase | Prerequisite | Yes | The feature must be functionally complete before polishing | | `PRODUCT.md` | File | Yes | Product context: users, brand, tone, anti-references | | `DESIGN.md` | File | Recommended | Design tokens: colors, typography, spacing, components | | Browser DevTools | Tool | Yes | Inspect spacing, contrast, and layout in real browser | | Real device(s) | Hardware | Yes | Verify touch targets and text size on actual devices | | Accessibility checker | Tool | Yes | WAVE, axe, or equivalent for WCAG contrast and ARIA checks | ## Step 1: Environment Setup Verify prerequisites before touching any code. ```bash echo "=== POLISH PRE-FLIGHT ===" # Verify functional completeness was declared if [ -z "$TARGET_FEATURE" ]; then echo "ERROR: TARGET_FEATURE env var required. Set it to the feature/component path." exit 1 fi # Check for design context files PRODUCT_MD=$(find . -maxdepth 3 -name "PRODUCT.md" | head -1) DESIGN_MD=$(find . -maxdepth 3 -name "DESIGN.md" | head -1) [ -n "$PRODUCT_MD" ] && echo "PASS: PRODUCT.md found at $PRODUCT_MD" || echo "WARN: PRODUCT.md not found — polish will use visible codebase conventions" [ -n "$DESIGN_MD" ] && echo "PASS: DESIGN.md found at $DESIGN_MD" || echo "WARN: DESIGN.md not found — will infer tokens from existing code" mkdir -p /app/results echo "PASS: Output directory ready" ``` **CRITICAL**: Do not proceed if the feature is not functionally complete. Polish before functionality is wasteful and often introduces regressions. ## Step 2: Design System Discovery Before any edits, map the existing design system. Polish without system alignment is decoration on top of drift. 1. **Load context files** — Read `PRODUCT.md` and `DESIGN.md` (or equivalent). Extract: - Color tokens (names and values) - Spacing scale (e.g., 4px base, t-shirt sizes, or named tokens) - Typography styles (families, sizes, weights, line heights) - Component library location and import patterns - Motion conventions (duration ranges, easing curves, reduced-motion policy) - Naming conventions for variables and components 2. **Scan the codebase for conventions** — Even without formal docs, the code reveals the system: ```bash # Find token definitions grep -r "spacing\|color\|font\|radius" src/ --include="*.css" --include="*.ts" | grep -E "^\s*--" | sort -u | head -40 # Find shared component imports grep -r "from.*components\|from.*ui" src/ --include="*.tsx" | grep -oE "from '[^']+'" | sort | uniq -c | sort -rn | head -20 ``` 3. **Identify and classify drift** — For every deviation from the system, assign a root cause: - **Missing token** — the value should exist as a token but doesn't yet - **One-off implementation** — a shared component already exists but wasn't used - **Conceptual misalignment** — flow, IA, or hierarchy doesn't match neighboring features 4. **Write `design_system_notes.md`** with all discovered conventions and drift findings. **If anything about the system is ambiguous, ask — never guess at design system principles.** ## Step 3: Pre-Polish Assessment Understand the current state before making changes. 1. **Review completeness** — confirm the feature is fully functional, list any known issues to preserve as TODOs, establish the quality bar (`MVP` or `flagship`), and note the ship timeline. 2. **Walk the user's path** — experience the feature as the end user before opening DevTools: - Use the feature end-to-end - Note friction points, confusion, and anything that feels off - Ask: does this match the shape of neighboring features? 3. **Triage issues** — classify each issue as: - **Cosmetic** — looks off, does not block the user - **Functional** — breaks, blocks, or confuses the experience When polish time is limited, functional issues ship first. 4. **Document findings** in `/app/results/polish_report.md` with a running list as you discover and resolve issues. ## Step 4: Polish Systematically (max 3 rounds per dimension) Work through all dimensions methodically. For each dimension: inspect → find issues → fix → verify. Never move on leaving known issues unresolved unless explicitly deferred. ### 4.1 Visual Alignment & Spacing - Enable grid overlay and verify all elements align to the grid - Check all spacing values against the design token scale — no arbitrary values - Verify optical alignment for icons (may need 1–2px offset for visual centering) - Test at all declared breakpoints - **Fix**: Replace hard-coded pixel gaps with design token references ### 4.2 Information Architecture & Flow - Compare this feature's shape to 2–3 neighboring features: does the same conceptual weight get the same visual weight? - Verify the flow shape (modal vs full-page, inline edit vs route, save-on-blur vs explicit submit) matches established patterns - Check that nouns and verbs match the rest of the product vocabulary - Verify empty → loading → loaded → error transitions match adjacent features ### 4.3 Typography - Confirm heading/body/caption size and weight hierarchy is consistent throughout - Verify body text line length (45–75 characters) - Check for widows and orphans in long text blocks - Confirm no FOUT/FOIT on font load ### 4.4 Color & Contrast ```bash # Quick contrast audit using axe-cli (if available) npx axe --disable=color-contrast-enhanced 2>/dev/null | grep -i contrast || echo "Run contrast check manually in browser DevTools" ``` - All text meets WCAG AA (4.5:1 body, 3:1 large text) - No hard-coded hex/rgb values — all colors reference tokens - Tinted neutrals: no pure gray (`#808080`) or pure black — add subtle chroma - Gray text never on colored backgrounds — use a shade of that color or transparency ### 4.5 Interaction States Every interactive element must have all 8 states: default, hover, focus, active, disabled, loading, error, success. ```bash # Find interactive elements missing focus styles grep -rn "button\|input\|select\|textarea\|a" src/ --include="*.css" | grep -v "focus" | head -20 ``` ### 4.6 Micro-interactions & Transitions - All state changes animate at 150–300ms with ease-out easing - No bounce or elastic easing — they feel dated - Test at 60fps (Chrome DevTools Performance panel) - Verify `prefers-reduced-motion` media query disables/reduces animations ### 4.7 Content & Copy - Same things named the same everywhere - Consistent capitalization rule applied (Title Case vs Sentence case) - No typos; grammar is consistent - Labels don't end in periods unless all labels do ### 4.8 Forms & Inputs - All inputs have associated `