react-client-expert
Skill2 starsChanged 40 days agoMITView on GitHub
Senior client-side React (no RSC for UI): minimal state, deliberate effects, use() + Suspense and TanStack Query for data, XState for complex flows, refs, restrained Context. Use for components, hooks, fetching, effects, or client refactors in .tsx files.
In this repository49 other files it gives its agents.
- AGENTS.mdAGENTS.md
- adversarial-auditSkill
- agentic-reactorSkill
- agent-orchestratorSkill
- ai-optimizationSkill
- architecture-synthesisSkill
- audit-allow-buildsSkill
- audit-ide-dependenciesSkill
- author-workflow-skillSkill
- bdd-strategizerSkill
- chrome-extension-mv3Skill
- concurrent-cli-agentsSkill
- control-feederSkill
- control-graphSkill
- cursor-transcript-harvestSkill
- cv-promote-guardSkill
- devcontainer-hardenedSkill
- dual-copy-skill-publishSkill
- explore-repo-readonlySkill
- finder-reactorSkill
- fix-dependency-securitySkill
- fusion-sageSkill
- git-worktreesSkill
- grok-host-prepSkill
- gt-flowSkill
- higher-order-decision-architectSkill
- looperSkill
- master-plannerSkill
- mvu-refactor-planSkill
- odysseus-navigatorSkill
- project-editor-profileSkill
- semantic-markup-cssSkill
- semantic-nameSkill
- session-unit-orderSkill
- shell-kernel-ontologySkill
- skill-rename-propagationSkill
- split-to-prsSkill
- src-tree-reorganizeSkill
- stellar-roadmapSkill
- stellar-spacemapSkill
- subagent-delegationSkill
- subagent-explore-reportSkill
- supply-chain-hardenSkill
- tauri-agenticSkill
- tauri-ipc-debugSkill
- tidy-commit-pushSkill
- upgrade-packagesSkill
- verification-cockpitSkill
- x-agent-resourcesSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 69
When correct: setup + cleanup (abort, removeListener, disconnect).
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
react-client-expert
Load rule: Formal SoT. Code samples + narrative → references/patterns.md only if needed.
// Scope
Client only ("use client" when Next requires)
¬ async Server Components for interactive UI state
// Lint note
Biome useExhaustiveDependencies may be OFF — fix the model, not dep stuffing
// Data preference order
useQuery / useMutation ≽ use(promise)+Suspense ≻ useEffect+fetch+useStateFetch: do not conflate RSC vs client
| Mechanism | Layer | Role |
async Server Component | server | RSC stream — out of scope for interactive client logic |
use(promise) / use(context) | client | suspend during render; needs <Suspense> |
| TanStack Query | client | cache, dedupe, refetch, invalidation — default non-trivial data |
useEffect+fetch+useState | client | avoid for load-by-key |
Rules for use(promise): stable promise (not bare use(fetch()) every render) · Suspense above · rejections → error boundary · refetch via new promise/key or graduate to Query.
State: default to zero useState
| Need | Prefer | Avoid |
| computable from props/state | derive in render | sync useState+effect |
| expensive pure | useMemo if hot/profiled | memo everything |
| form field | controlled or uncontrolled+ref | duplicate DOM in state |
| remote data | Query / use() | effect fetch soup |
| form+async UI together | useReducer + status enum | N booleans that desync |
| multi-step / guards / cancel | XState | effect chains + flags |
| high-freq (pointer/scroll) | ref + rAF/DOM | context every move |
| theme/auth read-mostly | narrow Context | giant hot context |
status ∈ { idle, loading, error, success } // mutually exclusive phases
isLoading ≔ status === "loading" // derive; don't store extra boolGraduate: useReducer (one feature, linear) → Query mutation (retries/invalidation) → XState (guards, parallel, cancel).
useEffect: last resort
OK: subscriptions, imperative widgets, post-commit analytics, browser APIs without React wrapper.
Forbidden uses: initial/keyed load · transform for render · reset when props change (use key) · chain user events · notify parent (call in handler).
When correct: setup + cleanup (abort, removeListener, disconnect); deps = semantic only.
Refs / Context / XState / components
| Area | Rule |
| Refs | no re-render needed (timers, last value, DOM measure via callback ref) |
| Context | split by update frequency; avoid high-churn in provider value |
| XState | idle/loading/error/success + guards/parallel/retry → colocate featureMachine.ts |
| Components | container vs presentation · colocate state · stable list keys · event handlers not effect-watchers |
React 19 client: use · useActionState · useOptimistic · useEffectEvent — see patterns.
Perf (measured only)
memo / useCallback only for hot leaves or true effect deps · virtualize long lists · startTransition / useDeferredValue for expensive input. Default: no memo.
Review checklist
useState+effect → derive orkey?- submit/async → reducer+status enum?
- each effect has cleanup if it subscribes?
- machine/store shrinks boolean soup?
- context frequency safe?
- refs for DOM/imperative?
- Query/
use()not effect-load? - no async Server Component for interactive UI?
Anti-patterns
| ¬ | Do |
| sync derived state in effect | derive in render |
| fetch without abort / Query | Query or abort+cleanup |
| loading+error+result bool soup | status enum + reducer |
| giant Context every keystroke | local state / store / machine |
| async client function component as fetch | "use client" + use/Query |
Done when: client UI follows tables above; no effect-based loaders for keyed data; review checklist green for touched files.
Patterns/code: references/patterns.md.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

