home / skills / pbakaus / impeccable / normalize

normalize skill

/source/skills/normalize

This skill helps normalize a feature to the design system by aligning typography, colors, spacing, components, and accessibility.

npx playbooks add skill pbakaus/impeccable --skill normalize

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
4.0 KB
---
name: normalize
description: Normalize design to match your design system and ensure consistency
args:
  - name: feature
    description: The page, route, or feature to normalize (optional)
    required: false
user-invokable: true
---

Analyze and redesign the feature to perfectly match our design system standards, aesthetics, and established patterns.

## MANDATORY PREPARATION

Use the frontend-design skill — 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 teach-impeccable first.

---

## Plan

Before making changes, deeply understand the context:

1. **Discover the design system**: Search for design system documentation, UI guidelines, component libraries, or style guides (grep for "design system", "ui guide", "style guide", etc.). Study it thoroughly until you understand:
   - Core design principles and aesthetic direction
   - Target audience and personas
   - Component patterns and conventions
   - Design tokens (colors, typography, spacing)
   
   **CRITICAL**: If something isn't clear, ask. Don't guess at design system principles.

2. **Analyze the current feature**: Assess what works and what doesn't:
   - Where does it deviate from design system patterns?
   - Which inconsistencies are cosmetic vs. functional?
   - What's the root cause—missing tokens, one-off implementations, or conceptual misalignment?

3. **Create a normalization plan**: Define specific changes that will align the feature with the design system:
   - Which components can be replaced with design system equivalents?
   - Which styles need to use design tokens instead of hard-coded values?
   - How can UX patterns match established user flows?
   
   **IMPORTANT**: Great design is effective design. Prioritize UX consistency and usability over visual polish alone. Think through the best possible experience for your use case and personas first.

## Execute

Systematically address all inconsistencies across these dimensions:

- **Typography**: Use design system fonts, sizes, weights, and line heights. Replace hard-coded values with typographic tokens or classes.
- **Color & Theme**: Apply design system color tokens. Remove one-off color choices that break the palette.
- **Spacing & Layout**: Use spacing tokens (margins, padding, gaps). Align with grid systems and layout patterns used elsewhere.
- **Components**: Replace custom implementations with design system components. Ensure props and variants match established patterns.
- **Motion & Interaction**: Match animation timing, easing, and interaction patterns to other features.
- **Responsive Behavior**: Ensure breakpoints and responsive patterns align with design system standards.
- **Accessibility**: Verify contrast ratios, focus states, ARIA labels match design system requirements.
- **Progressive Disclosure**: Match information hierarchy and complexity management to established patterns.

**NEVER**:
- Create new one-off components when design system equivalents exist
- Hard-code values that should use design tokens
- Introduce new patterns that diverge from the design system
- Compromise accessibility for visual consistency

This is not an exhaustive list—apply judgment to identify all areas needing normalization.

## Clean Up

After normalization, ensure code quality:

- **Consolidate reusable components**: If you created new components that should be shared, move them to the design system or shared UI component path.
- **Remove orphaned code**: Delete unused implementations, styles, or files made obsolete by normalization.
- **Verify quality**: Lint, type-check, and test according to repository guidelines. Ensure normalization didn't introduce regressions.
- **Ensure DRYness**: Look for duplication introduced during refactoring and consolidate.

Remember: You are a brilliant frontend designer with impeccable taste, equally strong in UX and UI. Your attention to detail and eye for end-to-end user experience is world class. Execute with precision and thoroughness.

Overview

This skill normalizes UI features to match a project's design system so interfaces are consistent, accessible, and maintainable. It guides discovery, analysis, planning, and execution to replace one-off implementations with design-system-aligned components and tokens. The result is predictable UX, fewer regressions, and a cleaner shared component surface.

How this skill works

First, it runs a Context Gathering Protocol to find and study the design system, tokens, and patterns. Then it analyzes the target feature to identify cosmetic and functional deviations, creates a prioritized normalization plan, and executes changes across typography, color, spacing, components, motion, responsiveness, and accessibility. Finally, it consolidates reusable code, removes orphaned artifacts, and verifies quality through linting, type checks, and tests.

When to use it

  • When a feature uses hard-coded styles or custom components that diverge from the design system
  • During UI refactors to improve consistency and reduce maintenance overhead
  • Before adding new features so they follow established tokens and patterns
  • When accessibility or responsive behavior is inconsistent with product standards
  • When onboarding a new design system or consolidating multiple style sources

Best practices

  • Always run the Context Gathering Protocol; never guess design intent or tokens
  • Prefer design system components and tokens over new one-off implementations
  • Prioritize UX and accessibility before visual polish when resolving conflicts
  • Document any shared components moved into the system and delete obsolete code
  • Verify changes with linting, type checks, responsive checks, and accessibility audits

Example use cases

  • Replace a custom modal with the design system dialog component and map tokens for spacing, typography, and focus behavior
  • Convert hard-coded color values to theme color tokens and ensure contrast meets accessibility thresholds
  • Refactor a bespoke form input into the system input component to unify validation, labels, and error states
  • Align a feature's responsive breakpoints and grid layout to the system’s layout utilities
  • Audit animations and micro-interactions to match system timings and easing for consistent motion

FAQ

What if the design system is incomplete or missing guidance?

Follow the Context Gathering Protocol and run teach-impeccable to collect missing context. If gaps remain, ask clarifying questions and prefer patterns used elsewhere in the product rather than inventing new ones.

Can I introduce a new component when solving a problem?

Only introduce a new component if there is a clear, repeated need that the design system cannot address. When you do, move it into the shared system path and document its tokens, variants, and accessibility behavior.