ui-sdk-write-code
БесплатноБез исполняемых скриптовНе проверенWrites and edits ui-sdk code (core, the React, Vue, Svelte, Solid, web component and Angular adapters, examples, specs and scripts) the way an expert in that…
от vercel-labs★ 8 234 звезды на GitHubОб этом скилле
Write ui-sdk code
The bar: an expert in the framework reads the file and says "this is how I'd write it", and anyone else reads it top to bottom without stopping. Readable first, then fast, never clever.
1. Find the twin
Every piece of code here has a twin that already does it well. Open it before you write a line, and copy its shape, names and order.
| You're writing | Start from |
|---|---|
| A core component | packages/core/src/components/tabs/tabs.ts, or menu/ once it passes about 400 lines (menu.ts, menu-api.ts, menu-parts.ts) |
| A popup | packages/core/src/components/popover/popover.ts and its adapters, on createPopup in foundation/popups/ |
| A React, Vue or Solid part | The same component's file in packages/<framework>/src/, on createParts |
| A Svelte part | packages/svelte/src/tabs/ |
| A web component | packages/web/src/tabs.ts, on createParts |
| An Angular part | packages/angular/src/tabs.ts, on usePrimitive and usePart |
| An example | The same example in another framework: examples/components/<name>/<framework>/ |
| A spec | tests/specs/tabs*.spec.ts |
If two twins disagree, the shape is wrong in one of them. Say so instead of picking one.
Copy a twin's shape, not its comments. Older files carry more comments than the rules below allow.
2. Load the framework
Read the expert's knowledge file for every framework you touch: .agents/experts/<framework>/knowledge.md, part 1 and "Common mistakes to flag", and its decisions.md. It's pinned to the versions this repo installs, so trust it over memory. Write in the current idiom of that version:
- React 19: pure render, no
forwardRef,refas a prop, no effect where an event handler or a derived value belongs, code the React Compiler compiles without a bailout. - Vue 3.5:
<script setup lang="ts">,v-modelon parts,defineModelwhen a component you write takes one, typeddefinePropsanddefineSlots, no options API. - Svelte 5: runes only (
$state,$derived,$props,$bindable), snippets,onclickattributes, attachments. No$:,on:,<slot>orcreateEventDispatcher. Props typed with aninterface Props. Outsidepackages/svelte, declaration tags ({const x = $derived(...)}) instead of{@const}. - Solid 2: props read where they're used, never destructured; derive with memos, not effects; Solid 2 APIs only.
- Web components: platform first. Options reflect as attributes the way built-ins do, public events are
composedand don't bubble (listen with{ capture: true }), and the user's markup stays in light DOM. - Angular 21: standalone directives, signal
input()andoutput(),inject()in field initializers,computedovereffect,@ifand@forin templates, DOM reads after render. No@Input(),EventEmitter,NgModuleor*ngIf.
3. Write it
The rules in contributing/code.md hold everywhere. The ones that make code look generated when missed:
- One shape.
<Name>root,<Name><Part>per slot,renderto change the element, neveras. Same names and the same props in every framework. - Names in full words that say what a thing is. Booleans read as questions.
- Exports listed once at the end. Inline types. No return type annotations.
- No comment by default. Write one only when a reader would get the code wrong without it: a browser bug, an APG rule, a trade-off. One to three lines. Never a comment per declaration, and never one that explains the design or the data flow. Examples have none.
- No defensive code for cases that can't happen. Types already rule them out.
- No helper for one caller, and no wrapper that only renames.
- Behavior lives in core. An adapter that grows a listener, a focus call or an
aria-*attribute is in the wrong layer.
4. Check it
Run each and check the exit code, not the output:
pnpm lint
pnpm format
pnpm typecheck
pnpm --filter <package> test
pnpm --filter examples build # when you touched examples
pnpm test:pr # the specs your change reaches
Then run each framework's
Установить ui-sdk-write-code в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл ui-sdk-write-code?
Writes and edits ui-sdk code (core, the React, Vue, Svelte, Solid, web component and Angular adapters, examples, specs and scripts) the way an expert in that framework would, then checks it with the linters, the framework expert's checklist and a cold read. Use whenever you write or change code in this repo, before you call the change done.
Как установить скилл ui-sdk-write-code?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл ui-sdk-write-code запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic