React container/presentation component
Create a React component under src/components that follows this repository's Container/Presentation pattern, TypeScript conventions, SCSS module rules, and Storybook minimums.
When to invoke
- "/react-container-presentation-component UserCard ui"
- "
/react-container-presentation-component"
- "Create a Container/Presentation component."
- "Create a Container/Presentation-based component."
- "Scaffold a React component under src/components/features."
- "Help decide whether this component belongs in ui or features."
- "Replace direct Mantine usage with a reusable ui component."
Inputs
Use $ARGUMENTS as componentName type(ui|features). Validate that the component name is PascalCase and the type is exactly ui or features. If arguments are incomplete, ask for missing information before creating files; if the environment has an ask_user interaction primitive, use it.
Required questions when missing:
| Missing input |
Question requirement |
| Component name |
Require PascalCase. |
| Type |
Offer only ui and features. |
Replacement intent for ui |
Ask whether equivalent direct Mantine or other UI-library usage in existing features should be replaced. |
Classification rules
| Type |
Directory |
Use when |
Required files |
ui |
src/components/ui/<ComponentName> |
Pure reusable rendering with no business logic, async processing, context/store update, or feature-specific state management. |
index.tsx, index.module.scss, index.stories.tsx |
features |
src/components/features/<ComponentName> |
Component coordinates state management, side effects, async processing, context/store updates, or business logic. |
index.tsx, use<ComponentName>.tsx, presentation.tsx, types.ts, presentation.module.scss, presentation.stories.tsx |
Even when the user specifies ui, apply Reclassification Rule in references/component-architecture.md before creating files. If the implementation is closer to features, pause and confirm one of these choices: Create as features or Keep ui and move state/logic to parent or features.
Procedure
- Read
references/component-architecture.md and references/typescript-and-scss-rules.md.
- Parse
$ARGUMENTS and ask for any missing component name, type, or ui replacement decision.
- Check whether
src/components/ui/<ComponentName> or src/components/features/<ComponentName> already exists.
- If a target exists, do not overwrite it; confirm whether to stop, extend, or choose a different name.
- Decide the target directory from the classification table.
- Create the required files for
ui or features.
- If creating
ui and the user approved replacements, replace equivalent direct implementations using Mantine or other UI libraries in existing features.
- Run the repository's build and lint commands and fix issues introduced by the new or updated files.
- Follow
Storybook Minimum from references/component-architecture.md. Ask whether to run a Storybook check, with run/skip choices such as Run or Skip for now.
- Run
npm run storybook only if the user selects Run; otherwise report that Storybook execution was skipped.
Responsibility placement
| Concern |
ui location |
features location |
| Rendering markup |
index.tsx |
presentation.tsx |
| Styles |
index.module.scss |
presentation.module.scss |
| Public props |
index.tsx types when small |
types.ts |
| State and effects |
Parent or feature component, not ui |
use<ComponentName>.tsx hook |
| Storybook examples |
index.stories.tsx |
presentation.stories.tsx |
| Business logic |
Not allowed |
Container/hook, not presentation |
Progressive disclosure and bundled resources
| Resource |
Use it when |
references/component-architecture.md |
Classification, Reclassification Rule, Storybook Minimum, dependency direction, and Container/Presentation responsibilities. |
references/typescript-and-scss-rules.md |
TypeScript exports, props, SCSS module naming, and style conventions. |
Gotchas
- Do not overwrite existing components: existing directories require explicit confirmation.
- Do not force
ui: state management, side effects, async processing, context/store updates, or business logic mean features unless logic is moved upward.
- Do not run Storybook without consent: ask first and report
Run or Skip for now.
- Do not violate dependency direction:
ui must not depend on features.
Output template
## React component scaffold result
**Status:** created | needs input | blocked
**Component:** `<ComponentName>`
**Classification:** `ui` | `features`
**Target directory:** `src/components/<ui|features>/<ComponentName>`
### Files created
- `<path>`
### Replacements
- `<changed file>`: <replacement details or none>
### Usage example
```tsx
<<ComponentName> />
Responsibilities
- State and side effects:
- Rendering:
- Styling:
- Dependency direction violations: none |
Validation
- Build: pass | fail | not run
- Lint: pass | fail | not run
- Storybook: run with
npm run storybook | skipped by user
- Unresolved items:
## Quality gate
- [ ] `$ARGUMENTS` was parsed as `componentName type(ui|features)` and missing values were requested.
- [ ] Component name is PascalCase and type is `ui` or `features`.
- [ ] Existing `src/components/ui/<ComponentName>` and `src/components/features/<ComponentName>` were checked before writing.
- [ ] `ui` classification was re-checked against state, side effects, async processing, context/store updates, and business logic.
- [ ] Required files were created for the selected classification.
- [ ] Approved replacements in existing `features` were reported, or none were performed.
- [ ] Build and lint commands were run or a concrete blocker was reported.
- [ ] Storybook execution was run only after user approval or explicitly reported as skipped.
1---2name: react-container-presentation-component3description: Create a React Container/Presentation component under src/components with TypeScript, Storybook, SCSS module, ui/features classification, optional Mantine replacement, and validation. Use when explicitly asked for a Container/Presentation component or when running /react-container-presentation-component.4---56<!-- Generated from harness/github-copilot/skills/react-container-presentation-component/SKILL.md by harness/claude-code/scripts/convert_from_copilot.py. Edit the source, not this file. -->78# React container/presentation component910Create a React component under `src/components` that follows this repository's Container/Presentation pattern, TypeScript conventions, SCSS module rules, and Storybook minimums.1112## When to invoke1314- "/react-container-presentation-component UserCard ui"15- "`/react-container-presentation-component`"16- "Create a Container/Presentation component."17- "Create a Container/Presentation-based component."18- "Scaffold a React component under src/components/features."19- "Help decide whether this component belongs in ui or features."20- "Replace direct Mantine usage with a reusable ui component."2122## Inputs2324Use `$ARGUMENTS` as `componentName type(ui|features)`. Validate that the component name is PascalCase and the type is exactly `ui` or `features`. If arguments are incomplete, ask for missing information before creating files; if the environment has an `ask_user` interaction primitive, use it.2526Required questions when missing:2728| Missing input | Question requirement |29| --- | --- |30| Component name | Require PascalCase. |31| Type | Offer only `ui` and `features`. |32| Replacement intent for `ui` | Ask whether equivalent direct Mantine or other UI-library usage in existing `features` should be replaced. |3334## Classification rules3536| Type | Directory | Use when | Required files |37| --- | --- | --- | --- |38| `ui` | `src/components/ui/<ComponentName>` | Pure reusable rendering with no business logic, async processing, context/store update, or feature-specific state management. | `index.tsx`, `index.module.scss`, `index.stories.tsx` |39| `features` | `src/components/features/<ComponentName>` | Component coordinates state management, side effects, async processing, context/store updates, or business logic. | `index.tsx`, `use<ComponentName>.tsx`, `presentation.tsx`, `types.ts`, `presentation.module.scss`, `presentation.stories.tsx` |4041Even when the user specifies `ui`, apply `Reclassification Rule` in `references/component-architecture.md` before creating files. If the implementation is closer to `features`, pause and confirm one of these choices: `Create as features` or `Keep ui and move state/logic to parent or features`.4243## Procedure44451. Read `references/component-architecture.md` and `references/typescript-and-scss-rules.md`.462. Parse `$ARGUMENTS` and ask for any missing component name, type, or `ui` replacement decision.473. Check whether `src/components/ui/<ComponentName>` or `src/components/features/<ComponentName>` already exists.484. If a target exists, do not overwrite it; confirm whether to stop, extend, or choose a different name.495. Decide the target directory from the classification table.506. Create the required files for `ui` or `features`.517. If creating `ui` and the user approved replacements, replace equivalent direct implementations using Mantine or other UI libraries in existing `features`.528. Run the repository's build and lint commands and fix issues introduced by the new or updated files.539. Follow `Storybook Minimum` from `references/component-architecture.md`. Ask whether to run a Storybook check, with run/skip choices such as `Run` or `Skip for now`.5410. Run `npm run storybook` only if the user selects `Run`; otherwise report that Storybook execution was skipped.5556## Responsibility placement5758| Concern | `ui` location | `features` location |59| --- | --- | --- |60| Rendering markup | `index.tsx` | `presentation.tsx` |61| Styles | `index.module.scss` | `presentation.module.scss` |62| Public props | `index.tsx` types when small | `types.ts` |63| State and effects | Parent or feature component, not `ui` | `use<ComponentName>.tsx` hook |64| Storybook examples | `index.stories.tsx` | `presentation.stories.tsx` |65| Business logic | Not allowed | Container/hook, not presentation |6667## Progressive disclosure and bundled resources6869| Resource | Use it when |70| --- | --- |71| `references/component-architecture.md` | Classification, Reclassification Rule, Storybook Minimum, dependency direction, and Container/Presentation responsibilities. |72| `references/typescript-and-scss-rules.md` | TypeScript exports, props, SCSS module naming, and style conventions. |7374## Gotchas7576- **Do not overwrite existing components**: existing directories require explicit confirmation.77- **Do not force `ui`**: state management, side effects, async processing, context/store updates, or business logic mean `features` unless logic is moved upward.78- **Do not run Storybook without consent**: ask first and report `Run` or `Skip for now`.79- **Do not violate dependency direction**: `ui` must not depend on `features`.8081## Output template8283```markdown84## React component scaffold result8586**Status:** created | needs input | blocked87**Component:** `<ComponentName>`88**Classification:** `ui` | `features`89**Target directory:** `src/components/<ui|features>/<ComponentName>`9091### Files created92- `<path>`9394### Replacements95- `<changed file>`: <replacement details or none>9697### Usage example98```tsx99<<ComponentName> />100```101102### Responsibilities103- State and side effects: <where they live>104- Rendering: <where it lives>105- Styling: <where it lives>106- Dependency direction violations: none | <details>107108### Validation109- Build: pass | fail | not run110- Lint: pass | fail | not run111- Storybook: run with `npm run storybook` | skipped by user112- Unresolved items: <none or list>113```114115## Quality gate116117- [ ] `$ARGUMENTS` was parsed as `componentName type(ui|features)` and missing values were requested.118- [ ] Component name is PascalCase and type is `ui` or `features`.119- [ ] Existing `src/components/ui/<ComponentName>` and `src/components/features/<ComponentName>` were checked before writing.120- [ ] `ui` classification was re-checked against state, side effects, async processing, context/store updates, and business logic.121- [ ] Required files were created for the selected classification.122- [ ] Approved replacements in existing `features` were reported, or none were performed.123- [ ] Build and lint commands were run or a concrete blocker was reported.124- [ ] Storybook execution was run only after user approval or explicitly reported as skipped.