Agent skill Frontend
Component Canvas
Build an interactive canvas for comparing existing components and variants side by side, with pan and zoom.
Install the skill
Run the command from your project root with Node.js and npm.
npx skills@latest add ibelick/skills --skill component-canvas --agent claude-code --yesCheck this file in your project.claude/skills/component-canvas/SKILL.md
Other ways to install
Choose an assistant interactively
npx skills@latest add ibelick/skills --skill component-canvasSelect your assistant and choose the project installation scope.
Official instructions
The tested Skills CLI 1.10.0 requires Node.js 22.20 or later. Open a project with reusable components. Use local fixtures or mock providers for examples that normally read or write account data.
View operation manualWhat this skill helps with
- Collect related component variants in a full-screen workspace.
- Preview real project components and their states side by side.
- Add pan and zoom for inspecting details and larger sets.
Good for
- Comparing card and button variants
- Reviewing a design system’s components
- Input
- Component paths, variants, and safe sample data.
- Output
- A private route or entry point that wraps real components.
- Controls
- Pan, zoom, keyboard navigation, fit all, and reset.
- Saved state
- The camera position and zoom, with a versioned storage format.
- Skill name
component-canvas- Repository
ibelick/skills
Keep the preview faithful to the product
Underspecified prompt
Build a canvas for all our buttons and dialogs.
A replica can hide bugs in the real components. A live example can trigger the same navigation or writes as the product.
A bounded preview
- Name the exact components and list their supported public props.
- Start with one real component in a private route and a safe fixture.
- Test interactions as rendered before adding camera features.
Component Canvas operation manual
Start with an existing Button and Dialog. Set up a safe preview, compare real variants, and test the camera without interfering with controls.
Provide the component files and tell the assistant which private development route it may create.
Mount one safe example
A working single example confirms the public import, route and provider setup.
Prompt · Step 1Use component-canvas in [Project directory]. Inspect [Button component], [Dialog component], existing preview routes, theme providers and access rules. Add a private preview entry at [Development route]. Mount one existing Button with local fixture data and an inert callback. Preserve the source components and their public APIs. Report the preview URL and confirm it renders before adding more groups.Lay out real props and states
The preview should make a visual comparison and still let users exercise the native behavior.
- Each example uses the original component.
- Tab, Escape and pointer actions work inside the preview.
- No network writes are triggered by examples.
Prompt · Step 2Continue in [Development route]. Add groups for [Button variants] and [Dialog states] using their public props. Use a local fixture or mock provider before mounting any example with side effects. Skip examples that cannot be isolated safely. Keep Dialog in its native portal and check Escape, Tab and focus return. Show a group label and a short label for each example.Add the camera and test it around controls
Start panning on empty space and test the same controls at several zoom levels.
- Preview interactions keep their own keys and gestures.
- Dialog focus and clickable bounds work after zooming.
- Fit All and Reset work, and reload preserves only the camera.
Prompt · Step 3Use component-canvas to add shell-only pan, cursor-centered zoom, touch pinch, keyboard camera navigation, Fit All and Reset to [Development route]. Save only the versioned camera state. Test typing, nested scrolling and Dialog focus at [Desktop viewport] and [Narrow viewport] and several zoom levels. Reload and test invalid camera storage. Report changed files, run checks with results, skipped checks, and omitted previews.
Look up a specific canvas problem
Point the assistant to a real example and describe how to reproduce the symptom.
Dialog tracks the wrong position as you zoomPortal
- Command or reference
Interactions- Examples
- Open the same Dialog after zooming. Check its screen-space bounds and focus through its native portal.
A state requires production servicesFixture
- Command or reference
Safety for previews- Examples
- Use a mock provider or local fixture. Report and omit any example that cannot be isolated.
Troubleshooting and FAQ
Can this preview make component changes?
The publisher’s workflow wraps the existing components and keeps changes inside the canvas. Give separate approval for source changes or dependencies.
What must be persisted between visits?
Only validated camera values go to versioned storage. The reset button restores the camera and leaves each preview’s state alone.