Agent skill

React

by MatrixAges in MatrixAges/polywise

Guides React component implementation, performance optimization, and state management thresholds.

MITAuto-check passedFrontend & Design

Install React

skills CLI
$ npx skills add MatrixAges/polywise --skill react -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install MatrixAges/polywise react --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/MatrixAges/polywise.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.opencode/skills/react .claude/skills/react && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
react
GitHub stars
662
Token cost
~1.4k tokens
SKILL.md length
445 words
Files
1
Skills in repo
11
Repo updated
First seen
Licence
MIT

At a glance

Guides React component implementation, performance optimization, and state management thresholds.

  • Works in 4 steps: Component Architecture → Performance Optimization → State Management Thresholds → …
  • Tasks that involve State management
  • SKILL.md covers 1. Component Architecture, 2. Performance Optimization, 3. State Management Thresholds and 4. Summary Checklist
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

React is an agent skill from MatrixAges/polywise. Guides React component implementation, performance optimization, and state management thresholds. Triggered when handling components, pages, or UI logic.

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Frontend & Design, covering State management, React components and Performance optimization. It works with React. The repository describes itself as: The open source agentic content system to make your contents alive. Self-hosted on any platform. ◑. The licence is MIT.

When your agent uses it

  • Tasks that involve State management
  • Tasks that involve React components
  • Tasks that involve Performance optimization

Example prompts

  • “Use the react skill to guide React component implementation, performance optimization, and state management thresholds”
  • “/react”

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Component Architecture
  2. Performance Optimization
  3. State Management Thresholds
  4. Summary Checklist

What it can do on your machine

Read from SKILL.md and the folder at commit f8d2320. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

React loads about 1.4k tokens when it runs. Until then it costs about 40 tokens; SKILL.md has 445 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~40
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from MatrixAges/polywise at commit f8d2320, republished under its MIT licence (© MatrixAges). 445 words, ~1,389 tokens.

Download SKILL.mdSave it as .claude/skills/react/SKILL.md (or your agent's skills folder).
name
react
description
Guides React component implementation, performance optimization, and state management thresholds. Triggered when handling components, pages, or UI logic.

React Development Guide

This skill provides a comprehensive guide for building React components in the project, focusing on performance, state management thresholds, and modular organization.

1. Component Architecture

1.1 Standard Component Pattern

Every component should follow the standard export pattern to ensure responsiveness (MobX) and performance (Memoization).

typescript
import { observer } from 'mobx-react-lite'

const Index = (props: IProps) => {
	const { data } = props

	return (
		<div className='flex flex-col p-4'>
			{/* Content */}
		</div>
	)
}

// ✅ Mandatory: For components needing state responsiveness or performance optimization, use $app.handle wrapper
export default new $app.handle(Index).by(observer).by($app.memo).get()

// ✅ Optional: For simple presentational components, directly use $app.memo
export default $app.memo(Index)
1.2 Module Splitting (Fractal Architecture)

Large modules must be split according to fractal patterns to maintain high maintainability and clear scope.

  • Local Components: Use components/ folder within the module directory. Component names should be concise (e.g., Item.tsx, Header.tsx).
  • Loop Extraction: Components rendered in loops (e.g., content inside .map()) must be extracted to separate component files to optimize diff rendering performance.
  • File Organization:
    module/
    ├── index.tsx                # Entry and layout
    ├── types.ts                 # Local type definitions
    ├── components/              # Local sub-components
    │   ├── List.tsx
    │   ├── Item.tsx             # Loop item component extraction
    │   └── index.ts             # Internal unified export
    ├── models/                  # (Optional) Local MobX models
    │   └── Local.ts
    └── styles/                  # (Optional) CSS Modules
        └── index.module.css
1.3 Props Management Pattern

To maintain component cleanliness and reference stability, follow these patterns for declaring and passing Props:

  • Performance-sensitive Props: For props that trigger heavy operations (e.g., Ant Design theme configuration, large data trees), use useMemo.
  • Standard Props: If they don't trigger expensive re-renders, simple objects can be declared directly.
  • Naming: Always use props_* prefix as the naming convention for internal props objects.

2. Performance Optimization

2.1 Function Reference Management

To prevent unnecessary re-renders of child components, all functions (event handlers, callbacks) must have stable references.

typescript
import { useMemoizedFn } from 'ahooks'

// ✅ Mandatory: wrap all component-internal functions with useMemoizedFn
const handleClick = useMemoizedFn(() => {
	// Logic handling
})

// ✅ Pass stable references to child components
<Child onClick={handleClick} />
2.2 Props Comparison Optimization

$app.memo performs deep comparison. To cooperate with its work and avoid unnecessary checks on heavy objects:

  • Reference Type Values: For non-primitive data type props (objects, arrays), use global $copy(value) to pass value-based copies.
  • Principle: Using $copy ensures that even if the parent component re-renders and creates new object references, as long as the data content hasn't changed, the child component won't re-render.
typescript
// ✅ Mandatory: pass non-primitive data types through $copy
<LargeComponent
	config={$copy(config_object)}
	items={$copy(data_array)}
/>
Show full SKILL.md (150 more words)Show less
2.3 Conditional Style Classes

Use the global $cx (classix) utility for efficient, readable conditional CSS class merging.

typescript
<div
	className={$cx(
		'base-class',
		isActive && 'active-class',
		isError ? 'text-red' : 'text-gray'
	)}
/>

3. State Management Thresholds

3.1 State Hierarchy
  1. Shared State: Managed by top-level models (e.g., GlobalModel), injected via tsyringe, obtained using useGlobal.
  2. Simple Component State: If reactive variables/logic blocks are less than or equal to 4, manage with standard Hooks (useState, useMemo).
  3. Complex Component State: If a component's internal logic exceeds 4 reactive variables, you must create a standalone MobX model (Local Model) coexisting with that component.
3.2 Local Model Implementation

Local models also use tsyringe dependency injection.

typescript
// module/models/Local.ts
import { makeAutoObservable } from 'mobx'
import { injectable } from 'tsyringe'

@injectable()
export class LocalModel {
	v1 = ''
	v2 = 0
	v3 = []
	v4 = false
	v5 = {} // 5th variable, triggers mandatory Model usage rule

	constructor() {
		makeAutoObservable(this, {}, { autoBind: true })
	}

	action() { /* ... */ }
}

// module/index.tsx
const Index = () => {
	const [local] = useState(() => container.resolve(LocalModel))

	return <div onClick={local.action}>{local.v1}</div>
}

4. Summary Checklist

  • Are components exported via $app.handle or $app.memo?
  • Are all component-internal functions wrapped with useMemoizedFn?
  • Are large object/array props passed using $copy?
  • Are loop-rendered list items extracted to separate component files?
  • Do local component state variables exceed 4? (If yes, transfer to MobX Model)
  • Does the directory structure follow fractal patterns?

© MatrixAges, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .opencode/skills/react of MatrixAges/polywise.

Open the folder on GitHubat commit f8d2320

Compare with similar skills

React next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

React compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
React this skillMatrixAges/polywise662—~1.4kAutomated safety check: PassMIT
React Code Reviewgiuseppe-trisciuoglio/developer-kit355—~2.6kAutomated safety check: NotesMIT
Vercel React Best Practicessanity-io/sanity6.4k130 repos~1.6kAutomated safety check: PassMIT
Dify Component Writing Guidelanggenius/dify158k—~626Automated safety check: PassCustom licence
Frontend Patternskurealnum/dotfiles29019 repos~3.7kAutomated safety check: PassNone
Opik Frontend Patternscomet-ml/opik22k—~1.1kAutomated safety check: PassApache-2.0

Similar skills

  • React Code Review

    giuseppe-trisciuoglio/developer-kit

    Provides comprehensive code review capability for React applications, validates component architecture, hooks usage, React 19 patterns, state management, performance optimization, accessibility…

    355 GitHub stars~2.6k tokensUpdated 27 days ago
    Frontend & DesignAuto-check: notes
  • Official

    React and Next.js performance optimization guidelines from Vercel Engineering.

    6.4k GitHub starsUsed in 130 repos~1.6k tokens
    Frontend & DesignAuto-check passed
  • Use when implementing or refactoring React/TypeScript components and the task requires decisions about component ownership, feature boundaries, state, data…

    158k GitHub stars~626 tokensUpdated today
    Frontend & DesignAuto-check passed
  • Frontend Patterns

    kurealnum/dotfiles

    Frontend development patterns for React, Next.js, state management, performance optimization, and UI best practices.

    290 GitHub starsUsed in 19 repos~3.7k tokens
    Frontend & DesignAuto-check passed
  • Sets the conventions for the Opik React frontend: TanStack Query for data, Zustand for shared state, one-way layer imports and a fix for Google Translate crashes.

    22k GitHub stars~1.1k tokensUpdated today
    Frontend & DesignAuto-check passed
  • Frontend

    redis/RedisInsight

    Official

    React/Redux frontend development patterns for RedisInsight UI: component folder structure, styled-components, hooks, named exports, barrel files, layout components, and theme usage.

    8.9k GitHub stars~3.2k tokensUpdated 2 days ago
    Frontend & DesignAuto-check passed

More from MatrixAges/polywise

All 11 skills in this repo
  • Chrome Cdp

    MatrixAges/polywise

    Interacts with local browser via Chrome DevTools Protocol (only triggered after user explicitly requests to inspect, debug, or interact with pages open in Chrome)

    662 GitHub stars~800 tokensUpdated 3 mo ago
    Auto-check passed
  • Skill Generator

    MatrixAges/polywise

    Called when users need to create new OpenCode skills. An agent skill from MatrixAges/polywise.

    662 GitHub stars~333 tokensUpdated 3 mo ago
    Auto-check passed
  • Agentmap Generator

    MatrixAges/polywise

    Guides the generation, reading, and updating of agentmap.md files.

    662 GitHub stars~489 tokensUpdated 3 mo ago
    Auto-check passed
  • CSS

    MatrixAges/polywise

    Guides styling implementation using TailwindCSS + CSS Modules.

    662 GitHub stars~1.3k tokensUpdated 3 mo ago
    Auto-check passed
  • Erpc Communication

    MatrixAges/polywise

    Guides using eRPC (electron-tRPC) for inter-process communication (IPC) between Electron main and renderer processes.

    662 GitHub stars~618 tokensUpdated 3 mo ago
    Auto-check passed
  • I18n

    MatrixAges/polywise

    Guides internationalization (i18n) implementation using i18next with TypeScript.

    662 GitHub stars~898 tokensUpdated 3 mo ago
    Auto-check passed

Works with

Questions about React

What does React do?

Guides React component implementation, performance optimization, and state management thresholds. React is an agent skill from MatrixAges/polywise. Guides React component implementation, performance optimization, and state management thresholds.

When should I use React?

React fits situations like: tasks that involve State management; tasks that involve React components; tasks that involve Performance optimization.

How do I install React in Claude Code?

Run `npx skills add MatrixAges/polywise --skill react -a claude-code`. Or copy the skill folder (.opencode/skills/react in MatrixAges/polywise) into .claude/skills/react in your project. Claude Code loads it when a task matches its description.

How do I install React in Codex?

Run `npx skills add MatrixAges/polywise --skill react -a codex`. Or copy the skill folder (.opencode/skills/react in MatrixAges/polywise) into .agents/skills/react in your project. Codex loads it when a task matches its description.

Can I use React in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add MatrixAges/polywise --skill react -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/react, .gemini/skills/react, .github/skills/react and .opencode/skills/react in your project.

What does React need to run?

SKILL.md names no scripts, command-line tools or credentials: React is instructions for the agent only.

Does React access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is React safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does React use?

React is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does React use?

About 1.4k tokens (SKILL.md is roughly 5.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to React?

Skills that share tags, products or a category with React: React Code Review (giuseppe-trisciuoglio/developer-kit, 355 stars), Vercel React Best Practices (sanity-io/sanity, 6.4k stars), Dify Component Writing Guide (langgenius/dify, 158k stars) and Frontend Patterns (kurealnum/dotfiles, 290 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains React?

MatrixAges (a GitHub organization) maintains it in MatrixAges/polywise, which has 662 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on June 11, 2026.

Source: MatrixAges/polywise on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.