ui
AGENTS.md4.8k starsChanged 17 days agoApache-2.0View on GitHub
ui-sdk is a TypeScript library of UI behaviors for building interfaces. It isn't a component library. It's the layer underneath one: keyboard navigation, focus, selection, dismissal, popups, drag and drop and the ARIA they need, as small functions you combine in @ui-sdk/core. Component libraries cover familiar patterns like menus, dialogs and tabs. Real products also need things nobody ships: a kanban board, a timeline you can scrub, a picker made for one task. Agents can now generate those interfaces, but…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,439 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository7 other files it gives its agents.
- apps/docs/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- ui-sdk-expert-reviewSkill
- ui-sdk-unslopSkill
- ui-sdk-write-codeSkill
- ui-sdk-write-docsSkill
- ui-sdkSkill
The file
We split this AGENTS.md into the rules it gives an agent
6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Primitives: put one component's options, state, behaviors and parts together in a single definition (definePrimitive), with no styles.
- Very specific: line 31
One shape everywhere: Every component follows the same composable shape, with the same contract in every framework.
- Distinctive: line 32
Discuss first: before changing a public API's name or shape, adding a component or a dependency, or changing a principle.
- Distinctive: line 36
Finish with unslop: Write code with ui-sdk-write-code, and run ui-sdk-unslop on your diff before you commit.
- Distinctive: line 38
Docs: When writing or reviewing website docs, use ui-sdk-write-docs.
- Very specific: line 39
Tests: Every server command sets its own port.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
ui-sdk
ui-sdk is a TypeScript library of UI behaviors for building interfaces. It isn't a component library. It's the layer underneath one: keyboard navigation, focus, selection, dismissal, popups, drag and drop and the ARIA they need, as small functions you combine in @ui-sdk/core.
How it fits together
- Behaviors are the building blocks. Each is one thing an interface does, like moving focus with the arrow keys (
createRovingFocus). - Primitives put one component's options, state, behaviors and parts together in a single definition (
definePrimitive), with no styles. - Adapters render a primitive in React, Vue, Svelte, Solid and web components, with the same names everywhere (
createParts). You write the markup and styles. State shows up as data attributes and CSS variables. - Checking.
@ui-sdk/core/testingchecks the result against its WAI-ARIA pattern, in right to left and on the server. - Agents can operate a finished interface through
@ui-sdk/core/agent(snapshot,act).
Why we're building it
Component libraries cover familiar patterns like menus, dialogs and tabs. Real products also need things nobody ships: a kanban board, a timeline you can scrub, a picker made for one task. Agents can now generate those interfaces, but each time they rebuild focus, arrow keys and screen reader support from scratch, and they get it subtly wrong. ui-sdk gives people and their agents tested behaviors to build any component on, and a way to check the result.
Principles
- No runtime dependencies.
- Works with SSR and before hydration. Right to left works without a provider. Popups work without portals.
- Small, predictable APIs with one shape across components and frameworks, so a model writes them correctly in few tokens.
Read first
- contributing/README.md: the repo, where things stand and how we work, with links to the architecture, the API guide, the code standard, the pitfalls and the docs site.
- tests/README.md: every kind of test and the exact command.
Rules
- Zero runtime dependencies in shipped packages. Behavior lives in core; adapters stay generic.
- One shape everywhere. Every component follows the same composable shape, with the same contract in every framework. A part changes its element through
render, never anasprop. - Discuss first before changing a public API's name or shape, adding a component or a dependency, or changing a principle.
- Commits are conventional, with a lowercase subject.
- Code follows contributing/code.md: no return type annotations, inline types, named exports listed at the end of each file.
pnpm lintandpnpm formatcheck what they can;pnpm format:writefixes formatting. - Comments are rare. Write none unless a reader would get the code wrong without it: a browser bug, an APG rule, a trade-off. Three lines at most, ending in a period. Never say what the code does, what a value is or how the pieces connect.
pnpm lintchecks the length. - Finish with unslop. Write code with ui-sdk-write-code, and run ui-sdk-unslop on your diff before you commit.
- Examples have no comments, and follow contributing/examples.md.
- Docs. When writing or reviewing website docs, use ui-sdk-write-docs. Writing Website Docs records the current style; the docs-site guide covers the implementation.
- Tests. Every server command sets its own port. Run tests through
scripts/test-slot.sh. Check exit codes, not grep output. Run the specs for what you touched (pnpm test:pr), and rerun only what failed.
Skills
.agents/skills/holds the skills for working on ui-sdk:ui-sdk-write-code,ui-sdk-write-docs,ui-sdk-unslopandui-sdk-expert-review. Its README says when to use each. Plain Markdown, usable from any harness: readSKILL.mdand follow it.packages/core/skills/ui-sdkships inside@ui-sdk/coreto people building their own components on it.skills.sh.jsonpointsnpx skills add vercel-labs/uiat that folder. The skills in.agents/skills/are markedinternal, so it doesn't offer them.
Framework experts
One expert per framework in .agents/experts/<framework>/ (react, vue, svelte, solid, web): who it is in expert.md, what it knows in knowledge.md and what's already decided in decisions.md. Claude Code also loads each one as a named subagent from .claude/agents/<framework>-expert.md. Ask one any question about its framework, or ask it to review code. Before merging a change to an adapter, core, the specs, examples or framework docs, run ui-sdk-expert-review on it; node scripts/expert-scope.mjs shows which experts it reaches.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

