react-component-creation
Skill525 starsChanged 2 months agoApache-2.0View on GitHub
Component creation checklist and ai-client-specific patterns for React .tsx files in opentrons-ai-client/ and protocol-designer/. Use when creating new React components in these packages.
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Consider the component's purpose, functionality, and design
- Distinctive: line 13
Check if a similar component already exists in:
- Distinctive: line 16
If an existing component can be extended or composed, prefer that over creating a new one
- Very specific: line 42
Use renderWithProviders from the ai-client testing utils:
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
React Component Creation Checklist
General TypeScript, React, styling, testing, and import conventions are in the opentrons-typescript skill. PD-specific architecture is in the protocol-designer skill. CSS Modules details are in the css-modules skill. This file covers the component creation workflow and opentrons-ai-client specifics.
Before Creating a New Component
- Consider the component's purpose, functionality, and design
- Check if a similar component already exists in:
components/src/atoms/,components/src/molecules/,components/src/organisms/(shared library)<project>/src/components/atoms/,molecules/,organisms/(project-local)
- If an existing component can be extended or composed, prefer that over creating a new one
Component File Structure
ComponentName/
├── index.tsx
├── componentname.module.css
└── __tests__/
└── ComponentName.test.tsxopentrons-ai-client Specifics
Path Alias
The ai-client uses /ai-client/ as its path alias (mapped to opentrons-ai-client/src/):
import { AttachedFileItem } from '/ai-client/atoms/AttachedFileItem'
import type { ChatData } from '/ai-client/resources/types'Testing
Use renderWithProviders from the ai-client testing utils:
import { renderWithProviders } from '/ai-client/__testing-utils__'Running Tests
pnpm vitest opentrons-ai-client/src/path/to/file
pnpm vitest opentrons-ai-client/src/folder/Running Stylelint
pnpm stylelint opentrons-ai-client/src/path/to/file.module.cssIn this repository18 other files it gives its agents.
- .cursor/rules/ai-server-api-docs-curation.mdcCursor rule
- .cursor/rules/monorepo-setup.mdcCursor rule
- ai-clientSkill
- ai-serverSkill
- analyses-snapshot-testingSkill
- css-modulesSkill
- docsSkill
- documented-mutationsSkill
- e2e-testingSkill
- grill-frontend-codeSkill
- js-package-testingSkill
- locize-syncSkill
- opentrons-typescriptSkill
- protocol-authoringSkill
- protocol-designerSkill
- protocol-verificationSkill
- robot-python-projectsSkill
- static-deploySkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

