Skip to main content
skill CX Codex

lab — Claude Code skill: what it does, how to install

lab — a skill for Claude Code that builds an isolated preview route displaying all states and variants of actual UI components. Runs during component styling and design tuning in local development.

MIT 173 installs ★ 69 updated 2026-11-14

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add raphaelsalaja/skills --skill lab -a claude-code
Open on GitHub

What lab does

This skill creates a dedicated route like /lab and loads lab.js to inspect all component states on a single screen. It imports genuine project components directly instead of pasting mock markup.

States that usually demand interaction are forced visible: hover, pressed, focus, disabled, loading, and open popovers using controlled props or force="hover". Every state sits inside a lab-entry element linked back to its source file and line, with lab-tune controls when CSS variables need adjustment.

The route belongs strictly to local development: leaving /lab accessible in production triggers a HIGH severity audit failure and blocks the release.

What it helps with

  • display every component variant and size on a single screen
  • force open hover, focus, and open dropdowns without manual clicks
  • link rendered component entries directly to source lines
  • adjust custom design tokens with lab-tune controls

Example prompts for the agent

  • Build a /lab route showing every state of Button and Dropdown
  • Generate a lab page with all variants and loading states for the auth form
  • Set up an isolated lab view for the navigation menu with open submenus

How to install lab

1Skills CLI (Vercel)

npx skills add raphaelsalaja/skills --skill lab -a claude-code

2Manually: put the files in place

~/.claude/skills/lab/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/lab/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about lab

How to install lab in Claude Code?

Run npx skills add raphaelsalaja/skills --skill lab -a claude-code or save the file to ~/.claude/skills/lab/SKILL.md.

What does the lab skill do?

It creates a temporary /lab route powered by lab.js that renders real components with all interactive states forced open.

What is required for the lab skill to work?

A running dev server, importing lab.js into the route, and gating the route so it never ships to production.

Source text

SKILL.md · MIT
---
name: lab
description: Builds a temporary page that shows every variant and state of real components at once, each linked to its source.
disable-model-invocation: true
---

# 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](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.

| Rule | Broken | Replacement |
| --- | --- | --- |
| `lab-every-state` | The resting button only | Rest, hover, pressed, focus, disabled and loading |
| `lab-real-components` | Copied markup for each state | The real `Button` imported |
| `lab-states-open` | A menu behind a trigger | `<Menu open>` with its submenu open |
| `lab-one-theme` | Light and dark side by side, unasked | The app's current theme |
| `lab-link-the-source` | An unlabelled grid | `Menu / Submenu Open` linked to `menu/index.tsx` |
| `lab-shipped-frame` | A lab grid and labels written from scratch | `lab.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 site | The 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`.

© raphaelsalaja · MIT · raphaelsalaja/skills

Similar skills

All skills for Frontend and UI →

From the same set25

The whole set →
match The match Claude Code skill rebuilds a named interface part from its source and compares the result with the reference. It activates when a request points to an app, URL, screenshot, or design file. CX Codex +1 175installs reuse Skill for Claude Code enforces a strict reuse hierarchy: internal project parts first, maintained libraries next, custom code last. Flags duplicate UI components and stray styles during reviews. CX Codex +1 175installs restraint The restraint Claude Code skill trims changes to the requested scope. It flags extra UI, settings, and code paths during implementation and cleanup. CX Codex +1 175installs defaults defaults — a skill for Claude Code enforces interface baseline rules across surfaces, scrolling, shadows, focus states, and overlays. Audits markup against common UI flaws directly in code. CX Codex +1 174installs copy copy — a Claude Code skill that inspects and edits interface text. Enforces Title Case on buttons and headers, cuts excess phrasing, and bans em dashes. CX Codex +1 172installs verify The verify Claude Code skill checks UI and behaviour changes in the running app. The agent opens the affected screen, tests new controls and reports where the result can be seen. CX Codex +1 171installs keyboard This Claude Code skill tests a running page using only the keyboard. It records focus stops and reports controls that users cannot reach, see, or operate. CX Codex +1 170installs rule This Claude Code skill turns repeated corrections into short project rules and fixes code that breaks them. After the same correction comes up twice, it proposes a rule. CX Codex +1 169installs

Project sponsors

Companies that keep this analytics open