react-component-creation

Create reusable React components with Opentrons-specific file structure and testing conventions.

515|208|Updated Jul 6, 2015
One-click install
npx skills add https://github.com/Opentrons/opentrons --skill react-component-creation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-component-creation
Source: https://github.com/Opentrons/opentrons/tree/main/.cursor/skills/react-component-creation
Command: npx skills add https://github.com/Opentrons/opentrons --skill react-component-creation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This checklist guides engineers to create robust React components in opentrons-ai-client and protocol-designer, ensuring consistent structure, naming, testing, and styling across projects.

Core Features & Use Cases

  • Establishes a standard component file structure (index.tsx, componentname.module.css, tests/ComponentName.test.tsx) for new React components.
  • Enforces opentrons-ai-client specific path aliases and testing utilities, enabling predictable imports and test execution.
  • Provides guidance for CSS Modules and project-local component organization, reducing integration friction and code duplication.

Quick Start

Create a new component named ComponentName following the specified structure and conventions, then wire it into the project for immediate use.

Frequently Asked Questions about react-component-creation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a new React component for the opentrons-ai-client project?

To structure a new React component, create a directory with an index.tsx file, a componentname.module.css file for styling, and a __tests__/ComponentName.test.tsx file for tests. This standardizes file organization across opentrons projects.

What is the standard file structure for reusable React components in protocol-designer?

The standard file structure for reusable React components requires an index.tsx entry point, a componentname.module.css stylesheet, and a __tests__/ComponentName.test.tsx file. This enforces consistent TypeScript and React conventions across the project.

How do I apply CSS Modules when creating React components in Opentrons projects?

To apply CSS Modules, create a componentname.module.css file alongside your index.tsx component file. This project-local styling approach reduces integration friction and code duplication while ensuring consistent styling conventions.

Do I need TypeScript path aliasing for React component creation in opentrons-ai-client?

Yes, TypeScript path aliasing is enforced for React component creation in opentrons-ai-client. Using the specified path aliases enables predictable imports and ensures correct testing utilities are applied throughout the project.

How do I set up tests for a new React component using TypeScript conventions?

To set up tests, create a __tests__/ComponentName.test.tsx file within your component directory and use the project-specific testing utilities. This enforces correct TypeScript and React conventions for predictable test execution.

What's the best way to standardize React component imports across opentrons-ai-client and protocol-designer?

The best way to standardize React component imports is by enforcing project-specific path aliases and predictable file structures. Applying these conventions across opentrons-ai-client and protocol-designer reduces integration friction and code duplication.