Agent skill
workbench
Workshop workbench for discovering templates, previewing with hot reload, and iterating designs via test videos or browser automation. Supports light/dark color schemes.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/workbench
SKILL.md
Workbench
Workshop workbench for discovering templates, previewing with hot reload, and iterating designs via test videos or browser automation.
Purpose
This skill provides:
- Discovery - Find stories, bElements, and generate preview URLs
- Preview - Dev server with hot reload via CLI
- Iteration - Multi-modal design refinement with test videos or browser automation
Quick Reference
| Capability | Command/Tool | Use Case |
|---|---|---|
| Discover stories | query-stories.ts |
Find all *.stories.tsx files |
| Discover templates | query-templates.ts |
Find all bElement exports |
| Generate URLs | query-story-url.ts |
Get preview URL for a story |
| Batch analysis | query-analyze.ts |
Combined discovery + URLs |
| Dev server | bun --hot plaited dev |
Hot reload preview (background) |
| Test with video | bun plaited test --record-video |
Visual test feedback |
| Browser automation | Chrome DevTools MCP | Screenshots, interaction |
Discovery Scripts
query-stories
Discover all stories in specified paths.
bun scripts/query-stories.ts <paths...>
Example:
bun scripts/query-stories.ts src/main
bun scripts/query-stories.ts src/templates src/features
query-templates
Discover all bElement exports in specified paths.
bun scripts/query-templates.ts <paths...>
Example:
bun scripts/query-templates.ts src/main
query-story-url
Generate preview URLs for a story.
bun scripts/query-story-url.ts <file> <exportName> [--port <port>]
Example:
bun scripts/query-story-url.ts src/button.stories.tsx PrimaryButton
bun scripts/query-story-url.ts src/button.stories.tsx PrimaryButton --port 3500
query-paths
Get route and entry path for a story export.
bun scripts/query-paths.ts <file> <exportName>
Example:
bun scripts/query-paths.ts src/button.stories.tsx PrimaryButton
query-analyze
Batch analysis for discovering stories, templates, and generating URLs.
bun scripts/query-analyze.ts <paths...> [options]
Options:
--stories, -s- Find all stories--templates, -t- Find all bElements--urls, -u- Generate URLs for discovered stories--all- Run all analyses (stories + templates + urls)--port, -p- Dev server port for URLs (default: 3000)
Examples:
# Full analysis
bun scripts/query-analyze.ts src/main --all
# Just stories with URLs
bun scripts/query-analyze.ts src/main --stories --urls
# Just templates
bun scripts/query-analyze.ts src/templates --templates
Dev Server
Start the dev server with hot reload. Always use --hot flag for proper hot reload support.
Running as Background Task
IMPORTANT: Run the dev server directly with run_in_background: true - do NOT use wrapper scripts.
# Basic - discovers stories in current directory
bun --hot plaited dev
# With specific path
bun --hot plaited dev src/main
# With custom port
bun --hot plaited dev src/main -p 3500
# With color scheme
bun --hot plaited dev src/templates -p 3500 -c dark
Arguments:
paths: Directories to discover stories (default: current directory)-p, --port: Server port (default: 3000)-c, --color-scheme: Color scheme (light | dark)
Process Management
Running directly (not via wrapper script) allows Claude to:
- Track the task ID for later reference
- Monitor output with
/bashescommand - Kill the server with
KillShellwhen done
Cleanup: SessionEnd hook automatically kills orphaned dev servers when session ends.
Console Output
Discovering stories in: /path/to/project
Found 5 story exports
Server ready at http://localhost:3000
Hot reload enabled via WebSocket
BasicButton: http://localhost:3000/@story/...
PrimaryButton: http://localhost:3000/@story/...
The server outputs story URLs directly - parse stdout for programmatic access.
Design Iteration
Two primary modes for iterating on template designs:
| Mode | Use Case | Tool | Requirements |
|---|---|---|---|
| Test Video | Interaction stories with play functions | bun plaited test --record-video |
None |
| Chrome DevTools | Browser automation, screenshots, inspection | chrome-devtools MCP |
Chrome browser |
References
- mode-selection.md - When to use each mode
- test-video-mode.md - CLI with
--record-video - chrome-devtools-mode.md - Browser automation
Test Video Workflow
# Run tests with video recording (both color schemes)
bun plaited test src/templates/button --record-video ./videos --color-scheme both
- Run story test with
--record-video --color-scheme both - Review pass/fail results
- Review generated videos (
videos/light/,videos/dark/) - Describe changes needed
- Modify code (styles, tokens, template)
- Re-run test to generate new videos
- Repeat until satisfied
Chrome DevTools Workflow
- Start dev server:
bun --hot plaited dev src/ - Get story URL from stdout or via query scripts
- Navigate with Chrome DevTools MCP
- Take screenshot for visual context
- Describe changes
- Modify code
- Hot reload refreshes browser
- Take new screenshot
- Repeat until satisfied
Chrome DevTools MCP Examples:
// Navigate to story
mcp__chrome-devtools__navigate_page({ url: storyUrl })
// Take screenshot
mcp__chrome-devtools__take_screenshot({ filename: 'preview.png' })
// Get accessibility tree snapshot
mcp__chrome-devtools__take_snapshot({})
Workshop CLI
The workshop CLI provides test execution and dev server:
# Discover and run all story tests
bun plaited test src/main
# Start dev server with hot reload (use run_in_background)
bun --hot plaited dev src/main
Related Skills
- plaited-ui-patterns - Templates, bElements, and styling
- plaited-behavioral-core - Behavioral programming patterns
- typescript-lsp - Type verification and code navigation
- code-documentation - TSDoc standards
File Locations
Workshop utilities:
plaited/workshop/collect-stories.ts- Story discoveryplaited/workshop/collect-behavioral-templates.ts- Element discoveryplaited/workshop/get-paths.ts- URL generationplaited/workshop/cli.ts- Workshop CLI
Type definitions:
plaited/workshop/workshop.types.ts- StoryMetadata, TemplateExportplaited/testing/testing.types.ts- StoryExport, Play function types
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?