agentleFS
monegitmonegit/agent-skills/skills/create-component/SKILL.md

create-component

Skill0 starsChanged 31 days agoMITView on GitHub

Design, create, or refactor React components in this repository. Use when implementing component APIs, compound components, reusable component children, Tailwind CSS or tailwind-variants styles, component folders, props, or exports.

12 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. 0 are common, 10 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 11 edited versions we read keep these.

  • 10

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read the applicable AGENTS.md, package exports, and nearby components before choosing an API.

    line 10
  2. Distinctive:

    Use a simple component by default.

    line 11
  3. Distinctive:

    Create the component under its category and separate the root, reusable child renderers, JSX, styles, public types, state hooks, and pure …

    line 12
  4. Very specific:

    Put Tailwind classes in styles.ts.

    line 13
  5. Distinctive:

    Keep the public API typed, semantic, and accessible.

    line 14
  6. Distinctive:

    If dependencies are already declared but unavailable locally, restore them with the existing lockfile instead of adding duplicate …

    line 22
  7. Distinctive:

    If installation fails because of network, registry, or permission restrictions, report the blocker and the exact remaining setup.

    line 24
  8. Distinctive:

    Prefer composition over boolean prop combinations that alter structure.

    line 28
  9. Distinctive:

    Keep one responsibility per file.

    line 30
  10. Very specific:

    Keep component function signatures light: accept props, then destructure it as const { ...

    line 32
  11. Distinctive:

    Keep application-specific state and data fetching outside shared UI components.

    line 34
  12. Distinctive:

    Do not introduce a compound API solely for visual grouping.

    line 35
  13. Very specific:

    Do not accept or forward className from a public component API.

    line 36

“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Create Component

Workflow

  1. Read the applicable AGENTS.md, package exports, and nearby components before choosing an API. Check and install missing dependencies as described below before implementing the component.
  2. Use a simple component by default. Use a compound API only when related children need shared state, coordinated behavior, or a clearer semantic tree. Read references/compound-components.md first.
  3. Create the component under its category and separate the root, reusable child renderers, JSX, styles, public types, state hooks, and pure utilities by responsibility. Read references/architecture.md.
  4. Put Tailwind classes in styles.ts. Declare every supported visual style as an invariant class or a typed semantic variant; do not expose className as a styling escape hatch. Add cursor-pointer to every clickable control. For tailwind-variants, use the tailwind-variants-best-practice skill and read references/styling.md.
  5. Keep the public API typed, semantic, and accessible. Forward native element props deliberately; supply accessible labels for icon-only controls.
  6. Export the public component from its category and package barrels, then run the narrowest type and lint checks.

Dependency Setup

  • Inspect the target package's package.json, workspace configuration, packageManager field, and lockfile to identify the existing package manager and dependency conventions.
  • Before implementation, ensure the target package has access to the dependencies the component actually needs: react for React components, tailwindcss for Tailwind styling, and tailwind-variants when using tv. Install missing required packages automatically as part of the component task; do not install optional libraries that the implementation does not use.
  • Use the project's existing package manager and workspace targeting. Add dependencies to the package that owns the component, following existing runtime, development, and peer dependency conventions. Preserve compatible existing versions and use versions compatible with the project's React, Tailwind, and build setup; do not upgrade installed packages unnecessarily.
  • If dependencies are already declared but unavailable locally, restore them with the existing lockfile instead of adding duplicate declarations. Keep manifest and lockfile changes together and do not create a second package manager's lockfile.
  • For a new Tailwind setup, also add the integration required by the existing build tool and configure its stylesheet entry so the classes work. Reuse an existing setup when present.
  • If installation fails because of network, registry, or permission restrictions, report the blocker and the exact remaining setup; do not claim installation succeeded. After installation, run the narrowest relevant type, lint, or build check and report the dependencies added.

Guardrails

  • Prefer composition over boolean prop combinations that alter structure.
  • Name slots by responsibility (root, label, icon), not by HTML tag or incidental position.
  • Keep one responsibility per file. Extract a child only when it is independently reusable or materially simplifies its parent.
  • Define props for an extracted child in the parent component's types.ts; import that contract into the child instead of declaring it inside the child file.
  • Keep component function signatures light: accept props, then destructure it as const { ... } = props at the top of the function body.
  • Move state transitions and event handlers shared by the component tree into a dedicated hook; move pure calculations into a utility module.
  • Keep application-specific state and data fetching outside shared UI components.
  • Do not introduce a compound API solely for visual grouping.
  • Do not accept or forward className from a public component API. Omit it from native prop contracts and add a declared semantic variant when consumers need a supported visual difference.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.