From codebrain
Use when creating UI mockups, wireframes, design systems, or visual prototypes before implementing frontend code. Uses Pencil.dev MCP to create designs in .pen files, validate visually with screenshots, then generate code from approved designs. Design-first workflow for UI features.
npx claudepluginhub chrsmay/codebrain-plugin --plugin codebrainThis skill uses the workspace's default tool permissions.
Design-first UI development using Pencil.dev. Create mockups in `.pen` files, validate visually, then implement from approved designs.
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Design-first UI development using Pencil.dev. Create mockups in .pen files, validate visually, then implement from approved designs.
Prerequisite: Pencil.dev must be open BEFORE starting Claude Code. The Pencil MCP server runs locally when Pencil is open.
/codebrain:design <description>
/codebrain:design review — screenshot and review current design
/codebrain:design implement — generate code from approved design
Check Pencil is available.
mcp__pencil__get_editor_state to verify Pencil is runningOpen or create a .pen file.
.pen file exists for this feature: call mcp__pencil__open_document with its pathmcp__pencil__open_document with "new" to create a blank canvasLoad design guidelines.
mcp__pencil__get_guidelines with the appropriate topic:
web-app for web applicationsmobile-app for mobile designslanding-page for marketing pagesdesign-system for component librariestailwind for Tailwind CSS-based projectsmcp__pencil__get_style_guide_tags then mcp__pencil__get_style_guide for visual inspirationCreate the design using mcp__pencil__batch_design:
batch_design callValidate visually.
mcp__pencil__get_screenshot to see the rendered designmcp__pencil__snapshot_layout to check for overlapping/clipped elementsbatch_design callsPresent to user for approval.
Save design tokens.
mcp__pencil__get_variables to extract design tokens.codebrain/active/design-tokens.json via codebrain MCPRead the approved design.
mcp__pencil__batch_get with patterns to read the design treemcp__pencil__get_variables for design tokens (colors, spacing, fonts)mcp__pencil__get_guidelines with topic: "code" for code generation rulesGenerate implementation plan.
/codebrain:plan with the design as the specImplement.
Visual verification.
mcp__pencil__get_screenshot for the current designmcp__pencil__snapshot_layout with problemsOnly: true for layout issuesget_screenshot after design changes to verify visually.mcp__pencil__export_nodes to save finalized designs as PNG/PDF for documentation.