Skip to content
Back to skills

React Doctor

ASecurity

Use when Scan React and Next.js applications for security, performance, re-render inefficiencies, memory leaks, and correctness issues.

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
ai-agentsbashreactnextjssecurityperformance

Works with

  • cli

Security analysis

A100/100

Scanned September 27, 2026

npx -y skills add Harmitx7/tribunal-kit --skill react-doctor --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of React Doctor?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for React Doctor
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/harmitx7-react-doctor-tribunal-kit/badge)](https://www.skillsdirectory.com/skills/harmitx7-react-doctor-tribunal-kit)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: react-doctor
description: "Use when Scan React and Next.js applications for security, performance, re-render inefficiencies, memory leaks, and correctness issues."
version: 5.0.0
last-updated: 2026-09-13
skills:
  - react-specialist
  - nextjs-react-expert
  - baseline-ui
tools: Read, Grep, Glob, Bash, Edit, Write
scripts-binding:
  - .agent/scripts/lint_runner.js
  - .agent/scripts/verify_all.js
---

# React Doctor — React Performance & Health Audit

---

## 🛠️ Technical Architecture & Reference Recipes

---

---

## 4 React Health Checks

### 1. Unnecessary Re-render Prevention

- **Inline Object/Array Props**: Passing inline objects `<Child config={{ color: 'blue' }} />` creates new references every render. Wrap with `useMemo` or declare outside component scope.
- **Inline Callback Props**: Passing inline functions `<Child onClick={() => doSomething()} />` breaks `React.memo`. Wrap callbacks with `useCallback`.

### 2. State Colocation

- Don't lift state higher than necessary. Keep state local to the component consuming it to isolate re-render subtrees.

### 3. Cleanup in `useEffect`

- Every event listener, interval, or subscription created in `useEffect` MUST return a cleanup function to prevent memory leaks:

```tsx
useEffect(() => {
  const handleResize = () => setWidth(window.innerWidth);
  window.addEventListener('resize', handleResize);
  return () => window.removeEventListener('resize', handleResize);
}, []);
```

### 4. Derived State Anti-Pattern

- Never duplicate props into state (`const [name, setName] = useState(props.name)`). Calculate derived values during rendering directly.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…