generic-react-feature-developer
БесплатноБез исполняемых скриптовНе проверенGuide feature development for React applications with architecture focus. Covers Zustand/Redux patterns, IndexedDB usage, component systems, lazy loading…
Об этом скилле
React Feature Developer
Guide feature development with React architecture patterns.
Extends: Generic Feature Developer - Read base skill for development workflow, scope assessment, and build vs integrate decisions.
React Architecture
Project Structure
src/
├── components/
│ ├── ui/ # Reusable primitives (Button, Input)
│ ├── features/ # Feature-specific components
│ └── layout/ # Layout components (Header, Sidebar)
├── hooks/ # Custom hooks (useAuth, useStore)
├── stores/ # Zustand stores
├── services/ # API clients, IndexedDB wrappers
├── types/ # TypeScript interfaces
└── lib/ # Utilities
State Management Patterns
Zustand Store (Preferred)
// stores/useFeatureStore.ts
interface FeatureState {
items: Item[];
isLoading: boolean;
// Actions
addItem: (item: Item) => void;
removeItem: (id: string) => void;
}
const useFeatureStore = create<FeatureState>()(
persist(
(set) => ({
items: [],
isLoading: false,
addItem: (item) => set((s) => ({ items: [...s.items, item] })),
removeItem: (id) =>
set((s) => ({
items: s.items.filter((i) => i.id !== id),
})),
}),
{
name: "feature-storage",
version: 1,
migrate: (state, version) => {
// Handle migrations between versions
return state as FeatureState;
},
},
),
);
Zustand Selectors (Performance)
// Avoid re-renders with selectors
const items = useFeatureStore((state) => state.items);
const addItem = useFeatureStore((state) => state.addItem);
// Shallow compare for objects
import { shallow } from "zustand/shallow";
const { items, isLoading } = useFeatureStore(
(state) => ({ items: state.items, isLoading: state.isLoading }),
shallow,
);
Context vs Zustand Decision
| Use Context | Use Zustand |
|---|---|
| Theme, locale (rarely changes) | Frequently updated data |
| Authentication state | Complex state with actions |
| Provider already exists | Need persistence |
| Prop drilling 1-2 levels | Cross-cutting concern |
Server State (React Query)
// Server state - React Query
const { data, isLoading, error } = useQuery({
queryKey: ["items", userId],
queryFn: () => fetchItems(userId),
staleTime: 5 * 60 * 1000, // 5 minutes
});
// Mutations
const mutation = useMutation({
mutationFn: createItem,
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ["items"] });
},
});
IndexedDB Integration
When to Use
| Scenario | Solution |
|---|---|
| < 5MB total | localStorage via Zustand persist |
| > 5MB total | IndexedDB |
| Binary data (images, files) | IndexedDB |
| Simple key-value | localStorage |
| Complex queries | IndexedDB |
Service Wrapper Pattern
// services/indexedDBService.ts
class IndexedDBService {
private db: IDBDatabase | null = null;
async init() {
return new Promise<void>((resolve, reject) => {
const request = indexedDB.open("AppDB", 1);
request.onerror = () => reject(request.error);
request.onsuccess = () => {
this.db = request.result;
resolve();
};
request.onupgradeneeded = (event) => {
const db = (event.target as IDBOpenDBRequest).result;
db.createObjectStore("items", { keyPath: "id" });
};
});
}
async setItem<T>(store: string, value: T): Promise<void> {
// Implementation
}
async getItem<T>(store: string, key: string): Promise<T | null> {
// Implementation
}
}
export const indexedDBService = new IndexedDBService();
Lazy Loading
Component Lazy Loading
// Heavy components (>20KB)
const HeavyChart = lazy(() => import('./HeavyChart'));
const RichTextEditor = lazy(() => import('./RichTextEditor'));
// Pages
const SettingsPage = lazy(() => import('./pages/Settings'));
// Usage with Suspense
<Suspense fallback={<Skeleton />}>
<HeavyChart data={data} />
</Suspense>
Route-Level Code Splitting
// React Router example
const routes = [
{
path: '/dashboard',
element: <DashboardLayout />,
children: [
{
path: 'settings',
lazy: () => import('./pages/Settings'),
},
],
},
];
Custom Hook Patterns
Feature Hook
// hooks/useItems.ts
function useItems() {
const items = useFeatureStore((s) => s.items);
const addItem = useFeatureStore((s) => s.addItem);
const sortedItems = useMemo(
() => [...items].sort
Установить generic-react-feature-developer в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл generic-react-feature-developer?
Guide feature development for React applications with architecture focus. Covers Zustand/Redux patterns, IndexedDB usage, component systems, lazy loading strategies, and seamless integration. Use when adding new features, refactoring existing code, or planning major changes.
Как установить скилл generic-react-feature-developer?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл generic-react-feature-developer запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic