ux · rainmanjam — скилл для Claude Code: порядок в коде интерфейса
Помогает агенту разложить экран на компоненты, определить владельца состояния и не смешивать вёрстку с бизнес-правилами.
npx skills add rainmanjam/poka-yoke --skill ux -a claude-codeЧто делает ux
Скилл задаёт агенту рамку для работы с формами, экранами и потоками в коде. Каждое новое требование к интерфейсу приходит формулировкой «и ещё, когда пользователь делает X» — так один компонент обрастает загрузкой данных, валидацией, форматированием, отправкой и показом ошибок. Скилл требует сначала назвать границы компонентов и типы пропсов, а уже потом писать код.
Внутри четыре правила и список того, чего избегать. У каждого куска состояния должен быть один владелец: если значение меняют два компонента, они разойдутся, причём нерегулярно. Вычисляемое не хранят рядом с исходным. Состояние сервера и состояние формы живут раздельно, потому что у них разный срок жизни. Компонент, который и загружает, и рисует, нельзя проверить и переиспользовать с другими данными.
Скилл требует явно перечислить не-успешные состояния экрана: загрузку (в том числе повторную поверх уже показанного), пустоту, ошибку с действием для пользователя и частичные данные. Если всё это лежит ветками внутри одного рендера, компонент делает пять вещей сразу. Бизнес-правило вроде применимости скидки выносится в функцию, которую тестируют без рендера. Отдельно оговорено, что цвета и отступы в структурном ревью не обсуждают.
Какие задачи решает
- разложить экран на компоненты с понятными пропсами
- решить, где хранится каждый кусок состояния формы
- убрать дублирующее вычисление суммы рядом со списком товаров
- показать пустой и частичный результат отдельно от ошибки
- вынести проверку условий скидки из разметки в тестируемую функцию
Примеры запросов агенту
- Помоги разложить компонент
CheckoutFormна части и назови типы пропсов. - Пересмотри
Cart: где здесь владелец состояния и что можно вычислять вместо хранения? - Пройдись по
OrderScreenи перечисли, какие не-успешные состояния у него не обработаны.
Как установить ux
1Через Skills CLI (Vercel)
npx skills add rainmanjam/poka-yoke --skill ux -a claude-code2Вручную: положить файлы
~/.claude/skills/ux/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/ux/
1Через Skills CLI (Vercel)
npx skills add rainmanjam/poka-yoke --skill ux -a codex2Вручную: положить файлы
.agents/skills/ux/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add rainmanjam/poka-yoke --skill ux -a cursor2Вручную: положить файлы
.cursor/skills/ux/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install rainmanjam/poka-yoke ux2Вручную: положить файлы
.github/skills/ux/SKILL.md1Через Skills CLI (Vercel)
npx skills add rainmanjam/poka-yoke --skill ux -a gemini-cli2Командой платформы
gemini skills install https://github.com/rainmanjam/poka-yoke --path benchmarks/controls/clean-code/skills/uxВручную: положить файлы
.devin/skills/ux/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add rainmanjam/poka-yoke --skill ux -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о ux
Как установить скилл ux в Claude Code?
Выполните npx skills add rainmanjam/poka-yoke --skill ux -a claude-code. Файл скилла окажется по пути ~/.claude/skills/ux/SKILL.md.
Что делает ux?
Задаёт агенту правила структуры кода интерфейса: границы компонентов, владение состоянием, разделение загрузки данных и отображения. Ещё требует обрабатывать пустое, частичное и загружающееся состояние экрана.
Для каких платформ подходит этот скилл?
Его можно поставить в Claude, Codex, Cursor, GitHub Copilot, Gemini CLI и OpenCode — для каждой платформы своя команда установки и свой путь к файлу.
Исходный текст
SKILL.md · MIT
--- name: ux description: >- Forms, flows and screens. Structure, naming and clarity of user-facing interaction code: component boundaries, state ownership, and keeping presentation separable from the rules behind it. --- # UX: Structuring Interaction Code Interface code accumulates faster than any other kind, because every requirement arrives as "and also, when the user does X". Without structure a screen becomes one component holding fetching, validation, formatting, submission and error display, and every change risks all of them. The discipline is ordinary: single responsibility, explicit state ownership, and names that survive being read alone. What is different is that the pressure to skip it is higher, because interface code is visible and the deadline is usually visual. ## Decide where state lives, once Most interface bugs are state-ownership bugs wearing other clothes. **One owner per piece of state.** If two components can both change a value, they will disagree, and the disagreement will be intermittent. Lift the state to the nearest common parent and pass it down, or move it out of the tree entirely. **Derive rather than duplicate.** A `total` stored alongside the `items` it sums is two facts that must agree. Compute it. If computing it is expensive, memoise the computation rather than storing a second copy. **Keep server state and form state distinct.** What the server last said and what the user has typed are different things with different lifetimes. Conflating them is why "the form reset itself" bugs are so hard to reproduce. **Name state for what it is, not what it shows.** `isSubmitting` is a fact. `showSpinner` is a consequence, and it will eventually need to be true for a second reason. ## Split components along seams that will move **By responsibility, not by size.** A 400-line component that renders one coherent thing is easier to work with than four components passing state between them. **Separate what fetches from what displays.** A component that both loads and renders cannot be previewed, tested, or reused with different data. Take data as props; let a parent decide where it came from. **Keep the rules out of the markup.** Whether a discount applies is a business question with a right answer that does not depend on React. It should be a function you can test without rendering. **Push formatting to the edge.** Currency, dates and pluralisation are presentation. Keep the underlying values unformatted until the moment they are shown, or you will parse your own output later. ## Handle the states that are not "success" Every screen that loads has at least four states, and most code writes one. - **Loading**, including a second load over existing content, which is a different visual case - **Empty**, which is not an error and should not look like one - **Error**, with something the user can act on - **Partial**, where some of the data arrived If those live as branches inside one render, the component is doing five things. A small discriminated union describing the state, matched once, keeps them separable and makes it obvious when one is missing. ## What good output looks like - **Show the component boundary and the prop types.** Most of the design is visible from the signature. - **Say where each piece of state lives and why.** Ownership is the decision worth recording. - **Cover the non-success states explicitly**, or say which are out of scope. - **Point at specific components.** "The table" is not reviewable. ## What to avoid **Prop drilling as a default.** Passing a value through four components that do not use it couples all four. Either lift it out of the tree or restructure so the intermediate layers do not exist. **Premature component extraction.** Splitting a component that has one caller, to "keep files small", adds a hop with no benefit. Wait for the second use. **Effects that synchronise state.** An effect that copies one piece of state into another is almost always a derivation that should have been computed. **Styling decisions in a structural review.** Spacing and colour are real work and a different conversation. Mixing them in means the structural comments get skimmed.
© rainmanjam · MIT · rainmanjam/poka-yoke
Похожие скиллы
Все скиллы по теме «Фронтенд и UI» →Сначала — ux от других авторов.