Skip to content
Agentmart
Submit a tool

component-purity

Verify React component purity - components only render UI, all logic belongs in hooks.

Skill by ArkadiuszSieracki

IndexedApache-2.0
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/arkadiuszsieracki-component-purity

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Verify React component purity - components only render UI, all logic belongs in hooks. Use for: property drilling, logic in JSX, useEffect in component, domain useState in component, GUI and business logic separation.

Use cases: design, frontend

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/component-purity

What's inside

Skill name
component-purity
Description
Verify React component purity - components only render UI, all logic belongs in hooks. Use for: property drilling, logic in JSX, useEffect in component, domain useState in component, GUI and business logic separation.
License
Apache-2.0
Instructions
85 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# React component purity

## When to use

- You suspect property drilling (props passed through 2+ levels)
- Business logic is in component instead of hook
- `useEffect` with domain logic is inside component
- `useState` for domain data is inside component
- Component does too many things at once

## Core rule

React component = **pure view**:

- renders JSX based on props and hook values,
- passes handlers from its hooks to UI elements,
- does not contain computational logic, conditional business logic, or side effects.

## Verification procedure

1. Open component file.
2. Check each `useState` - does it store domain data? If yes -> move to hook.
3. Check each `useEffect` - is it in component? If yes -> move to hook.
4. Check for calculations/filters/data transforms -> move to hook.
5. Check props chain: does any prop pass through 2+ components without use -> property drilling.
6. Check whether handlers are defined inline in JSX -> move to hook.

## Remediation patterns

### Logic in component -> hook

```tsx
// [BAD] ERROR
function RecordingList({ recordings }) {
  const filtered = recordings.filter((r) => r.active); // logic
  const [selected, setSelected] = useState(null); // domain state
  useEffect(() => {
    fetchData();
  }, []); // effect
  return <List items={filtered} />;
}

// [OK] CORRECT
function RecordingList() {
  const { recordings, selected, handleSelect } = useRecordingList();
  return (
    <List items={recordings} selected={selected} onSelect={handleSelect} />
  );
}
```

### Property drilling -> useReducer + context

```tsx
// [BAD] prop `onSave` passed through 3 levels
<WizardRoot onSave={handleSave}>
  <WizardStep onSave={handleSave}>
    {" "}
    // does not use it, only forwards
    <WizardForm onSave={handleSave} /> // uses it
  </WizardStep>
</WizardRoot>;

// [OK] useReducer in domain hook + context
const { dispatch } = useWizardContext(); // directly in WizardForm
```

## Responsibility split

| Layer         | File                         | Contains                          |
| ------------- | ---------------------------- | --------------------------------- |
| Component     | `components/MyComponent.tsx` | JSX, hook calls                   |
| Domain hook   | `hooks/useMyDomain.ts`       | state, effects, logic, React Query |
| API           | `api/myDomain.api.ts`        | React Query query definitions     |
| Model         | `model/myDomain.model.ts`    | types, interfaces, constants      |

## Checklist

- [ ] No `useState` for domain data in component (UI state like `isOpen` for local modal is OK)
- [ ] No `useEffect` in component
- [ ] No calculations/data transformations in JSX or before `return`
- [ ] All handlers come from hook
- [ ] No property drilling through 2+ levels

From ArkadiuszSieracki/mastermind-agentic-sdlc-vscode-copilot, Apache-2.0.

More from ArkadiuszSieracki/mastermind-agentic-sdlc-vscode-copilot

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Apr 23, 2026 (6 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
Apache-2.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from ArkadiuszSieracki

Cite this page

component-purity skill. Agent Mart. https://agentmart.dev/skills/arkadiuszsieracki-component-purity (last updated 2026-10-24)