state-machine
하는 일
이 스킬은 컴포넌트가 가질 수 있는 상태, 예를 들어 로딩, 빈 상태, 오류를 나열하고 각 상태를 임시 페이지에 보여 줍니다. 각 상태의 모습을 작업하려는 개발자와 디자이너를 위한 것입니다.
사용하는 경우
- ✓테이블이나 패널의 로딩, 빈 상태, 오류 상태를 보고 싶을 때.
- ✓요금제, 역할, 기능 플래그마다 화면 모양을 작업해야 할 때.
- ✓모의 데이터가 있는 페이지에서 키로 모든 상태를 전환하며 보고 싶은 경우.
스킬 링크
https://github.com/jakubkrehel/skills/blob/main/skills/state-machine/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“감사 로그 테이블의 모든 상태를 테스트 페이지에 보여 주세요. 각 상태를 작업할 수 있게요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
스킬은 컴포넌트 코드에서 이미 처리하는 각 상태를 찾습니다. 각 상태에 대해 모의 데이터를 넣은 임시 페이지와, 상태를 전환하는 스위처를 만듭니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
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:
- Props, where the component takes its data as props.
- 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 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,
자주 묻는 질문
코드가 도달할 수 없는 상태를 추가하나요?
아닙니다. 컴포넌트 코드가 이미 처리하는 상태만 보여 줍니다.
실제 페이지를 바꾸나요?
아닙니다. 모의 데이터가 있는 임시 페이지에서 작업하므로 실제 페이지는 그대로 둡니다.
작업이 끝나면 테스트 페이지를 보관하나요?
아닙니다. 끝나면 한 번에 삭제하도록 되어 있습니다.
상세 정보
작성자의 원본 설명
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.
repo: jakubkrehel/skills
인기도
- GitHub 스타
- 10k
- 순위
- #11895
- 라이선스
- MIT
- 업데이트
- 2026. 11. 1.
댓글
- …
이 저장소의 다른 스킬
better-accessibility
10k인터페이스의 키보드, 포커스, 스크린 리더, 양식, 움직임 문제를 WCAG 2.2 기준으로 검토하고 고칩니다.
better-colors
10k색상 단계 생성, 토큰 이름 짓기, 형식 변환, 대비 측정으로 색상 체계를 만들고 확인합니다.
better-interface
10k에이전트가 화면이나 흐름 전체를 접근성, 레이아웃, 글, 서체, 색, 완성도 측면에서 검토하고 문제의 우선순위를 매기도록 돕습니다.
better-layout
10k그룹화, 정렬, 읽기 순서, 반응형 구조를 설정하고, 크기가 바뀌거나 번역되어도 레이아웃이 유지되는지 확인합니다.
비슷한 스킬
angular-developer
280k에이전트가 Angular 코드를 만들고 프로젝트 구조를 조언하도록 돕습니다. 새 프로젝트 시작, 코드 부분 생성, 성능과 접근성 개선에 유용합니다.
frontend-a11y
280k모든 사람이 웹 인터페이스를 쓸 수 있도록 에이전트를 돕습니다. 웹사이트와 앱이 화면 읽기 프로그램과 키보드 탐색에서 잘 작동하도록 합니다.
frontend-patterns
280k프론트엔드 개발의 현대적인 패턴을 적용하도록 에이전트를 돕습니다. React와 Next.js에서 성능을 최적화하고, 상태를 관리하며, 모범 사례를 따릅니다.