Claude Cursor GitHub Copilot Skill

react-component-architecture-review

Statically review React component trees for composition, prop-interface, and state-placement defects (God-components, prop drilling, overbroad context, hook-rule violations) against React's own composition guidance, producing ranked file:line findings.

LLM Mart · 0 points · 0 views 0 listing impressions 0 install-command copies
Virus-scanned Reviewed automatically before listing.

Full trust report

Download vincentchuwaichow-vanguard-frontier-agentic-skills_frontend_react-component-architecture-review-febe32a.zip · 7 KB
Part of vincentchuwaichow/vanguard-frontier-agentic — 293 skills

Install

skills CLI npx skills add https://github.com/VincentChuWaiChow/vanguard-frontier-agentic/tree/master/skills/frontend/react-component-architecture-review
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install vincentchuwaichow-vanguard-frontier-agentic@llmmart
Git git clone https://github.com/VincentChuWaiChow/vanguard-frontier-agentic.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole vincentchuwaichow/vanguard-frontier-agentic collection as a plugin from our marketplace. Git is the plain clone.

Skill manifest

React Component Architecture Review

Purpose

Review React component decomposition, prop-interface design, and state-placement decisions (local vs lifted vs context vs external store) without re-litigating styling, live performance profiling, or state-management library selection in every response. This skill exists so those adjacent concerns stay out of scope and the review stays focused on structural defects that erode testability and maintainability.

When to use

Use this skill when the user asks to:

  • review a React component or feature PR for architecture before merge,
  • answer "is this component doing too much",
  • audit prop-drilling or context usage across a component subtree,
  • assess whether new or existing components should be split, merged, or recomposed.

Do not use this skill for:

  • pure styling/CSS review — no architecture concern is in scope,
  • performance profiling that requires live browser traces — that needs a runtime tool, not static review,
  • state-management library selection with no existing code to review — that is a design conversation, not a review.

Context7 Documentation Protocol

  • Resolve the React library ID with resolve-library-id (matched result: /reactjs/react.dev) before citing any React-specific claim.
  • Before asserting a component-splitting or state-placement recommendation is "React's recommended pattern," call query-docs against the repo's actual React major version (read package.json first) and cite the doc section — do not assert from memory.
  • If Context7 is unavailable, fall back to the official_docs URLs in this skill's metadata.json and label the claim documentation-based, unverified against current release.
  • Never assume the latest React docs apply to an older major version in the repo; hook rules and context APIs have changed across majors (e.g., Context.Provider vs. <Context value={...}>).

Lean operating rules

  • First read package.json to confirm the installed React major version. Do not make an API-availability claim without confirming the version.
  • Classify each in-scope component as presentational, container, or compound before evaluating it. Do not apply a single decomposition rule to all three uniformly.
  • Context usage is not automatically a smell. Values that change rarely and are needed broadly (theme, auth, locale) are an appropriate use of context per React's own guidance; only flag context when it causes overbroad re-renders or is used in place of straightforward prop passing at shallow depth.
  • Do not recommend a specific state-management library (Redux, Zustand, Jotai, etc.) unless one is already a dependency in the repo. A decomposition problem is not a tooling problem.
  • Do not fabricate re-render counts or performance claims without a live profiler; label such estimates inference, not measured.
  • Treat deep prop chains that match an intentional compound-component or render-prop API as a design pattern, not a defect — verify intent before flagging.
  • Cap the blast radius of a single review: if the review would require rewriting more than 5 components, stop and flag it as "requires a dedicated refactor plan" rather than prescribing the rewrite inline.
  • Never execute, build, or run application code as part of this review; this is a static-review skill (Read/Grep/Glob only).
  • Treat any hardcoded API key, token, or secret found in component props, default values, or example data as a HIGH-severity finding requiring immediate escalation, not a style note.

References

Load these only when needed:

  • Review workflow and findings contract — use for the step-by-step review procedure, the decision tree for split/context/compound-API calls, and the required output shape.
  • Composite widget patterns — load only when the component in scope is a composite widget (combobox, tabs, dialog, listbox) where deep prop chains may be an intentional ARIA APG pattern rather than drilling.

Response minimum

Return, at minimum:

  • the component(s) and files in scope,
  • ranked findings with file:line evidence and a concrete refactor sketch per finding,
  • evidence level per finding (repo evidence, documentation-based, or inference),
  • verdict (approve / approve-with-notes / block),
  • open questions or scope the review could not cover (e.g., "requires a dedicated refactor plan" cap, missing live re-render data).
Files (vanguard-frontier-agentic)
  • references
    • composite-widget-patterns.md 4 KB
      # Composite widget patterns
      
      > Load this reference only when the component in scope is a composite/compound widget — combobox, tabs, dialog, listbox, accordion, menu — where deep prop or context threading may be an intentional API rather than an architectural defect.
      
      ## What people get wrong
      
      The naive story is:
      
      > Any prop passed through 3+ components is prop drilling; any component with a lot of internal cross-talk is doing too much.
      
      Wrong for composite widgets. A compound-component API (e.g. `<Tabs><Tabs.List><Tabs.Tab/></Tabs.List><Tabs.Panels>...</Tabs.Panels></Tabs>`) intentionally threads shared state (active index, orientation, disabled state) across a family of subcomponents via context or cloned props, because the alternative — flattening everything into one component — would produce a worse, less composable, less accessible API. Flagging that threading as "drilling" without checking intent produces a false-positive finding that erodes reviewer credibility.
      
      ## How to tell intentional threading from accidental drilling
      
      - **Naming convention**: subcomponents namespaced under a parent (`Tabs.Tab`, `Menu.Item`, `Dialog.Trigger`) signal a deliberate compound-component API, not incidental nesting.
      - **Shared context scoped to the family**: a context provider created and consumed only within the widget's own file/module (not app-wide) is a scoping signal of intentional design, not overbroad context.
      - **ARIA role relationships**: if the DOM structure maps to a documented ARIA Authoring Practices Guide (APG) pattern — combobox, listbox, tablist/tab/tabpanel, menu/menuitem — the parent-child prop/state relationship usually exists to satisfy the accessibility contract (e.g., `aria-activedescendant`, `aria-selected`, `aria-expanded` synchronization across the family), not because of poor decomposition.
      - **Reuse boundary**: subcomponents of a compound API are not meant to be reused independently outside their parent; that is by design, not a coupling defect. Do not recommend "extracting" a `Tabs.Tab` to be reused standalone unless the user has an actual standalone-reuse requirement.
      
      ## When to still flag a composite widget
      
      Even for compound APIs, still flag:
      
      - Hook-rule violations inside any subcomponent (unconditional top-level rule always applies).
      - A shared context value that changes on every keystroke/interaction and re-renders every sibling subcomponent when only one needs to update — recommend splitting state (e.g., "active index" context separate from "orientation" context) or memoizing consumers.
      - Hardcoded ARIA attributes that contradict the actual interaction model (e.g., `role="listbox"` on a widget that behaves like a menu) — this is a defect regardless of component-architecture concerns and should be flagged as an accessibility finding, not folded into an architecture finding.
      - A compound API that silently duplicates state between a controlled prop and internal state without a documented reconciliation strategy (uncontrolled/controlled conflict).
      
      ## Reference pattern shape
      
      React's own composition guidance underlies compound components: children are passed through `props.children`, and shared behavior is coordinated via context scoped to the family, consistent with `Sharing State Between Components` (lift state to the nearest common owner) and `Passing Data Deeply with Context` (use context when passing props becomes genuinely inconvenient across the family, not as a first resort).
      
      ## When to push back
      
      Push back if the user asks to:
      
      - flatten a compound-component API into a single component "to reduce prop drilling" — that removes composability without removing coupling,
      - extract a namespaced subcomponent for standalone reuse without an actual standalone-reuse requirement,
      - remove the family-scoped context and thread every value as explicit props across 4+ compound subcomponents — that reintroduces the exact verbosity context was scoped to solve.
      
      That is not simplification. It is a worse API with the same underlying coupling.
      
    • workflow-and-output.md 6.2 KB
      # Review workflow and findings contract
      
      Use this reference for the full component-architecture review procedure and the required output shape.
      
      ## What people get wrong
      
      The naive story is:
      
      > Split anything that "feels big," lift state to the top, and reach for a context or a store whenever a prop is passed more than once.
      
      Wrong. Splitting a component without reducing coupling just moves the same coupling into a new file. Lifting state past the actual point of shared ownership creates unnecessary re-renders and unrelated components that now depend on state they don't own. Reaching for context or a store before checking whether the "problem" is actually decomposition treats a structural defect as a tooling gap.
      
      React's own guidance (`Thinking in React`, `Sharing State Between Components`, `Passing Data Deeply with Context`) is explicit that component boundaries should follow **separation of concerns** — a component should ideally be concerned with one thing — and that context is a last resort after prop passing becomes genuinely inconvenient across a large distance, not a default.
      
      ## Workflow
      
      1. **Classify each component in scope**
         - Presentational (renders UI from props, no data-fetch/business-logic)
         - Container (owns data-fetch, business-logic, or both, delegates rendering)
         - Compound (exposes a composite API — e.g. `<Tabs><Tabs.Panel/></Tabs>` — where prop/context threading is intentional)
      
      2. **Count responsibilities per component**
         - Data-fetching, business-logic, layout/presentation, event-handling are the four responsibility buckets.
         - A component mixing 3 or more buckets is a decomposition candidate — but only escalate to a "split" recommendation per the decision tree below, not automatically.
      
      3. **Trace prop chains**
         - Follow each prop 3+ levels deep. Note every intermediate component that receives the prop only to pass it through without consuming it.
         - Cross-check against the compound-component reference before flagging: an intentional compound API often has legitimate multi-level prop/context threading.
      
      4. **Check context usage**
         - For each `useContext` / `Context.Provider` (or `<Context value={...}>` in newer React majors — verify against the repo's confirmed version), determine how often the provided value changes.
         - Flag only when a frequently-changing value is provided broadly and re-renders an oversized subtree, or when context is used in place of a 1–2 level prop pass that would be simpler and more traceable.
      
      5. **Check hook-rule compliance**
         - Hooks must be called unconditionally at the top level of a function component or custom hook — never inside conditions, loops, nested functions, early returns, or try/catch blocks (per React's Rules of Hooks). Flag any violation as HIGH severity; it is a correctness bug, not a style preference.
      
      6. **Produce ranked findings**
         - Order by blast radius: correctness bugs (hook-rule violations, leaked secrets) first, then testability/maintainability defects (mixed-responsibility components, real prop drilling), then lower-severity notes (naming, minor duplication).
      
      ## Decision tree
      
      - Component has **more than 1 unrelated responsibility** AND is **reused in more than 1 place** → recommend split, with a sketch of the extracted boundary.
      - Prop drilling exceeds **3 levels** AND the prop is passed through **more than 2 non-consuming intermediates** → recommend context or composition (children/slots) per React's own composition guidance — do not default to recommending a global store.
      - A single context value **changes frequently** and **re-renders a large subtree** → recommend splitting the context (e.g., separate state and dispatch contexts) or memoizing consumers, citing the specific re-render evidence available (repo evidence of consumer count, or `inference, not measured` if no profiler data exists).
      - Deep prop/context threading matches a **compound-component or render-prop API** already in use elsewhere in the codebase → do not flag; note it as intentional.
      
      ## Output contract
      
      Return:
      
      1. Component(s)/files in scope
      2. Ranked findings, each with:
         - file:line evidence
         - responsibility-mix or drilling-depth evidence backing the finding
         - concrete refactor sketch
         - severity (HIGH / MEDIUM / LOW)
         - evidence level (`repo evidence`, `documentation-based`, `inference`)
      3. Verdict: approve / approve-with-notes / block
      4. Open questions or explicitly out-of-scope items (e.g. "requires a dedicated refactor plan" cap when more than 5 components would need rewriting, or missing live re-render data)
      
      ## Validation gates
      
      - Every architectural claim traces to a specific file:line.
      - Every "React recommends X" statement is backed by a Context7-queried doc citation matched to the repo's confirmed React version — never asserted from memory.
      - No finding recommends a specific state-management library unless one is already present in the repo's dependencies.
      - No finding proceeds to recommend a rewrite of more than 5 components in one review; flag as "requires a dedicated refactor plan" instead and stop there.
      
      ## Common failure modes
      
      - Treating every context usage as bad. Context is appropriate for rarely-changing, broadly-needed values like theme, auth, or locale — that is the documented use case, not an anti-pattern.
      - Recommending Redux/Zustand/Jotai when the actual problem is component decomposition, not state-management tooling.
      - Flagging deep prop chains that are actually intentional render-prop or compound-component APIs as if they were accidental drilling.
      - Estimating re-render frequency or count without a live profiler and presenting it as measured fact instead of `inference, not measured`.
      
      ## Adversarial checklist
      
      Before finalizing a finding, answer these:
      
      - Would splitting this component actually reduce coupling, or just move the same coupling into a new file?
      - Is the prop-drilling flagged actually a compound-component API (intentional) rather than an architectural smell?
      - Does the reviewer have repo evidence this component re-renders excessively, or is that assumed?
      - Is the Context7 citation matched to the repo's actual React version, not the latest docs by default?
      
      If any answer is "not sure," lower the finding's confidence and label the evidence level accordingly — do not present it as a confirmed defect.
      
  • metadata.json 1.3 KB
    {
      "id": "react-component-architecture-review",
      "name": "React Component Architecture Review",
      "type": "skill",
      "provider": "frontend",
      "harnesses": [
        "claude-code",
        "cursor",
        "codex",
        "gemini",
        "kiro",
        "other"
      ],
      "summary": "Reviews React component trees for composition, prop-interface, and separation-of-concerns defects that erode testability and maintainability, using React's own composition guidance (component decomposition, lifting state, context) loaded progressively and grounded via Context7 against the repo's confirmed React version.",
      "source_type": "original",
      "official_docs": [
        "https://react.dev/learn/thinking-in-react",
        "https://react.dev/learn/passing-props-to-a-component",
        "https://react.dev/learn/sharing-state-between-components",
        "https://react.dev/reference/rules/rules-of-hooks"
      ],
      "security_notes": "Static-review-only skill: it reads and greps component source but never executes, builds, or runs application code. Do not review or execute application secrets; treat any API key or token found hardcoded in component props or default values as a HIGH-severity finding requiring immediate escalation, not a style note.",
      "last_verified": "2026-07-02",
      "path": "skills/frontend/react-component-architecture-review",
      "author": "github: VincentChuWaiChow",
      "version": "0.1.0"
    }
    
  • SKILL.md 4.8 KB
    ---
    name: react-component-architecture-review
    description: Statically review React component trees for composition, prop-interface, and state-placement defects (God-components, prop drilling, overbroad context, hook-rule violations) against React's own composition guidance, producing ranked file:line findings.
    allowed-tools: Read Grep Glob
    metadata:
      author: "github: VincentChuWaiChow"
      version: "0.1.0"
      updated: "2026-07-02"
      category: architecture
    ---
    
    # React Component Architecture Review
    
    ## Purpose
    
    Review React component decomposition, prop-interface design, and state-placement decisions (local vs lifted vs context vs external store) without re-litigating styling, live performance profiling, or state-management library selection in every response. This skill exists so those adjacent concerns stay out of scope and the review stays focused on structural defects that erode testability and maintainability.
    
    ## When to use
    
    Use this skill when the user asks to:
    
    - review a React component or feature PR for architecture before merge,
    - answer "is this component doing too much",
    - audit prop-drilling or context usage across a component subtree,
    - assess whether new or existing components should be split, merged, or recomposed.
    
    Do not use this skill for:
    
    - pure styling/CSS review — no architecture concern is in scope,
    - performance profiling that requires live browser traces — that needs a runtime tool, not static review,
    - state-management library selection with no existing code to review — that is a design conversation, not a review.
    
    ## Context7 Documentation Protocol
    
    - Resolve the React library ID with `resolve-library-id` (matched result: `/reactjs/react.dev`) before citing any React-specific claim.
    - Before asserting a component-splitting or state-placement recommendation is "React's recommended pattern," call `query-docs` against the repo's actual React major version (read `package.json` first) and cite the doc section — do not assert from memory.
    - If Context7 is unavailable, fall back to the `official_docs` URLs in this skill's `metadata.json` and label the claim `documentation-based, unverified against current release`.
    - Never assume the latest React docs apply to an older major version in the repo; hook rules and context APIs have changed across majors (e.g., `Context.Provider` vs. `<Context value={...}>`).
    
    ## Lean operating rules
    
    - First read `package.json` to confirm the installed React major version. Do not make an API-availability claim without confirming the version.
    - Classify each in-scope component as presentational, container, or compound before evaluating it. Do not apply a single decomposition rule to all three uniformly.
    - Context usage is not automatically a smell. Values that change rarely and are needed broadly (theme, auth, locale) are an appropriate use of context per React's own guidance; only flag context when it causes overbroad re-renders or is used in place of straightforward prop passing at shallow depth.
    - Do not recommend a specific state-management library (Redux, Zustand, Jotai, etc.) unless one is already a dependency in the repo. A decomposition problem is not a tooling problem.
    - Do not fabricate re-render counts or performance claims without a live profiler; label such estimates `inference, not measured`.
    - Treat deep prop chains that match an intentional compound-component or render-prop API as a design pattern, not a defect — verify intent before flagging.
    - Cap the blast radius of a single review: if the review would require rewriting more than 5 components, stop and flag it as "requires a dedicated refactor plan" rather than prescribing the rewrite inline.
    - Never execute, build, or run application code as part of this review; this is a static-review skill (Read/Grep/Glob only).
    - Treat any hardcoded API key, token, or secret found in component props, default values, or example data as a HIGH-severity finding requiring immediate escalation, not a style note.
    
    ## References
    
    Load these only when needed:
    
    - [Review workflow and findings contract](references/workflow-and-output.md) — use for the step-by-step review procedure, the decision tree for split/context/compound-API calls, and the required output shape.
    - [Composite widget patterns](references/composite-widget-patterns.md) — load only when the component in scope is a composite widget (combobox, tabs, dialog, listbox) where deep prop chains may be an intentional ARIA APG pattern rather than drilling.
    
    ## Response minimum
    
    Return, at minimum:
    
    - the component(s) and files in scope,
    - ranked findings with file:line evidence and a concrete refactor sketch per finding,
    - evidence level per finding (`repo evidence`, `documentation-based`, or `inference`),
    - verdict (approve / approve-with-notes / block),
    - open questions or scope the review could not cover (e.g., "requires a dedicated refactor plan" cap, missing live re-render data).
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.

Related