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

component-rules

Skill by digital-go-jp

component-rules is an agent skill that sets project-wide rules for building React components in the digital-go-jp repo. It covers composition, styling tokens, file layout, accessibility, Storybook and testing conventions.

  • Score 73
  • 693 stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install component-rules

Built from the published package, never by AI.

git clone --depth 1 https://github.com/digital-go-jp/design-system-example-components-react /tmp/design-system-example-components-react && mkdir -p ~/.claude/skills && cp -r /tmp/design-system-example-components-react/.agents/skills/component-rules ~/.claude/skills/component-rules

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

Step-by-step: install component-rules in Claude Code

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

About

component-rules is an agent skill with the project-wide rules for writing React components in the digital-go-jp repository. It covers composition over large props, keeping logic out of component bodies, Tailwind styling with the project's theme tokens, per-component file layout, accessibility targets, and Storybook and testing conventions. It tells the assistant to read neighboring components before adding or changing code.

The skill is written for developers and assistants editing components in this repo. Workflow skills such as port-html-to-react, write-tests and write-component-docs build on these rules instead of repeating them. The rules target React 19, avoid React 19-only APIs, and point to a separate guide for React 18 users.

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

What it can do

  • Composition patternGuides the assistant to use React children composition with minimal props.
  • No logic in component bodyKeeps state, effects and data fetching out of components and in hooks or utils.
  • Styling tokensDirects Tailwind styles to the theme plugin tokens instead of stock values.
  • File layoutDescribes the standard files for each component, such as Foo.tsx, stories, tests and index.ts.
  • AccessibilitySets WCAG 2.2 Level AA as the target and favors native HTML semantics over ARIA.
  • Storybook conventionsRequires a Playground story and story names that match the HTML file names.
  • Testing conventionsDescribes Vitest browser-mode tests using composeStories and vitest-browser-react.
  • Self-contained componentsPrevents changes to shared Tailwind config or global CSS for a single component.

What you need

  • React 19 project
  • Tailwind CSS with @digital-go-jp/tailwind-theme-plugin
  • Storybook
  • Vitest with Playwright and Chromium

Try asking

  • Write a new Button component following the repo's component rules.
  • Move the logic out of this component into a separate hook file.
  • Check my styles and replace stock Tailwind colors with theme tokens.

Good to know

  • Targets React 19; React 18 needs changes described in a separate document.
  • Tests run in browser mode with Playwright and Chromium, with no jsdom environment.
  • Do not split Foo.tsx preemptively; propose a split once it passes roughly 300 lines.

Security check

A

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

Checked automatically: .agents/skills/component-rules/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Alternatives to component-rules

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

component-rules: common questions

Can component bodies use hooks like useState?

No. The rules say component bodies must not use useState, useRef, useEffect or other hooks, and logic should go in separate hook or util files.

Should I use forwardRef with this skill?

No. The rules say not to use forwardRef on React 19, because ComponentProps already includes ref and spreading rest forwards it.

What test setup does the skill require?

Vitest in browser mode through Playwright and Chromium. UI behavior is tested against Stories with composeStories and vitest-browser-react.

How do I install component-rules?

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

Is component-rules free?

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

Is component-rules safe to use?

It scores 73 of 100. Grades: maintenance B, 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 component-rules?

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

component-rules Install

Add to stack

Loading.