$npx -y skills add DevelopersGlobal/ai-agent-skills --skill frontend-engineeringAccessible, performant, responsive UI patterns. Component design, state management discipline, and Core Web Vitals compliance.
| 1 | ## Overview |
| 2 | |
| 3 | Frontend code touches every user. Poor UI engineering causes accessibility barriers, performance degradation, and broken experiences on non-standard devices. This skill enforces the discipline of building UI that works for everyone. |
| 4 | |
| 5 | ## When to Use |
| 6 | |
| 7 | - Building any user-facing UI component |
| 8 | - Reviewing frontend PRs |
| 9 | - Before any UI ships to production |
| 10 | |
| 11 | ## Process |
| 12 | |
| 13 | ### Step 1: Accessibility First |
| 14 | |
| 15 | 1. Every interactive element has a visible focus state. |
| 16 | 2. All images have meaningful alt text (or `alt=""` for decorative). |
| 17 | 3. Color contrast ratio ≥ 4.5:1 for normal text. |
| 18 | 4. All functionality operable by keyboard alone. |
| 19 | 5. Use semantic HTML: `<button>` not `<div onclick>`, `<nav>` not `<div class="nav">`. |
| 20 | |
| 21 | **Verify:** Run axe DevTools or Lighthouse accessibility audit. Score ≥ 90. |
| 22 | |
| 23 | ### Step 2: Performance (Core Web Vitals) |
| 24 | |
| 25 | 6. LCP (Largest Contentful Paint) < 2.5s: Optimize images, preload critical resources. |
| 26 | 7. FID/INP < 100ms: Avoid long tasks on the main thread. |
| 27 | 8. CLS (Cumulative Layout Shift) < 0.1: Reserve space for dynamic content. |
| 28 | 9. Lazy load below-the-fold images and non-critical JS. |
| 29 | 10. Bundle size: measure before and after. No unneeded dependencies. |
| 30 | |
| 31 | **Verify:** Lighthouse performance score ≥ 80. CWV within targets. |
| 32 | |
| 33 | ### Step 3: Responsive Design |
| 34 | |
| 35 | 11. Test at 320px, 768px, 1024px, 1440px viewports. |
| 36 | 12. No horizontal scrolling at any standard viewport. |
| 37 | 13. Touch targets ≥ 44px × 44px. |
| 38 | |
| 39 | ### Step 4: State Management Discipline |
| 40 | |
| 41 | 14. Server state vs. client state are separate concerns — don't mix. |
| 42 | 15. No prop drilling more than 2 levels — use context or state management. |
| 43 | 16. Loading, error, and empty states handled for every async operation. |
| 44 | |
| 45 | **Verify:** Loading, error, and empty states all visible in Storybook/dev environment. |
| 46 | |
| 47 | ## Common Rationalizations (and Rebuttals) |
| 48 | |
| 49 | | Excuse | Rebuttal | |
| 50 | |--------|----------| |
| 51 | | "Accessibility is for edge cases" | 1 in 4 adults has a disability. It's not an edge case. | |
| 52 | | "We'll optimize performance later" | Users leave after 3 seconds. "Later" is too late. | |
| 53 | |
| 54 | ## Verification |
| 55 | |
| 56 | - [ ] Accessibility audit score ≥ 90 |
| 57 | - [ ] Core Web Vitals within targets |
| 58 | - [ ] Responsive at 320px/768px/1024px/1440px |
| 59 | - [ ] Loading, error, empty states handled |
| 60 | - [ ] All interactive elements keyboard-operable |
| 61 | |
| 62 | ## References |
| 63 | |
| 64 | - [references/accessibility-checklist.md](../../references/accessibility-checklist.md) |
| 65 | - [performance-optimization skill](../performance-optimization/SKILL.md) |