applying-frontend-patterns

Identify and apply frontend patterns for component design in React, Vue, and Angular.

11|1|Updated Aug 6, 2025
One-click install
npx skills add https://github.com/thkt/claude-config --skill applying-frontend-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: applying-frontend-patterns
Source: https://github.com/thkt/claude-config/tree/main/ja/skills/applying-frontend-patterns
Command: npx skills add https://github.com/thkt/claude-config --skill applying-frontend-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

フロントエンドの設計パターンをフレームワーク非依存で提供します。

Core Features & Use Cases

  • Container/Presentational分離
  • フックパターン(useEffect/useMemo/useCallback)
  • カスタムフック設計
  • 状態管理とコンポーネントコンポジション

Quick Start

実装時にこのガイドを参照して、最初はPresentationalから開始します。

Frequently Asked Questions about applying-frontend-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I separate container and presentational components in React?

Container/presentational separation isolates state management and side effects (container) from UI rendering (presentational). Containers handle logic, data fetching, and state; presentational components receive props and render UI. This pattern improves reusability, testability, and maintainability across React applications.

What's the best way to design custom hooks for reusable logic?

Custom hooks extract stateful logic into reusable functions prefixed with 'use-'. Design them to handle specific concerns—data fetching, form state, animations—accepting configuration parameters and returning state and handlers. Follow naming conventions and compose multiple hooks to build complex, shareable functionality.

Can I apply these frontend patterns to Vue and Angular projects?

Yes. Container/presentational separation, custom hooks (composition API in Vue, services in Angular), and state management patterns are framework-agnostic design principles. The guidance adapts these patterns to Vue's composition API, Angular's services and components, and React's hooks ecosystem.

How do I refactor components to improve logic and UI separation?

Refactoring for logic/UI separation involves extracting business logic into containers or custom hooks, moving side effects out of presentational components, and applying composition principles. Review existing components against container/presentational roles, Law of Demeter, and YAGNI to identify separation opportunities.

What state management patterns work best with component composition?

Composition patterns integrate with state management by using custom hooks to encapsulate state, derived values, and handlers. Pass state through props or context; compose multiple hooks to manage different concerns. This approach avoids prop drilling and keeps components focused on single responsibilities.

When should I use presentational components instead of container patterns?

Presentational components suit scenarios requiring reusable, stateless UI—buttons, cards, forms. Use them when the component receives all data via props and has no side effects. Container patterns wrap presentational components to inject state, logic, and effects; choose based on the component's role in your architecture.