React/TypeScript component style guide. Use when writing, refactoring, or reviewing React components, especially around props typing, state boundaries, shared local state with Jotai atoms, API types, query/mutation contracts, navigation, memoization, wrappers, and empty-state handling.
Ships in front. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use this as the decision guide for React/TypeScript component structure. Existing code is reference material, not automatic precedent; when it conflicts with these rules, adapt the approach instead of reproducing the violation.
packages/dify-ui/README.md and packages/dify-ui/AGENTS.md. Prefer design-system tokens, utilities, and radius mappings over generic Tailwind guidance.FC or React.FC.function for top-level components and module helpers. Use arrow functions for local callbacks, handlers, and lambda-style APIs.Props type only when reused, exported, complex, or clearer.appInstanceId. Normalize framework or route params at the boundary.web/contract/* as the single source of truth for API shape; follow existing domain/router patterns and the { params, query?, body? } input shape.useQuery(consoleQuery.xxx.queryOptions(...)) or useQuery(marketplaceQuery.xxx.queryOptions(...)).web/service/use-* wrappers that only rename queryOptions() or mutationOptions(). Extract a small queryOptions helper only when repeated call-site options justify it.input: skipToken; use enabled only for extra business gating after the input is valid.useMutation(consoleQuery.xxx.mutationOptions(...)) or useMutation(marketplaceQuery.xxx.mutationOptions(...)); use oRPC clients as mutationFn only for custom flows.createTanstackQueryUtils(...experimental_defaults...); components may add UI feedback callbacks, but should not own shared invalidation rules.useInvalid or useReset.mutate(...); use mutateAsync(...) only when Promise semantics are required, and wrap awaited calls in try/catch.useMemo only when the calculation is actually expensive.key reset, storing a stable ID and deriving the selected object, or guarded same-component render-time adjustment when truly necessary.Link for normal navigation. Use router APIs only for command-flow side effects such as mutation success, guarded redirects, or form submission.memo, useMemo, and useCallback unless there is a clear performance reason.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
/front:how-to-write-componentfrom front
npx claudepluginhub nmhjklnm/frontend-skills --plugin front11 skills in this plugin
/calm-uiApply a restrained, Swiss/Japanese/Scandinavian/German-influenced product design system when building or refining UI in React, Next.js, TypeScript, and shadcn/ui — the stack-specific binding of the ui-principles core, with concrete numbers. Use when the user asks to build, refine, critique, redesign, or review a page, screen, component, form, table, dashboard, layout, or other frontend interface in a React, Next.js, TypeScript, or shadcn/ui project. For stacks without React/shadcn (plain HTML/CSS, Vue, Svelte, emails, server-rendered templates), use ui-principles instead. Do not use for marketing sites, landing pages, non-UI work, or requests for bold, playful, maximalist, or otherwise expressive aesthetics./component-refactoringRefactor high-complexity React components in Dify frontend. Use when `pnpm analyze-component --json` shows complexity > 50 or lineCount > 300, when the user asks for code splitting, hook extraction, or complexity reduction, or when `pnpm analyze-component` warns to refactor before testing; avoid for simple/well-structured components, third-party wrappers, or when the user explicitly wants testing without refactoring./reactBuilds token-driven React components with TypeScript and modern patterns. Use when creating React component libraries, integrating CSS custom properties, or building Next.js design system components with forwardRef and composition./frontend-code-reviewTrigger when the user requests a review of frontend files (e.g., `.tsx`, `.ts`, `.js`). Support both pending-change reviews and focused file reviews while applying the checklist rules./frontend-designCreate distinctive, production-grade frontend interfaces with strong visual direction, polished typography, considered layout, and working HTML/CSS/JS or framework code. Use for websites, landing pages, dashboards, React components, application screens, and UI beautification.
/frontend-testingGenerate Vitest + React Testing Library tests for Dify frontend components, hooks, and utilities. Triggers on testing, spec files, coverage, Vitest, RTL, unit tests, integration tests, or write/review test requests.