Rime react
Use when writing, reviewing, or refactoring React components, hooks, or data-fetching patterns. Covers effect discipline, component composition, performance optimization, and data flow. Applies to any React project (Vite, Next.js, Remix, etc.).From its SKILL.md
npx -y skills add josui/rime-craft --skill rime-reactAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.8 KB, as published. Nobody here has run it
React Component Rules
Framework-agnostic React component development rules. Covers 4 groups, 21 rules total: Effect Discipline, Component Structure, Performance, and Data & Boundaries.
Rules Index
Effect Discipline — "useEffect is not a lifecycle hook"
| Rule | Summary | Priority |
|---|---|---|
| effect-derive-state | Compute derived state inline, never sync via Effect | critical |
| effect-use-event-handler | Side effects from user actions belong in event handlers | critical |
| effect-data-fetching | Use a data-fetching library, not raw Effect + fetch | critical |
| effect-mount-only | Effects are only for syncing with external systems on mount | critical |
| effect-reset-with-key | Reset component state with key prop, not Effect | critical |
Component Structure — "Composition over configuration"
| Rule | Summary | Priority |
|---|---|---|
| component-no-inline-def | Never define components inside other components | critical |
| component-composition | Prefer composition (children) over boolean prop sprawl | recommended |
| component-compound | Use compound component pattern for complex UI | recommended |
| component-state-lifting | Lift state to nearest common ancestor or provider | recommended |
| component-conditional-render | Guard && renders against numeric falsy values (0, NaN) | critical |
Performance — "Measure first, optimize second"
| Rule | Summary | Priority |
|---|---|---|
| perf-memo-strategy | With React Compiler: automatic. Without: manual memo for expensive computations only | recommended |
| perf-stable-references | Functional setState, hoisted defaults, useRef for transient values, lazy init | recommended |
| perf-bundle-imports | Avoid barrel imports; defer third-party scripts post-hydration | critical |
| perf-lazy-loading | Lazy-load heavy components + preload on hover/focus | recommended |
| perf-async-parallel | Promise.all for independent ops; defer await until consumption | recommended |
| perf-transitions | Mark non-urgent updates with startTransition | recommended |
| perf-activity | Preserve state/DOM of toggled components with Activity (experimental) | recommended |
Data & Boundaries — "Data flows down, events flow up"
| Rule | Summary | Priority |
|---|---|---|
| data-rsc-boundary | Minimize serialized data across Server/Client boundary | recommended |
| data-suspense-streaming | Wrap async regions in Suspense for streaming, avoid waterfalls | recommended |
| data-dedup | Client: SWR/TanStack Query dedup. Server: React.cache() | recommended |
| data-render-as-you-fetch | Component tree mirrors data dependencies; parent fetches, child consumes | recommended |
Stack Hints
| Scenario | Vite SPA | Next.js App Router | Remix |
|---|---|---|---|
| Lazy loading | React.lazy + Suspense | next/dynamic | React.lazy (route-level handled by framework) |
| RSC boundary | N/A | "use client" / "use server" | N/A (Remix v3+ exploring) |
| Data fetching | SWR / TanStack Query | Server Components + fetch | loader / action |
| Streaming | Manual SSR streaming setup | Built-in | Built-in |
Framework API Guidance
Framework-specific APIs (routing, data loading, middleware, etc.) are out of scope. Use context7 or official docs to look up the latest framework APIs.
Relationship with rime-js
Framework-agnostic JS/TS rules live in rime-js. The following rime-react rules have authoritative counterparts there:
perf-async-parallel→rime-js:async-parallel(generic async concurrency)perf-bundle-imports→rime-js:module-no-barrels(barrel file avoidance)
The rime-react versions add React-specific context (component rendering, hydration). For non-React JS/TS code, refer to rime-js directly.
Recommended Tools
- react-doctor — React code health check (if installed). Run it and cross-reference findings with these rules.