playful-design/router

lab

Builds a temporary page that shows every variant and state of real components at once, each linked to its source.

ソースを見る

使い方

  1. インストールコマンドをコピーし、自分の環境へ導入する前にソースを確認します。
  2. 必要なツール、認証情報、対応環境を原文で確認します。
  3. 入力と成果物を指定し、出力を資料と照合します。
npx skills add https://github.com/playful-design/router --skill lab

開始前の確認

  • 導入にはモデル契約、API枠、ファイルへのアクセス許可は含まれません。
  • スター数や導入数は活動の指標であり、独立した品質・安全性試験ではありません。
リポジトリの原文

見出し、例、コード、表、リンク、参照画像を含む原文を表示しています。

Lab

This skill builds a page for inspecting components. Every variant and every state of the real components sits open on one screen, so the user can tune them without clicking through the app.

Every state open, nothing faked

The lab renders the real components, not copies. States that need a click, such as an open menu or a hover, are forced open. The lab is a development page and never ships.

Exploring new options for one idea belongs to prototype. The values on the page come from defaults, motion, color and the project's tokens.

1. Find the states

Read each component and list its variants, sizes and states: hover, pressed, focus, open, selected, disabled, loading, empty and error. A lab that shows the resting state only is lab-every-state.

2. Build one route

Add one development-only route, such as /lab, that imports the real components. Copy lab.js into the app and load it once on that route. A lab built from copied markup is lab-real-components.

3. Force states open

Render menus, popovers, tooltips and submenus open with their controlled props or data-* attributes. Hold hover and focus with force on the entry, such as force="hover". A menu that needs a click to see is lab-states-open. Use the app's current theme unless the user asked for both. That is lab-one-theme.

4. Link each entry to its source

Wrap each state in a lab-entry naming its component, state and source line, as the header comment in lab.js shows. An unlabelled grid is lab-link-the-source. When the user asked to tune values, add a lab-tune for each custom property with its range.

The grid, labels, filters and controls ship with the skill, so write entries only. A lab page with its own grid, labels or styles is lab-shipped-frame.

5. Open it

Start the dev server and open the lab. A route named in the reply but never opened is lab-open-it.

6. Keep it out of the release

Gate the route and lab.js to development, or delete both before release. A lab reachable in production is lab-not-in-production.

The pair

Every check is a pair. The broken line sits beside the line that replaces it.

RuleBrokenReplacement
lab-every-stateThe resting button onlyRest, hover, pressed, focus, disabled and loading
lab-real-componentsCopied markup for each stateThe real Button imported
lab-states-openA menu behind a trigger<Menu open> with its submenu open
lab-one-themeLight and dark side by side, unaskedThe app's current theme
lab-link-the-sourceAn unlabelled gridMenu / Submenu Open linked to menu/index.tsx
lab-shipped-frameA lab grid and labels written from scratchlab.js loaded, only lab-entry elements written
lab-open-it"Added /lab"The lab opened for the user
lab-not-in-production/lab live on the production siteThe route gated to development

Reporting

Severity. HIGH is a lab built from copies, or a lab reachable in production. MEDIUM is a missing state, a state that still needs a click or a hand-written lab page. LOW is an unlabelled entry, or a lab that was not opened for the user.

Format. One finding per root cause:

file:line - [rule-id] what is wrong

Then a Rule | Count | Severity summary. Block when any HIGH remains, Approve otherwise. Mark every state you could not render as Not verified.

同じリポジトリから

関連する Skills

すべての Skills
playful-design
コミュニティ

alignment

Measures a running page for edges, gaps, centring and radii that miss by a pixel or two, then judges visual weight and returns a numbered report with proof.

1時間の導入数
2
GitHub Stars
13
更新日
11月5日
playful-design
コミュニティ

animate

Build an animation from scratch, making the decisions in the order that determines whether it feels right — should it animate at all, what purpose, which tool, which properties, which curve and duration, how it interrupts, how it exits. Writes the implementation. Use when asked to animate something, add motion, make a component feel alive, or build a transition. For critiquing existing motion use review-animations; for auditing a whole codebase use improve-animations.

1時間の導入数
2
GitHub Stars
13
更新日
11月5日
playful-design
コミュニティ

animate-expo

Build animations in React Native and Expo, making the decisions in the order that determines whether they feel right — should it animate, which thread it runs on, which properties, spring or timing, how the gesture hands off, how it degrades. Writes the implementation with Reanimated, Gesture Handler, Expo Router and expo-haptics. Use when animating anything in an Expo app, adding gestures, sheets, screen transitions, press feedback or haptics, or fixing motion that stutters on device. For web a

1時間の導入数
2
GitHub Stars
13
更新日
11月5日
playful-design
コミュニティ

animation-performance

Keep web animations inside the frame budget — animate composite-only properties, keep motion off the main thread when the page is busy, and find the cause when an animation drops frames. Covers the layout/paint/composite pipeline, cheaper property swaps, CSS vs WAAPI vs requestAnimationFrame, Motion's hardware-accelerated path, React re-rendering per frame, inherited CSS variable recalculation, blur cost, and when will-change actually helps. Use when an animation is janky, choppy, stutters, or d

1時間の導入数
2
GitHub Stars
13
更新日
11月5日