diff --git a/.claude/commands/create-component.md b/.claude/commands/create-component.md new file mode 100644 index 0000000..1374d72 --- /dev/null +++ b/.claude/commands/create-component.md @@ -0,0 +1,747 @@ +--- +description: Scaffold a complete new headless form component for react-vanilla-components — interactive, reads HTL from aem-core-forms-components for exact BEM markup, runs af-core state check, generates component + tests + mappings registration. +allowed-tools: Read, Edit, Write, Bash +--- + +## Trigger +Invoked when the user asks to **create a new headless form component** for the `react-vanilla-components` package. This skill is interactive — it gathers information in phases, confirms interpretation before writing code, then generates the component, tests, and registration. + +--- + +## Phase 0 — Gather required information (interactive) + +Do NOT write any code until you have completed this phase. + +### 0a — Component name + +If the user did not provide a component name, ask: +> What is the component name? (PascalCase, e.g. `RatingInput`, `ColorPicker`, `PhoneInput`) + +### 0b — Special behaviors + +Ask: + +> Does this component have any of the following special behaviors? (answer all that apply) +> - **Modal / dialog** (opens a popup for input — like Scribble's canvas dialog) +> - **Canvas drawing** (draws on an HTML canvas) +> - **Rich options list** (custom option rendering beyond a plain `` | +| `string` | `date` | `` | +| `string` | `date-time` | `` | +| `string` | `time` | `` | +| `string` | `email` | `` | +| `string` | `uri` | `` | +| `string` | `tel` | `` | +| `number` / `integer` | _(any)_ | `` | +| `boolean` | _(any)_ | `` | +| with `enum`/`enumNames` | _(any)_ | `