react-component-guidelines
Skill by langfuse
Guides an assistant when it creates React components. It sets rules for minimal props, composition, explicit state types, overlays, icon sizing and styling.
Install react-component-guidelines
Built from the published package, never by AI.
git clone --depth 1 https://github.com/langfuse/langfuse /tmp/langfuse && mkdir -p ~/.claude/skills && cp -r /tmp/langfuse/.agents/skills/react-component-guidelines ~/.claude/skills/react-component-guidelinesRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install react-component-guidelines in Claude Code
git clone --depth 1 https://github.com/langfuse/langfuse /tmp/langfuse && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/langfuse/.agents/skills/react-component-guidelines ~/.gemini/antigravity-cli/skills/react-component-guidelinesAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install react-component-guidelines in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This agent skill holds a set of guidelines for writing React components. It explains that a component should be an encapsulated unit with explicit, unambiguous props. The rules cover a minimal interface with no unused or optional props, avoiding polymorphic components, and using Pick<> and discriminated unions to make impossible states unrepresentable.
The guidelines also cover encapsulation, margin ownership, and overlays composed with DropdownMenuController, PopoverController and DialogController. They include icon size scale rules (icon-sm, icon-base, icon-lg, icon-xl) and deterministic styling with cva or lookup tables. The skill is aimed at developers and AI assistants writing new React components who want them to follow these conventions.
Written from the project's SKILL.md and checked against it.
What it can do
- Minimal props interfaceKeeps component props explicit, with no unused props, conflicting props, or avoidable optional props.
- Composition rulesDecides when shared logic should be a component, a pure function, or a hook, and avoids polymorphic components.
- Explicit state typesPrefers Pick<> over Omit<> and discriminated unions over nullability or optional flags.
- Encapsulation rulesLimits className and style props and keeps cva classes and helper functions unexported.
- Ownership of margin and empty statesPuts margin in the parent and moves null-returning conditions up to the parent component.
- Icon sizing and colourSets icon sizes from a fixed scale and icon colour to match the paired text.
- Overlay compositionGuides use of DropdownMenuController, PopoverController and DialogController with caller-owned triggers.
- Deterministic stylingAsks for explicit style variants through cva, conditions or lookup tables instead of conflicting class names.
Try asking
- Create a React component for a status badge following the repo's component guidelines.
- Refactor this button component to remove optional props and use a discriminated union.
- Write a dialog trigger component that keeps the Trigger asChild at the call site.
Good to know
- Icon rules assume a specific icon size scale and a design-system setup described in the source.
- Guidance covers React component design only and does not address other frameworks.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .agents/skills/react-component-guidelines/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md6 KB
Alternatives to react-component-guidelines
All alternatives →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.
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.
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.
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.
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.
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.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
react-component-guidelines: common questions
What does the react-component-guidelines skill do?
It gives guidelines for writing React components, such as keeping props explicit, avoiding polymorphic components, and using discriminated unions. It is meant to be used when creating a new React component.
Does it cover how to style React components?
Yes. It covers avoiding conflicting style names and making variants explicit with cva, conditions or lookup tables. It also sets icon size and colour rules.
When should a component return null according to this skill?
The source says returning null or undefined from a component is bad practice. It suggests handling that condition in the parent component, often with a hook or HOC.
How do I install react-component-guidelines?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is react-component-guidelines free?
The code is published under the NOASSERTION licence. The service it connects to may have its own pricing.
Is react-component-guidelines safe to use?
It scores 83 of 100. Grades: maintenance A, licence F, 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 react-component-guidelines?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
