diff --git a/docs/README.skills.md b/docs/README.skills.md index 45a9d055..d4f156ac 100644 --- a/docs/README.skills.md +++ b/docs/README.skills.md @@ -41,6 +41,7 @@ Skills differ from other primitives by supporting bundled assets (scripts, code | [microsoft-code-reference](../skills/microsoft-code-reference/SKILL.md) | Look up Microsoft API references, find working code samples, and verify SDK code is correct. Use when working with Azure SDKs, .NET libraries, or Microsoft APIs—to find the right method, check parameters, get working examples, or troubleshoot errors. Catches hallucinated methods, wrong signatures, and deprecated patterns by querying official docs. | None | | [microsoft-docs](../skills/microsoft-docs/SKILL.md) | Query official Microsoft documentation to understand concepts, find tutorials, and learn how services work. Use for Azure, .NET, Microsoft 365, Windows, Power Platform, and all Microsoft technologies. Get accurate, current information from learn.microsoft.com and other official Microsoft websites—architecture overviews, quickstarts, configuration guides, limits, and best practices. | None | | [nuget-manager](../skills/nuget-manager/SKILL.md) | Manage NuGet packages in .NET projects/solutions. Use this skill when adding, removing, or updating NuGet package versions. It enforces using `dotnet` CLI for package management and provides strict procedures for direct file edits only when updating versions. | None | +| [penpot-uiux-design](../skills/penpot-uiux-design/SKILL.md) | Comprehensive guide for creating professional UI/UX designs in Penpot using MCP tools. Use this skill when: (1) Creating new UI/UX designs for web, mobile, or desktop applications, (2) Building design systems with components and tokens, (3) Designing dashboards, forms, navigation, or landing pages, (4) Applying accessibility standards and best practices, (5) Following platform guidelines (iOS, Android, Material Design), (6) Reviewing or improving existing Penpot designs for usability. Triggers: "design a UI", "create interface", "build layout", "design dashboard", "create form", "design landing page", "make it accessible", "design system", "component library". | `references/accessibility.md`
`references/component-patterns.md`
`references/platform-guidelines.md` | | [plantuml-ascii](../skills/plantuml-ascii/SKILL.md) | Generate ASCII art diagrams using PlantUML text mode. Use when user asks to create ASCII diagrams, text-based diagrams, terminal-friendly diagrams, or mentions plantuml ascii, text diagram, ascii art diagram. Supports: Converting PlantUML diagrams to ASCII art, Creating sequence diagrams, class diagrams, flowcharts in ASCII format, Generating Unicode-enhanced ASCII art with -utxt flag | None | | [prd](../skills/prd/SKILL.md) | Generate high-quality Product Requirements Documents (PRDs) for software systems and AI-powered features. Includes executive summaries, user stories, technical specifications, and risk analysis. | None | | [refactor](../skills/refactor/SKILL.md) | Surgical code refactoring to improve maintainability without changing behavior. Covers extracting functions, renaming variables, breaking down god functions, improving type safety, eliminating code smells, and applying design patterns. Less drastic than repo-rebuilder; use for gradual improvements. | None | diff --git a/skills/penpot-uiux-design/SKILL.md b/skills/penpot-uiux-design/SKILL.md new file mode 100644 index 00000000..798711d2 --- /dev/null +++ b/skills/penpot-uiux-design/SKILL.md @@ -0,0 +1,283 @@ +--- +name: penpot-uiux-design +description: 'Comprehensive guide for creating professional UI/UX designs in Penpot using MCP tools. Use this skill when: (1) Creating new UI/UX designs for web, mobile, or desktop applications, (2) Building design systems with components and tokens, (3) Designing dashboards, forms, navigation, or landing pages, (4) Applying accessibility standards and best practices, (5) Following platform guidelines (iOS, Android, Material Design), (6) Reviewing or improving existing Penpot designs for usability. Triggers: "design a UI", "create interface", "build layout", "design dashboard", "create form", "design landing page", "make it accessible", "design system", "component library".' +--- + +# Penpot UI/UX Design Guide + +Create professional, user-centered designs in Penpot using the `penpot/penpot-mcp` MCP server and proven UI/UX principles. + +## Available MCP Tools + +| Tool | Purpose | +| ---- | ------- | +| `mcp__penpot__execute_code` | Run JavaScript in Penpot plugin context to create/modify designs | +| `mcp__penpot__export_shape` | Export shapes as PNG/SVG for visual inspection | +| `mcp__penpot__import_image` | Import images (icons, photos, logos) into designs | +| `mcp__penpot__penpot_api_info` | Retrieve Penpot API documentation | + +## Quick Reference + +| Task | Reference File | +| ---- | -------------- | +| Component specs (buttons, forms, nav) | [component-patterns.md](references/component-patterns.md) | +| Accessibility (contrast, touch targets) | [accessibility.md](references/accessibility.md) | +| Screen sizes & platform specs | [platform-guidelines.md](references/platform-guidelines.md) | + +## Core Design Principles + +### The Golden Rules + +1. **Clarity over cleverness**: Every element must have a purpose +2. **Consistency builds trust**: Reuse patterns, colors, and components +3. **User goals first**: Design for tasks, not features +4. **Accessibility is not optional**: Design for everyone +5. **Test with real users**: Validate assumptions early + +### Visual Hierarchy (Priority Order) + +1. **Size**: Larger = more important +2. **Color/Contrast**: High contrast draws attention +3. **Position**: Top-left (LTR) gets seen first +4. **Whitespace**: Isolation emphasizes importance +5. **Typography weight**: Bold stands out + +## Design Workflow + +1. **Check for design system first**: Ask user if they have existing tokens/specs, or discover from current Penpot file +2. **Understand the page**: Call `mcp__penpot__execute_code` with `penpotUtils.shapeStructure()` to see hierarchy +3. **Find elements**: Use `penpotUtils.findShapes()` to locate elements by type or name +4. **Create/modify**: Use `penpot.createBoard()`, `penpot.createRectangle()`, `penpot.createText()` etc. +5. **Apply layout**: Use `addFlexLayout()` for responsive containers +6. **Validate**: Call `mcp__penpot__export_shape` to visually check your work + +## Design System Handling + +**Before creating designs, determine if the user has an existing design system:** + +1. **Ask the user**: "Do you have a design system or brand guidelines to follow?" +2. **Discover from Penpot**: Check for existing components, colors, and patterns + +```javascript +// Discover existing design patterns in current file +const allShapes = penpotUtils.findShapes(() => true, penpot.root); + +// Find existing colors in use +const colors = new Set(); +allShapes.forEach(s => { + if (s.fills) s.fills.forEach(f => colors.add(f.fillColor)); +}); + +// Find existing text styles (font sizes, weights) +const textStyles = allShapes + .filter(s => s.type === 'text') + .map(s => ({ fontSize: s.fontSize, fontWeight: s.fontWeight })); + +// Find existing components +const components = penpot.library.local.components; + +return { colors: [...colors], textStyles, componentCount: components.length }; +``` + +**If user HAS a design system:** + +- Use their specified colors, spacing, typography +- Match their existing component patterns +- Follow their naming conventions + +**If user has NO design system:** + +- Use the default tokens below as a starting point +- Offer to help establish consistent patterns +- Reference specs in [component-patterns.md](references/component-patterns.md) + +## Key Penpot API Gotchas + +- `width`/`height` are READ-ONLY → use `shape.resize(w, h)` +- `parentX`/`parentY` are READ-ONLY → use `penpotUtils.setParentXY(shape, x, y)` +- Use `insertChild(index, shape)` for z-ordering (not `appendChild`) +- Flex children array order is REVERSED for `dir="column"` or `dir="row"` +- After `text.resize()`, reset `growType` to `"auto-width"` or `"auto-height"` + +## Positioning New Boards + +**Always check existing boards before creating new ones** to avoid overlap: + +```javascript +// Find all existing boards and calculate next position +const boards = penpotUtils.findShapes(s => s.type === 'board', penpot.root); +let nextX = 0; +const gap = 100; // Space between boards + +if (boards.length > 0) { + // Find rightmost board edge + boards.forEach(b => { + const rightEdge = b.x + b.width; + if (rightEdge + gap > nextX) { + nextX = rightEdge + gap; + } + }); +} + +// Create new board at calculated position +const newBoard = penpot.createBoard(); +newBoard.x = nextX; +newBoard.y = 0; +newBoard.resize(375, 812); +``` + +**Board spacing guidelines:** + +- Use 100px gap between related screens (same flow) +- Use 200px+ gap between different sections/flows +- Align boards vertically (same y) for visual organization +- Group related screens horizontally in user flow order + +## Default Design Tokens + +**Use these defaults only when user has no design system. Always prefer user's tokens if available.** + +### Spacing Scale (8px base) + +| Token | Value | Usage | +| ----- | ----- | ----- | +| `spacing-xs` | 4px | Tight inline elements | +| `spacing-sm` | 8px | Related elements | +| `spacing-md` | 16px | Default padding | +| `spacing-lg` | 24px | Section spacing | +| `spacing-xl` | 32px | Major sections | +| `spacing-2xl` | 48px | Page-level spacing | + +### Typography Scale + +| Level | Size | Weight | Usage | +| ----- | ---- | ------ | ----- | +| Display | 48-64px | Bold | Hero headlines | +| H1 | 32-40px | Bold | Page titles | +| H2 | 24-28px | Semibold | Section headers | +| H3 | 20-22px | Semibold | Subsections | +| Body | 16px | Regular | Main content | +| Small | 14px | Regular | Secondary text | +| Caption | 12px | Regular | Labels, hints | + +### Color Usage + +| Purpose | Recommendation | +| ------- | -------------- | +| Primary | Main brand color, CTAs | +| Secondary | Supporting actions | +| Success | #22C55E range (confirmations) | +| Warning | #F59E0B range (caution) | +| Error | #EF4444 range (errors) | +| Neutral | Gray scale for text/borders | + +## Common Layouts + +### Mobile Screen (375×812) + +```text +┌─────────────────────────────┐ +│ Status Bar (44px) │ +├─────────────────────────────┤ +│ Header/Nav (56px) │ +├─────────────────────────────┤ +│ │ +│ Content Area │ +│ (Scrollable) │ +│ Padding: 16px horizontal │ +│ │ +├─────────────────────────────┤ +│ Bottom Nav/CTA (84px) │ +└─────────────────────────────┘ + +``` + +### Desktop Dashboard (1440×900) + +```text +┌──────┬──────────────────────────────────┐ +│ │ Header (64px) │ +│ Side │──────────────────────────────────│ +│ bar │ Page Title + Actions │ +│ │──────────────────────────────────│ +│ 240 │ Content Grid │ +│ px │ ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐ │ +│ │ │Card │ │Card │ │Card │ │Card │ │ +│ │ └─────┘ └─────┘ └─────┘ └─────┘ │ +│ │ │ +└──────┴──────────────────────────────────┘ + +``` + +## Component Checklist + +### Buttons + +- [ ] Clear, action-oriented label (2-3 words) +- [ ] Minimum touch target: 44×44px +- [ ] Visual states: default, hover, active, disabled, loading +- [ ] Sufficient contrast (3:1 against background) +- [ ] Consistent border radius across app + +### Forms + +- [ ] Labels above inputs (not just placeholders) +- [ ] Required field indicators +- [ ] Error messages adjacent to fields +- [ ] Logical tab order +- [ ] Input types match content (email, tel, etc.) + +### Navigation + +- [ ] Current location clearly indicated +- [ ] Consistent position across screens +- [ ] Maximum 7±2 top-level items +- [ ] Touch-friendly on mobile (48px targets) + +## Accessibility Quick Checks + +1. **Color contrast**: Text 4.5:1, Large text 3:1 +2. **Touch targets**: Minimum 44×44px +3. **Focus states**: Visible keyboard focus indicators +4. **Alt text**: Meaningful descriptions for images +5. **Hierarchy**: Proper heading levels (H1→H2→H3) +6. **Color independence**: Never rely solely on color + +## Design Review Checklist + +Before finalizing any design: + +- [ ] Visual hierarchy is clear +- [ ] Consistent spacing and alignment +- [ ] Typography is readable (16px+ body text) +- [ ] Color contrast meets WCAG AA +- [ ] Interactive elements are obvious +- [ ] Mobile-friendly touch targets +- [ ] Loading/empty/error states considered +- [ ] Consistent with design system + +## Validating Designs + +Use these validation approaches with `mcp__penpot__execute_code`: + +| Check | Method | +| ----- | ------ | +| Elements outside bounds | `penpotUtils.analyzeDescendants()` with `isContainedIn()` | +| Text too small (<12px) | `penpotUtils.findShapes()` filtering by `fontSize` | +| Missing contrast | Call `mcp__penpot__export_shape` and visually inspect | +| Hierarchy structure | `penpotUtils.shapeStructure()` to review nesting | + +### Export CSS + +Use `penpot.generateStyle(selection, { type: 'css', includeChildren: true })` via `mcp__penpot__execute_code` to extract CSS from designs. + +## Tips for Great Designs + +1. **Start with content**: Real content reveals layout needs +2. **Design mobile-first**: Constraints breed creativity +3. **Use a grid**: 8px base grid keeps things aligned +4. **Limit colors**: 1 primary + 1 secondary + neutrals +5. **Limit fonts**: 1-2 typefaces maximum +6. **Embrace whitespace**: Breathing room improves comprehension +7. **Be consistent**: Same action = same appearance everywhere +8. **Provide feedback**: Every action needs a response diff --git a/skills/penpot-uiux-design/references/accessibility.md b/skills/penpot-uiux-design/references/accessibility.md new file mode 100644 index 00000000..2482b9da --- /dev/null +++ b/skills/penpot-uiux-design/references/accessibility.md @@ -0,0 +1,329 @@ +# Accessibility Guidelines Reference (WCAG) + +## Quick Compliance Checklist + +### Level AA Requirements (Minimum Standard) + +- [ ] Color contrast 4.5:1 for normal text +- [ ] Color contrast 3:1 for large text (18px+ or 14px bold) +- [ ] Touch targets minimum 44×44px +- [ ] All functionality available via keyboard +- [ ] Visible focus indicators +- [ ] No content flashes more than 3 times/second +- [ ] Page has descriptive title +- [ ] Link purpose clear from text +- [ ] Form inputs have labels +- [ ] Error messages are descriptive + +--- + +## Color and Contrast + +### Contrast Ratios + +| Element | Minimum Ratio | Enhanced (AAA) | +| ------- | ------------- | -------------- | +| Body text | 4.5:1 | 7:1 | +| Large text (18px+) | 3:1 | 4.5:1 | +| UI components | 3:1 | - | +| Graphical objects | 3:1 | - | + +### Color Independence + +Never use color as the only means of conveying information: + +```text +✗ Error fields shown only in red +✓ Error fields with red border + error icon + text message + +✗ Required fields marked only with red asterisk +✓ Required fields labeled "(required)" or with icon + tooltip + +✗ Status shown only by color dots +✓ Status with color + icon + label text + +``` + +### Accessible Color Combinations + +**Safe text colors on backgrounds:** + +| Background | Text Color | Contrast | +| ---------- | ---------- | -------- | +| White (#FFFFFF) | Dark gray (#1F2937) | 15.5:1 ✓ | +| Light gray (#F3F4F6) | Dark gray (#374151) | 10.9:1 ✓ | +| Primary blue (#2563EB) | White (#FFFFFF) | 4.6:1 ✓ | +| Dark (#111827) | White (#FFFFFF) | 18.1:1 ✓ | + +**Colors to avoid for text:** + +- Yellow on white (insufficient contrast) +- Light gray on white +- Orange on white (marginal at best) + +--- + +## Keyboard Navigation + +### Requirements + +1. **All interactive elements** must be reachable via Tab key +2. **Logical tab order** following visual layout +3. **No keyboard traps** (user can always Tab away) +4. **Focus visible** at all times during keyboard navigation +5. **Skip links** to bypass repetitive navigation + +### Focus Indicators + +```css +/* Example focus styles */ +:focus { + outline: 2px solid #2563EB; + outline-offset: 2px; +} + +:focus:not(:focus-visible) { + outline: none; /* Hide for mouse users */ +} + +:focus-visible { + outline: 2px solid #2563EB; + outline-offset: 2px; +} + +``` + +### Keyboard Shortcuts + +| Key | Expected Behavior | +| --- | ----------------- | +| Tab | Move to next interactive element | +| Shift+Tab | Move to previous element | +| Enter | Activate button/link | +| Space | Activate button, toggle checkbox | +| Escape | Close modal/dropdown | +| Arrow keys | Navigate within components | + +--- + +## Screen Reader Support + +### Semantic HTML Elements + +Use appropriate elements for their purpose: + +| Purpose | Element | Not This | +| ------- | ------- | -------- | +| Navigation | `