ai/dot-pi/agent/skills/design-deck/SKILL.md
Present visual options for architecture, UI, and code decisions with high-fidelity side-by-side previews. For comparing approaches visually — code diffs, diagrams, UI mockups, images — not for gathering structured input (use interview for that). Supports previewBlocks (code, mermaid, image, html), previewHtml, generate-more loops, and plan/PRD-driven flows.
npx skillsauth add lolwierd/dotfiles design-deckInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
design_deckis a direct tool — call it directly, not via MCP.
Use this skill when the task requires presenting multiple visual directions and collecting explicit user choices. Load this skill before building any deck to get the full format reference.
Design deck vs interview: The design deck is for visual comparisons — rendered UI mockups, architecture diagrams, syntax-highlighted code, images. If the options are just text, use interview with single-type questions instead. It's faster, doesn't open a browser, and displays text natively. The deck adds value only when you need to see the difference, not just read it.
Three slash commands cover the main flows:
/deck — General purpose. Reads codebase and plan/PRD context, presents visual options. If the request is underspecified and no plan exists, interviews the user in depth first./deck-plan <path> — Reads a plan or PRD, identifies decision points, and presents visual options for each./deck-discover — Two-phase: in-depth interview first to gather requirements, then design deck from responses. Use when starting from scratch with no plan.Build a deck directly when there's enough context to produce meaningful visual options:
Interview first when requirements are genuinely ambiguous, multi-dimensional, or missing critical constraints — goals, audience, aesthetics, technical boundaries. Don't force discovery when you already have what you need.
When working from an existing plan or PRD:
aside text and recommendations.Build 1 decision per slide.
Provide 2-4 options per slide that are genuinely distinct in direction, not tiny variants.
Each slide supports an optional columns property (1, 2, 3, or 4) to override the auto-detected grid. Omit columns by default — the auto-layout picks 2 or 3 columns based on option count, which is correct for most content. Only override to columns: 1 when options contain wide architecture diagrams or detailed code that genuinely needs full viewport width. Use columns: 4 when presenting many small, comparable items (e.g., icon sets, color swatches).
Each slide supports an optional context property — a string displayed below the title that frames the decision for the user.
Each option must include:
labelpreviewHtml or previewBlocks (exactly one, not both)description (optional — short rationale shown on hover)aside (optional — explanatory text rendered below the preview with styled typography, supports \n for line breaks)recommended (optional)Use previewHtml for rich, custom UI mockups with inline styles. This is the original approach and works for anything that needs full HTML control.
Use previewBlocks when the preview is composed of standard block types. Each block is a typed object in an array:
{ "type": "html", "content": "<div>...</div>" } — raw HTML snippet{ "type": "mermaid", "content": "graph LR\n A-->B" } — Mermaid diagram (flowchart, sequence, ER, etc.){ "type": "code", "code": "const x = 1;", "lang": "ts" } — syntax-highlighted code block{ "type": "image", "src": "/absolute/path.png", "alt": "description", "caption": "optional" } — image from diskBlocks render in order, stacked vertically. Mix block types freely within one option.
Mermaid blocks accept an optional theme object to override default Mermaid theme variables per-block: { "type": "mermaid", "content": "...", "theme": { "primaryColor": "#..." } }.
Image blocks reference absolute file paths on disk. The server copies the file into a temp directory and serves it via /assets/. The browser never sees the original path.
If surf CLI is available, generate images for architecture diagrams:
which surf
surf gemini "isometric microservices architecture, blue nodes, dark bg" \
--generate-image /tmp/deck-arch.png --aspect-ratio 4:3
Then reference the file in the image block. If surf isn't installed, use mermaid or code blocks instead.
previewHtml should be a self-contained HTML snippet that renders realistic UI inside the deck card.
No iframes. The deck injects previewHtml directly into .preview via innerHTML.
Keep snippets production-like, readable, and complete enough for side-by-side comparison.
The core principle across all preview types: each option should represent a genuinely different approach, not a surface-level variant of the same idea. If your options differ only in color or wording, they're not distinct enough.
Recognize when you're generating variants instead of alternatives:
The test: could a stakeholder with strong opinions pick one and reject the others for substantive reasons? If all options would lead to roughly the same implementation, they're not distinct.
When presenting architecture options via mermaid diagrams or mixed blocks:
Vary the structural approach, not the diagram style:
Show different tradeoff priorities:
Use diagram type to match the story:
When presenting code options via code blocks:
Vary the paradigm or pattern, not the syntax:
Show enough code to reveal the philosophy:
Make tradeoffs visible in the code itself:
When presenting UI options via previewHtml, avoid patterns that scream "AI-generated":
Color anti-patterns: indigo-500/violet-500/blue-500 as primary, blue-to-purple or pink-to-orange gradients, raw Tailwind defaults without customization.
Typography anti-patterns: Inter, Roboto, system-ui, or Arial as the only choice. Uniform sizing with no hierarchy.
Layout anti-patterns: Everything centered with uniform padding. Identical cards in a grid. Generic hero with "Welcome to [Product]" and a gradient button.
Instead, commit to a direction:
Typography that creates hierarchy:
Palettes with character (not Tailwind defaults):
#0d1117 bg, #c9d1d9 text, #7ee787 accent#1a1814 bg, #e8e4dd text, #d4a574 gold#faf7f2 bg, #1c1917 text, #dc2626 accentThe test for UI distinctiveness: Would these options appeal to different audiences or brand personalities? If option A and B would both work for the same brand, they're not distinct enough.
Image blocks can show AI-generated visuals, screenshots, exported mockups, mood references, or photography direction. Use them when visual fidelity matters more than code-level detail.
Generate images when useful:
If surf CLI is available, generate architectural or UI visuals:
surf gemini "isometric database cluster, dark theme, blue nodes" \
--generate-image /tmp/db-arch.png --aspect-ratio 16:9
When to use images vs other blocks:
Make image options distinct:
Combine images with other blocks: An image showing the visual direction paired with a code block showing the implementation approach, or a mermaid diagram showing data flow alongside a generated image showing the UI that flow produces.
When generating UI component options (tabs, accordions, tree views, buttons, etc.), read ./references/component-gallery/components.md for best practices, common layouts, and aliases for 60 UI components.
The reference enables three things:
The INDEX.md provides a design system vocabulary table (Ant Design, Blueprint, Carbon, Material, etc.) and guidance on when to use distinct systems vs variations.
Decide based on context:
See ./references/component-gallery/INDEX.md for the decision table and examples.
Proactively browse real examples: When you need visual inspiration for a component, fetch the component.gallery page directly:
Each page shows real screenshots from Ant Design, Blueprint, Carbon, Material, Shopify Polaris, and 90+ other design systems. Useful when you need concrete visual references — not required for every deck.
When user vocabulary is unclear or ambiguous: Read ./references/component-gallery/LOOKUP.md to resolve user terms to canonical component names. The lookup file provides:
collapse → Accordion, snackbar → Toastdropdown (Select? Combobox? Dropdown menu?) or popup (Modal? Popover? Tooltip?)Use the lookup before generating options if the user's component vocabulary seems imprecise or you're unsure which component they mean.
Many slides benefit from combining block types — a mermaid diagram showing structure alongside a code block showing usage, or an HTML mockup with a code block showing the component API.
When mixing, make sure the combination tells a coherent story:
Don't just stack blocks for completeness. Each block should add information the others don't convey.
The tool returns selections as a map of slideId -> selected option label.
Use these selections as the implementation contract for the final build.
When the user clicks generate-more, design_deck returns a result instructing which slide needs options and how many, along with the existing option labels.
Generate the requested number of new options, each meaningfully distinct from the existing ones.
Re-invoke with all options in a single call:
design_deck({ action: "add-options", slideId: "...", options: "[{...}, {...}]" })
The add-options call pushes all options into the live deck and blocks for the next user action. Use add-options (plural) for generate-more requests — it takes an array and handles blocking automatically.
The deck shows a model dropdown below the header (when 2+ models are available). Users can pick which model generates new options and optionally save it as the default.
When the generate-more result includes a model instruction (e.g. "Generate using model X via deck_generate"), use the built-in deck_generate tool to generate the options with that model:
deck_generate({ model: "google/gemini-3.1-pro", task: "Generate JSON deck options..." })
Parse the output as the options JSON array and pass it to add-options.
The default model can also be set in ~/.pi/agent/settings.json:
{
"designDeck": {
"generateModel": "google/gemini-3.1-pro"
}
}
Priority: browser dropdown selection > settings default > current model (no delegation).
{
"title": "Architecture Direction",
"slides": [
{
"id": "arch",
"title": "System Architecture",
"context": "Choose the high-level architecture for the backend.",
"columns": 2,
"options": [
{
"label": "Monolith",
"description": "Single deployable, shared database",
"aside": "Simpler to deploy and debug. Good starting point.\nWatch for coupling as the codebase grows.",
"previewBlocks": [
{ "type": "mermaid", "content": "graph TD\n Client-->API\n API-->DB" },
{ "type": "code", "code": "app.listen(3000)", "lang": "ts" }
]
},
{
"label": "Microservices",
"description": "Event-driven, independently deployable",
"aside": "Independent scaling and deployment per service.\nRequires service mesh, distributed tracing, and eventual consistency patterns.",
"previewBlocks": [
{ "type": "mermaid", "content": "graph LR\n Gateway-->Auth\n Gateway-->Orders\n Gateway-->Inventory" },
{ "type": "code", "code": "bus.publish('order.created', payload)", "lang": "ts" }
],
"recommended": true
}
]
}
]
}
development
Generate beautiful, self-contained HTML pages that visually explain systems, code changes, plans, and data. Use when the user asks for a diagram, architecture overview, diff review, plan review, project recap, comparison table, or any visual explanation of technical concepts. Also use proactively when you are about to render a complex ASCII table (4+ rows or 3+ columns) — present it as a styled HTML page instead.
development
Use when the task asks for a visually strong landing page, website, app, prototype, demo, or game UI. This skill enforces restrained composition, image-led hierarchy, cohesive content structure, and tasteful motion while avoiding generic cards, weak branding, and UI clutter.
devops
Deploy applications and infrastructure to Cloudflare using Workers, Pages, and related platform services. Use when the user asks to deploy, host, publish, or set up a project on Cloudflare.
development
Generate beautiful, self-contained HTML pages that visually explain systems, code changes, plans, and data. Use when the user asks for a diagram, architecture overview, diff review, plan review, project recap, comparison table, or any visual explanation of technical concepts. Also use proactively when you are about to render a complex ASCII table (4+ rows or 3+ columns) — present it as a styled HTML page instead.