Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

narrow-react-prop-types

Skill by humanlayer

Narrows React component prop types so they match the states live application code actually uses. Built for developers who widened props for Storybook, tests, or mocks and want stricter types.

  • Score 83
  • 13k stars
  • Apache-2.0
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install narrow-react-prop-types

Built from the published package, never by AI.

git clone --depth 1 https://github.com/humanlayer/humanlayer /tmp/humanlayer && mkdir -p ~/.claude/skills && cp -r /tmp/humanlayer/.claude/skills/narrow-react-prop-types ~/.claude/skills/narrow-react-prop-types

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install narrow-react-prop-types in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

This skill guides an assistant through tightening React component prop types. It starts by finding components with broad props, such as many optional fields or optional callback calls. It then finds the non-test, non-Storybook call sites and classifies each prop as required, optional, or removed based on those live usages.

The skill asks for stricter public and internal types, derived types where possible, and explicit useState type parameters. It also removes fallback logic such as `?? []` once props are required. Stories and tests are expected to adapt to the stricter contract rather than weakening it. The workflow ends with typecheck validation for the changed package and its consumers. It is aimed at developers working in React codebases, especially monorepos.

Written from the project's SKILL.md and checked against it.

What it can do

  • Find suspect componentsSpots components with large optional prop interfaces, optional callbacks, or fallback handling.
  • Map live call sitesSeparates live code paths from Storybook stories, tests, fixtures, and mocks before changing types.
  • Classify propsMarks each prop as required, optional, or removed based on non-test call sites.
  • Tighten exported and child propsMakes always-used handlers and props required in the public type and in internal child components.
  • Remove unsupported fallbacksDrops defensive fallbacks such as `?? []` once the props they guarded are required.
  • Derive typesUses Parameters, ReturnType, Extract, and React.Dispatch types instead of hand-written copies.
  • Validate with typecheckRuns package-level typechecks for the changed package and each consuming app or package.

What you need

  • Bun, for the typecheck command shown in the monorepo example

Try asking

  • Narrow the prop types of my ProjectList component to match live usage.
  • Make the onRename handler required in my menu component and fix the call sites.
  • Find props on my Sidebar component that only Storybook stories use and remove them.

Good to know

  • Written for the monorepo workflow shown in the source, with a Bun typecheck example.
  • Relies on the assistant telling live code paths apart from stories, tests, and mocks.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: .claude/skills/narrow-react-prop-types/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md7 KB

Alternatives to narrow-react-prop-types

All alternatives →
openclaw-github-repo-commandersickn33
94

Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.

AAA Skill 50k
gradiogradio-app
94

Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.

AAA Skill 44k
hig-components-menussickn33
94

Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.

AAA Skill 50k
fastapi-templateswshobson
94

Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.

AAA Skill 43k
appfunctionsandroid
94

Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.

AAA Skill 11k
agent-qa-authoringsickn33
94

Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.

AAA Skill 50k

Compare with openclaw-github-repo-commander, gradio or hig-components-menus

narrow-react-prop-types: common questions

What does narrow-react-prop-types do?

It guides narrowing React component prop types to the states that non-test, non-Storybook code actually uses. Optional props and callbacks are made required where live code always supplies them.

Should I make props optional so my Storybook stories are easier to write?

No. The skill says not to keep props optional only to ease stories, tests, or mock data. Stories and tests should provide realistic handlers and state instead.

How does the skill decide which props are needed?

It reads the non-test, non-Storybook call sites. A prop is required if every live call site supplies it, optional if at least one live call site omits it for a meaningful reason, and removed if no live call site uses it.

How do I install narrow-react-prop-types?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is narrow-react-prop-types free?

The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.

Is narrow-react-prop-types safe to use?

It scores 83 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to narrow-react-prop-types?

Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.

narrow-react-prop-types Install

Add to stack

Loading.