skillZs
★ LIVE SKILL TAGS ★
>>> LIVE SKILLS INDEX <<<
* OPEN SOURCE *
NO LOGIN, NO TRACKING
※ REAL INSTALL DATA ※
← back to all skills
robsonrung/rar-skills47 installs

advanced-react

Plan, implement, or review React component structure, state placement, re-renders, and async behavior using composition first. Use for component design or behavior problems; use react for compiler setup and version-specific APIs.

How do I install this agent skill?

npx skills add https://github.com/robsonrung/rar-skills --skill advanced-react
view source ↗

Is this agent skill safe to install?

  • Gen Agent Trust Hubpass

    This skill provides a structured framework for analyzing and refactoring React code based on industry best practices. It poses a low risk of indirect prompt injection as it is designed to ingest and process untrusted external source code.

  • Socketpass

    No alerts

  • Snykpass

    Risk: LOW · No issues

What does this agent skill do?

Advanced React

Apply Advanced React (Nadia Makarevich, 2023) to a React change: a named composition shape, code that matches it, or a review that cites the book's rules by name. The rules, one per name, live in references/lenses.md; check a chapter there before resting a claim on it.

Detect the target

From package.json (and the lockfile if the range is loose), record:

  • React major. The book matches 17/18. Where the detected version disagrees, follow the detected framework and say so: "on the detected React 19, ref is a prop."
  • Compiler coverage of the affected components. A dependency or lint rule is a clue, not proof. Under the compiler, leave render-only memo / useMemo / useCallback to react; everything else here still applies.
  • Store: TanStack Query, SWR, Apollo, RTK Query, Zustand, Jotai, Redux Toolkit, or none.
  • UI library: MUI, Radix, Headless UI, shadcn/ui, Chakra, Ant, or hand-rolled. A styled-component-heavy library makes parent re-renders expensive; weight the re-render rules higher.

The two anchors

Re-renders myth. A state update re-renders its owner and every nested component, props or not. Props matter only under React.memo. A custom hook is a pocket, not a move: its state re-renders whoever calls it.

Composition-first. Structure beats memoization. Say it as you decide: "this is composition-first: the hot state moves down before any memo is added." React.memo is the last rung, because one recreated non-primitive prop, children included, silently defeats it.

Optimize only where state is hot and the subtree is heavy. A cheap, rare render is not a finding, and an unmeasured "expensive" calculation is not a reason.

Plan

Walk the composition ladder and stop at the first rung that isolates the hot state from the heavy tree:

  1. move-state-down: extract the state and its small consumer into a child.
  2. children-as-props / element-as-prop: the owner of hot state receives the heavy subtree as an element.
  3. render-prop-for-dom-data: only when that slot needs the owner's state or DOM data.
  4. split-context / existing-store: skip the middle of the tree.
  5. memo-last: only when the consumer is React.memo'd or uses the value as a hook dependency.

Write no production code. Emit:

## Advanced React plan
- Hot state: <value> owned by <component>; frequency <high|low>
- Ladder stop: <rung>
- Why not the earlier rungs: <one line>
- List identity: <key strategy | none>
- Overlay: <portal | library primitive | none>
- Fetch: <initial|on-demand>; <parallel|waterfall-risk>; race <abort|cleanup-flag|id-compare|key-remount|data-layer|n/a>
- Errors: <boundary locations | none>
- Memo: none | last-resort because <consumer is React.memo | value is a hook dep>
- Detected: React <major>, compiler <yes|no>, store <name|none>, UI <name|none>

Acceptance contract: every high-frequency state has an owner; the ladder stop is named and the earlier rungs rejected; every memo cites its justification; no component is defined inside another.

Implement

Use the planned rung, or plan first when the shape is open. State the ladder stop in one sentence, then write the code.

Acceptance contract: the code matches the stop; components and hooks sit at module scope; a hook owning hot state is called from a leaf, not a page, layout, or provider; every added memo cites a dead-memo justification; debounced functions are created once and read fresh values through a ref; every fetch in an effect has a race strategy or uses the repo's data layer.

Review

Walk the chapters the change touches, in order. Omit the rest.

ChRule nameTypical trigger
1move-state-down / hook-hides-statehot state or a hook in a page or layout
2–3children-as-props / element-as-propowner of hot state renders a heavy slot
4render-prop-for-dom-dataparent must feed state into a slot
5dead-memo / defeated-memomemo / useMemo / useCallback
6inner-component / missing-key / state-resetlists, conditionals, remounts
7hoc-for-cross-cuttingcomponent factories
8unmemoized-context / unsplits-contextproviders
9–11stale-closure / debounce-recreatedrefs, timers, memoized callbacks
12flicker-useEffectmeasure-then-mutate
13trapped-overlaymodal, tooltip, dropdown
14–15waterfall / fetch-raceclient fetch
16missing-error-boundaryrender or async errors
## Advanced React review
- [file:line] <rule-name>: <what's wrong>. Fix: <concrete change>.
- <chapter>: clean
Verdict: <one line>

Acceptance contract: every finding carries file:line, a rule name from the table, and a fix; an applicable chapter with no finding is marked clean.

Gate verdict

A design-gate or implement-and-review caller gets read-only review mode and its own canonical proceed-or-revise result. Revise on a load-bearing miss: hot state in a layout, a defeated memo counted as real, a fetch race, a render path with no boundary. Proceed past an unmeasured "expensive" calculation.

Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.

<a href="https://skillzs.dev/skills/robsonrung/rar-skills/advanced-react">View advanced-react on skillZs</a>