Skip to content

component-creator skill

The component-creator skill powered /kit-create. It also auto-triggered on natural-language phrases. /kit-create is now handled by the components skill (Creator Mode).

Triggered by/kit-create plus phrases like “create a …”, “make me a …”, “build a …”, “design a …”, “generate a …”
OutputA TSX snippet (default) or a standalone component file
DependenciesPer-component reference docs under plugins/acss-kit/skills/components/references/components/<name>.md
StatusAbsorbed into components skill v1.0.0 — Creator Mode and Form Mode now live in that skill

Reference docs live under plugins/acss-kit/skills/components/references/components/:

ComponentReference doc
Button, IconButtonbutton.md, icon-button.md
Alertalert.md
Card, Dialog, Popovercard.md, dialog.md, popover.md
Link, Img, Iconlink.md, img.md, icon.md
Input, Checkbox, Fieldinput.md, checkbox.md, field.md
List, Table, Navlist.md, table.md, nav.md
Alert message
Card

Card body text

Link
<div style="display:flex;flex-wrap:wrap;gap:.75rem;align-items:flex-start">
<button>Button</button>
<button style="display:inline-flex;align-items:center;gap:.4rem">
  <svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor"><circle cx="8" cy="8" r="7"/></svg>
  IconButton
</button>
<div role="alert" style="padding:.5rem 1rem;border-left:3px solid currentColor">Alert message</div>
<div style="padding:1rem;border:1px solid #ccc;border-radius:4px;min-width:10rem">
  <strong>Card</strong><p style="margin:.25rem 0 0">Card body text</p>
</div>
<a href="#">Link</a>
<input type="text" placeholder="Input" style="padding:.25rem .5rem" />
<label style="display:flex;gap:.4rem;align-items:center"><input type="checkbox" /> Checkbox</label>
</div>

The skill is structured as a ten-step pipeline. Each step has explicit halt/confirm rules so the output is reproducible.

If the session is in plan mode, exit it before Step A. Step B runs detect_target.py and may invoke /kit-add to bootstrap a missing component or dependency, and Step C’s file-mode output writes a standalone TSX file — all blocked by plan mode. The skill only stays in plan mode when the user asked for a description without running anything.

  • A1 Resolve component noun to its reference doc via the dispatch table.
  • A2 Load the doc’s Props Interface, Generation Contract, and Usage Examples.
  • A3 Match user phrases against the prop vocabulary (colours, sizes, booleans, slots).
  • A3.5 State-control demo defaults: open/expanded/visibletrue, checkedfalse. Wire up to caller state in the summary note.
  • A4 Extract quoted strings for slot content ("Add to cart"children).
  • A5 Halt if any required prop is unresolved or any conflict is detected.

Run detect_target.py to locate the components directory. If the requested component or any dependency is missing, bootstrap it via /kit-add.

Ask the user: snippet mode (print the TSX block) or file mode (write a standalone component).

Apply H1 generic rules; then any H2 rules from the component’s reference doc.

Emit single-element JSX, or compound JSX (Step E2) when slots are present. Add the correct imports.

Verify aria-label, alt, and labelFor (where required). Drop empty compound slots rather than emitting them.

Support delta turns (“make it larger”, “swap to secondary”) on the in-memory spec until the user resets or names a new component.

  • Hard halts — unresolved required props, out-of-union values, same-axis conflicts.
  • Confirms — long text, sub-minimum sizes called out by the reference doc.

Four worked examples (button, alert, card, refinement) double as parser test fixtures.

  1. Silently default a colour prop. Ask the user instead.
  2. Substitute a value that isn’t in the prop’s union.
  3. Hard-code component import paths — always use detect_target.py.
  4. Generate empty compound slots.
  5. Write files without confirmation when an H1 halt fires.
VersionPlanned
v0.2Each reference doc declares its own Generation Notes — Creator Mode halts/confirms
v0.3Multi-component compositions in one prompt
v0.4Project naming-conventions awareness