ui-sdk
Builds interfaces with ui-sdk in React, Vue, Svelte, Solid or web components. Covers choosing and composing its components, building a component or behavior it doesn't ship from @ui-sdk/core (like a stepper, splitter, transfer list or emoji picker), making the interface usable by agents through createAgent, agent tools and WebMCP, and testing keyboard, focus, ARIA, server rendering and right to left, including writing tests for an existing component. Use whenever a project has @ui-sdk/* installed or the user mentions ui-sdk.
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 3
- Forks
- 0
01 前言 Front Matter
- name
- ui-sdk
- description
- Builds interfaces with ui-sdk in React, Vue, Svelte, Solid or web components. Covers choosing and composing its components, building a component or behavior it doesn't ship from @ui-sdk/core (like a stepper, splitter, transfer list or emoji picker), making the interface usable by agents through createAgent, agent tools and WebMCP, and testing keyboard, focus, ARIA, server rendering and right to left, including writing tests for an existing component. Use whenever a project has @ui-sdk/* installed or the user mentions ui-sdk.
02 资源文件 7
- 参考文档references/agent-ready.md11.9 KB
- 参考文档references/build-interface.md14.5 KB
- 参考文档references/create-component.md11.6 KB
- 参考文档references/patterns.md9.3 KB
- 参考文档references/styles.md6.9 KB
- 参考文档references/testing.md9.6 KB
- 参考文档references/web-components.md4.5 KB
03 SKILL.md 正文
Build with ui-sdk
ui-sdk is a library of UI behaviors: keyboard navigation, focus, selection, dismissal, popups, drag and drop and the ARIA they need. Its components are built from those behaviors and render no styles of their own, in React, Vue, Svelte, Solid and web components. @ui-sdk/core/web.css gives them an optional default look. When a component is missing, you build it from the same behaviors in @ui-sdk/core, and it gets the same keyboard, focus, server rendering and right to left support.
Read first
The docs for the installed version ship in each package, as Markdown:
node_modules/@ui-sdk/<framework>/docs/llms.txtis the index. Read it first.<framework>isreact,vue,svelte,solidorweb.- Then read only the pages your task needs, like
docs/components/select.md. Don't read the wholedocs/folder; it's large. - An interface built from our components doesn't need
docs/core.md. Only path 2 below does, and even then you search it by heading: it's over 300 KB.docs/rendering.mdsits next to it in the samedocs/folder. - Don't read compiled JavaScript in
dist/*.js, even to debug. The docs and the.d.tstypes are the API; when they don't answer, write a small test that tries it.
The same docs are online at https://ui-sdk.dev/docs. Prefer the installed copy: it matches the version in the project.
A page with no build step, like an Artifact, installs nothing: it loads https://ui-sdk.dev/web.js and web.css with two tags. Read https://ui-sdk.dev/web.md instead of llms.txt. It's the web components docs in one file, for that page, and references/web-components.md has the rest.
Otherwise, if no @ui-sdk package is installed yet, install @ui-sdk/core and the framework's package with the project's package manager.
Pick your path
- Build an interface from our components, like a settings page, a form or a command palette: read references/build-interface.md.
- Build a component or behavior ui-sdk doesn't ship, or extend one of ours: read references/create-component.md.
Most interfaces only need path 1. When one part of it needs a component we don't have, follow path 2 for that part.
Every path ends the same way:
- Make it agent-ready: references/agent-ready.md.
- Test it: references/testing.md.
Rules for every path
- Import from entries. Each component has its own entry, like
@ui-sdk/react/select. There's no root import from a framework package. Never import@ui-sdk/core/internal/*. - One shape everywhere. A root and its parts, nested as the component page's Composition shows. Change a part's element with
render, never anasprop. - Default or controlled.
defaultValueto start, orvaluewithonValueChange(value, details)to control it (each framework's idiom:v-modelin Vue,bind:valuein Svelte, properties and events in web components).detailshasreason,sourceandcancel(). - Name every control. Use the component's label part (
FieldLabel,SelectLabel,DialogTitle), oraria-labelwhen there's no visible text. People using screen readers and agents both find controls by name. - Style from state. Target
data-slotand state attributes likedata-openordata-pressed, and the CSS variables each component lists. Never inline styles for state, and never generated ids. When the app usesweb.css, read references/styles.md first: it draws icons and sets sizes you can't see in the markup. - Declare the ui-sdk layer. Put
@layer ui-sdk;at the top of the global stylesheet, above@import "tailwindcss"if there is one. - Check color. Text needs 4.5:1 against what's behind it, and control edges, focus rings and state fills 3:1. jsdom can't see color, so check it in a real browser.
- Key lists by value or id, never by index.
- Right to left needs no provider. Components read the direction from the page.
- Comments are rare. Write one only when a reader would get the code wrong without it, like a browser quirk or a trade-off, in one or two lines. Never comment what the code does, what a value is, or which section starts here, and no JSDoc blocks on app code.
- Don't hand-roll what we ship. Before you write any
role=attribute, look for the component in the table in references/build-interface.md. Adivwithrole="listbox","menu","dialog","tablist","separator","switch","slider","radiogroup","toolbar"or"tree"next to an installed ui-sdk package is almost always a bug.
When you're done
- Typecheck. If the root
tsconfig.jsonhas"files": []andreferences,npx tsc --noEmitchecks nothing: runnpx tsc -bornpx tsc --noEmit -p <app config>. For Svelte, runsvelte-check; for Vue,vue-tsc. - Write and run tests (see testing.md). Every task gets tests, and every interface gets at least the agent test from agent-ready.md. If a test finds a bug in code you were asked only to test, mark it
test.fails(orit.fails) with a one-line reason, report the bug, and leave the suite green. - Read every comment in your diff. Delete it unless it names a browser quirk, an APG rule or a trade-off, and cut what's left to two lines. Turn JSDoc on app code into a plain comment or delete it. Never tell the reader to replace something.
- Report each command you ran with its exit code, anything you couldn't check, and anything the docs or types got wrong or left out.
04 同仓库更多 Skills
pika-relay
Talk to Pi agents and other Codex threads through pika relay, and stand by for their requests. Use when a [relay] message arrives, when the user asks to message, list, or coordinate with other agents or Pi sessions, or when asked to stand by on pika relay.
impeccable
Use when the user wants to design, redesign, shape, critique, audit, polish, simplify, harden, animate, or otherwise improve a frontend interface: websites, landing pages, dashboards, product UI, components, forms, settings, onboarding, empty states, and native iOS or Android screens. Handles UX review, hierarchy, layout, typography, color, motion, UX copy, accessibility, responsive behavior, edge cases, and capturing or documenting design systems (DESIGN.md, tokens). Also for making bland UI bolder, loud UI quieter, or ambitious visual effects. Not for backend-only or non-UI tasks.
herder-simplify
Survey a codebase, read-only, for evidence-backed opportunities to delete or consolidate code, retire obsolete paths and abstractions, reduce state and control-flow complexity, and lower maintenance burden without changing required behavior; then let the user pick findings and start a Herder run for them. Use after /herder-simplify or when asked for a smaller, clearer, easier-to-maintain codebase with the work run by Herder.
herder-improve
Survey a codebase as a senior advisor, read-only, and present prioritized, verified findings - bugs, security, performance, tests, architecture, dependencies, tooling, docs, and evidence-backed direction - then let the user pick findings and start a Herder run for them. Use after /herder-improve or when asked to audit code or find improvement opportunities to hand to Herder.
herder
Runs coding work as a durable, verified Herder run - an approved goal with checks, agent steps in isolated git worktrees, serial integration, runtime verification, and delivery after user confirmation. Use after /herder or /herder resume, or when a Herder run is active and you need to plan, orchestrate, verify, or deliver it.
agent-browser
Browser automation and web testing for AI agents using agent-browser (Chrome/Chromium CDP, accessibility-tree snapshots with @eN element refs, inline screenshots, and isolated sessions). Use when the user wants to open a website, test a web app, inspect UI, click buttons, fill forms, take screenshots, scrape data, or run exploratory QA.