aiskillstore/marketplace / skills/0xbigboss/react-best-practices
react-best-practices
VerifiedUse when reading or writing React components (.tsx, .jsx files with React imports).
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 3.2 KB |
| react-patterns.md | markdown | 11.6 KB |
| skill-report.json | config | 24.8 KB |
skill-report.json
View on GitHub{
"schema_version": "2.0",
"meta": {
"generated_at": "2026-07-06T13:57:18.640Z",
"slug": "0xbigboss-react-best-practices",
"source_url": "https://github.com/0xBigBoss/claude-code/tree/main/.claude/skills/react-best-practices",
"source_ref": "main",
"model": "codex",
"analysis_version": "3.0.0",
"source_type": "community",
"content_hash": "a5ad1a127d0904857c226fcedd11807060c43524a18a1875a315d0475a2d2578",
"tree_hash": "fa9591c692aac445c389ddf99cabba28445ca8415e79978d6cd767b62bb244e9",
"provenance": {
"model_effective": "codex",
"fallback_chain": [
{
"agent": "codex",
"outcome": "success"
}
],
"analysis_version": "3.0.0"
}
},
"skill": {
"name": "react-best-practices",
"description": "Guides React component work with patterns for effects, hooks, refs, composition, and controlled state.",
"summary": "Use focused React patterns to write cleaner components and avoid common hook mistakes.",
"icon": "π¦",
"version": "1.0.1",
"author": "0xBigBoss",
"license": "MIT",
"category": "coding",
"tags": [
"react",
"hooks",
"components",
"typescript",
"frontend"
],
"supported_tools": [
"claude",
"codex",
"claude-code"
],
"risk_factors": [
"external_commands"
]
},
"security_audit": {
"risk_level": "safe",
"is_blocked": false,
"safe_to_publish": true,
"analysis_status": "ok",
"summary": "All 22 static findings were judged false positives after context review. The flagged backticks are Markdown inline code or JavaScript template literals in documentation examples, and the reconnaissance hits are React timer or lifecycle wording. No prompt injection, data exfiltration, external command execution, or malicious intent was found.",
"remediation": [],
"risk_factor_evidence": [
{
"factor": "external_commands",
"evidence": [
{
"file": "react-patterns.md",
"line_start": 68,
"line_end": 77
},
{
"file": "react-patterns.md",
"line_start": 77,
"line_end": 80
},
{
"file": "SKILL.md",
"line_start": 10,
"line_end": 10
},
{
"file": "SKILL.md",
"line_start": 20,
"line_end": 20
},
{
"file": "SKILL.md",
"line_start": 21,
"line_end": 21
},
{
"file": "SKILL.md",
"line_start": 23,
"line_end": 23
},
{
"file": "SKILL.md",
"line_start": 33,
"line_end": 33
},
{
"file": "SKILL.md",
"line_start": 34,
"line_end": 34
},
{
"file": "SKILL.md",
"line_start": 42,
"line_end": 42
},
{
"file": "SKILL.md",
"line_start": 43,
"line_end": 43
},
{
"file": "SKILL.md",
"line_start": 44,
"line_end": 44
},
{
"file": "SKILL.md",
"line_start": 49,
"line_end": 49
},
{
"file": "SKILL.md",
"line_start": 50,
"line_end": 50
},
{
"file": "SKILL.md",
"line_start": 56,
"line_end": 56
},
{
"file": "SKILL.md",
"line_start": 57,
"line_end": 57
},
{
"file": "SKILL.md",
"line_start": 62,
"line_end": 62
},
{
"file": "SKILL.md",
"line_start": 64,
"line_end": 64
}
]
}
],
"static_findings": [
{
"id": "external_commands:react-patterns.md:68:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "react-patterns.md",
"line_start": 68,
"line_end": 77,
"snippet": "showNotification(`Added ${product.name} to cart`);"
},
{
"id": "external_commands:react-patterns.md:77:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "react-patterns.md",
"line_start": 77,
"line_end": 80,
"snippet": "showNotification(`Added ${product.name} to cart`);"
},
{
"id": "blocker:react-patterns.md:150:system-reconnaissance",
"category": "blocker",
"severity": "low",
"pattern": "System reconnaissance",
"file": "react-patterns.md",
"line_start": 150,
"line_end": 150,
"snippet": "const id = setInterval(() => {"
},
{
"id": "blocker:react-patterns.md:159:system-reconnaissance",
"category": "blocker",
"severity": "low",
"pattern": "System reconnaissance",
"file": "react-patterns.md",
"line_start": 159,
"line_end": 159,
"snippet": "const id = setInterval(() => {"
},
{
"id": "blocker:react-patterns.md:444:system-reconnaissance",
"category": "blocker",
"severity": "low",
"pattern": "System reconnaissance",
"file": "react-patterns.md",
"line_start": 444,
"line_end": 444,
"snippet": "### Avoid \"Lifecycle\" Hooks"
},
{
"id": "external_commands:SKILL.md:10:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 10,
"line_end": 10,
"snippet": "When working with React, always load both this skill and `typescript-best-practices` together. TypeS"
},
{
"id": "external_commands:SKILL.md:20:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 20,
"line_end": 20,
"snippet": "3. **Need cached expensive calculation?** Use `useMemo`"
},
{
"id": "external_commands:SKILL.md:21:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 21,
"line_end": 21,
"snippet": "4. **Need to reset state on prop change?** Use `key` prop"
},
{
"id": "external_commands:SKILL.md:23:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 23,
"line_end": 23,
"snippet": "6. **Need non-reactive code in Effect?** Use `useEffectEvent`"
},
{
"id": "external_commands:SKILL.md:33:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 33,
"line_end": 33,
"snippet": "- Expensive calculations β use `useMemo`"
},
{
"id": "external_commands:SKILL.md:34:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 34,
"line_end": 34,
"snippet": "- Resetting state on prop change β use `key` prop"
},
{
"id": "external_commands:SKILL.md:42:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 42,
"line_end": 42,
"snippet": "- Never read or write `ref.current` during render; only in event handlers and effects"
},
{
"id": "external_commands:SKILL.md:43:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 43,
"line_end": 43,
"snippet": "- Use ref callbacks (not `useRef` in loops) for dynamic lists"
},
{
"id": "external_commands:SKILL.md:44:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 44,
"line_end": 44,
"snippet": "- Use `useImperativeHandle` to limit what parent can access"
},
{
"id": "external_commands:SKILL.md:49:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 49,
"line_end": 49,
"snippet": "- Name `useXxx` only if it actually calls other hooks; otherwise use a regular function"
},
{
"id": "external_commands:SKILL.md:50:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 50,
"line_end": 50,
"snippet": "- Avoid lifecycle hooks (`useMount`, `useEffectOnce`) β use `useEffect` directly so the linter catch"
},
{
"id": "external_commands:SKILL.md:56:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 56,
"line_end": 56,
"snippet": "- Prefer composition with `children` over prop drilling"
},
{
"id": "external_commands:SKILL.md:57:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 57,
"line_end": 57,
"snippet": "- Treat boolean props that switch large component trees (`isEditing`, `isThread`, `hideAttachments`)"
},
{
"id": "external_commands:SKILL.md:62:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 62,
"line_end": 62,
"snippet": "- Use `flushSync` when you need to read the DOM synchronously after a state update"
},
{
"id": "external_commands:SKILL.md:64:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 64,
"line_end": 64,
"snippet": "See `react-patterns.md` for code examples and detailed patterns."
},
{
"id": "blocker:SKILL.md:50:system-reconnaissance",
"category": "blocker",
"severity": "low",
"pattern": "System reconnaissance",
"file": "SKILL.md",
"line_start": 50,
"line_end": 50,
"snippet": "- Avoid lifecycle hooks (`useMount`, `useEffectOnce`) β use `useEffect` directly so the linter catch"
},
{
"id": "blocker:SKILL.md:60:system-reconnaissance",
"category": "blocker",
"severity": "low",
"pattern": "System reconnaissance",
"file": "SKILL.md",
"line_start": 60,
"line_end": 60,
"snippet": "- Render JSX directly for UI variation; avoid config-array mini-frameworks unless the config is real"
}
],
"finding_verdicts": [
{
"id": "external_commands:react-patterns.md:68:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.98,
"reason": "The backticks are a JavaScript template literal inside a TSX documentation example. It interpolates a product name for a notification and does not invoke a shell or external command."
},
{
"id": "external_commands:react-patterns.md:77:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.98,
"reason": "The line repeats the same JavaScript template literal in an event handler example. It is not Ruby or shell execution and has no command execution path."
},
{
"id": "blocker:react-patterns.md:150:system-reconnaissance",
"verdict": "false_positive",
"confidence": 0.97,
"reason": "setInterval is used in a React effect dependency example to teach cleanup and stale closure behavior. It does not inspect the system, files, users, processes, or network."
},
{
"id": "blocker:react-patterns.md:159:system-reconnaissance",
"verdict": "false_positive",
"confidence": 0.97,
"reason": "setInterval appears in the corrected React effect example with clearInterval cleanup. This is ordinary timer code in documentation, not reconnaissance."
},
{
"id": "blocker:react-patterns.md:444:system-reconnaissance",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The text is a section heading about avoiding lifecycle-style React hooks. It contains no system probing instruction or operational behavior."
},
{
"id": "external_commands:SKILL.md:10:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The backticks mark the related skill name typescript-best-practices in Markdown. This is a documentation reference, not executable shell syntax."
},
{
"id": "external_commands:SKILL.md:20:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The backticks mark the React API name useMemo in Markdown. No command or subprocess is invoked."
},
{
"id": "external_commands:SKILL.md:21:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The backticks mark the React key prop in Markdown. This is explanatory prose and not shell execution."
},
{
"id": "external_commands:SKILL.md:23:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The backticks mark the React useEffectEvent API name in Markdown. The file contains documentation only and no executable command path."
},
{
"id": "external_commands:SKILL.md:33:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The backticks mark the useMemo API name in a best-practice bullet. This is not Ruby or shell backtick execution."
},
{
"id": "external_commands:SKILL.md:34:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The backticks mark the key prop name in Markdown prose. There is no command interpreter or user-controlled command input."
},
{
"id": "external_commands:SKILL.md:42:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The backticks mark ref.current in a React refs guideline. This is an inline code style marker, not executable shell syntax."
},
{
"id": "external_commands:SKILL.md:43:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The backticks mark the useRef API name in Markdown. The line explains React hook usage and does not execute commands."
},
{
"id": "external_commands:SKILL.md:44:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The backticks mark the useImperativeHandle API name in Markdown. This is documentation text with no shell behavior."
},
{
"id": "external_commands:SKILL.md:49:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The backticks mark the hook naming pattern useXxx in Markdown. It is a React naming guideline, not command execution."
},
{
"id": "external_commands:SKILL.md:50:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The backticks mark React hook names useMount, useEffectOnce, and useEffect in prose. These are API references and not shell commands."
},
{
"id": "external_commands:SKILL.md:56:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The backticks mark the React children prop in Markdown. This is a component composition guideline, not executable syntax."
},
{
"id": "external_commands:SKILL.md:57:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The backticks mark boolean prop names such as isEditing, isThread, and hideAttachments. The line documents API design concerns and does not invoke a command."
},
{
"id": "external_commands:SKILL.md:62:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The backticks mark the React DOM flushSync API name in Markdown. It is an inline code reference, not shell execution."
},
{
"id": "external_commands:SKILL.md:64:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The backticks mark the local reference file react-patterns.md. This is a documentation pointer and does not execute or request external commands."
},
{
"id": "blocker:SKILL.md:50:system-reconnaissance",
"verdict": "false_positive",
"confidence": 0.98,
"reason": "The line discusses lifecycle-style React hooks and lint dependency checks. It has no system discovery or environment inspection behavior."
},
{
"id": "blocker:SKILL.md:60:system-reconnaissance",
"verdict": "false_positive",
"confidence": 0.98,
"reason": "The line warns against config-array mini-frameworks in React UI. It is design guidance and contains no reconnaissance instruction."
}
],
"semantic_findings": [],
"critical_findings": [],
"high_findings": [],
"medium_findings": [],
"low_findings": [],
"dangerous_patterns": [],
"files_scanned": 2,
"total_lines": 582,
"audit_model": "codex",
"audited_at": "2026-07-06T13:57:18.640Z",
"agent_auto_install_policy": "allowed",
"manual_install_policy": "allowed"
},
"content": {
"user_title": "Improve React Component Patterns",
"value_statement": "React components can become hard to maintain when effects, refs, and state patterns are misused. This skill gives concise React guidance for Claude, Codex, and Claude Code.",
"seo_keywords": [
"Claude",
"Codex",
"Claude Code",
"React best practices",
"React hooks",
"useEffect guidance",
"React components",
"frontend development",
"TypeScript React",
"component composition"
],
"actual_capabilities": [
"Explains when to avoid effects and calculate values during render.",
"Shows safer useEffect dependencies, cleanup, and updater function patterns.",
"Guides ref usage for DOM access, timers, and dynamic lists.",
"Compares controlled, uncontrolled, compound, and composed component patterns.",
"Provides React code examples for common hook and component decisions."
],
"limitations": [
"Does not run tests, lint code, or inspect dependencies by itself.",
"Does not replace official React documentation for version-specific API details.",
"Focuses on component patterns, not routing, build tooling, or deployment.",
"Assumes the user provides relevant React files or component context."
],
"use_cases": [
{
"title": "Refactor Effect-heavy Components",
"description": "Review components that overuse useEffect and move derived logic into render or event handlers.",
"target_user": "Frontend engineers"
},
{
"title": "Teach Hook Decisions",
"description": "Create review guidance that explains when to use useMemo, refs, useEffectEvent, or direct calculation.",
"target_user": "Engineering leads"
},
{
"title": "Review Reusable UI APIs",
"description": "Assess component props, composition, controlled state, and provider boundaries before expanding shared UI.",
"target_user": "Design system maintainers"
}
],
"prompt_templates": [
{
"title": "Review a Component",
"prompt": "Review this React component for effect, state, ref, and composition issues. Explain each change in plain language.",
"scenario": "Beginner review"
},
{
"title": "Rewrite an Effect",
"prompt": "Rewrite this component to remove unnecessary useEffect usage. Keep behavior the same and explain what now runs during render or events.",
"scenario": "Intermediate refactor"
},
{
"title": "Design a Hook",
"prompt": "Design a focused custom hook for this React behavior. Make dependencies explicit and avoid lifecycle-style wrappers.",
"scenario": "Advanced hook design"
},
{
"title": "Audit a Component API",
"prompt": "Audit this reusable component API for prop complexity, composition options, controlled state, and provider boundaries. Recommend a maintainable design.",
"scenario": "System design review"
}
],
"output_examples": [
{
"input": "A product page shows notifications from an effect when cart state changes.",
"output": "Move the notification into the purchase event handler so it only runs for the user's action."
},
{
"input": "A chat component reconnects every time a theme prop changes.",
"output": "Keep the connection effect tied to the room and read the latest theme through non-reactive effect logic."
},
{
"input": "A reusable panel has many boolean props that switch large UI branches.",
"output": "Split the branches into composed components and keep shared state behind a scoped provider when needed."
}
],
"best_practices": [
"Ask whether logic can run during render before adding an effect.",
"Keep effect dependency lists honest and fix code instead of suppressing the linter.",
"Use composition and controlled state when a component must support varied behavior."
],
"anti_patterns": [
"Using effects to mirror derived state that can be calculated directly.",
"Creating lifecycle-style hooks that hide dependencies from React lint rules.",
"Adding many boolean props to one component instead of composing separate variants."
],
"faq": [
{
"question": "When should I use this skill?",
"answer": "Use it when reviewing or writing React components, especially files that use hooks, refs, or reusable UI patterns."
},
{
"question": "Does it support TypeScript React?",
"answer": "Yes. It pairs well with TypeScript guidance and applies to TSX and JSX component work."
},
{
"question": "Can it fix React code automatically?",
"answer": "It provides guidance and examples. The AI assistant still needs file context and permission to edit code."
},
{
"question": "Does it cover React Server Components?",
"answer": "No. The included guidance focuses on client component patterns, effects, refs, hooks, and composition."
},
{
"question": "Why does it discourage many effects?",
"answer": "Many effects duplicate render logic or event logic. Avoiding them reduces bugs, extra renders, and stale dependency issues."
},
{
"question": "Is it safe to install?",
"answer": "The reviewed files are documentation only. The audit found no real command execution or reconnaissance behavior."
}
]
},
"file_structure": [
{
"name": "react-patterns.md",
"type": "file",
"path": "react-patterns.md",
"lines": 517
},
{
"name": "SKILL.md",
"type": "file",
"path": "SKILL.md",
"lines": 65
}
]
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |