Axonix Tools
Back to all skills
Development

React Composer

Refactors components using React composition patterns — avoids boolean prop proliferation, implements compound components, and uses context providers effectively.

Skill summary

Difficultyadvanced
Assistants12
Config files5
Trigger phrases6

Copy-ready skill file

Paste this into your assistant rules file

Recommended targets: CLAUDE.md, .cursorrules, .windsurfrules, AGENTS.md, .clinerules

Remix this skill
# React Composer

## Purpose
Refactors components using React composition patterns — avoids boolean prop proliferation, implements compound components, and uses context providers effectively.

## When to Use
- **"refactor this component"** — Apply React composition patterns to eliminate prop drilling, improve reusability, and simplify the component API.
- **"too many props"** — Covers build reusable component libraries.
- **"composition patterns"** — Covers design flexible component APIs.
- **"compound components"** — Covers refactor components with boolean prop explosion.
- **"React component architecture"** — Covers build reusable component libraries.
- **"clean up props"** — Covers design flexible component APIs.

### CLAUDE.md
```markdown
# React Composer — AI Assistant Rules
# Place this file in your project root as CLAUDE.md

Refactors components using React composition patterns — avoids boolean prop proliferation, implements compound components, and uses context providers effectively.
```

## Operating Instructions
1. Read the surrounding code before proposing anything, and match what is already there
2. Reproduce the problem, or say plainly that you could not reproduce it
3. Write or point to the failing case that captures the expected behaviour
4. Make the smallest change that satisfies that case
5. Run the project's own checks — build, types, tests — and report exactly what passed
6. State what you changed, what you deliberately left alone, and the risk that remains

## Example Prompts
- "Refactor this component — it has 15 boolean props."
- "Design a compound component API for our data table."

## Verification Checklist
- [ ] The failure was reproduced before the fix, and the fix is covered by a test
- [ ] Type checks, lint and the test suite were run, and the results are reported honestly
- [ ] No unrelated reformatting or refactoring crept into the diff
- [ ] Error handling covers the failure mode, not only the happy path
- [ ] The skill file is placed at `CLAUDE.md` in the project root
- [ ] Tested with Claude to confirm the rules load and fire

## Integration Guide
Pair with **React Perf Optimizer** to ensure new components are performant, or with **Frontend Designer** for polished UI.

## Primary Use Cases
- Refactor components with boolean prop explosion
- Build reusable component libraries
- Design flexible component APIs

## Difficulty
**Advanced** — assumes deep familiarity with the domain; expect to edit the rules rather than accept them.
Try it like this

With the React Composer rules in CLAUDE.md, ask:

“refactor this component”

The assistant then takes on refactor components with boolean prop explosion — the approach, the checks and the shape of the answer are fixed by the file before the first token is written.

What it is for

  • Refactor components with boolean prop explosion
  • Build reusable component libraries
  • Design flexible component APIs

6 ways to trigger it

refactor this componenttoo many propscomposition patternscompound componentsReact component architectureclean up props
How Development skills behave

Skills in this category read the repository before they propose anything. They look at neighbouring modules, the existing test setup, and the project's own conventions so the change fits the codebase instead of introducing a second style of solving the same problem. The output tends to be a diff and the reasoning behind it, not a tutorial.

Practices that matter in Development work

  • Write the failing test first when the behaviour is testable. It settles the spec before the implementation and gives you the regression case for free.
  • Keep the diff small enough to review in one sitting. A 400-line change gets rubber-stamped; three 40-line changes get read.
  • Read the actual error before guessing at a fix. Most of the time the message names the file and the line.
  • Match the conventions already in the file you are editing, not the ones in the style guide you have not opened.
  • Delete the branch you no longer need. Abandoned variants are where the bug always hides.
Where the rules go

Start with CLAUDE.md.

AssistantRules file
ClaudeCLAUDE.md
Cursor.cursorrules
Windsurf.windsurfrules
OpenCodeAGENTS.md
Cline.clinerules
GitHub Copilot.github/copilot-instructions.md
Continue.continuerc.json
Aider.aider.conf.yml
Cody.cody.json
Amazon Q.amazon-q.json
CodeGPT.codegpt.json
Replit.replit
.cursorrules.windsurfrulesAGENTS.md
React Composer questions
What does the React Composer skill do?
Refactors components using React composition patterns — avoids boolean prop proliferation, implements compound components, and uses context providers effectively. The copy-ready file above carries the full rule set, the trigger phrases and the checks the assistant runs before it hands work back.
How do I trigger the React Composer skill?
Ask for the work using one of its trigger phrases — for example “refactor this component”, “too many props”, “composition patterns”. Once the rules file is in place, assistants that read it also pick the skill up without the phrase.
Which files should hold the React Composer skill?
CLAUDE.md, .cursorrules, .windsurfrules, AGENTS.md. CLAUDE.md is the one to start with; the rest exist so the same rules load in whichever assistant your team uses.
Which assistants support the React Composer skill?
Claude, Cursor, Windsurf, OpenCode, Cline, GitHub Copilot, Continue, Aider, Cody, Amazon Q, CodeGPT, Replit. Any assistant that reads a plain-text rules file can use it, so the format matters more than the product.
Is the React Composer skill hard to set up?
It is rated advanced. It assumes deep familiarity with the domain, and you will probably edit the rule set rather than accept it as-is.
What can I actually use the React Composer skill for?
The documented jobs are refactor components with boolean prop explosion, build reusable component libraries, design flexible component apis. Beyond those it still works — the rule set is instructions, and assistants follow it past the examples you give it.
Does the React Composer skill send my code anywhere?
No. The file is static text in your repository. What happens to your code afterwards depends on the assistant you run it in and that provider's own data policy.

Related Skills