visual-design
Generate style guides, component mockups, and visual assets using AI (Gemini 3 Pro Image, FLUX.2 Pro). Optional feature - gracefully skips if OPENROUTER_API_KEY unavailable.
What this skill does
# Visual Design Skill
## Overview
Generate publication-quality visual assets for component development:
- **Style Guides**: Color palettes, typography, spacing systems
- **Component Mockups**: Visual references to guide implementation
- **Architecture Diagrams**: Component dependencies, data flow
- **Design System Documentation**: Visual brand guidelines
**100% Optional** - All features work without this skill if OPENROUTER_API_KEY is unavailable.
## When to Use This Skill
This skill should be used when:
- Creating a new design system or style guide
- Generating visual references for complex components
- Documenting design decisions visually
- Creating component mockups before implementation
- Generating architecture diagrams for documentation
**Skip this skill when:**
- OPENROUTER_API_KEY not available (plugin works normally)
- User prefers manual design (Figma, Sketch, etc.)
- Budget constraints for API usage
## Quick Start
```python
# Generate component mockup
python ${CLAUDE_PLUGIN_ROOT}/skills/visual-design/scripts/generate_mockup.py \
"Modern React card component with header, content, and actions. Clean design." \
--output mockups/card.png
# Generate style guide
python ${CLAUDE_PLUGIN_ROOT}/skills/visual-design/scripts/generate_style_guide.py \
--framework react \
--design-system custom \
--output style-guide/
```
## API Key Setup
**Check before using:**
```bash
# Check if OPENROUTER_API_KEY is available
if [ -z "$OPENROUTER_API_KEY" ]; then
echo "Visual generation disabled (API key not set)"
echo "To enable: https://openrouter.ai/keys"
exit 0 # Gracefully skip
fi
```
**User instructions (show once):**
```
ℹ️ Visual Generation Features Disabled
To enable AI-powered visual generation:
1. Get API key: https://openrouter.ai/keys
2. Add to .env: OPENROUTER_API_KEY=your_key_here
You can still use all other features (Storybook setup, story generation, testing).
```
## Use Cases
### 1. Style Guide Generation
**Context-Aware Workflow:**
```javascript
// Phase 1: Analyze project
const framework = detectFramework();
const designSystem = detectDesignSystem();
const colors = extractColorsFromCSS();
// Phase 2: User collaboration
AskUserQuestion({
questions: [
{
question: `What aesthetic matches your ${designSystem} design system?`,
header: "Style",
multiSelect: false,
options: [
{
label: "Modern/Minimal (Recommended for your stack)",
description: "Clean lines, lots of whitespace, professional"
},
{
label: "Bold/Vibrant",
description: "Strong colors, high contrast, energetic"
},
{
label: "Professional/Corporate",
description: "Conservative, trustworthy, business-focused"
}
]
},
{
question: "Primary brand color?",
header: "Color",
multiSelect: false,
options: [
{ label: "Blue (#2563eb)", description: "Trust, professionalism (detected in your CSS)" },
{ label: "Green (#10b981)", description: "Growth, sustainability" },
{ label: "Purple (#8b5cf6)", description: "Creativity, innovation" },
{ label: "Custom", description: "I'll specify" }
]
}
]
})
// Phase 3: Generate visual assets
python generate_style_guide.py \
--framework ${framework} \
--aesthetic "modern-minimal" \
--primary-color ${selectedColor} \
--output style-guide/
```
**Output:**
- `style-guide/colors.png` - Color palette with hex codes
- `style-guide/typography.png` - Font scale and examples
- `style-guide/spacing.png` - Spacing scale visualization
- `style-guide/components.png` - Example component variants
### 2. Component Mockup Generation
**When to Generate:**
- Card components
- Modal dialogs
- Complex forms
- Tables with data
- Navigation menus
- Dashboards
**Skip for:**
- Simple buttons
- Basic inputs
- Icons
- Badges
**Generation:**
```python
# Context-aware mockup
python generate_mockup.py \
"${componentType} component for ${framework}. \
Design system: ${designSystem}. \
Variants: ${detectedVariants}. \
Modern, professional, ${aesthetic} style." \
--output mockups/${componentName}.png
```
**Example:**
```python
python generate_mockup.py \
"React data table component with sortable columns, pagination, row selection. \
Material UI design system. Clean, modern interface." \
--output mockups/data-table.png
```
### 3. Architecture Diagrams
**Component Dependency Visualization:**
```python
# Analyze component relationships
components = scanComponents('src/components');
dependencies = buildDependencyGraph(components);
# Generate diagram (using Mermaid or AI)
generateDiagram({
type: 'component-architecture',
components: components,
dependencies: dependencies,
output: 'diagrams/component-deps.png'
});
```
## AI Models
**Supported Models:**
- `google/gemini-3-pro-image-preview` (Default - High quality, recommended)
- `black-forest-labs/flux.2-pro` (Fast, high quality)
**Model Selection:**
```python
# Use default (Gemini)
python generate_mockup.py "prompt" --output out.png
# Use FLUX.2 Pro
python generate_mockup.py "prompt" --model black-forest-labs/flux.2-pro --output out.png
```
## Graceful Degradation
**When OPENROUTER_API_KEY is unavailable:**
1. **Skip visual generation silently**
2. **Provide alternatives**:
- Text-based style guide templates
- Link to Figma/Sketch
- Mermaid diagrams for architecture
3. **Continue with other features**:
- Storybook setup works
- Story generation works
- Testing works
**Implementation:**
```javascript
async function generateStyleGuide(options) {
if (!process.env.OPENROUTER_API_KEY) {
console.log('ℹ️ Skipping visual generation (API key not set)');
console.log(' Creating text-based style guide template instead...');
// Generate markdown template
createTextStyleGuideTemplate(options);
return;
}
// Generate visual assets with AI
await generateVisualStyleGuide(options);
}
```
## Prompt Engineering for Components
**Good Prompts:**
```
✅ "Modern React card component with image header, title, description, and action buttons.
Material UI design system. Subtle shadow, rounded corners. Light theme."
✅ "Vue 3 data table with sortable columns, pagination controls, and row selection checkboxes.
Professional corporate style. Clean typography."
✅ "Svelte modal dialog with header, scrollable content area, and footer actions.
Overlay background. shadcn/ui aesthetic."
```
**Bad Prompts:**
```
❌ "Button" (too vague)
❌ "Make a component" (no details)
❌ "Card thing" (unclear)
```
**Context Enhancement:**
Automatically add context from project:
```python
def enhance_prompt(user_prompt, context):
return f"{user_prompt}. Framework: {context.framework}. \
Design system: {context.designSystem}. \
Color palette: {context.colors}. \
Typography: {context.fonts}."
```
## Quality Thresholds
Following claude-project-planner patterns:
| Document Type | Threshold | Usage |
|---------------|-----------|-------|
| Style Guide | 8.5/10 | Design system documentation |
| Component Mockup | 8.0/10 | Complex component references |
| Architecture Diagram | 8.0/10 | Technical documentation |
| Quick Sketch | 7.0/10 | Rapid prototyping |
**Smart Iteration:**
```python
def generate_with_quality_check(prompt, threshold=8.0):
image = generate_image(prompt)
quality = review_quality_with_gemini(image) # Gemini 3 Pro review
if quality < threshold:
print(f"Quality: {quality}/10 (below {threshold})")
print("Regenerating...")
return generate_with_quality_check(prompt, threshold)
print(f"Quality: {quality}/10 ✓")
return image
```
## Integration with Other Skills
- **storybook-config**: Generate visual assets during setup
- **component-scaffold**: Generate mockups for new components
- **style-guide-generator**: Visual enhancement for documentationRelated in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.