@maccesar/aiskills 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/README.md +531 -0
  2. package/bin/aiskills.js +76 -0
  3. package/lib/cache.js +49 -0
  4. package/lib/cleanup.js +77 -0
  5. package/lib/commands/auto-update.js +131 -0
  6. package/lib/commands/doctor.js +139 -0
  7. package/lib/commands/list.js +77 -0
  8. package/lib/commands/skills.js +263 -0
  9. package/lib/commands/status.js +94 -0
  10. package/lib/commands/uninstall.js +182 -0
  11. package/lib/commands/update.js +149 -0
  12. package/lib/config.js +90 -0
  13. package/lib/downloader.js +110 -0
  14. package/lib/hooks.js +74 -0
  15. package/lib/installer.js +114 -0
  16. package/lib/platform.js +112 -0
  17. package/lib/prompts/checkboxCancel.js +264 -0
  18. package/lib/prompts/selectCancel.js +204 -0
  19. package/lib/symlink.js +154 -0
  20. package/lib/utils.js +49 -0
  21. package/package.json +61 -0
  22. package/skills/humaniza/SKILL.md +51 -0
  23. package/skills/humaniza/agents/openai.yaml +4 -0
  24. package/skills/humaniza/references/ai-patterns-es.md +51 -0
  25. package/skills/humaniza/references/checklist.md +9 -0
  26. package/skills/humaniza/references/examples.md +17 -0
  27. package/skills/humaniza/references/lexicon-es-mx.md +36 -0
  28. package/skills/humaniza/references/modes-es-mx.md +41 -0
  29. package/skills/humaniza/references/voice-es-mx.md +24 -0
  30. package/skills/refactoring-ui/SKILL.md +59 -0
  31. package/skills/refactoring-ui/references/01-design-process.md +72 -0
  32. package/skills/refactoring-ui/references/02-visual-hierarchy.md +84 -0
  33. package/skills/refactoring-ui/references/03-layout-spacing.md +69 -0
  34. package/skills/refactoring-ui/references/04-typography.md +70 -0
  35. package/skills/refactoring-ui/references/05-color.md +96 -0
  36. package/skills/refactoring-ui/references/06-depth-shadows.md +74 -0
  37. package/skills/refactoring-ui/references/07-images.md +75 -0
  38. package/skills/refactoring-ui/references/08-finishing-touches.md +91 -0
  39. package/skills/stitch-showcase/SKILL.md +411 -0
  40. package/skills/stitch-showcase/references/01-navbar.md +52 -0
  41. package/skills/stitch-showcase/references/02-hero.md +56 -0
  42. package/skills/stitch-showcase/references/03-design-system.md +102 -0
  43. package/skills/stitch-showcase/references/04-screen-gallery.md +102 -0
  44. package/skills/stitch-showcase/references/05-viewer-web.md +105 -0
  45. package/skills/stitch-showcase/references/06-viewer-mobile.md +104 -0
  46. package/skills/stitch-showcase/references/07-theme-system.md +77 -0
  47. package/skills/stitch-showcase/references/08-type-detection.md +81 -0
  48. package/skills/stitch-showcase/references/09-quality-standards.md +126 -0
  49. package/skills/stitch-showcase/references/10-component-standardization.md +40 -0
  50. package/skills/stitch-showcase/references/11-component-catalog.md +70 -0
  51. package/skills/stitch-showcase/references/catalog-template.html +841 -0
  52. package/skills/stitch-showcase/references/index.html +299 -0
  53. package/skills/stitch-showcase/references/viewer.html +412 -0
  54. package/skills/stitch-showcase/scripts/__pycache__/build_showcase.cpython-314.pyc +0 -0
  55. package/skills/stitch-showcase/scripts/__pycache__/component_utils.cpython-313.pyc +0 -0
  56. package/skills/stitch-showcase/scripts/__pycache__/detect_components.cpython-313.pyc +0 -0
  57. package/skills/stitch-showcase/scripts/__pycache__/extract_catalog.cpython-313.pyc +0 -0
  58. package/skills/stitch-showcase/scripts/__pycache__/extract_text.cpython-313.pyc +0 -0
  59. package/skills/stitch-showcase/scripts/__pycache__/extract_zips.cpython-313.pyc +0 -0
  60. package/skills/stitch-showcase/scripts/__pycache__/parse_design_md.cpython-313.pyc +0 -0
  61. package/skills/stitch-showcase/scripts/apply_canonical.py +238 -0
  62. package/skills/stitch-showcase/scripts/build_showcase.py +2103 -0
  63. package/skills/stitch-showcase/scripts/component_utils.py +398 -0
  64. package/skills/stitch-showcase/scripts/detect_components.py +284 -0
  65. package/skills/stitch-showcase/scripts/extract_catalog.py +913 -0
  66. package/skills/stitch-showcase/scripts/extract_text.py +268 -0
  67. package/skills/stitch-showcase/scripts/extract_zips.py +178 -0
  68. package/skills/stitch-showcase/scripts/parse_design_md.py +397 -0
  69. package/skills/vscode-extension-dev/SKILL.md +114 -0
  70. package/skills/vscode-extension-dev/references/api-patterns.md +625 -0
  71. package/skills/vscode-extension-dev/references/architecture.md +287 -0
  72. package/skills/vscode-extension-dev/references/package-json-schema.md +345 -0
  73. package/skills/vscode-extension-dev/references/publishing.md +251 -0
@@ -0,0 +1,102 @@
1
+ # Section: Screen Gallery
2
+
3
+ ## Purpose
4
+
5
+ The main browsing area where users explore all screens. Organized by sections with filterable tabs, searchable, and switchable between grid and list views.
6
+
7
+ ## Data Required (from showcase_context.json)
8
+
9
+ - `sections` — array of `{name, key, screens}` for section grouping and tabs
10
+ - `all_screens` — flat list for search/filter
11
+ - Each screen: `slug`, `title`, `description`, `html_file`, `png_file`, `detected_type`
12
+ - `type` — project-level type for default aspect ratios
13
+ - `color_tokens.accent` or `colors.primary` — accent color for hover/active states
14
+
15
+ ## Design Requirements
16
+
17
+ ### Section Tabs
18
+
19
+ - Horizontal scrollable pill bar below the navbar (or inside gallery header)
20
+ - "All" tab + one tab per section with screen count badge
21
+ - Active tab: accent color background with white text
22
+ - Inactive: ghost pill with hover state
23
+ - Tabs scroll horizontally on mobile with `-webkit-overflow-scrolling: touch`
24
+
25
+ ### Screen Cards (Grid Mode)
26
+
27
+ - **Aspect ratio adapts to screen type**:
28
+ - If `detected_type === "mobile"` → `aspect-ratio: 9/16` (portrait phone)
29
+ - If `detected_type === "web"` → `aspect-ratio: 16/10` (landscape desktop)
30
+ - If `detected_type === "unknown"` → use project-level `type` default
31
+ - Thumbnail: `object-cover object-top` for natural cropping
32
+ - Card structure: thumbnail on top, title + description below, separated by subtle border
33
+ - Hover: slight scale (1.02), accent border, elevated shadow
34
+ - Dark/light variant badge: if slug ends with `_oscuro`/`_dark` → dark badge; `_claro`/`_light` → light badge
35
+ - Grid: 4 columns for mobile screens, `auto-fill minmax(280px, 1fr)` for web screens
36
+ - Gap: 16-20px between cards
37
+
38
+ ### Screen Cards (List Mode)
39
+
40
+ - Horizontal card: small thumbnail (120px wide) on left, title + full description on right
41
+ - No line-clamp on description in list mode
42
+ - Compact vertical spacing (8px gap)
43
+
44
+ ### Empty State
45
+
46
+ - When search yields no results: centered message with muted icon and "No screens match your search" text
47
+ - When a section has 0 screens: section is hidden from tabs
48
+
49
+ ### Card Link Behavior
50
+
51
+ - Each card links to `viewer.html?screen={html_file}&title={title}&desc={description}`
52
+ - **Critical**: if `detected_type === "web"`, link to the web viewer. If `detected_type === "mobile"`, link to the mobile viewer.
53
+ - Opens in new tab (`target="_blank"`)
54
+
55
+ ## Functional Requirements
56
+
57
+ - **Section filtering**: clicking a tab shows only that section's cards; "All" shows everything
58
+ - **Search**: filters cards by title and description text match (case-insensitive)
59
+ - **View toggle**: switches between grid and list layouts; persists in localStorage
60
+ - **Smooth transitions**: cards fade/slide when filtering sections
61
+ - Cards use `loading="lazy"` on thumbnail images
62
+
63
+ ## Anti-Patterns
64
+
65
+ - Do NOT use uniform aspect ratios for mixed web+mobile projects — web screens in portrait cards look broken
66
+ - Do NOT hide descriptions in grid mode — they provide context for choosing which screen to view
67
+ - Do NOT use tiny cards — minimum card width of 200px for mobile, 240px for web
68
+ - Do NOT use pagination — show all screens and rely on section tabs + search for navigation
69
+
70
+ ## Structural Pattern
71
+
72
+ ```
73
+ <section> gallery: max-w-7xl mx-auto px-6
74
+ <div> gallery-header
75
+ <h2> "Screens" + intro text
76
+ <div> section tabs (pill bar)
77
+
78
+ <div> screens-container
79
+ for each section:
80
+ <section> data-section="{key}"
81
+ <h3> section name + count
82
+ <div> screens-grid: grid of cards
83
+ for each screen:
84
+ <a> screen-card → viewer.html?...
85
+ <div> card-thumb: aspect-ratio based on detected_type
86
+ <img> thumbnail
87
+ <span> dark/light badge (conditional)
88
+ <div> card-info
89
+ <p> title
90
+ <p> description
91
+ ```
92
+
93
+ ## Contract (Required IDs/Classes)
94
+
95
+ - `.screen-section[data-section="{key}"]` — section wrapper for tab filtering
96
+ - `.screen-card` — each card element
97
+ - `.screens-grid` — the grid container (JS toggles `.list-mode` class)
98
+ - `.filter-tab[data-section="{key}"]` — tab buttons
99
+ - `.card-thumb` — thumbnail container
100
+ - `.card-info` — text info container
101
+ - `.card-desc` — description paragraph
102
+ - Viewer URL format: `viewer.html?screen={html_file}&title={encodeURIComponent(title)}&desc={encodeURIComponent(description)}`
@@ -0,0 +1,105 @@
1
+ # Section: Viewer — Web
2
+
3
+ ## Purpose
4
+
5
+ Full-screen viewer for web (desktop/dashboard) designs. Displays the screen's HTML in an iframe that fills the available viewport width, mimicking a real browser window with chrome decoration.
6
+
7
+ ## Data Required (from URL parameters)
8
+
9
+ - `screen` — path to the HTML file (e.g., `assets/dashboard.html`)
10
+ - `title` — screen title for the header
11
+ - `desc` — screen description
12
+
13
+ ## Data Required (from showcase_context.json — embedded in viewer)
14
+
15
+ - `all_screens` — flat ordered list for prev/next navigation
16
+ - `font_family` — consistent typography
17
+ - `default_theme` — initial theme
18
+ - `project_name` — page title
19
+
20
+ ## Design Requirements
21
+
22
+ ### Browser Chrome Bar
23
+
24
+ - A decorative bar at the top of the iframe area simulating a browser window:
25
+ - Three dots (red/yellow/green) on the left
26
+ - URL bar in the center showing the screen slug (non-functional, decorative)
27
+ - Subtle rounded corners on the chrome bar
28
+ - The chrome bar is purely decorative — it frames the web design to feel like viewing a real website
29
+
30
+ ### Iframe Container
31
+
32
+ - **Full viewport width** within content area (no phone frame!)
33
+ - `width: 100%` with natural height based on content, or `height: calc(100vh - header - chrome)`
34
+ - No artificial width constraints — web designs must breathe
35
+ - Border: subtle `1px solid` border around the iframe area
36
+ - Background: neutral dark (matches iframe loading state)
37
+
38
+ ### Header Bar
39
+
40
+ - Compact header (48-56px) with:
41
+ - Back button (← or X) that calls `window.close()` or navigates back
42
+ - Screen title (truncated)
43
+ - Screen description (right-aligned, muted, hidden on mobile)
44
+ - Prev/Next navigation arrows
45
+ - Fullscreen toggle button
46
+
47
+ ### Navigation
48
+
49
+ - **Prev/Next**: arrow buttons cycle through `all_screens` in order
50
+ - **Keyboard shortcuts**: Left/Right arrow keys for prev/next, Escape to go back, F for fullscreen
51
+ - Wrap around: after last screen, next goes to first
52
+
53
+ ## Functional Requirements
54
+
55
+ - **URL-driven**: reads `?screen=...&title=...&desc=...` params on load
56
+ - **Prev/Next updates URL** without page reload (history.replaceState)
57
+ - **Fullscreen**: Fullscreen API on the iframe container (not the whole page)
58
+ - **Theme**: respects localStorage theme setting from index.html
59
+ - **Responsive**: on very small screens, hide the chrome bar and description, keep core functionality
60
+
61
+ ## Anti-Patterns
62
+
63
+ - **NEVER** use a phone frame for web designs — this is the critical bug being fixed
64
+ - **NEVER** constrain the iframe to a fixed narrow width (like 390px)
65
+ - Do NOT add scrollbars around the iframe — let the iframe content handle its own scroll
66
+ - Do NOT use a heavy header that competes with the design being viewed
67
+
68
+ ## Structural Pattern
69
+
70
+ ```
71
+ <html>
72
+ <head> title, theme setup, Tailwind CDN, font
73
+ <body> flex flex-col h-screen
74
+ <header> compact bar
75
+ <button> back
76
+ <span> title
77
+ <span> description (desktop only)
78
+ <div> prev / next / fullscreen buttons
79
+
80
+ <main> flex-1 overflow-hidden
81
+ <div> browser-chrome-bar
82
+ <div> three dots
83
+ <div> fake URL bar
84
+ <div> iframe-container
85
+ <iframe> src={screen param} width=100% height=100%
86
+
87
+ <script>
88
+ - Parse URL params
89
+ - Load all_screens from embedded JSON
90
+ - Prev/next navigation
91
+ - Keyboard shortcuts
92
+ - Fullscreen toggle
93
+ - Theme management
94
+ ```
95
+
96
+ ## Contract
97
+
98
+ - `id="viewer-frame"` — the iframe element
99
+ - `id="screen-title"` — title display
100
+ - `id="screen-desc"` — description display
101
+ - `id="btn-back"` — back/close button
102
+ - `id="btn-prev"` / `id="btn-next"` — navigation buttons
103
+ - `id="btn-fullscreen"` — fullscreen toggle
104
+ - URL format: `viewer.html?screen={path}&title={title}&desc={desc}`
105
+ - `SCREENS_DATA` — embedded JSON array of all screens (for prev/next)
@@ -0,0 +1,104 @@
1
+ # Section: Viewer — Mobile
2
+
3
+ ## Purpose
4
+
5
+ Viewer for mobile app designs. Displays the screen's HTML inside a realistic phone frame (390×844), centered on the page, with device-like bezel styling.
6
+
7
+ ## Data Required (from URL parameters)
8
+
9
+ - `screen` — path to the HTML file (e.g., `assets/login.html`)
10
+ - `title` — screen title for the header
11
+ - `desc` — screen description
12
+
13
+ ## Data Required (from showcase_context.json — embedded in viewer)
14
+
15
+ - `all_screens` — flat ordered list for prev/next navigation
16
+ - `font_family` — consistent typography
17
+ - `default_theme` — initial theme
18
+ - `project_name` — page title
19
+
20
+ ## Design Requirements
21
+
22
+ ### Phone Frame
23
+
24
+ - **Dimensions**: 390×844px (iPhone 14/15 logical resolution)
25
+ - **Bezel**: 8px solid border with rounded corners (40px border-radius)
26
+ - **Notch/Dynamic Island**: optional decorative element at the top (a small pill shape)
27
+ - **Shadow**: deep box-shadow to lift the device off the background: `0 20px 60px rgba(0,0,0,0.4)`
28
+ - **Background behind frame**: dark neutral (#0d0d0d dark mode, #f0f0f0 light mode)
29
+
30
+ ### Responsive Scaling
31
+
32
+ - On viewports narrower than ~450px, scale the phone frame down using `transform: scale()` to fit
33
+ - Calculate scale factor: `min(1, (viewportWidth - 40) / 390)`
34
+ - Also scale vertically if viewport height is limited: `min(1, (viewportHeight - headerHeight - 40) / 844)`
35
+ - Use `transform-origin: top center`
36
+
37
+ ### Header Bar
38
+
39
+ - Same compact header pattern as web viewer:
40
+ - Back button → `window.close()`
41
+ - Screen title (truncated)
42
+ - Description (hidden on mobile)
43
+ - Prev/Next arrows
44
+ - Fullscreen toggle
45
+
46
+ ### Iframe Inside Frame
47
+
48
+ - `width: 390px; height: 844px` — matches the frame interior
49
+ - `border: none`
50
+ - Overflow handled by the iframe's own content
51
+
52
+ ## Functional Requirements
53
+
54
+ - **URL-driven**: reads `?screen=...&title=...&desc=...` params
55
+ - **Prev/Next**: cycles through all_screens; updates URL via history.replaceState
56
+ - **Keyboard shortcuts**: Left/Right arrows, Escape, F for fullscreen
57
+ - **Fullscreen**: expands the phone frame container (not just the iframe)
58
+ - **Theme**: respects localStorage theme from index.html
59
+ - **Scaling recalculates on window resize**
60
+
61
+ ## Anti-Patterns
62
+
63
+ - **NEVER** display web designs in this viewer — they will be crushed to 390px
64
+ - Do NOT remove the phone frame border/bezel — it provides essential context
65
+ - Do NOT use fixed positioning that breaks on mobile browsers
66
+ - Do NOT let the phone frame overflow the viewport without scaling
67
+
68
+ ## Structural Pattern
69
+
70
+ ```
71
+ <html>
72
+ <head> title, theme setup, Tailwind CDN, font
73
+ <body> flex flex-col h-screen bg-neutral
74
+ <header> compact bar
75
+ <button> back
76
+ <span> title
77
+ <span> description (desktop only)
78
+ <div> prev / next / fullscreen buttons
79
+
80
+ <main> flex-1 flex items-center justify-center
81
+ <div> phone-wrap: 390x844, border, border-radius, shadow
82
+ <iframe> src={screen} 390x844
83
+
84
+ <script>
85
+ - Parse URL params
86
+ - Responsive scaling logic
87
+ - Prev/next from embedded SCREENS_DATA
88
+ - Keyboard shortcuts
89
+ - Fullscreen toggle
90
+ - Theme management
91
+ - Window resize handler for scale recalculation
92
+ ```
93
+
94
+ ## Contract
95
+
96
+ - `id="phone-wrap"` — the phone frame container
97
+ - `id="viewer-frame"` — the iframe element
98
+ - `id="screen-title"` — title display
99
+ - `id="screen-desc"` — description display
100
+ - `id="btn-back"` — back/close button
101
+ - `id="btn-prev"` / `id="btn-next"` — navigation buttons
102
+ - `id="btn-fullscreen"` — fullscreen toggle
103
+ - Phone dimensions: exactly 390×844px (CSS), scaled via transform
104
+ - `SCREENS_DATA` — embedded JSON array of all screens
@@ -0,0 +1,77 @@
1
+ # Section: Theme System (Light/Dark Mode)
2
+
3
+ ## Purpose
4
+
5
+ Consistent light/dark mode across index.html and viewer.html, with intelligent defaults based on the project's surface color and user preference persistence.
6
+
7
+ ## Data Required (from showcase_context.json)
8
+
9
+ - `default_theme` — "light" or "dark", computed from surface color luminance
10
+ - `color_tokens.surface` — the app's surface color (used to compute smart default)
11
+
12
+ ## Design Requirements
13
+
14
+ ### Smart Default
15
+
16
+ The default theme is the **opposite** of the app's surface color for maximum contrast:
17
+ - Dark app surface (luminance < 100) → showcase opens in **light** mode
18
+ - Light app surface (luminance > 155) → showcase opens in **dark** mode
19
+ - This ensures thumbnails stand out against the showcase background
20
+
21
+ ### Color Tokens
22
+
23
+ | Element | Light Mode | Dark Mode |
24
+ |---------|-----------|-----------|
25
+ | Page background | `#f5f5f5` or `#fafafa` | `#0d0d0d` or `#0a0a0a` |
26
+ | Card background | `#ffffff` | `#1a1a1a` |
27
+ | Card border | `rgba(0,0,0,0.08)` | `rgba(255,255,255,0.08)` |
28
+ | Text primary | `#111827` (gray-900) | `#f3f4f6` (gray-100) |
29
+ | Text secondary | `#6b7280` (gray-500) | `#9ca3af` (gray-400) |
30
+ | Text muted | `#9ca3af` (gray-400) | `#6b7280` (gray-500) |
31
+
32
+ ### Transitions
33
+
34
+ - All color transitions: `transition-colors duration-200`
35
+ - Apply to `<body>` and major containers
36
+ - No flash of wrong theme on load (theme class applied before render)
37
+
38
+ ## Functional Requirements
39
+
40
+ ### Initialization (Critical — no flash)
41
+
42
+ ```javascript
43
+ // In <head> BEFORE any rendering — blocks render until class is set
44
+ (function() {
45
+ const saved = localStorage.getItem('showcase-theme');
46
+ const defaultTheme = '{{DEFAULT_THEME}}'; // from context
47
+ const theme = saved || defaultTheme;
48
+ if (theme === 'dark') document.documentElement.classList.add('dark');
49
+ })();
50
+ ```
51
+
52
+ ### Toggle Logic
53
+
54
+ ```javascript
55
+ document.getElementById('theme-toggle').addEventListener('click', () => {
56
+ document.documentElement.classList.toggle('dark');
57
+ const isDark = document.documentElement.classList.contains('dark');
58
+ localStorage.setItem('showcase-theme', isDark ? 'dark' : 'light');
59
+ });
60
+ ```
61
+
62
+ ### Shared State
63
+
64
+ - Both index.html and viewer.html read/write the same `localStorage` key: `'showcase-theme'`
65
+ - Opening viewer from index inherits the current theme immediately
66
+
67
+ ## Implementation Notes
68
+
69
+ - Use Tailwind's `darkMode: 'class'` configuration
70
+ - Tailwind config should extend colors with the project's accent: `colors: { accent: '{{PRIMARY_COLOR}}' }`
71
+ - The theme initialization script MUST be in `<head>`, not at end of body, to prevent flash
72
+
73
+ ## Anti-Patterns
74
+
75
+ - Do NOT use `prefers-color-scheme` as the only source — the smart default from surface luminance is more important for showcase contrast
76
+ - Do NOT animate the initial theme application (only transitions after user interaction)
77
+ - Do NOT forget to sync theme between index and viewer pages
@@ -0,0 +1,81 @@
1
+ # Section: Type Detection & Routing
2
+
3
+ ## Purpose
4
+
5
+ Intelligent per-screen type detection that ensures web designs open in the web viewer (full-width) and mobile designs open in the mobile viewer (phone frame). Solves the critical bug where web designs were displayed inside a phone frame.
6
+
7
+ ## Data Required (from showcase_context.json)
8
+
9
+ - `type` — project-level type ("mobile" or "web")
10
+ - Each screen's `detected_type` — per-screen type ("mobile", "web", or "unknown")
11
+
12
+ ## How Detection Works (in build_showcase.py)
13
+
14
+ Each screen's HTML is analyzed for these signals:
15
+
16
+ | Signal | Points | Type |
17
+ |--------|--------|------|
18
+ | `user-scalable=no` in viewport meta | +2 | mobile |
19
+ | `maximum-scale=1` in viewport meta | +1 | mobile |
20
+ | Fixed widths 375-430px in CSS | +2 | mobile |
21
+ | Desktop breakpoints (768px+) in media queries | +2 | web |
22
+ | Sidebar/nav-rail/drawer patterns | +1 | web |
23
+ | Wide fixed widths (900px+) | +1 | web |
24
+
25
+ If mobile score > web score → mobile. If web > mobile → web. Tie → "unknown".
26
+
27
+ ## Routing Rules
28
+
29
+ ### In index.html (Gallery Cards)
30
+
31
+ When generating card links, the AI must use the correct viewer:
32
+
33
+ ```
34
+ if screen.detected_type === "web":
35
+ link → viewer-web.html?screen=...
36
+ elif screen.detected_type === "mobile":
37
+ link → viewer-mobile.html?screen=...
38
+ elif screen.detected_type === "unknown":
39
+ link → viewer based on project-level type
40
+ ```
41
+
42
+ ### Single vs Dual Viewer Strategy
43
+
44
+ **Option A — Two separate viewer files** (simpler):
45
+ - `viewer-web.html` — always renders full-width with browser chrome
46
+ - `viewer-mobile.html` — always renders in phone frame
47
+ - Cards link to the appropriate one
48
+
49
+ **Option B — Single viewer.html with mode parameter** (DRYer):
50
+ - `viewer.html?screen=...&mode=web` or `mode=mobile`
51
+ - Viewer reads mode param and adjusts layout accordingly
52
+ - Prev/next must respect mode of each screen
53
+
54
+ **Recommended**: Option B for mixed-type projects, Option A when all screens are the same type.
55
+
56
+ ### Gallery Card Aspect Ratios
57
+
58
+ Cards in the gallery should adapt their thumbnail aspect ratio:
59
+ - Mobile screens: `aspect-ratio: 9/16` (tall portrait)
60
+ - Web screens: `aspect-ratio: 16/10` (wide landscape)
61
+ - This provides visual differentiation even before clicking
62
+
63
+ ### Mixed-Type Badges
64
+
65
+ For projects with both web and mobile screens, add a small badge on cards:
66
+ - Mobile screens: phone icon or "Mobile" pill
67
+ - Web screens: monitor icon or "Web" pill
68
+ - Only show these badges in mixed-type projects (when both types exist)
69
+
70
+ ## Anti-Patterns
71
+
72
+ - **NEVER** route all screens to the same viewer regardless of type — this is the bug being fixed
73
+ - Do NOT ignore `detected_type` and only use project-level `type`
74
+ - Do NOT show web designs in a phone frame under any circumstance
75
+ - Do NOT show mobile designs in a full-width iframe (they'll be tiny and lost)
76
+
77
+ ## Contract
78
+
79
+ - Viewer URL must include type/mode information
80
+ - `detected_type` field must be present on every screen in the context JSON
81
+ - Gallery cards must use adaptive aspect ratios based on detected_type
@@ -0,0 +1,126 @@
1
+ # Section: Quality Standards & Anti-Patterns
2
+
3
+ ## Purpose
4
+
5
+ Guardrails that prevent the AI from generating generic, flat, "obviously AI-made" showcase HTML. This document defines the visual quality bar and common failure modes to avoid.
6
+
7
+ ## Required Skills
8
+
9
+ Before generating ANY showcase HTML, the AI MUST invoke these skills:
10
+ - **`frontend-design`** — for creative, distinctive HTML generation that avoids generic AI patterns
11
+ - **`refactoring-ui`** — for visual hierarchy, depth, spacing, and typography decisions
12
+ - **`ui-ux-pro-max`** — for color system best practices, component patterns, and interaction design
13
+
14
+ These skills contain specific techniques for achieving professional-grade output.
15
+
16
+ ## Visual Quality Bar
17
+
18
+ The generated showcase should feel like it was designed by a product designer at **Linear, Raycast, Stripe, or Vercel** — not by a template engine. Specific qualities:
19
+
20
+ ### Depth & Layering
21
+ - Use subtle shadows at multiple levels (not just `shadow-lg` on everything)
22
+ - Cards should feel lifted off the surface with layered borders + shadows
23
+ - Background should have subtle texture or gradient (not flat solid color)
24
+ - Ghost borders (`border: 1px solid rgba(255,255,255,0.06)`) add refinement in dark mode
25
+
26
+ ### Typography
27
+ - Use the project's font family with a clear **type scale** (not everything the same size)
28
+ - Tracking adjustments: `-0.02em` on headings, normal on body
29
+ - Font weight hierarchy: Bold (700) for headings, Semibold (600) for labels, Regular (400) for body
30
+ - Line height: tight (1.2) on headings, relaxed (1.6) on body text
31
+
32
+ ### Color Usage
33
+ - Accent color used sparingly: tab highlights, hover borders, interactive elements
34
+ - **NEVER** as large surface backgrounds
35
+ - Neutral surfaces with slight warmth or coolness (not pure gray)
36
+ - Sufficient contrast ratios (WCAG AA minimum: 4.5:1 for text)
37
+
38
+ ### Spacing & Rhythm
39
+ - Consistent spacing scale: 4px base (4, 8, 12, 16, 24, 32, 48, 64)
40
+ - Generous whitespace between sections (48-96px)
41
+ - Tighter spacing within components (8-16px)
42
+ - Asymmetric padding creates visual interest (more top than bottom, more left than right for headers)
43
+
44
+ ### Micro-interactions
45
+ - Hover states on ALL interactive elements (cards, buttons, tabs)
46
+ - Scale transforms on card hover: `scale(1.02)` — subtle, not bouncy
47
+ - Color transitions: `transition-colors duration-200`
48
+ - Focus-visible rings for keyboard navigation accessibility
49
+
50
+ ### Responsive Behavior
51
+ - Mobile-first: single column, then expand to grid
52
+ - No horizontal scroll on any viewport
53
+ - Touch-friendly tap targets (minimum 44×44px)
54
+ - Breakpoints: 640px (sm), 768px (md), 1024px (lg), 1280px (xl)
55
+
56
+ ## Banned Patterns (The "Generic AI" Checklist)
57
+
58
+ If you see yourself doing ANY of these, STOP and redesign:
59
+
60
+ | Banned Pattern | Why It's Bad | What To Do Instead |
61
+ |---|---|---|
62
+ | Flat gray (#f3f4f6) background everywhere | Lifeless, no personality | Use near-white/near-black with subtle warmth |
63
+ | All cards exactly the same size and spacing | Monotonous grid | Vary card sizes for DS section vs gallery cards |
64
+ | Color swatches as small circles | Minimizes the design system | Large blocks showing relationships |
65
+ | "Aa" as the only type specimen | Tells nothing about the typeface | Full type scale with real project text |
66
+ | Generic sans-serif (system-ui) when font exists | Ignores project identity | Always load and apply the project's font |
67
+ | Bright colored header/hero backgrounds | Clashes with thumbnails | Neutral backgrounds, accent as detail only |
68
+ | No hover states | Feels static, dead | Every clickable element needs hover feedback |
69
+ | Same border-radius everywhere | Boring uniformity | Vary: 8px for cards, 12px for modals, full for pills |
70
+ | Centered everything | Template feel | Left-align text, asymmetric layouts |
71
+ | "Welcome to..." copy | AI copywriting smell | Jump straight to project stats and content |
72
+ | Rainbow gradients | Unprofessional | Monochrome or two-tone gradients from project palette |
73
+ | Icon soup (decorative icons everywhere) | Visual noise | Icons only for functional purposes (toggle, nav) |
74
+
75
+ ## Technical Standards
76
+
77
+ ### Self-Contained HTML
78
+ - Single HTML file with all CSS inline (in `<style>` or Tailwind classes)
79
+ - Tailwind CSS via CDN: `<script src="https://cdn.tailwindcss.com"></script>`
80
+ - Google Fonts via CDN link
81
+ - No external JS libraries beyond Tailwind
82
+ - No build step required — just open in browser
83
+
84
+ ### Performance
85
+ - Images use `loading="lazy"`
86
+ - Minimal DOM nesting (avoid wrapper div soup)
87
+ - CSS transitions, not JS animations
88
+ - No layout shift on theme toggle
89
+
90
+ ### Accessibility
91
+ - Semantic HTML: `<header>`, `<main>`, `<section>`, `<nav>`
92
+ - All images have `alt` text
93
+ - Focus-visible styles on interactive elements
94
+ - Keyboard navigable: Tab through cards, Enter to open
95
+ - `role="button"` on non-button clickable elements
96
+
97
+ ### URL Contract
98
+ - Index links to viewer via: `viewer.html?screen={path}&title={title}&desc={desc}`
99
+ - Viewer reads URL params and renders accordingly
100
+ - Prev/next updates URL without reload (history.replaceState)
101
+
102
+ ## Inspiration References
103
+
104
+ Study these products for visual quality benchmarks:
105
+ - **Linear** — dark mode, subtle gradients, layered cards, excellent typography
106
+ - **Raycast** — clean hierarchy, bold headings, muted descriptions, pill badges
107
+ - **Stripe Docs** — structured sections, code blocks, clear information hierarchy
108
+ - **Vercel Dashboard** — minimal, high contrast, excellent use of whitespace
109
+ - **Apple Human Interface Guidelines** — phone frame styling, device showcasing
110
+
111
+ ## Verification Checklist
112
+
113
+ Before declaring the showcase complete, verify:
114
+
115
+ - [ ] Project font is loaded and applied (not falling back to system-ui)
116
+ - [ ] Accent color from project is used (hover, active tab, not generic indigo)
117
+ - [ ] Dark/light mode works and persists across pages
118
+ - [ ] Design system section shows color RELATIONSHIPS, not just swatches
119
+ - [ ] Typography specimen shows multiple sizes and weights
120
+ - [ ] Gallery cards have correct aspect ratios (portrait for mobile, landscape for web)
121
+ - [ ] Web screens open in full-width viewer, mobile screens in phone frame
122
+ - [ ] Search filters cards
123
+ - [ ] Section tabs filter correctly
124
+ - [ ] Prev/next works in viewer with keyboard shortcuts
125
+ - [ ] No horizontal scroll on mobile viewport
126
+ - [ ] All hover states are present and smooth
@@ -0,0 +1,40 @@
1
+ # Component Standardization
2
+
3
+ ## Problem
4
+
5
+ Google Stitch generates slight variations of shared components (navbar, footer, tabbar) across screens within the same session. Navigation might have a different link order, footer might use different spacing, tabbar icons might differ.
6
+
7
+ ## Solution
8
+
9
+ The `--components` flag detects these shared components, groups variants by similarity, and recommends a canonical version for the user to replicate across all screens.
10
+
11
+ ## Detection Strategy
12
+
13
+ 1. **Semantic tags**: `<nav>`, `<header>`, `<footer>`, `<aside>`
14
+ 2. **ARIA roles**: `role="navigation"`, `role="contentinfo"`, `role="tablist"`
15
+ 3. **CSS class patterns**: classes containing `nav`, `footer`, `sidebar`, `tabbar`, `bottom-nav`
16
+ 4. **Position fallback**: `position: fixed/sticky` with `top: 0` (navbar) or `bottom: 0` (tabbar)
17
+
18
+ ## Similarity Scoring
19
+
20
+ Components are compared using a weighted score:
21
+ - **DOM structure (50%)**: Tag-only tree signature comparison via `SequenceMatcher`
22
+ - **CSS classes (30%)**: Jaccard similarity of class name sets
23
+ - **Visible text (20%)**: Text content similarity via `SequenceMatcher`
24
+
25
+ Default grouping threshold: **85% similarity**.
26
+
27
+ ## Canonical Selection
28
+
29
+ Priority for choosing the canonical (best) version:
30
+ 1. Screens with "home", "main", "dashboard", "landing" in the slug
31
+ 2. Most DOM nodes (most complete version)
32
+ 3. First encountered
33
+
34
+ ## Output
35
+
36
+ `shared_components.json` in the showcase directory, containing per component type:
37
+ - `found_in`: number of screens containing this component
38
+ - `total_screens`: total screens analyzed
39
+ - `canonical`: the recommended version with slug and HTML snippet
40
+ - `variants`: list of other versions with similarity scores and difference descriptions