← Back to Skills Marketplace
codekungfu

React Patterns

by ClawKK · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
328
Downloads
0
Stars
1
Active Installs
1
Versions
Install in OpenClaw
/install react-patterns
Description
Deep React patterns workflow—component boundaries, composition, hooks rules, effects and data fetching, performance (memo, lists, suspense), testing, and acc...
README (SKILL.md)

React Patterns (Deep Workflow)

Healthy React codebases emphasize clear data flow, minimal effects, and predictable rendering. Prefer composition over inheritance; treat effects as synchronization, not “do something after render” for everything.

When to Offer This Workflow

Trigger conditions:

  • Prop drilling vs context vs external stores; confusion on server components (Next) vs client
  • useEffect spaghetti; stale closures; double-fetch
  • Re-render performance; large lists; hydration issues

Initial offer:

Use six stages: (1) structure & boundaries, (2) state & data sources, (3) hooks discipline, (4) effects & events, (5) performance, (6) testing & a11y). Confirm React version and framework (plain CRA, Vite, Next App Router).


Stage 1: Structure & Boundaries

Goal: Colocate state; split presentational vs container only when it clarifies—not by default.

Practices

  • Compound components for flexible APIs; avoid mega-props objects
  • In Next App Router: default to Server Components; add use client at leaves

Stage 2: State & Data Sources

Goal: Local state for UI; server state via React Query/SWR/Apollo as appropriate; avoid duplicating server entities in global stores without sync rules.


Stage 3: Hooks Discipline

Goal: Rules of Hooks satisfied; custom hooks encapsulate reusable stateful logic with clear inputs/outputs.

Practices

  • Name hooks useThing; return stable APIs (objects memoized when needed)

Stage 4: Effects & Events

Goal: Prefer event handlers for user-driven work; useEffect for sync with external systems (subscriptions, non-React widgets).

Practices

  • Cleanup subscriptions; abort fetches; list effect dependencies honestly
  • Strict Mode double-invoke in dev—write effects idempotent

Stage 5: Performance

Goal: Measure before memo; virtualize long lists; code-split routes.

Practices

  • useCallback/useMemo when profiling shows benefit—not by default
  • Concurrent features and Suspense boundaries where supported

Stage 6: Testing & Accessibility

Goal: React Testing Library user-centric queries; focus management and labels for forms.


Final Review Checklist

  • Component boundaries match data ownership
  • Server vs client state strategy clear
  • Hooks and effects used appropriately
  • Performance optimizations evidence-based
  • Tests and a11y basics covered for critical flows

Tips for Effective Guidance

  • Derive state when possible instead of storing redundant pieces.
  • URL as state for shareable UI state when appropriate.
  • Point to state-management skill for Redux/Zustand-scale decisions.

Handling Deviations

  • Legacy class components: same principles; hooks migration incremental.
Usage Guidance
This skill is a documentation-style, instruction-only workflow for React patterns; it does not install software or request credentials, so it is coherent with its description. Note the source/homepage are unknown—if provenance matters to you, ask for the author or a homepage before trusting the guidance wholesale. Also remember: this is advisory content (it can be outdated or opinionated); validate important recommendations against your codebase and React docs before applying them.
Capability Analysis
Type: OpenClaw Skill Name: react-patterns Version: 1.0.0 The skill bundle contains purely instructional content for a React development workflow. The SKILL.md file provides standard architectural guidance (e.g., hooks discipline, state management, and performance optimization) without any executable code, suspicious network calls, or malicious prompt injection attempts.
Capability Assessment
Purpose & Capability
Name and description match the SKILL.md content (React architecture, hooks, effects, performance, testing, accessibility). The skill requests no binaries, env vars, or installs—everything requested is proportional to a documentation/guide skill.
Instruction Scope
SKILL.md contains only prose guidance and checklists; it does not instruct the agent to read files, access environment variables, run commands, or contact external endpoints. No scope creep detected.
Install Mechanism
No install spec and no code files. This is instruction-only, so nothing is written to disk or downloaded during install.
Credentials
No environment variables, credentials, or config paths are requested. No disproportionate access is requested for the stated purpose.
Persistence & Privilege
always is false and the skill does not request persistent/system privileges. Model invocation is enabled (the default) which is appropriate for a user-invocable guidance skill.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install react-patterns
  3. After installation, invoke the skill by name or use /react-patterns
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
- Initial release of the skill. - Provides a structured, 6-stage workflow for React patterns: component boundaries, state, hooks, effects, performance, and testing/accessibility. - Offers concise guidance for common challenges: prop drilling, useEffect, re-renders, and hydration. - Includes practical tips and a review checklist for React apps. - Guidance adapts to different frameworks and React versions.
Metadata
Slug react-patterns
Version 1.0.0
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 1
Frequently Asked Questions

What is React Patterns?

Deep React patterns workflow—component boundaries, composition, hooks rules, effects and data fetching, performance (memo, lists, suspense), testing, and acc... It is an AI Agent Skill for Claude Code / OpenClaw, with 328 downloads so far.

How do I install React Patterns?

Run "/install react-patterns" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is React Patterns free?

Yes, React Patterns is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does React Patterns support?

React Patterns is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created React Patterns?

It is built and maintained by ClawKK (@codekungfu); the current version is v1.0.0.

💬 Comments