react
React core guidance for purity, state modeling, effects discipline, and predictable component design in React projects.
- License 许可
- MIT
- 最近更新
- 2026-09-14
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- react
- agents
- [ "coder", "sidekick-reviewer", "architect", "feature-designer", "feature-reviewer", "planner", "ask", "builder", "orchestrator" ]
- detect
- { "content": [ { "file": "package.json", "contains": "\"react\"" } ] }
- description
- React core guidance for purity, state modeling, effects discipline, and predictable component design in React projects.
03 SKILL.md 正文
Scope
- In scope: React component/hook correctness, render purity, state updates, effect usage, and compositional design patterns.
- Out of scope: Next.js-specific routing/caching/runtime concerns (covered by
the
nextjsskill) and framework-agnostic browser styling conventions.
Invariants
- Components and Hooks MUST be pure: no side effects during render.
- Props and state are immutable snapshots; updates must create new values.
- Effects are for synchronizing with external systems only, not for deriving render data.
- State should be minimal and normalized; derive values in render when possible.
- Keys in lists must be stable identifiers, never array index when order can change.
Validation Checklist
- Validate behavior against official React docs:
- Confirm no render-path side effects were introduced.
- Confirm Effects have correct dependencies and cleanup for subscriptions/timers.
- Run project tests and ensure no regression in interactive behavior.
Failure Handling
- If logic depends on mutating objects/arrays in place, stop and refactor to immutable updates before proceeding.
- If an Effect exists only to compute derived UI data, replace it with render-time derivation or memoization.
- If hook ordering is conditional, block the change and restore Rules of Hooks compliance.
High-Value React Practices
- Move business rules into testable pure functions, keep components focused on rendering.
- Keep hooks small and single-purpose; split hooks when responsibilities diverge.
- Prefer controlled boundaries for async state (
idle/loading/success/errorunions). - Memoize only when profiling or clear render hotspots justify it.
04 同仓库更多 Skills
unslop
Perform sequential slop-cleanup edits in bounded changed-file scope with behavior-preserving rules; do not use for read-only scanning.
unslop-reviewer
Run a read-only, pass-ordered slop scan covering abstraction and locally fixable boundary findings; never edit files.
unslop-coder
Apply unslop-reviewer findings as targeted in-scope code edits in pass order; do not run discovery/scanning in this skill.
serena
Semantic code retrieval, editing, refactoring and debugging tools using LSP servers
read-image
guidance to read images in a lightweight fashion using cwebp
playwright-cli
Drive browser UI checks with playwright-cli commands, snapshots, and test/debug workflows; do not use for backend-only or non-browser tasks.