Skill library / Cursor

React Component Generator skill for Cursor

Cursor writes React quickly, but not always your React. This skill encodes your folder layout, styling approach and testing pattern so new components look like the rest of the codebase.

Customise this skill free →

What it's good for

How the skill works

  1. Look at two existing components to infer conventions
  2. Create the component file with a typed Props interface
  3. Use semantic HTML and ARIA attributes where needed
  4. Add a test covering render, props and one interaction
  5. Export it from the nearest index file

Built-in rules

Example

You: “Create a Pagination component”
Result: Pagination.tsx, Pagination.test.tsx and Pagination.stories.tsx in components/Pagination/, matching existing patterns.

SKILL.md template

Save as react-component-generator/SKILL.md.

---
name: react-component-generator
description: "Creates React components that follow the project's conventions: TypeScript props, accessible markup, co-located tests and stories. Use when the user asks to create, scaffold or add a React component."
---

# React Component Generator

## Workflow
1. Look at two existing components to infer conventions
2. Create the component file with a typed Props interface
3. Use semantic HTML and ARIA attributes where needed
4. Add a test covering render, props and one interaction
5. Export it from the nearest index file

## Rules
- No default exports unless the project already uses them
- No inline styles; use the project's styling system
- Every interactive element must be keyboard accessible

How to install in Cursor

Put the folder in .cursor/skills/ (or .agents/skills/), or copy the included .mdc file into .cursor/rules/.

Pro tip

Set the .mdc rule's globs to src/components/**/*.tsx so it only applies where it matters.

Want it tailored to how you work?

Answer a few questions and get a customised version with examples, a Cursor rule and GPT/Gem instructions, emailed free.

Make my version →

FAQ

How do I install the react component generator skill in Cursor?

Put the folder in .cursor/skills/ (or .agents/skills/), or copy the included .mdc file into .cursor/rules/.

Is it free?

Yes. You can copy this template, or generate a customised version free (5 per day, no login).

Does it work on other platforms?

Yes. The SKILL.md follows the open Agent Skills standard, and every generated package also includes a Cursor rule and ChatGPT/Gemini instructions.

Related skills