agentleFS
basidiocarpbasidiocarp/pileus/.claude/skills/react-patterns/SKILL.md

react-patterns

Skill0 starsChanged 6 months agoMITView on GitHub

Applies React and Next.js component patterns for performance, accessibility, and animation work.

38 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use typescript-patterns, typescript-strict and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • cohen-lielSkill

    typescript-patterns

    TypeScript best practices and patterns. Use when writing TypeScript code, defining types, working with generics, or converting JavaScript to TypeScript.

    Also in 3 projects that use this

  • MicrosoftSkill

    typescript-strict

    Enable TypeScript strict mode (strict, noImplicitAny, strictNullChecks, etc.) in a project and fix the resulting errors without weakening types, tests, or runtime behavior. Use when asked to "enable strict mode", "turn on TypeScript strict", "fix strict errors", or migrate a codebase to strict type checking.

    Also in 3 projects that use this

  • xfstudioSkill

    docker-expert

    Docker containerization expert with deep knowledge of multi-stage builds, image optimization, container security, Docker Compose orchestration, and production deployment patterns. Use PROACTIVELY for Dockerfile optimization, container issues, image size problems, security hardening, networking, and orchestration challenges.

    Also in 3 projects that use this

  • LangChainSkill

    docker-patterns

    Best practices for Docker containerization and multi-stage builds

    Also in 4 projects that use this

  • BlockSkill

    testing-strategy

    Guidelines for writing effective tests in this project

    Also in 4 projects that use this

  • LangChainSkill

    database-migrations

    Database migration patterns and schema versioning

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 6 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 34 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use this skill as the router for non-obvious React and Next.js guidance.

    line 8
  2. Very specific:

    Start with the nearest matching rule under rules/.

    line 20
  3. Distinctive:

    If the problem spans many performance categories, consult AGENTS.md as the full compiled rulebook.

    line 21
  4. Very specific:

    Keep the SKILL.md layer short and use the rule files for detail.

    line 22
  5. Distinctive:

    prefer route or component restructuring over clever memoization

    line 39
  6. Distinctive:

    keep client bundles small before tuning event handlers

    line 40
  7. Distinctive:

    treat hydration mismatches and browser-only data as explicit design problems

    line 41
  8. Distinctive:

    Use compound components when related UI pieces need implicit shared state and a cohesive API.

    line 47
  9. Distinctive:

    If you need the full 40+ rule compilation, read AGENTS.md.

    line 68

“Common” is measured: kept by at least 6 in 10 of the 34 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

React Patterns

Use this skill as the router for non-obvious React and Next.js guidance. Standard component syntax, hooks basics, and common JSX patterns are assumed.

When to Use

  • component architecture and reuse
  • React or Next.js performance work
  • hydration, bundle, or waterfall issues
  • accessibility-sensitive UI patterns
  • animation choices that affect render cost

Load Order

  1. Start with the nearest matching rule under rules/.
  2. If the problem spans many performance categories, consult AGENTS.md as the full compiled rulebook.
  3. Keep the SKILL.md layer short and use the rule files for detail.

Quick Routing

ProblemStart Here
request waterfalls, early await, Suspense streamingrules/async-*.md
bundle size and client-load costrules/bundle-*.md
client fetching, SWR, or browser listener issuesrules/client-*.md
re-render churn, effect deps, stale state readsrules/rerender-*.md
render-path cost, hydration mismatch, SVG, visibilityrules/rendering-*.md
low-level JavaScript hot-path cleanuprules/js-*.md
callback refs and advanced event patternsrules/advanced-*.md

Non-Obvious Defaults

  • eliminate waterfalls before micro-optimizing renders
  • prefer route or component restructuring over clever memoization
  • keep client bundles small before tuning event handlers
  • treat hydration mismatches and browser-only data as explicit design problems

Small Pattern Starters

Compound Components

Use compound components when related UI pieces need implicit shared state and a cohesive API.

Virtualization

Virtualize lists once item counts are large enough to affect mount or scroll cost.

Accessibility

Focus trapping, keyboard navigation, and dialog return-focus behavior are first-class concerns, not polish items.

Animation

Animate with explicit entry and exit states, but avoid introducing client-heavy animation libraries into flows that do not need them.

Reference Boundary

This skill intentionally stays thin because the detailed rule set already lives in:

  • AGENTS.md
  • the rules/ directory

If you need the full 40+ rule compilation, read AGENTS.md. If you need an actionable fix, open the matching rule file directly.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

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.