react
БесплатноБез исполняемых скриптовНе проверенUSE WHEN changing the logic, data, props, state, Effects or rendered text of a React component, hook or page, even a one-line change; NOT WHEN the request is…
от mintuz★ 38 звёзд на GitHubОб этом скилле
React
Write React 19 code with only the project's installed libraries. Do not add a dependency unless the user asks for one.
Before you change code, read each guide that matches the change. A change that crosses a boundary needs more than one guide. Follow the conditions and exceptions of each guide rule, not only the summaries below. Use the same guides to review components.
Return complete, type-correct code for each behaviour you claim, including event handlers and data flow. A comment, a console.log stub or a no-op callback is not an implementation.
| Change | Guide |
|---|---|
| Component APIs, boolean modes, explicit variants, children, compound components, providers, refs or context | composition.md |
| State placement, URL state, handlers, Effects, actor integration or resource lifetimes | state-effects.md |
| Feature structure, imports, endpoint schemas, fetchers and hooks, permissions or HTTP errors | structure-api.md |
| Rendering, subscriptions, memoisation, deferred rendering, code loading or preloading | performance.md |
Apply principle-derive-from-one-owner, principle-reuse-before-building, principle-model-the-domain, principle-type-system-discipline, principle-hide-representations and principle-narrow-state-lifetime within their own triggers and exclusions.
Render purity is a React rule, not the domain-purity principle. React types (ReactNode, ref props, typed actor refs) may cross component boundaries inside UI integration code. Do not let them enter framework-independent domain or API code. Put state in the nearest common UI owner that needs it. Put a temporal lifecycle (a request answer, retry, cancellation, polling, optimistic update or drag) in an actor, and follow web:xstate.
Permissions and API answers
For a permission change, open the role fetcher and the HTTP wrapper that the action uses before you finish. Repair each conflict with the rules below in the same change, not only in the reply. Do not change unrelated endpoints.
- A UI permission check only controls what the UI shows. It cannot stop a crafted request. In the reply, state both facts and state that the server must authenticate the actor, authorise each mutation for that actor and resource, and refuse with 403 before it changes data.
- Put each permission rule in a plain exported function outside components, such as
canInvite(user). When access depends on a specific resource, include resource ownership in the predicate. Returnfalsewhen there is no user. The component calls that same function. Test the function directly, without rendering React (principle-keep-the-core-pure). - Call the action from its event handler. Show a rejected 403 as a visible failure in the component where the action happened. For a 403, do not sign the user out, clear the session or redirect; if the wrapper does, repair it. A 401 still signs the user out.
- Use the Fetch API, never axios. The wrapper checks
response.ok. The fetcher parses the JSON body fromunknowninto the app's type. On this path, replace an existingascast with a parser that narrows the value withtypeofandinchecks. Parse an unknown role or permission to an explicit unknown value that grants nothing and differs from each real role (principle-parse-at-the-boundary).
State and Effects
- Derive values from props, state, URL parameters or actor snapshots during render. Do not copy them into state through an Effect.
- Put work that a user action causes in its event handler, not in an Effect that watches a flag.
- Use an Effect only to synchronise with an external system.
- An Effect that synchronises an imperative target (an editor, a chart, a map, a DOM node) applies the current values on each run, including the first run after mount. Do not guard it with a previous-value or transition check: that guard skips the state the component mounts in. List each value it reads as a dependency. Do not add a separate mount-only update Effect.
- Async Effect fallback: use it only when neither XState nor a query library is installed and dependencies cannot change. Each run creates its own
AbortControllerwhen the operation accepts a signal. Cleanup marks the run stale, then aborts it. A stale run writes no state on success or on failure. Detect cancellation byerror.name === "AbortError", not by error class, and treat it as no error. Send each other rejection of the current run to the failure state.
Effects that call a callback prop
When an Effect subscribes outside React and calls a callback prop, wrap the callback in useEffectEvent. Call the Effect Event only from that Effect or its subscription callbacks. Do not call it during render, from another hook or component, or from a user handler. Leave it out of the dependency array: its identity changes on each render. Keep reactive subscription values, suc
Установить react в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл react?
USE WHEN changing the logic, data, props, state, Effects or rendered text of a React component, hook or page, even a one-line change; NOT WHEN the request is styling only (class names, Tailwind, CSS, dark mode, spacing, shadows) or tests only, or when it models submit, in-flight, loading, retry or failure states, even for a named React form (xstate covers that, including its React wiring); applies React 19 composition, state, Effect, structure, API and performance rules with only the project's installed libraries.
Как установить скилл react?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл react запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic