Skill library / For developers

Cursor skill for React components

For front-end developers and teams who want new components to look like the rest of the codebase.

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.

Use this skill nowSee the SKILL.md

Answer up to 4 quick questions, add your email, and get a version written around you, ready to paste into Cursor. Free, no account needed.

What it's good for

The SKILL.md file

Save as react-component-generator/SKILL.md. It follows the open Agent Skills format.

---
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 it in Cursor

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

Example

Illustrative example. This shows the kind of request and result to expect. It is not a real conversation, and your result will depend on what you give it.

You ask: “Create a Pagination component”

What you get back: Pagination.tsx, Pagination.test.tsx and Pagination.stories.tsx in components/Pagination/, matching existing patterns.

Pro tip

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

Make your own version

This prompt is a good start, but it doesn't know you. Answer a few quick questions about your situation and how you like things done, and we'll write a version that does. It appears on screen with a Copy button and setup steps for your AI, and we email you a copy. Free, up to 10 a month.

Make my own version free

Questions

Skill or .mdc rule?

Either. Put the folder in .cursor/skills/, or copy the .mdc file into .cursor/rules/ and scope it to your components folder.

Does it add tests?

Yes. It adds a test covering render, props and one interaction, plus a story if your project uses Storybook.

How do I install it 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 the prompt on this page for free, with no sign-up. If you want a version written around you, our generator is free too (up to 10 a month, no account needed): answer a few questions and we email you a copy.

Related skills

One small, practical way to get more from the AI you already use. Free, every Tuesday, five minutes to read.