Skip to main content

Frontend Implementation

Folder: .github/skills/tsh-implementing-frontend/
Used by: Software Engineer

Provides comprehensive frontend guidelines covering component design, design system usage, accessibility, and performance.

Component Design Principles

  • Reusable — Build components that can be composed and reused.
  • Extend, don't duplicate — Wrap existing components instead of copying.
  • Single responsibility — Each component does one thing well.

Design System Usage

A 5-step token mapping process:

  1. Identify the visual property in the Figma design.
  2. Find the corresponding design token in the codebase.
  3. Map the Figma value to the closest existing token.
  4. If no token exists, ask before creating a new one.
  5. Never hardcode color, spacing, or typography values.

Accessibility Requirements

RequirementDetails
Semantic HTMLUse correct elements (<button>, <nav>, <main>, etc.)
ARIAAdd ARIA attributes where semantic HTML is insufficient
Keyboard navigationAll interactive elements must be keyboard accessible
Color contrastMinimum 4.5:1 for normal text, 3:1 for large text
Focus managementVisible focus indicators on all interactive elements

Performance Guidelines

AreaApproach
DOMMinimize DOM depth, use virtual lists for large datasets
RenderingAvoid unnecessary re-renders, use React.memo and useMemo appropriately
AssetsOptimize images, lazy-load below-the-fold content
React-specificUse useCallback for event handlers, avoid inline objects in JSX

Anti-Patterns

Anti-PatternCorrection
Hardcoded colors/spacingUse design tokens
div for buttonsUse <button> element
Missing alt text on imagesAlways provide descriptive alt text
Inline stylesUse CSS modules or design system classes
God components (500+ lines)Split into smaller, focused components
CSS !importantFix specificity issues at the source
Missing error boundariesWrap feature sections in error boundaries

Connected Skills

  • tsh-ui-verifying — Verification criteria and tolerances.
  • tsh-technical-context-discovering — Project conventions.
Never Guess — Always Ask

If a design specification is unclear, a token is missing, or behavior is ambiguous, stop and ask. Do not guess or make assumptions about design intent.