К основному содержанию
скилл Claude Code CX Codex Cursor GitHub Copilot

state-machine — скилл для Claude Code: состояния компонента

Создаёт временную страницу со всеми достижимыми состояниями одного компонента, мок-данными и переключателем. Нужен для правки визуальных состояний без изменений в самом компоненте.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add jakubkrehel/skills --skill state-machine -a claude-code
Открыть на GitHub

Что делает state-machine

Скилл берёт один компонент и выводит его на временный маршруте во всех ветках, которые уже есть в коде: загрузка, пустые данные, ошибка, роли, права, флаги или лимиты. Для каждого режима он подаёт мок-данные, а переключатель меняет параметр __state в URL. Это строгий режим: состояния, которых код не умеет показать, он не добавляет.

Страница импортирует настоящий компонент и наследует существующие layout, шрифты, стили и провайдеры приложения. Данные нужно подать на границе, где компонент их получает: через props, кэш запросов, мок-провайдер или механизм моков проекта. Если в Next есть разделение серверных и клиентских компонентов, временная страница должна быть клиентской с "use client", иначе фикстуры могут исчезнуть.

Скилл проверяет в браузере каждый режим и убеждается, что отображаются моки, а не реальные данные или пустая область. После работы папку страницы и согласованные изменения можно удалить одним действием; затем он ищет в коде имена маршрута и фикстур.

Какие задачи решает

  • показать загрузку, ошибку и пустые данные компонента
  • переключать роли и уровни доступа на одной странице
  • проверить длинный список со скроллом или пагинацией
  • отделить мок-данные от реальных запросов
  • удалить временный маршрут вместе с фикстурами

Примеры запросов агенту

  • Создай страницу состояний для компонента audit log table.
  • Покажи все достижимые состояния billing card с мок-данными и переключателем.
  • Собери временный маршрут для network panel, не меняя сам компонент.

Как установить state-machine

1Через Skills CLI (Vercel)

npx skills add jakubkrehel/skills --skill state-machine -a claude-code

2Вручную: положить файлы

~/.claude/skills/state-machine/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/state-machine/

Из того же набора13

Весь набор →
better-ui jakubkrehel Скилл задаёт точные правила для радиусов, теней, иконок и анимаций интерфейса. Пригодится, когда базовые взаимодействия уже работают и нужна визуальная доводка. Claude Code CX Codex Cursor +1 38 900установок better-typography jakubkrehel Проверяет типографику интерфейса и предлагает правки в системе стилей проекта. Пригодится, когда нужно привести текст, переносы и пунктуацию к правилам дизайна. Claude Code CX Codex Cursor +1 33 800установок better-colors jakubkrehel Скилл проверяет палитры и строит систему цветовых токенов. Он нужен, когда в коде накопились случайные hex-значения, а контраст текста никто не считал. Claude Code CX Codex Cursor +1 32 200установок better-layout jakubkrehel Скилл проверяет и правит группировку, выравнивание, порядок чтения и адаптивную структуру макета, а потом ломает её ресайзом, переводом и зеркалированием под RTL. Claude Code CX Codex Cursor +1 30 400установок better-interface jakubkrehel Проводит сквозной аудит экранов и интерфейсов по правилам доступности, вёрстки, текста, цвета и типографики. Сводит отчёты узких скиллов в единый список замечаний по приоритету. Claude Code CX Codex Cursor +1 29 700установок better-accessibility jakubkrehel Проверяет доступность интерфейса по WCAG 2.2 и исправляет найденные проблемы в стилях проекта. Пригодится, когда нужно проверить клавиатурную навигацию и работу со скринридером. Claude Code CX Codex Cursor +1 29 200установок better-writing jakubkrehel Скилл проверяет и пишет текст интерфейса: ошибки, пустые экраны, кнопки и подсказки. Он помогает выдержать единый тон продукта и не заводить тупиковых сценариев. Claude Code CX Codex Cursor +1 28 700установок interface-review jakubkrehel Проверяет ветки, пулл-реквесты и незакоммиченные правки на дефекты UI, вёрстки, типографики и доступности. Показывает, что именно сломалось или добавилось в интерфейсе. Claude Code CX Codex Cursor +1 18 100установок

Похожие

appllama-app-design-skill Appllama (appllama.io) Скилл для создания нативных мобильных интерфейсов под iOS и Android на Expo и React Native. Помогает проектировать экраны, потоки, анимацию и навигацию по стандартам Apple HIG и Material Design, с верификацией в симуляторе. Claude Code CX Codex Cursor +1 4 700установок browser-extension-builder sickn33 Скилл помогает проектировать браузерные расширения на Manifest V3 для Chrome и Firefox. Пригодится при настройке архитектуры скриптов, фоновых воркеров и обмена сообщениями. Claude Code CX Codex Cursor +1 2 000установок scroll-experience sickn33 Скилл помогает проектировать скролл-анимации, параллакс и интерактивное повествование для веб-страниц. Пригодится для сцен, которые раскрываются при прокрутке. Claude Code CX Codex Cursor +1 2 000установок shopify-development sickn33 Скилл для разработки Shopify-приложений, расширений и тем через GraphQL Admin API, Shopify CLI, Polaris UI и Liquid. Маршрутизирует задачу в нужный трек: приложение, расширение, тема или комбинация. Claude Code CX Codex Cursor +1 1 900установок shopify-expert https://github.com/Jeffallan Скилл для разработки тем Shopify, приложений и headless-витрин через Storefront API. Пригодится, когда нужно собрать тему на Liquid, кастомный чекаут или Hydrogen-сторфронт. Claude Code CX Codex Cursor +1 5 000установок browser-harness browser-use Управляет реальным браузером через Chrome DevTools Protocol: клики, ввод текста, навигация, сессии авторизации, JS-рендер и защита от ботов. Для простого HTTP-запроса используй curl. Claude Code CX Codex Cursor +1 793установок frontend-design официальный anthropics Скилл задаёт осмысленное визуальное направление для новых интерфейсов и редизайна. Подойдёт, когда стандартный шаблонный UI не устраивает. Claude Code Claude.ai 1 025 790установок design-taste-frontend Leonxlnx Скилл задаёт арт-дирекцию для публичных страниц и рабочих экранов, а затем проверяет результат в браузере по скриншотам. Нужен, когда интерфейс выглядит шаблонным или недоработанным. Claude Code CX Codex Cursor +1 673 100установок

Вопросы о state-machine

Как установить state-machine в Claude Code?

Выполните npx skills add jakubkrehel/skills --skill state-machine -a claude-code, затем ещё раз npx skills add jakubkrehel/skills --skill state-machine -a claude-code. Файл скилла находится в ~/.claude/skills/state-machine/SKILL.md.

Что делает state-machine?

Скилл создаёт временную страницу с реальным компонентом проекта, мок-данными и переключателем состояний. Он использует только ветки, которые уже достижимы в коде.

Почему состояния нужно проверять после каждой визуальной правки?

Правка одного режима способна сломать другой. Скилл предлагает после изменения переключить и заново просмотреть каждое состояние.

Исходный текст

SKILL.md · MIT
---
name: state-machine
description: Renders every state of a component you choose on a throwaway page, with mock data and a switcher, so you can work on each state.
disable-model-invocation: true
---

# State machine

This skill takes one component and renders it on a throwaway page in every state it can be in. Mock data feeds each state, a switcher flips between them and the page is deleted in one step when you are done.

It is a workbench, not a review. The page stays up while the user works on the visuals, one state on screen and every other a keypress away. Stacking hostile scenarios on one page for a single look is `break`, exploring alternative designs is `variant` and reviewing finished work is `interface-review`.

## 1. Scope one component

One component per run: the audit log table, the network panel, the billing card. "The settings page" spans several, so list them and ask which one.

Restate it in one sentence: what the component shows, where it renders in production and where its data comes from.

## 2. Find the states in the code

The states are the branches the component already has. Read it and its data hooks for every one:

| Kind | States |
| --- | --- |
| Data | Loading, empty, error, one item, a typical set, a set long enough to scroll or paginate, some requests resolved and others pending, stale data refetching |
| Account | Plan tier, role and permission checks, an owner versus a member |
| Feature | Flags, trials, limits reached, a disabled or locked feature |

A state the code cannot reach is not a state. Do not add a branch to render one. Where the design shows a state the code lacks, list it as missing and leave it out.

Write the set down before building, one line each, named the way the product talks about it: `empty`, `enterprise`, `member-no-access`. Group them under headings in the product's words, by what changes. Use `Data` and `Account` or narrower ones such as `Connection` or `Access`. The switcher shows these groups. Say which kinds you dropped and why in one line. Combine kinds only where the code branches on the combination, such as `member-empty`, never as a cross product.

## 3. Build the throwaway page

A scratch route inside the app holds the real component, imported from the project and untouched. The route inherits the app's layout, fonts, global styles and providers for free.

Where the framework splits server from client components, the page is client code, `"use client"` in Next. Otherwise fixture data can silently vanish crossing that boundary, and the page renders empty.

Render one instance in a container as wide as the component is in production. The container, the fixtures and the switcher are everything the page adds, with no fonts, styles or themes of its own. Keep the page, its fixtures and its switcher in one folder, such as `/states/audit-log`, so removal is one delete.

## 4. Feed each state at the data boundary

Supply the data where the component receives it, from the page, without editing the component. In order of preference:

1. Props, where the component takes its data as props.
2. The app's own data seam: a seeded query cache, a mock provider or the project's request mocks.

A fixture threaded through props five levels down tests a path production never takes. Where the only way in is editing the component, say so and ask before adding a seam.

Make the data look like the product. Real-shaped names, timestamps, amounts and the item counts users actually have. Three rows of "Test item" make every state look fine.

Loading and pending states hold still. Keep them pending until the switcher moves, rather than resolving after a timeout.

## 5. Add the switcher

A grouped list beside the component flips the `__state` search param, so every state is a link. Where there is no room beside the component, it moves above it as a select with the same groups. The double underscore keeps it clear of any param the app's layout reads. [switcher.md](switcher.md) holds the spec.

## 6. Confirm every state renders, then hand over

Load the page once in a browser already at hand and flip through every state. The component shows the mock data, not the real data and not a blank region. Mock data that never appears is the common failure here. Live sync, a cache that refetches over the seed or a server boundary dropping the fixture all cause it. Fix the plumbing before handing over.

With no browser at hand, say so and hand the URL over for the user to check.

Then hand over the URL, the state list and the switcher keys. Stop there. Changing how a state looks is the user's next request, not part of this one.

## Re-check every state after each change

After a visual change, flip through every state again, since a fix for one state often breaks another.

## Remove it in one step, on the user's word

Delete the page folder and any seam the user approved. Then search the codebase for the route and fixture names, and check that the diff touches nothing else of the setup.

## Before you finish

| Mistake | Fix |
| --- | --- |
| The component edited to accept fixtures | Feed data from the page through props or the app's data seam; ask before adding a seam |
| A rebuilt lookalike component on the page | Import the real component from the project |
| The page restyles or re-themes the component | The app's layout, fonts and tokens as they are |
| Fixtures passed as props deep in the tree | Supply the data where the component receives it |
| A branch added to the component to show a state | Leave out states the code cannot reach, and list missing ones |
| "Item 1", "Test user", three rows | Product-shaped data in real quantities |
| Loading resolves after a timeout | Hold it until the switcher moves |
| Handed over without loading each state | Load every state; a blank or real-data state means broken plumbing |
| Switcher styled with the project's tokens | Keep it visibly outside the design system |
| One long row of tabs, one per state | A grouped list beside the component that scrolls on its own; a select above it where the list does not fit |
| Visuals changed unasked | Hand over and wait |
| Page deleted in the same turn it was built | Remove it only on the user's word |
| Route or fixture names left behind | Search for both after removal |

© jakubkrehel · MIT · jakubkrehel/skills

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой