claudecode-omc 5.6.8 → 5.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/.local/skills/prompt-optimizer/SKILL.md +262 -19
  2. package/.omc-curation/ecc-selection.json +80 -0
  3. package/.omc-curation/governance.json +113 -0
  4. package/.omc-curation/sources.lock.json +25 -0
  5. package/README.md +69 -4
  6. package/bundled/manifest.json +5 -5
  7. package/bundled/upstream/anthropic-skills/.omc-source/bundle.json +18 -0
  8. package/bundled/upstream/anthropic-skills/.omc-source/provenance.json +399 -0
  9. package/bundled/upstream/anthropic-skills/skills/claude-api/SKILL.md +18 -17
  10. package/bundled/upstream/anthropic-skills/skills/claude-api/curl/examples.md +9 -9
  11. package/bundled/upstream/anthropic-skills/skills/claude-api/curl/managed-agents.md +4 -4
  12. package/bundled/upstream/anthropic-skills/skills/claude-api/go/managed-agents/README.md +2 -2
  13. package/bundled/upstream/anthropic-skills/skills/claude-api/java/claude-api.md +2 -2
  14. package/bundled/upstream/anthropic-skills/skills/claude-api/java/managed-agents/README.md +2 -2
  15. package/bundled/upstream/anthropic-skills/skills/claude-api/php/claude-api.md +10 -10
  16. package/bundled/upstream/anthropic-skills/skills/claude-api/php/managed-agents/README.md +2 -2
  17. package/bundled/upstream/anthropic-skills/skills/claude-api/python/claude-api/README.md +16 -16
  18. package/bundled/upstream/anthropic-skills/skills/claude-api/python/claude-api/batches.md +3 -3
  19. package/bundled/upstream/anthropic-skills/skills/claude-api/python/claude-api/files-api.md +3 -3
  20. package/bundled/upstream/anthropic-skills/skills/claude-api/python/claude-api/streaming.md +7 -7
  21. package/bundled/upstream/anthropic-skills/skills/claude-api/python/claude-api/tool-use.md +19 -19
  22. package/bundled/upstream/anthropic-skills/skills/claude-api/python/managed-agents/README.md +3 -3
  23. package/bundled/upstream/anthropic-skills/skills/claude-api/ruby/claude-api.md +4 -4
  24. package/bundled/upstream/anthropic-skills/skills/claude-api/ruby/managed-agents/README.md +2 -2
  25. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/error-codes.md +5 -5
  26. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/live-sources.md +3 -1
  27. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-api-reference.md +10 -4
  28. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-core.md +19 -1
  29. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-environments.md +6 -2
  30. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-multiagent.md +1 -1
  31. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-onboarding.md +3 -3
  32. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-overview.md +3 -2
  33. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-self-hosted-sandboxes.md +173 -0
  34. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-tools.md +10 -4
  35. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/model-migration.md +113 -13
  36. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/models.md +14 -11
  37. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/prompt-caching.md +2 -2
  38. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/tool-use-concepts.md +4 -4
  39. package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/claude-api/README.md +15 -15
  40. package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/claude-api/batches.md +2 -2
  41. package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/claude-api/files-api.md +1 -1
  42. package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/claude-api/streaming.md +5 -5
  43. package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/claude-api/tool-use.md +15 -15
  44. package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/managed-agents/README.md +3 -3
  45. package/bundled/upstream/ecc/.omc-source/bundle.json +2 -1
  46. package/bundled/upstream/ecc/.omc-source/last-plan-apply.json +108 -24
  47. package/bundled/upstream/ecc/.omc-source/manifests/.claude-plugin/marketplace.json +3 -3
  48. package/bundled/upstream/ecc/.omc-source/provenance.json +563 -0
  49. package/bundled/upstream/ecc/agents/marketing-agent.md +159 -0
  50. package/bundled/upstream/ecc/agents/react-build-resolver.md +215 -0
  51. package/bundled/upstream/ecc/agents/react-reviewer.md +167 -0
  52. package/bundled/upstream/ecc/agents/typescript-reviewer.md +3 -0
  53. package/bundled/upstream/ecc/commands/harness-audit.md +17 -10
  54. package/bundled/upstream/ecc/commands/marketing-campaign.md +129 -0
  55. package/bundled/upstream/ecc/commands/react-build.md +187 -0
  56. package/bundled/upstream/ecc/commands/react-review.md +170 -0
  57. package/bundled/upstream/ecc/commands/react-test.md +265 -0
  58. package/bundled/upstream/ecc/skills/benchmark-optimization-loop/SKILL.md +69 -0
  59. package/bundled/upstream/ecc/skills/blender-motion-state-inspection/SKILL.md +164 -0
  60. package/bundled/upstream/ecc/skills/canary-watch/SKILL.md +9 -1
  61. package/bundled/upstream/ecc/skills/continuous-learning-v2/hooks/observe.sh +31 -9
  62. package/bundled/upstream/ecc/skills/continuous-learning-v2/scripts/detect-project.sh +38 -4
  63. package/bundled/upstream/ecc/skills/continuous-learning-v2/scripts/instinct-cli.py +319 -12
  64. package/bundled/upstream/ecc/skills/data-throughput-accelerator/SKILL.md +72 -0
  65. package/bundled/upstream/ecc/skills/dynamic-workflow-mode/SKILL.md +123 -0
  66. package/bundled/upstream/ecc/skills/frontend-a11y/SKILL.md +446 -0
  67. package/bundled/upstream/ecc/skills/ito-basket-compare/SKILL.md +63 -0
  68. package/bundled/upstream/ecc/skills/ito-data-atlas-agent/SKILL.md +63 -0
  69. package/bundled/upstream/ecc/skills/ito-market-intelligence/SKILL.md +60 -0
  70. package/bundled/upstream/ecc/skills/ito-trade-planner/SKILL.md +67 -0
  71. package/bundled/upstream/ecc/skills/latency-critical-systems/SKILL.md +73 -0
  72. package/bundled/upstream/ecc/skills/marketing-campaign/SKILL.md +113 -0
  73. package/bundled/upstream/ecc/skills/nextjs-turbopack/SKILL.md +13 -0
  74. package/bundled/upstream/ecc/skills/parallel-execution-optimizer/SKILL.md +72 -0
  75. package/bundled/upstream/ecc/skills/prediction-market-oracle-research/SKILL.md +63 -0
  76. package/bundled/upstream/ecc/skills/prediction-market-risk-review/SKILL.md +60 -0
  77. package/bundled/upstream/ecc/skills/react-patterns/SKILL.md +341 -0
  78. package/bundled/upstream/ecc/skills/react-performance/SKILL.md +574 -0
  79. package/bundled/upstream/ecc/skills/react-testing/SKILL.md +423 -0
  80. package/bundled/upstream/ecc/skills/recsys-pipeline-architect/SKILL.md +114 -0
  81. package/bundled/upstream/ecc/skills/recursive-decision-ledger/SKILL.md +79 -0
  82. package/bundled/upstream/ecc/skills/social-publisher/SKILL.md +115 -0
  83. package/bundled/upstream/ecc/skills/team-agent-orchestration/SKILL.md +110 -0
  84. package/bundled/upstream/ecc/skills/uncloud/SKILL.md +343 -0
  85. package/bundled/upstream/ecc/skills/windows-desktop-e2e/SKILL.md +99 -0
  86. package/bundled/upstream/oh-my-claudecode/.omc-source/bundle.json +2 -1
  87. package/bundled/upstream/oh-my-claudecode/.omc-source/provenance.json +116 -0
  88. package/bundled/upstream/oh-my-claudecode/skills/autopilot/SKILL.md +7 -0
  89. package/bundled/upstream/oh-my-claudecode/skills/cancel/SKILL.md +1 -0
  90. package/bundled/upstream/oh-my-claudecode/skills/deep-interview/SKILL.md +39 -5
  91. package/bundled/upstream/oh-my-claudecode/skills/hud/SKILL.md +1 -0
  92. package/bundled/upstream/oh-my-claudecode/skills/local-build-reminder/SKILL.md +78 -0
  93. package/bundled/upstream/oh-my-claudecode/skills/omc-doctor/SKILL.md +1 -1
  94. package/bundled/upstream/oh-my-claudecode/skills/omc-setup/SKILL.md +26 -10
  95. package/bundled/upstream/oh-my-claudecode/skills/omc-setup/phases/01-install-claude-md.md +3 -3
  96. package/bundled/upstream/oh-my-claudecode/skills/omc-setup/phases/02-configure.md +6 -4
  97. package/bundled/upstream/oh-my-claudecode/skills/omc-setup/phases/03-integrations.md +1 -1
  98. package/bundled/upstream/oh-my-claudecode/skills/omc-setup/phases/04-welcome.md +2 -2
  99. package/bundled/upstream/oh-my-claudecode/skills/omc-teams/SKILL.md +6 -6
  100. package/bundled/upstream/oh-my-claudecode/skills/plan/SKILL.md +44 -32
  101. package/bundled/upstream/oh-my-claudecode/skills/ralph/SKILL.md +45 -21
  102. package/bundled/upstream/oh-my-claudecode/skills/ralplan/SKILL.md +1 -1
  103. package/bundled/upstream/oh-my-claudecode/skills/self-improve/SKILL.md +7 -0
  104. package/bundled/upstream/oh-my-claudecode/skills/self-improve/scripts/resolve-paths.mjs +39 -15
  105. package/bundled/upstream/oh-my-claudecode/skills/team/SKILL.md +132 -90
  106. package/bundled/upstream/oh-my-claudecode/skills/ultragoal/SKILL.md +93 -0
  107. package/bundled/upstream/oh-my-claudecode/skills/ultraqa/SKILL.md +28 -13
  108. package/bundled/upstream/oh-my-claudecode/skills/ultrawork/SKILL.md +7 -0
  109. package/bundled/upstream/superpowers/.omc-source/bundle.json +2 -1
  110. package/bundled/upstream/superpowers/.omc-source/provenance.json +63 -0
  111. package/package.json +2 -1
  112. package/src/catalog/source-catalog.js +10 -4
  113. package/src/cli/index.js +4 -0
  114. package/src/cli/plan.js +14 -2
  115. package/src/cli/setup.js +52 -13
  116. package/src/cli/skill.js +1 -1
  117. package/src/cli/source.js +265 -14
  118. package/src/config/sources.js +67 -1
  119. package/src/merge/content-patch.js +84 -0
  120. package/templates/merge-config.json +1 -8
  121. package/bundled/upstream/ecc/skills/strategic-compact/suggest-compact.sh +0 -54
@@ -0,0 +1,129 @@
1
+ ---
2
+ description: Plan and execute a full marketing campaign. Accepts a product brief and returns positioning, landing page copy, email sequence, social posts, ad variants, video scripts, and a content calendar. Can also review existing copy for conversion quality.
3
+ allowed_tools: ["Read", "Grep", "Glob", "WebSearch", "WebFetch", "Write"]
4
+ ---
5
+
6
+ # /marketing-campaign
7
+
8
+ Plan and execute a marketing campaign from brief to full content suite.
9
+
10
+ ## Usage
11
+
12
+ ```
13
+ /marketing-campaign # Prompt for brief interactively
14
+ /marketing-campaign [product brief] # Full campaign from inline brief
15
+ /marketing-campaign copy [type] # Single deliverable only
16
+ /marketing-campaign review [file-or-brief] # Copy audit for conversion and brand consistency
17
+ ```
18
+
19
+ ## What It Does
20
+
21
+ 1. **Research** — Profiles the target audience and maps competitors before writing anything
22
+ 2. **Positioning** — Locks the campaign angle and tone profile first
23
+ 3. **Copy production** — Generates the full content suite in the right order (landing page → emails → social → ads → video scripts → calendar)
24
+ 4. **Review** — Gates all output through a conversion and brand consistency checklist
25
+
26
+ ## Modes
27
+
28
+ ### Full Campaign Mode
29
+
30
+ Provide a product brief containing:
31
+ - Product name and description
32
+ - Target audience (specific, not generic)
33
+ - Core problem the product solves
34
+ - Core benefit / outcome
35
+ - Tone guidance
36
+ - Channels required
37
+ - Launch goal or timeline
38
+
39
+ The agent returns all campaign deliverables in order, with a copy review summary at the end.
40
+
41
+ ### Single Deliverable Mode
42
+
43
+ ```
44
+ /marketing-campaign copy landing-page
45
+ /marketing-campaign copy email-sequence
46
+ /marketing-campaign copy social-posts
47
+ /marketing-campaign copy ads
48
+ /marketing-campaign copy video-scripts
49
+ ```
50
+
51
+ Requires positioning to be defined first. Run full mode or provide the angle before requesting a single deliverable.
52
+
53
+ ### Copy Review Mode
54
+
55
+ ```
56
+ /marketing-campaign review path/to/copy.md
57
+ /marketing-campaign review "paste copy here"
58
+ ```
59
+
60
+ Returns a structured audit against:
61
+ - 5-second clarity test (above-fold copy)
62
+ - CTA quality (specific, earned, one per piece)
63
+ - Brand tone consistency
64
+ - Claim specificity and supportability
65
+ - Platform-native fit
66
+ - Cross-channel consistency
67
+
68
+ ## Brief Template
69
+
70
+ ```markdown
71
+ Product: [name]
72
+ Description: [1-3 sentences on what it does]
73
+ Audience: [who, specifically]
74
+ Problem: [the specific pain the product solves]
75
+ Benefit: [the outcome the user gets]
76
+ Tone: [adjectives + what to avoid]
77
+ Channels: [landing page, email, LinkedIn, X, ads, video]
78
+ Goal: [launch, waitlist, signups, awareness — and timeline]
79
+ ```
80
+
81
+ ## Output Location
82
+
83
+ When saving campaign assets, the convention is `.claude/campaigns/{campaign-name}/`:
84
+
85
+ ```
86
+ .claude/campaigns/product-launch/
87
+ ├── positioning.md
88
+ ├── landing-page.md
89
+ ├── email-sequence.md
90
+ ├── social-posts.md
91
+ ├── ad-copy.md
92
+ ├── video-scripts.md
93
+ └── content-calendar.md
94
+ ```
95
+
96
+ Confirm the save location before writing files.
97
+
98
+ ## Examples
99
+
100
+ ```
101
+ /marketing-campaign Build a 7-day launch campaign for an AI career platform for UK university students.
102
+ ```
103
+
104
+ ```
105
+ /marketing-campaign copy landing-page
106
+ ```
107
+
108
+ ```
109
+ /marketing-campaign review .claude/campaigns/the-key/landing-page.md
110
+ ```
111
+
112
+ ## Agent Delegation
113
+
114
+ This command invokes:
115
+ - `marketing-agent` — campaign planning and copy production
116
+ - `brand-voice` — voice capture when tone needs locking across multiple outputs
117
+ - `content-engine` — platform-native social content production
118
+ - `crosspost` — multi-platform distribution
119
+ - `market-research` — deep audience or competitive intelligence
120
+
121
+ ## Related Commands
122
+
123
+ - `/plan` — Strategic planning before a campaign
124
+ - `/plan-prd` — Product requirements document before briefing a campaign
125
+ - `/code-review` — Review code behind a landing page implementation
126
+
127
+ ---
128
+
129
+ *Part of [Everything Claude Code](https://github.com/affaan-m/everything-claude-code)*
@@ -0,0 +1,187 @@
1
+ ---
2
+ description: Fix React build failures (Vite, webpack, Next.js, CRA, Parcel, esbuild, Bun) incrementally — JSX/TSX compile errors, hydration mismatches, server/client component boundary failures, missing types. Invokes the react-build-resolver agent for minimal, surgical fixes.
3
+ ---
4
+
5
+ # React Build and Fix
6
+
7
+ This command invokes the **react-build-resolver** agent to incrementally fix React build errors with minimal changes.
8
+
9
+ ## What This Command Does
10
+
11
+ 1. **Detect Build System**: Identify Vite, webpack, Next.js, CRA, Parcel, esbuild, or Bun
12
+ 2. **Run Build**: Execute the project's build script
13
+ 3. **Parse Errors**: Group by layer (TypeScript / bundler config / runtime / hydration)
14
+ 4. **Fix Incrementally**: One error at a time, re-running build after each change
15
+ 5. **Report Summary**: Show what was fixed and what remains
16
+
17
+ ## When to Use
18
+
19
+ Use `/react-build` when:
20
+
21
+ - `npm run build` (or pnpm/yarn/bun equivalent) fails
22
+ - JSX/TSX compile errors after a TypeScript or React upgrade
23
+ - Next.js hydration mismatch errors at runtime
24
+ - Server/Client Component boundary errors in App Router
25
+ - After installing or upgrading `react`, `react-dom`, `@types/react`, or a bundler
26
+ - Missing types or "module not found" errors involving React
27
+
28
+ ## Scope
29
+
30
+ This command owns **React build/bundler/runtime hydration** failures. For pure TypeScript type errors with no React involvement, use `/build-fix` (generic) instead.
31
+
32
+ ## Diagnostic Commands Run
33
+
34
+ ```bash
35
+ # Project build script (preferred)
36
+ npm run build --if-present
37
+ pnpm build 2>/dev/null
38
+ yarn build 2>/dev/null
39
+ bun run build 2>/dev/null
40
+
41
+ # Standalone typecheck
42
+ npm run typecheck --if-present
43
+ tsc --noEmit -p tsconfig.json
44
+
45
+ # Bundler-specific fallback
46
+ next build # Next.js
47
+ vite build # Vite
48
+ react-scripts build # CRA
49
+ webpack --mode=production # webpack
50
+ parcel build src/index.html # Parcel
51
+ bun build ./src/index.tsx --outdir=dist
52
+ ```
53
+
54
+ ## Example Session
55
+
56
+ ````text
57
+ User: /react-build
58
+
59
+ Agent:
60
+ # React Build Resolution
61
+
62
+ ## Build System Detected
63
+ Vite (vite.config.ts present, @vitejs/plugin-react in deps)
64
+
65
+ ## Initial Diagnostics
66
+
67
+ ```bash
68
+ $ npm run build
69
+ > tsc -b && vite build
70
+
71
+ src/components/UserCard.tsx:1:8 - error TS6133: 'React' is declared but its value is never read.
72
+ src/components/Modal.tsx:12:15 - error TS7016: Could not find a declaration file for module 'react-portal'.
73
+ src/pages/Home.tsx:42:5 - error: 'useState' is not defined
74
+ ```
75
+
76
+ Errors found: 3
77
+
78
+ ## Fix 1: Old JSX transform leftover
79
+
80
+ File: src/components/UserCard.tsx:1
81
+ Cause: `tsconfig.json` already uses `"jsx": "react-jsx"`; the explicit `import React` is unused.
82
+
83
+ ```tsx
84
+ // Removed
85
+ - import React from 'react';
86
+ ```
87
+
88
+ ```bash
89
+ $ npm run build
90
+ # 2 errors remaining
91
+ ```
92
+
93
+ ## Fix 2: Missing types
94
+
95
+ File: src/components/Modal.tsx
96
+ Cause: `@types/react-portal` not installed.
97
+
98
+ ```bash
99
+ $ npm i -D @types/react-portal
100
+ added 1 package
101
+ ```
102
+
103
+ ```bash
104
+ $ npm run build
105
+ # 1 error remaining
106
+ ```
107
+
108
+ ## Fix 3: Missing hook import
109
+
110
+ File: src/pages/Home.tsx
111
+ Cause: `useState` referenced but not imported.
112
+
113
+ ```tsx
114
+ - import { useEffect } from "react";
115
+ + import { useEffect, useState } from "react";
116
+ ```
117
+
118
+ ```bash
119
+ $ npm run build
120
+ # Build successful!
121
+ ```
122
+
123
+ ## Final Verification
124
+
125
+ ```bash
126
+ $ npm run build
127
+ ✓ built in 2.34s
128
+
129
+ $ npm test
130
+ ✓ 47 tests passed
131
+ ```
132
+
133
+ ## Summary
134
+
135
+ | Metric | Count |
136
+ |--------|-------|
137
+ | Build errors fixed | 3 |
138
+ | Files modified | 2 |
139
+ | Dependencies added | 1 (@types/react-portal) |
140
+ | Remaining issues | 0 |
141
+
142
+ Build Status: PASS: SUCCESS
143
+ ````
144
+
145
+ ## Common Errors Fixed
146
+
147
+ | Error | Typical Fix |
148
+ |---|---|
149
+ | `'React' is not defined` | Set `"jsx": "react-jsx"` in tsconfig (React 17+) |
150
+ | Missing `@types/react` | `npm i -D @types/react @types/react-dom` |
151
+ | `Unexpected token '<'` | Add `@vitejs/plugin-react` / `babel-loader` |
152
+ | `You're importing a component that needs useState` (Next.js) | Add `"use client"` or move hook to a Client Component child |
153
+ | `Module not found: Can't resolve 'fs'` (Next.js) | Remove `fs` import or move logic into Server Component / API route |
154
+ | `Hydration failed because the initial UI does not match` | Move `Date.now()`/`Math.random()`/`window.*` to `useEffect` |
155
+ | `Invalid hook call` | Multiple React copies — dedupe via `resolutions`/`overrides` |
156
+ | `Element type is invalid` | Default vs named import mismatch |
157
+
158
+ ## Fix Strategy
159
+
160
+ 1. **Compile errors first** — code must build
161
+ 2. **Hydration errors second** — affects production correctness
162
+ 3. **Bundler config third** — restore plugin/loader correctness
163
+ 4. **One fix at a time** — verify each change
164
+ 5. **Minimal changes** — never `// @ts-ignore` without explanation
165
+ 6. **Re-run after each fix** — surface new errors immediately
166
+
167
+ ## Stop Conditions
168
+
169
+ The agent will stop and report if:
170
+
171
+ - Same error persists after 3 attempts
172
+ - Fix introduces more errors than it resolves
173
+ - Requires architectural change beyond build resolution (e.g., redesigning the RSC boundary)
174
+ - Bundler version no longer supports the installed React major
175
+
176
+ ## Related Commands
177
+
178
+ - `/react-test` — run tests after the build is green
179
+ - `/react-review` — review code quality after the build succeeds
180
+ - `/build-fix` — generic build fixer (non-React)
181
+ - `verification-loop` skill — full verification loop
182
+
183
+ ## Related
184
+
185
+ - Agent: `agents/react-build-resolver.md`
186
+ - Skills: `skills/react-patterns/`, `skills/frontend-patterns/`
187
+ - Rules: `rules/react/coding-style.md`, `rules/react/patterns.md`
@@ -0,0 +1,170 @@
1
+ ---
2
+ description: Comprehensive React/JSX code review for hook correctness, render performance, server/client component boundaries, accessibility, and React-specific security. Invokes the react-reviewer agent (and typescript-reviewer alongside on TSX/JSX changes).
3
+ ---
4
+
5
+ # React Code Review
6
+
7
+ This command invokes the **react-reviewer** agent for React-specific code review. For pull requests touching `.tsx`/`.jsx` files, both `react-reviewer` and `typescript-reviewer` should run — each owns a distinct lane.
8
+
9
+ ## What This Command Does
10
+
11
+ 1. **Identify React Changes**: Find modified `.tsx`/`.jsx` files (and React-containing `.ts`/`.js` files) via `git diff`
12
+ 2. **Run Lint**: Execute `eslint` with `eslint-plugin-react-hooks` and `eslint-plugin-jsx-a11y`
13
+ 3. **Typecheck**: Run `tsc --noEmit` or the project's canonical typecheck command
14
+ 4. **Review React Lanes Only**: Hook rules, RSC boundaries, accessibility, render performance, React-specific security
15
+ 5. **Generate Report**: Categorize issues by severity (CRITICAL / HIGH / MEDIUM)
16
+
17
+ ## When to Use
18
+
19
+ Use `/react-review` when:
20
+
21
+ - A PR or commit touches `.tsx`/`.jsx` files
22
+ - After writing or modifying React components, custom hooks, or pages
23
+ - Before merging React code
24
+ - Auditing accessibility on UI components
25
+ - Reviewing a new hook for rules-of-hooks and dependency correctness
26
+ - Auditing a Next.js App Router server/client component boundary
27
+
28
+ For pure `.ts`/`.js` changes with no React imports, use `/code-review` (general) or invoke `typescript-reviewer` directly.
29
+
30
+ ## Scope vs `/code-review` and TypeScript Review
31
+
32
+ | Tool | Scope |
33
+ |---|---|
34
+ | `react-reviewer` (this command) | Hooks rules, JSX, RSC, a11y, React-specific security, render perf |
35
+ | `typescript-reviewer` | Generic TS/JS — `any` abuse, async correctness, Node security |
36
+ | `security-reviewer` | Project-wide security audit |
37
+ | `/code-review` | Generic uncommitted-changes or PR review |
38
+
39
+ On a TSX/JSX PR, invoke both `react-reviewer` and `typescript-reviewer`. Findings from each are non-overlapping by design.
40
+
41
+ ## Review Categories
42
+
43
+ ### CRITICAL (Must Fix)
44
+
45
+ - `dangerouslySetInnerHTML` with unsanitized input
46
+ - `href`/`src` with unvalidated user URLs (`javascript:`, `data:`)
47
+ - Server Action without input validation
48
+ - Secret in client bundle (`NEXT_PUBLIC_*`, `VITE_*`, `REACT_APP_*`)
49
+ - `localStorage`/`sessionStorage` for session tokens
50
+ - Conditional hook calls (violates Rules of Hooks)
51
+ - Direct state mutation
52
+ - Hook called outside a component or custom hook
53
+
54
+ ### HIGH (Should Fix)
55
+
56
+ - Missing `useEffect`/`useMemo`/`useCallback` deps (disabled `exhaustive-deps` without justification)
57
+ - Effect for derived state
58
+ - Effect missing cleanup
59
+ - Stale closures in handlers/intervals
60
+ - Server-only imports in Client Components
61
+ - Sensitive data leaked via props to Client Components
62
+ - Server Actions without auth checks
63
+ - Accessibility violations (missing labels, non-semantic interactive elements, ARIA misuse)
64
+ - `key={index}` in dynamic lists
65
+ - Duplicated state, useEffect chains
66
+
67
+ ### MEDIUM (Consider)
68
+
69
+ - Over-memoization without measured win
70
+ - Inline new object/function as prop to memoized child
71
+ - Suspense at route root only (no progressive reveal)
72
+ - Long lists without virtualization
73
+ - High-frequency value via `useContext`
74
+ - Roll-your-own validation in non-trivial forms
75
+ - Prop drilling beyond 3 levels
76
+ - Component over 200 lines
77
+ - Class components in new code
78
+
79
+ ## Automated Checks Run
80
+
81
+ ```bash
82
+ # Lint (required for any meaningful review)
83
+ npx eslint . --ext .tsx,.jsx,.ts,.js
84
+
85
+ # Typecheck (skip cleanly for JS-only projects)
86
+ npm run typecheck --if-present
87
+ [ -f tsconfig.json ] && tsc --noEmit -p tsconfig.json
88
+
89
+ # Targeted a11y rules
90
+ npx eslint . --rule 'jsx-a11y/alt-text: error' \
91
+ --rule 'jsx-a11y/anchor-is-valid: error' \
92
+ --rule 'jsx-a11y/click-events-have-key-events: error'
93
+
94
+ # Supply-chain
95
+ npm audit
96
+ ```
97
+
98
+ If `eslint-plugin-react-hooks` or `eslint-plugin-jsx-a11y` is not configured, the review will flag the gap as a HIGH config issue and continue.
99
+
100
+ ## Example Usage
101
+
102
+ ````text
103
+ User: /react-review
104
+
105
+ Agent:
106
+ # React Code Review Report
107
+
108
+ ## Files Reviewed
109
+ - src/components/UserCard.tsx (modified)
110
+ - src/hooks/useUser.ts (new)
111
+
112
+ ## Lint Results
113
+ PASS: eslint clean
114
+ PASS: typecheck clean
115
+
116
+ ## Issues Found
117
+
118
+ [CRITICAL] Unsanitized dangerouslySetInnerHTML
119
+ File: src/components/UserCard.tsx:42
120
+ Issue: User-controlled bio rendered as raw HTML.
121
+ Why: XSS via stored script tags in user input.
122
+ Fix: Sanitize with DOMPurify or render as text:
123
+ ```tsx
124
+ import DOMPurify from "isomorphic-dompurify";
125
+ <div dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(user.bio) }} />
126
+ ```
127
+
128
+ [HIGH] Effect cleanup missing
129
+ File: src/hooks/useUser.ts:18
130
+ Issue: `fetch` call without AbortController; setState on unmounted component possible.
131
+ Fix: Add AbortController and cleanup:
132
+ ```ts
133
+ useEffect(() => {
134
+ const ac = new AbortController();
135
+ fetch(`/api/users/${id}`, { signal: ac.signal })
136
+ .then(r => r.json())
137
+ .then(setUser);
138
+ return () => ac.abort();
139
+ }, [id]);
140
+ ```
141
+
142
+ ## Summary
143
+ - CRITICAL: 1
144
+ - HIGH: 1
145
+ - MEDIUM: 0
146
+
147
+ Recommendation: FAIL: Block merge until CRITICAL issue is fixed
148
+ ````
149
+
150
+ ## Approval Criteria
151
+
152
+ | Status | Condition |
153
+ |---|---|
154
+ | PASS: Approve | No CRITICAL or HIGH issues |
155
+ | WARNING: Warning | Only MEDIUM issues (merge with caution) |
156
+ | FAIL: Block | CRITICAL or HIGH issues found |
157
+
158
+ ## Integration with Other Commands
159
+
160
+ - Run `/react-build` first if the build is broken
161
+ - Run `/react-test` to ensure component tests pass
162
+ - Run `/react-review` before merging
163
+ - Use `/code-review` for non-React-specific concerns on the same PR
164
+
165
+ ## Related
166
+
167
+ - Agent: `agents/react-reviewer.md`
168
+ - Companion agent: `agents/typescript-reviewer.md` (run alongside for TSX/JSX PRs)
169
+ - Skills: `skills/react-patterns/`, `skills/react-testing/`, `skills/accessibility/`
170
+ - Rules: `rules/react/`