From 4bbab21cc69bb20c29f57f066bd8cc3ceb6dcfbd Mon Sep 17 00:00:00 2001 From: Luke Bennett Date: Sat, 26 Sep 2026 14:01:22 +1000 Subject: [PATCH] Ship a Luke UI conventions skill in the published package (#526) (#667) --- packages/@luke-ui/react/package.json | 1 + .../@luke-ui/react/skills/luke-ui/SKILL.md | 39 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 packages/@luke-ui/react/skills/luke-ui/SKILL.md diff --git a/packages/@luke-ui/react/package.json b/packages/@luke-ui/react/package.json index b99f73c3..77d73183 100644 --- a/packages/@luke-ui/react/package.json +++ b/packages/@luke-ui/react/package.json @@ -9,6 +9,7 @@ }, "files": [ "dist", + "skills", "README.md", "LICENSE" ], diff --git a/packages/@luke-ui/react/skills/luke-ui/SKILL.md b/packages/@luke-ui/react/skills/luke-ui/SKILL.md new file mode 100644 index 00000000..be838f3b --- /dev/null +++ b/packages/@luke-ui/react/skills/luke-ui/SKILL.md @@ -0,0 +1,39 @@ +--- +name: luke-ui +description: >- + Luke UI conventions for building with @luke-ui/react. Use when writing or reviewing Luke UI + components, layout, imports, or class names. +--- + +# Luke UI conventions + +Follow these rules when the task involves Luke UI. Each rule states what to do and what not to do. + +## Refs on field components + +`TextField`, `Checkbox`, and `ComboboxField` expose `inputRef` for reaching their underlying input. + +Do not pass a plain `ref` to these field components. Components that expose their rendered element +directly use their documented `ref` prop instead. For example, `ComboboxInput` takes a plain `ref`. + +## Element choice + +Use `elementType` only to change the rendered element without owning its DOM attributes. + +Use `render` when the callback must own the element and its DOM attributes. Pass the component's +documented resolved props to that element. + +Do not use `render` and `elementType` together. They are mutually exclusive. + +## Imports + +Import each component from its own package path, such as `@luke-ui/react/button` or +`@luke-ui/react/primitives/field`. + +Do not import from a root `@luke-ui/react` entrypoint. There is none. + +## Class names + +Join class names with `cx` from `@luke-ui/react/utils`. + +Do not hand-roll class-name joining when `cx` covers the case. -- 2.51.2