frontend-patterns
Frontend development patterns and best practices. Use for component architecture, state management, CSS patterns, accessibility, performance optimization, and…
от Andersonlimahw★ 19 звёзд на GitHub
Установить frontend-patterns в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Frontend Patterns
1. Component Architecture
- Atomic Design: Organize components into Atoms, Molecules, Organisms, Templates, and Pages.
- Compound Components: Use context to share implicit state between parent and child components (e.g.,
<Select>,<Select.Option>). - Render Props: Share code between React components using a prop whose value is a function.
- Custom Hooks: Extract stateful logic from a component so it can be tested independently and reused.
2. State Management
- Local State: Use
useStateoruseReducerfor state that is isolated to a single component or small subtree. - Global State: Use context API, Redux, Zustand, or Jotai for application-wide state.
- Server State: Use React Query, SWR, or Apollo Client to manage asynchronous data fetching, caching, synchronization, and error handling.
- Form State: Use libraries like React Hook Form or Formik for complex forms.
3. CSS Patterns
- Utility-first CSS: Tailwind CSS conventions for rapid styling and consistency.
- CSS Modules: Scope CSS locally by default to avoid class name collisions.
- Styled-components: Write actual CSS in JavaScript, leveraging tagged template literals.
4. Performance Optimization
- Code Splitting: Use
React.lazyand Suspense to lazy load components. - Memoization: Use
React.memo,useMemo, anduseCallbackto prevent unnecessary re-renders. - Virtual Scrolling: Render only the visible items in a long list to save memory and processing time.
5. Accessibility (A11y)
- WCAG 2.1 Checklist: Follow guidelines for contrast, text resizing, and keyboard navigability.
- ARIA Patterns: Use ARIA attributes appropriately to enhance semantics for screen readers.
- Focus Management: Ensure logical tab order and visible focus states.
6. Testing
- Component Testing: Use React Testing Library to test components from the user's perspective.
- Visual Regression: Compare screenshots of components to detect unintended visual changes (e.g., Chromatic, Percy).
- E2E Testing: Automate browser actions to test critical user flows (e.g., Playwright, Cypress).
7. Design System Integration
- Token Consumption: Map design tokens (colors, typography, spacing) to CSS variables or a theme provider.
- Component Composition: Build complex UIs by composing simpler, reusable design system components.
8. SEO
- Meta Tags: Use next/head or react-helmet for dynamic meta tags.
- Structured Data: Inject JSON-LD to help search engines understand page content.
- SSR/SSG: Leverage Next.js or Remix for server-side rendering or static site generation.
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл frontend-patterns?
Frontend development patterns and best practices. Use for component architecture, state management, CSS patterns, accessibility, performance optimization, and design system integration.
Как установить скилл frontend-patterns?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл frontend-patterns запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
AnthropicGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
webapp-testing
AnthropicToolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
brand-guidelines
AnthropicApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
web-artifacts-builder
AnthropicSuite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…