@devschile/chucao-skill 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 devsChile
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,34 @@
1
- # Temporary Holding Version
1
+ # Chucao agent skill
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ `@devschile/chucao-skill` teaches coding agents to generate accessible UI with Chucao's real components, tokens, events, and slots. It does not install the UI library. The [skill](SKILL.md) is a short router; read its linked references only when the task calls for them.
4
+
5
+ ## Install
6
+
7
+ Install a published version from its npm tarball URL. Replace `0.1.0` with the version you want:
8
+
9
+ ```sh
10
+ npx skills add https://registry.npmjs.org/@devschile/chucao-skill/-/chucao-skill-0.1.0.tgz
11
+ ```
12
+
13
+ To track the version in the repository instead:
14
+
15
+ ```sh
16
+ npx skills add https://github.com/devschile/chucao/tree/main/packages/chucao-skill
17
+ ```
18
+
19
+ If your project manages the skill as a dependency, use npm and then sync it:
20
+
21
+ ```sh
22
+ npm install -D @devschile/chucao-skill
23
+ npx skills sync -y
24
+ ```
25
+
26
+ `skills add` does not resolve bare npm package names.
27
+
28
+ ### Coding agents
29
+
30
+ - **Claude Code:** append `-a claude-code` to the install or sync command, then ask Claude to use the `chucao-skill` skill.
31
+ - **Cursor:** append `-a cursor`. To opt in through a Cursor rule, create `.cursor/rules/chucao.mdc` with `description: Build or review UI using Chucao` and `alwaysApply: false` in YAML frontmatter. In the body, tell Cursor to read `.agents/skills/chucao-skill/SKILL.md` before generating Chucao UI.
32
+ - **GitHub Copilot:** append `-a github-copilot` to the install or sync command, then refer to `chucao-skill` in your prompt.
33
+
34
+ See the [Chucao AI guide](https://devschile.github.io/chucao/docs/ai.md) for a ready-to-use Cursor rule and usage examples. For live documentation and token lookups rather than authored rules, use the [read-only `@devschile/chucao-mcp` server (issue #60)](https://github.com/devschile/chucao/issues/60).
package/SKILL.md ADDED
@@ -0,0 +1,87 @@
1
+ ---
2
+ name: chucao-skill
3
+ description: Build or review accessible UI with the Chucao design system. Use when choosing Chucao components, writing their HTML or framework bindings, or styling a Chucao interface with its design tokens.
4
+ ---
5
+
6
+ # Chucao UI
7
+
8
+ Chucao is the devsChile design system. Its Web Components are distributed as `@devschile/chucao`, with React and Vue wrappers and a CDN bundle. This skill gives you rules for using the library; it does not install the library itself.
9
+
10
+ ## Rules
11
+
12
+ 1. **Use only allow-listed Chucao tags.** If a requested `ch-*` tag is absent, say it is not part of Chucao; do not emit it as markup. Offer a listed component or semantic HTML instead. Never invent props, slots, or events.
13
+ 2. **Use Chucao tokens through `var(--token-name)`.** Only use existing token names. Do not hardcode colors, spacing, type sizes, radii, shadows, or other values covered by tokens; do not copy a token's value into a fallback.
14
+ 3. **Use the documented events.** Custom events use the `ch` prefix and camel case, such as `chClick`, `chChange`, and `chInput`. Check which event the component actually emits and its `detail` shape. Use supported native-like props such as `disabled`, `required`, `name`, and `value` where applicable.
15
+ 4. **Give controls accessible names.** Pass `label` to `ch-modal`, `ch-drawer`, icon-only `ch-button`, `ch-icon-button`, `ch-input`, and `ch-select`. Keep overlay labels in sync with the visible title. Keep keyboard operation and visible focus; an unlabeled `ch-spinner` is deliberately decorative.
16
+ 5. **Respect Shadow DOM.** Use documented slots, CSS custom properties, or parts rather than reaching into shadow roots. Use the default slot only when the component exposes one.
17
+
18
+ For a simple card, start with the default slot and style its content with existing tokens:
19
+
20
+ ```html
21
+ <ch-card>
22
+ <div class="card-copy">
23
+ <h2>Account settings</h2>
24
+ <p>Manage your profile and preferences.</p>
25
+ </div>
26
+ </ch-card>
27
+ ```
28
+
29
+ ```css
30
+ .card-copy {
31
+ color: var(--color-text-primary);
32
+ padding: var(--spacing-md);
33
+ }
34
+ ```
35
+
36
+ ## Read only when needed
37
+
38
+ - Read [framework rules](references/framework-rules.md) only when setting up Chucao or writing framework bindings.
39
+ - Read [tokens](references/tokens.md) only when choosing or verifying design tokens.
40
+ - Read [accessibility](references/a11y.md) only when building forms, overlays, icon-only actions, or dynamic feedback.
41
+ - Read [common pitfalls](references/common-pitfalls.md) only when troubleshooting markup, events, state, or styles.
42
+ - Read the [component index](references/components.md) only when choosing a component or checking its public API.
43
+
44
+ ## Component allow-list
45
+
46
+ - `ch-accordion`
47
+ - `ch-alert`
48
+ - `ch-badge`
49
+ - `ch-button`
50
+ - `ch-card`
51
+ - `ch-checkbox`
52
+ - `ch-cluster`
53
+ - `ch-combobox`
54
+ - `ch-confirm-dialog`
55
+ - `ch-copy-button`
56
+ - `ch-description-list`
57
+ - `ch-divider`
58
+ - `ch-drawer`
59
+ - `ch-emoji`
60
+ - `ch-empty-state`
61
+ - `ch-file-upload`
62
+ - `ch-grid`
63
+ - `ch-icon`
64
+ - `ch-icon-button`
65
+ - `ch-input`
66
+ - `ch-link`
67
+ - `ch-menu`
68
+ - `ch-modal`
69
+ - `ch-number-input`
70
+ - `ch-otp-input`
71
+ - `ch-page-header`
72
+ - `ch-pagination`
73
+ - `ch-radio`
74
+ - `ch-segmented-control`
75
+ - `ch-select`
76
+ - `ch-skeleton`
77
+ - `ch-spinner`
78
+ - `ch-stack`
79
+ - `ch-stat`
80
+ - `ch-switch`
81
+ - `ch-table`
82
+ - `ch-tabs`
83
+ - `ch-textarea`
84
+ - `ch-timeline`
85
+ - `ch-toast`
86
+ - `ch-toast-region`
87
+ - `ch-tooltip`
package/package.json CHANGED
@@ -1,6 +1,19 @@
1
1
  {
2
2
  "name": "@devschile/chucao-skill",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "description": "Agent skill for building accessible UI with the Chucao design system",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/devschile/chucao.git",
9
+ "directory": "packages/chucao-skill"
10
+ },
11
+ "files": [
12
+ "SKILL.md",
13
+ "references/",
14
+ "README.md"
15
+ ],
16
+ "publishConfig": {
17
+ "access": "public"
18
+ }
6
19
  }
@@ -0,0 +1,9 @@
1
+ # Accessibility
2
+
3
+ - Give `ch-modal` and `ch-drawer` a meaningful `label` matching the visible heading or header. Do not assume an ID in a separate shadow root will provide the accessible name. Use the documented trigger pattern and verify focus returns to the trigger when the overlay closes.
4
+ - Give icon-only `ch-button` and `ch-icon-button` controls an action-oriented label. Do not rely on an icon, tooltip, or placeholder for the name.
5
+ - Pass visible labels to form controls such as `ch-input` and `ch-select`; use their documented error, disabled, and required props where appropriate. Do not add a separate interactive control inside one.
6
+ - Pass a `label` to `ch-segmented-control` to name the group. Preserve native keyboard behavior and visible focus; never use CSS to remove the only focus indicator.
7
+ - Leave `ch-spinner` unlabeled when decorative. Supply a label if the loading status itself needs to be announced.
8
+
9
+ See the [component conventions](https://devschile.github.io/chucao/docs/components.md) for the full accessible-name contract.
@@ -0,0 +1,7 @@
1
+ # Common pitfalls
2
+
3
+ - **Invented API:** An unlisted tag is not a Chucao component. Say so, then fall back to a real component or semantic HTML. Check the linked component README for the exact prop, event, or slot name.
4
+ - **Wrong event:** Do not treat all components as native controls or assume all emit the same `detail`. For example, `ch-button` emits `chClick`, while `ch-combobox` emits `chFilter` for queries and `chChange` for committed values.
5
+ - **Incorrect form wiring:** Put `name` and `value` on the form-associated custom element where supported. Submit with `FormData` and confirm the browser sends the documented value shape.
6
+ - **Slots and shadow styling:** Check each README for supported slots. For example, `ch-table` totals use native `<tr>` rows in its `footer` slot. Do not reach into shadow roots or copy token values into CSS.
7
+ - **Wrong input type:** Use the component's documented property for typed inputs. For instance, set `ch-combobox` options as an array via a property, not a string attribute.
@@ -0,0 +1,58 @@
1
+ # Components
2
+
3
+ Open the linked generated README for the component you use to confirm the current props, events, methods, and slots.
4
+
5
+ ## Easy-to-miss API details
6
+
7
+ - `ch-card` is a container with a default slot; use native headings and other content inside it.
8
+ - `ch-combobox` takes `options` as a property. The committed `value` is a string in single mode and a string array with `multiple`; `chFilter` is not a commit.
9
+ - `ch-number-input` presents formatted numbers but exposes the canonical value. Read the component's submission rules instead of parsing visible text.
10
+ - `ch-modal` needs a `label` matching its visible heading. Wire an external button to the modal's `open` property and set `close-label` to include a close button.
11
+ - `ch-file-upload` is not form-associated. Keep the accepted `File[]` from `chChange` and append the files when building the submission.
12
+ - `ch-table` accepts totals in the `footer` slot and rich column headings in `header-<column-key>` slots. Keep each column's `label` for accessibility.
13
+ - `ch-toast` notifications live in a `ch-toast-region`; do not invent an imperative global API.
14
+
15
+ ## Component index
16
+
17
+ - [`ch-accordion`](https://devschile.github.io/chucao/components/ch-accordion/): Collapsible content sections
18
+ - [`ch-alert`](https://devschile.github.io/chucao/components/ch-alert/): Status messages (default, positive, warning)
19
+ - [`ch-badge`](https://devschile.github.io/chucao/components/ch-badge/): Small status indicators
20
+ - [`ch-button`](https://devschile.github.io/chucao/components/ch-button/): Interactive button
21
+ - [`ch-card`](https://devschile.github.io/chucao/components/ch-card/): Content container
22
+ - [`ch-checkbox`](https://devschile.github.io/chucao/components/ch-checkbox/): Checkbox input
23
+ - [`ch-cluster`](https://devschile.github.io/chucao/components/ch-cluster/): Horizontal wrapping flow
24
+ - [`ch-combobox`](https://devschile.github.io/chucao/components/ch-combobox/): Filterable picker, single or multiple
25
+ - [`ch-confirm-dialog`](https://devschile.github.io/chucao/components/ch-confirm-dialog/): Confirmation over `ch-modal`, one outcome
26
+ - [`ch-copy-button`](https://devschile.github.io/chucao/components/ch-copy-button/): Copies `value` to the clipboard
27
+ - [`ch-description-list`](https://devschile.github.io/chucao/components/ch-description-list/): Label/value pairs on a native `<dl>`
28
+ - [`ch-divider`](https://devschile.github.io/chucao/components/ch-divider/): Visual separator
29
+ - [`ch-drawer`](https://devschile.github.io/chucao/components/ch-drawer/): Sliding side panel
30
+ - [`ch-emoji`](https://devschile.github.io/chucao/components/ch-emoji/): Inline emoji from the devsChile CDN
31
+ - [`ch-empty-state`](https://devschile.github.io/chucao/components/ch-empty-state/): Empty / no-results block
32
+ - [`ch-file-upload`](https://devschile.github.io/chucao/components/ch-file-upload/): File picker with drag & drop zone
33
+ - [`ch-grid`](https://devschile.github.io/chucao/components/ch-grid/): Responsive equal-cell grid
34
+ - [`ch-icon`](https://devschile.github.io/chucao/components/ch-icon/): Single Lucide glyph
35
+ - [`ch-icon-button`](https://devschile.github.io/chucao/components/ch-icon-button/): Icon-only button, label required
36
+ - [`ch-input`](https://devschile.github.io/chucao/components/ch-input/): Text input field
37
+ - [`ch-link`](https://devschile.github.io/chucao/components/ch-link/): Hyperlink
38
+ - [`ch-menu`](https://devschile.github.io/chucao/components/ch-menu/): Action menu behind a trigger
39
+ - [`ch-modal`](https://devschile.github.io/chucao/components/ch-modal/): Dialog overlay
40
+ - [`ch-number-input`](https://devschile.github.io/chucao/components/ch-number-input/): Numeric input with canonical value (CLP)
41
+ - [`ch-otp-input`](https://devschile.github.io/chucao/components/ch-otp-input/): One-time code input, single field
42
+ - [`ch-page-header`](https://devschile.github.io/chucao/components/ch-page-header/): Page title, description and actions
43
+ - [`ch-pagination`](https://devschile.github.io/chucao/components/ch-pagination/): Controlled pager: prev/next and range
44
+ - [`ch-radio`](https://devschile.github.io/chucao/components/ch-radio/): Radio button
45
+ - [`ch-segmented-control`](https://devschile.github.io/chucao/components/ch-segmented-control/): Compact segmented selector
46
+ - [`ch-select`](https://devschile.github.io/chucao/components/ch-select/): Dropdown select
47
+ - [`ch-skeleton`](https://devschile.github.io/chucao/components/ch-skeleton/): Loading placeholder
48
+ - [`ch-spinner`](https://devschile.github.io/chucao/components/ch-spinner/): Loading indicator
49
+ - [`ch-stack`](https://devschile.github.io/chucao/components/ch-stack/): Vertical flow
50
+ - [`ch-stat`](https://devschile.github.io/chucao/components/ch-stat/): Dashboard metric with a tonal sign cue
51
+ - [`ch-switch`](https://devschile.github.io/chucao/components/ch-switch/): Toggle switch
52
+ - [`ch-table`](https://devschile.github.io/chucao/components/ch-table/): Data grid over a native `<table>`
53
+ - [`ch-tabs`](https://devschile.github.io/chucao/components/ch-tabs/): Tabbed interface
54
+ - [`ch-textarea`](https://devschile.github.io/chucao/components/ch-textarea/): Multiline text input
55
+ - [`ch-timeline`](https://devschile.github.io/chucao/components/ch-timeline/): Chronological history on a native `<ol>`
56
+ - [`ch-toast`](https://devschile.github.io/chucao/components/ch-toast/): Transient notification, lives in a region
57
+ - [`ch-toast-region`](https://devschile.github.io/chucao/components/ch-toast-region/): Fixed mount point for `ch-toast`
58
+ - [`ch-tooltip`](https://devschile.github.io/chucao/components/ch-tooltip/): Contextual help text
@@ -0,0 +1,8 @@
1
+ # Framework rules
2
+
3
+ - **Vanilla HTML:** Load the Chucao CDN module or import `@devschile/chucao/dist/chucao/chucao.esm.js` from the installed package. Use `ch-*` elements in markup. Set arrays and objects as JavaScript properties rather than string attributes, and subscribe with `addEventListener('chChange', handler)` when that is the event the component emits.
4
+ - **React:** Import named wrappers such as `ChButton` from `@devschile/chucao/react`. Use the wrapper's typed props and event handlers (for example, `onChClick` for `ChButton`). Pass structured props as values, not JSON.
5
+ - **Vue:** Import named wrappers such as `ChButton` from `@devschile/chucao/vue`. Use bound props for JavaScript values and component listeners such as `@chClick` in SFC templates. Check the wrapper API before assuming a component supports `v-model`.
6
+ - **Svelte:** Register the elements before use. Use the custom-element property and event conventions of the project's Svelte version; do not use the React or Vue wrappers.
7
+
8
+ See the [library integration guide](https://devschile.github.io/chucao/docs/using-the-library.md) for imports, registration, and framework-specific SSR setup.
@@ -0,0 +1,76 @@
1
+ # Design tokens
2
+
3
+ Use `var(--token-name)` with a real token. Prefer by role: for example, `var(--color-text-primary)` for primary copy, `var(--color-surface-default)` for an ordinary surface, and `var(--spacing-md)` for spacing. Do not manufacture derived names or copy default-theme values. Keep the same token names when switching themes.
4
+
5
+ The names below come from Chucao's generated CSS. See the [token documentation](https://devschile.github.io/chucao/tokens/README.md) for their intended roles.
6
+
7
+ ## Available tokens
8
+
9
+ - `--border-accent-bar`
10
+ - `--border-width`
11
+ - `--color-accent-default`
12
+ - `--color-accent-hover`
13
+ - `--color-accent-text`
14
+ - `--color-background-base`
15
+ - `--color-background-bottom-glow`
16
+ - `--color-background-top-glow`
17
+ - `--color-border-default`
18
+ - `--color-border-hover`
19
+ - `--color-brand-huemul-dark`
20
+ - `--color-brand-huemul-light`
21
+ - `--color-brand-stroke`
22
+ - `--color-scrim-default`
23
+ - `--color-status-positive`
24
+ - `--color-status-positive-background`
25
+ - `--color-status-warning`
26
+ - `--color-status-warning-background`
27
+ - `--color-surface-default`
28
+ - `--color-surface-hover`
29
+ - `--color-text-primary`
30
+ - `--color-text-secondary`
31
+ - `--duration-fast`
32
+ - `--duration-normal`
33
+ - `--duration-spin`
34
+ - `--easing-default`
35
+ - `--easing-linear`
36
+ - `--effect-blur`
37
+ - `--focus-outline-offset`
38
+ - `--focus-outline-width`
39
+ - `--icon-size-lg`
40
+ - `--icon-size-md`
41
+ - `--icon-size-sm`
42
+ - `--icon-stroke`
43
+ - `--layout-max-width`
44
+ - `--opacity-disabled`
45
+ - `--radius-md`
46
+ - `--radius-pill`
47
+ - `--radius-sm`
48
+ - `--shadow-card-hover`
49
+ - `--shadow-focus-ring`
50
+ - `--spacing-2xl`
51
+ - `--spacing-2xs`
52
+ - `--spacing-3xl`
53
+ - `--spacing-4xl`
54
+ - `--spacing-5xl`
55
+ - `--spacing-6xl`
56
+ - `--spacing-elevate`
57
+ - `--spacing-lg`
58
+ - `--spacing-md`
59
+ - `--spacing-shift`
60
+ - `--spacing-sm`
61
+ - `--spacing-xl`
62
+ - `--spacing-xs`
63
+ - `--typography-body`
64
+ - `--typography-heading`
65
+ - `--typography-size-lg`
66
+ - `--typography-size-md`
67
+ - `--typography-size-sm`
68
+ - `--typography-size-xl`
69
+ - `--typography-size-xs`
70
+ - `--typography-tracking-badge`
71
+ - `--typography-weight-bold`
72
+ - `--typography-weight-regular`
73
+ - `--typography-weight-semibold`
74
+ - `--z-index-base`
75
+ - `--z-index-dropdown`
76
+ - `--z-index-modal`