@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.
- package/README.md +531 -0
- package/bin/aiskills.js +76 -0
- package/lib/cache.js +49 -0
- package/lib/cleanup.js +77 -0
- package/lib/commands/auto-update.js +131 -0
- package/lib/commands/doctor.js +139 -0
- package/lib/commands/list.js +77 -0
- package/lib/commands/skills.js +263 -0
- package/lib/commands/status.js +94 -0
- package/lib/commands/uninstall.js +182 -0
- package/lib/commands/update.js +149 -0
- package/lib/config.js +90 -0
- package/lib/downloader.js +110 -0
- package/lib/hooks.js +74 -0
- package/lib/installer.js +114 -0
- package/lib/platform.js +112 -0
- package/lib/prompts/checkboxCancel.js +264 -0
- package/lib/prompts/selectCancel.js +204 -0
- package/lib/symlink.js +154 -0
- package/lib/utils.js +49 -0
- package/package.json +61 -0
- package/skills/humaniza/SKILL.md +51 -0
- package/skills/humaniza/agents/openai.yaml +4 -0
- package/skills/humaniza/references/ai-patterns-es.md +51 -0
- package/skills/humaniza/references/checklist.md +9 -0
- package/skills/humaniza/references/examples.md +17 -0
- package/skills/humaniza/references/lexicon-es-mx.md +36 -0
- package/skills/humaniza/references/modes-es-mx.md +41 -0
- package/skills/humaniza/references/voice-es-mx.md +24 -0
- package/skills/refactoring-ui/SKILL.md +59 -0
- package/skills/refactoring-ui/references/01-design-process.md +72 -0
- package/skills/refactoring-ui/references/02-visual-hierarchy.md +84 -0
- package/skills/refactoring-ui/references/03-layout-spacing.md +69 -0
- package/skills/refactoring-ui/references/04-typography.md +70 -0
- package/skills/refactoring-ui/references/05-color.md +96 -0
- package/skills/refactoring-ui/references/06-depth-shadows.md +74 -0
- package/skills/refactoring-ui/references/07-images.md +75 -0
- package/skills/refactoring-ui/references/08-finishing-touches.md +91 -0
- package/skills/stitch-showcase/SKILL.md +411 -0
- package/skills/stitch-showcase/references/01-navbar.md +52 -0
- package/skills/stitch-showcase/references/02-hero.md +56 -0
- package/skills/stitch-showcase/references/03-design-system.md +102 -0
- package/skills/stitch-showcase/references/04-screen-gallery.md +102 -0
- package/skills/stitch-showcase/references/05-viewer-web.md +105 -0
- package/skills/stitch-showcase/references/06-viewer-mobile.md +104 -0
- package/skills/stitch-showcase/references/07-theme-system.md +77 -0
- package/skills/stitch-showcase/references/08-type-detection.md +81 -0
- package/skills/stitch-showcase/references/09-quality-standards.md +126 -0
- package/skills/stitch-showcase/references/10-component-standardization.md +40 -0
- package/skills/stitch-showcase/references/11-component-catalog.md +70 -0
- package/skills/stitch-showcase/references/catalog-template.html +841 -0
- package/skills/stitch-showcase/references/index.html +299 -0
- package/skills/stitch-showcase/references/viewer.html +412 -0
- package/skills/stitch-showcase/scripts/__pycache__/build_showcase.cpython-314.pyc +0 -0
- package/skills/stitch-showcase/scripts/__pycache__/component_utils.cpython-313.pyc +0 -0
- package/skills/stitch-showcase/scripts/__pycache__/detect_components.cpython-313.pyc +0 -0
- package/skills/stitch-showcase/scripts/__pycache__/extract_catalog.cpython-313.pyc +0 -0
- package/skills/stitch-showcase/scripts/__pycache__/extract_text.cpython-313.pyc +0 -0
- package/skills/stitch-showcase/scripts/__pycache__/extract_zips.cpython-313.pyc +0 -0
- package/skills/stitch-showcase/scripts/__pycache__/parse_design_md.cpython-313.pyc +0 -0
- package/skills/stitch-showcase/scripts/apply_canonical.py +238 -0
- package/skills/stitch-showcase/scripts/build_showcase.py +2103 -0
- package/skills/stitch-showcase/scripts/component_utils.py +398 -0
- package/skills/stitch-showcase/scripts/detect_components.py +284 -0
- package/skills/stitch-showcase/scripts/extract_catalog.py +913 -0
- package/skills/stitch-showcase/scripts/extract_text.py +268 -0
- package/skills/stitch-showcase/scripts/extract_zips.py +178 -0
- package/skills/stitch-showcase/scripts/parse_design_md.py +397 -0
- package/skills/vscode-extension-dev/SKILL.md +114 -0
- package/skills/vscode-extension-dev/references/api-patterns.md +625 -0
- package/skills/vscode-extension-dev/references/architecture.md +287 -0
- package/skills/vscode-extension-dev/references/package-json-schema.md +345 -0
- package/skills/vscode-extension-dev/references/publishing.md +251 -0
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: stitch-showcase
|
|
3
|
+
description: >
|
|
4
|
+
Use this skill whenever the user has Google Stitch design exports and wants to do anything with them —
|
|
5
|
+
build a gallery, organize screens, generate a navigable showcase, process zip files, or browse designs.
|
|
6
|
+
Triggers on: "organiza mis diseños de Stitch", "arma el muestrario", "organize my Stitch designs",
|
|
7
|
+
"build the showcase", "I have the Stitch zips in X", "process this design folder",
|
|
8
|
+
"generate the index for my Stitch screens", "tengo los zips de Stitch", "quiero ver mis pantallas",
|
|
9
|
+
or any mention of Stitch exports, screen.png + code.html pairs, or design zip files.
|
|
10
|
+
Even if the user just says "I have a zip from Stitch" or "mis exports de Stitch" — use this skill.
|
|
11
|
+
Also triggers on: "optimiza el showcase", "mejora las descripciones", "enrich the showcase",
|
|
12
|
+
"optimize titles", "optimiza", or any request to improve an existing showcase's content.
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# stitch-showcase
|
|
16
|
+
|
|
17
|
+
Converts Google Stitch exports (zips with `code.html` + `screen.png`) into a navigable showcase with `index.html` + `viewer.html` + `catalog.html`.
|
|
18
|
+
|
|
19
|
+
**Architecture**: Python script generates all HTML from pre-built templates in ~3 seconds. AI enrichment (descriptions, sections, hero text) is **optional and on-demand** — only when the user asks to optimize. The AI NEVER writes index.html or viewer.html from scratch.
|
|
20
|
+
|
|
21
|
+
## Prerequisites
|
|
22
|
+
|
|
23
|
+
Scripts require Python 3.8+. No external dependencies (stdlib only).
|
|
24
|
+
|
|
25
|
+
## Workflow: Four Modes
|
|
26
|
+
|
|
27
|
+
```dot
|
|
28
|
+
digraph showcase {
|
|
29
|
+
"User trigger" -> "What mode?";
|
|
30
|
+
"What mode?" -> "Mode 1: Build" [label="new showcase"];
|
|
31
|
+
"What mode?" -> "Mode 2: Enrich" [label="optimize/improve"];
|
|
32
|
+
"What mode?" -> "Mode 3: Update" [label="add screens"];
|
|
33
|
+
"What mode?" -> "Mode 4: Standardize" [label="unify components"];
|
|
34
|
+
|
|
35
|
+
"Mode 1: Build" -> "Run build_showcase.py";
|
|
36
|
+
"Run build_showcase.py" -> "Showcase ready (~3s)";
|
|
37
|
+
"Showcase ready (~3s)" -> "Offer: optimize titles?";
|
|
38
|
+
|
|
39
|
+
"Mode 2: Enrich" -> "Extract text → improve DESIGN.md → rebuild";
|
|
40
|
+
|
|
41
|
+
"Mode 3: Update" -> "Copy new zips → --update → classify → rebuild";
|
|
42
|
+
|
|
43
|
+
"Mode 4: Standardize" -> "Review catalog → apply_canonical → rebuild";
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**CRITICAL**: Always run `build_showcase.py` WITHOUT `--context` to generate HTMLs from templates. The `--context` flag is ONLY for debugging/inspecting the data JSON. NEVER have the AI write index.html or viewer.html manually — the templates handle layout, grid, viewer, theme, tabs, search, and all interactive features.
|
|
48
|
+
|
|
49
|
+
## Mode 1: Build (default — instant)
|
|
50
|
+
|
|
51
|
+
**Triggers**: "arma el muestrario", "build the showcase", user gives a zip/folder path, or any request to create a new showcase.
|
|
52
|
+
|
|
53
|
+
This is the default mode. No AI analysis needed — the script handles everything with smart defaults.
|
|
54
|
+
|
|
55
|
+
Steps:
|
|
56
|
+
1. Identify the source path from the user's message
|
|
57
|
+
2. Run the build script — **nothing else**:
|
|
58
|
+
```bash
|
|
59
|
+
python ~/.claude/skills/stitch-showcase/scripts/build_showcase.py /path/to/source
|
|
60
|
+
```
|
|
61
|
+
3. Parse the script output to get the `showcase/` path
|
|
62
|
+
4. Open the showcase in the default browser:
|
|
63
|
+
```bash
|
|
64
|
+
open /path/to/showcase/index.html
|
|
65
|
+
```
|
|
66
|
+
5. Tell the user the showcase is ready and offer to optimize titles and descriptions
|
|
67
|
+
|
|
68
|
+
**That's it.** No pre-flight questions, no DESIGN.md enrichment, no `--extract-text`, no `--init`.
|
|
69
|
+
|
|
70
|
+
Only ask `--type` or `--name` if the **script fails** or the **user explicitly wants to override**:
|
|
71
|
+
```bash
|
|
72
|
+
# Only if script fails to detect type or user requests it
|
|
73
|
+
python ~/.claude/skills/stitch-showcase/scripts/build_showcase.py /path/to/source --type mobile
|
|
74
|
+
python ~/.claude/skills/stitch-showcase/scripts/build_showcase.py /path/to/source --name "My App" --type mobile
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Mode 2: Enrich (on-demand — user asks)
|
|
78
|
+
|
|
79
|
+
**Triggers**: "optimiza", "optimiza el showcase", "mejora las descripciones", "enrich", "optimize titles", "mejora el DESIGN.md", or any request to improve an existing showcase's content quality.
|
|
80
|
+
|
|
81
|
+
This mode improves the AI-generated content in DESIGN.md and rebuilds the showcase with enriched data.
|
|
82
|
+
|
|
83
|
+
Steps:
|
|
84
|
+
1. Find the source folder (from the user's message or the project's `showcase.json`)
|
|
85
|
+
2. Run `--extract-text` to get screen summaries:
|
|
86
|
+
```bash
|
|
87
|
+
python ~/.claude/skills/stitch-showcase/scripts/build_showcase.py /path/to/source --extract-text
|
|
88
|
+
```
|
|
89
|
+
This generates `screen_summaries.txt` — a compact text file with visible text from all screen HTMLs.
|
|
90
|
+
3. Read the existing `DESIGN.md` (in the source folder) + `screen_summaries.txt`
|
|
91
|
+
4. **Keep existing sections as-is** — do NOT re-group screens. Only improve content within each section:
|
|
92
|
+
- **De-mangle titles**: `configuraci_n` → "Configuración", `membres_as_y_pagos` → "Membresías y Pagos"
|
|
93
|
+
- **Write real descriptions**: From the extracted text, write a 1-sentence Spanish description for each screen explaining what it does for the user (NOT just a UI label). Example: "Panel principal del miembro con estado de membresía, próximas clases y accesos rápidos."
|
|
94
|
+
- **Fix the `Title | Description` format** for mangled slugs (see format below)
|
|
95
|
+
5. **Update the project description** at the top of DESIGN.md — this feeds the hero section. It should describe the full scope of the project based on the screens' content.
|
|
96
|
+
6. **Verify colors/fonts**: Scan the screen HTMLs for hex colors in CSS variables and font families. Update `## Colors` and `## Typography` sections if they're missing or incomplete.
|
|
97
|
+
7. Re-run the build to regenerate HTMLs with enriched data:
|
|
98
|
+
```bash
|
|
99
|
+
python ~/.claude/skills/stitch-showcase/scripts/build_showcase.py /path/to/source
|
|
100
|
+
```
|
|
101
|
+
8. Done — tell the user the showcase has been updated with improved descriptions
|
|
102
|
+
|
|
103
|
+
**Mangled slugs (Stitch replaces accented characters with `_`):**
|
|
104
|
+
|
|
105
|
+
Google Stitch strips accent characters from filenames, replacing each with `_`. When you see slugs like `confirmaci_n_de_reserva` or `men_m_s`, reconstruct the correct display title and write it explicitly using the `Title | Description` format:
|
|
106
|
+
|
|
107
|
+
```markdown
|
|
108
|
+
### Cuenta
|
|
109
|
+
- configuraci_n_oscuro: Configuración | Ajustes de cuenta, notificaciones y preferencias del usuario.
|
|
110
|
+
- notificaci_n_oscuro: Notificación | Centro de alertas y mensajes recibidos.
|
|
111
|
+
- esc_ner_oscuro: Escáner | Lector de código QR para acceso o verificación.
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
The parser splits on ` | ` — everything before is the display title, everything after is the description. For slugs without mangled characters, the plain `- slug: description` format is fine (title is inferred from the slug automatically).
|
|
115
|
+
|
|
116
|
+
## Mode 3: Update (add new screens to an existing showcase)
|
|
117
|
+
|
|
118
|
+
**Triggers**: "add these new screens", "el cliente pidió una pantalla más", "coloca este zip en el proyecto", "agrégalos al muestrario", or any similar update request.
|
|
119
|
+
|
|
120
|
+
Steps:
|
|
121
|
+
1. Copy the new zip(s) into the same source folder as the existing screens
|
|
122
|
+
2. Run `build_showcase.py /path/to/source --update`
|
|
123
|
+
- Extracts new zips (existing screens skipped via mtime)
|
|
124
|
+
- Detects slugs not yet in any DESIGN.md section
|
|
125
|
+
- Appends them under `### Por Clasificar` in DESIGN.md
|
|
126
|
+
3. Run `build_showcase.py /path/to/source --extract-text` to generate `screen_summaries.txt` with text from ALL screens (existing + new)
|
|
127
|
+
4. Read `screen_summaries.txt` and the current DESIGN.md
|
|
128
|
+
5. For each new slug in `### Por Clasificar`:
|
|
129
|
+
- Move it to the correct existing section based on its content
|
|
130
|
+
- If the slug is a variant of an existing screen (e.g. login_v2), put it in the same section
|
|
131
|
+
- If it's a genuinely new section topic, create a new `### Section` header
|
|
132
|
+
- Add `Title | Description` using the extracted text (especially if slug has mangled chars)
|
|
133
|
+
6. **Update the project description** at the top of DESIGN.md to reflect the new screens. The hero section uses this text — it should describe the full scope of the project including the additions.
|
|
134
|
+
7. Run the full build: `build_showcase.py /path/to/source`
|
|
135
|
+
8. Confirm with the user that the new screens appear correctly in the showcase
|
|
136
|
+
|
|
137
|
+
## Mode 4: Standardize Components
|
|
138
|
+
|
|
139
|
+
**Triggers**: "standardize the navbars", "make all footers the same", "usa el navbar del home", "estandariza los botones", or similar.
|
|
140
|
+
|
|
141
|
+
Steps:
|
|
142
|
+
1. Open `catalog.html` in the browser — review the comparison view
|
|
143
|
+
2. User decides which variant to use as canonical
|
|
144
|
+
3. Run `apply_canonical.py` to apply the chosen canonical:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
# Structural components (navbar, footer, sidebar, tabbar)
|
|
148
|
+
python ~/.claude/skills/stitch-showcase/scripts/apply_canonical.py /path/to/showcase/assets/ navbar home_screen
|
|
149
|
+
|
|
150
|
+
# Atomic components (button, input, heading, etc.)
|
|
151
|
+
python ~/.claude/skills/stitch-showcase/scripts/apply_canonical.py /path/to/showcase/assets/ button home_screen
|
|
152
|
+
|
|
153
|
+
# Target specific screens only
|
|
154
|
+
python ~/.claude/skills/stitch-showcase/scripts/apply_canonical.py /path/to/showcase/assets/ navbar home_screen --targets login settings profile
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
4. Rebuild the showcase: `build_showcase.py /path/to/source`
|
|
158
|
+
5. Verify the catalog shows fewer variants / more items in "Already Unified"
|
|
159
|
+
6. Repeat until all components are standardized
|
|
160
|
+
|
|
161
|
+
## Verification
|
|
162
|
+
|
|
163
|
+
Confirm with the user:
|
|
164
|
+
- Open `index.html` — thumbnails visible and correct
|
|
165
|
+
- Design system section shows color relationships and type specimen (not just swatches)
|
|
166
|
+
- Click a screen → viewer opens with correct default frame (phone for mobile, browser chrome for web)
|
|
167
|
+
- View mode toggle switches between mobile/web display in both index and viewer
|
|
168
|
+
- Prev/next and keyboard shortcuts work in viewer
|
|
169
|
+
- Light/dark mode toggles and persists
|
|
170
|
+
- Section tabs filter correctly
|
|
171
|
+
- Search filters cards
|
|
172
|
+
- "← Back" button closes the viewer tab
|
|
173
|
+
|
|
174
|
+
## Component Catalog & Comparison (automatic)
|
|
175
|
+
|
|
176
|
+
The catalog is generated automatically as part of every build. Open `catalog.html` to:
|
|
177
|
+
|
|
178
|
+
- **Browse all components** organized by type: Structural (navbars, footers, sidebars), Atomic (buttons, headings, inputs, badges, links, icons), Composite (cards, CTAs, heroes, testimonials)
|
|
179
|
+
- **Compare variants** side-by-side with styled previews (original Tailwind CSS), canonical badges, similarity scores, and screen counts
|
|
180
|
+
- **See what's unified** — components with only one variant appear in a collapsed "Already Unified" section
|
|
181
|
+
- **Copy component HTML** for use in other projects
|
|
182
|
+
|
|
183
|
+
## Build Script Reference
|
|
184
|
+
|
|
185
|
+
### Running the build
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
# Point to the project root — the script discovers the source automatically
|
|
189
|
+
python ~/.claude/skills/stitch-showcase/scripts/build_showcase.py /path/to/project
|
|
190
|
+
|
|
191
|
+
# Or point directly to the folder with zips/screens
|
|
192
|
+
python ~/.claude/skills/stitch-showcase/scripts/build_showcase.py /path/to/project/stitch
|
|
193
|
+
|
|
194
|
+
# Single mega-zip (zip containing all screens as subfolders)
|
|
195
|
+
python ~/.claude/skills/stitch-showcase/scripts/build_showcase.py /path/to/export.zip
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Flags
|
|
199
|
+
|
|
200
|
+
| Flag | Description |
|
|
201
|
+
|------|-------------|
|
|
202
|
+
| `--type mobile\|web` | Set default view mode instead of auto-detecting |
|
|
203
|
+
| `--name "Title"` | Set project name when no DESIGN.md is present |
|
|
204
|
+
| `--init` | Generate a DESIGN.md skeleton from detected screen slugs |
|
|
205
|
+
| `--update` | Detect new screens not yet in DESIGN.md and append under `### Por Clasificar` |
|
|
206
|
+
| `--extract-text` | Extract visible text from screen HTMLs → `screen_summaries.txt` (for LLM consumption) |
|
|
207
|
+
| `--context` | (Debug only) Generate showcase_context.json without building HTML — do NOT use for normal builds |
|
|
208
|
+
| `--watch` | Auto-rebuild on file changes (Ctrl+C to stop) |
|
|
209
|
+
|
|
210
|
+
**Note**: Component detection and catalog generation are now automatic — no `--catalog` or `--components` flags needed. Every build produces `catalog.html` alongside `index.html` and `viewer.html`.
|
|
211
|
+
|
|
212
|
+
### Output structure
|
|
213
|
+
|
|
214
|
+
The script creates a single `showcase/` directory next to the source folder:
|
|
215
|
+
```
|
|
216
|
+
showcase/ ← single output dir (view mode toggle inside)
|
|
217
|
+
├── index.html ← open this in browser (gallery + design system)
|
|
218
|
+
├── viewer.html ← individual screen viewer
|
|
219
|
+
├── catalog.html ← component catalog with comparison view
|
|
220
|
+
├── component_catalog.json ← atomic + composite + cluster data
|
|
221
|
+
├── shared_components.json ← structural component variants
|
|
222
|
+
├── DESIGN.md ← copy from source
|
|
223
|
+
└── assets/
|
|
224
|
+
├── splash_screen.html
|
|
225
|
+
├── splash_screen.png
|
|
226
|
+
├── login.html
|
|
227
|
+
├── login.png
|
|
228
|
+
└── ...
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
Source folder with original zips is **never touched**.
|
|
232
|
+
|
|
233
|
+
### Source discovery
|
|
234
|
+
|
|
235
|
+
The script accepts **any folder in the project** — it doesn't need to be the exact folder with screens. Discovery order:
|
|
236
|
+
1. If the given path has screens (zips or `code.html` folders) → use it directly
|
|
237
|
+
2. If `showcase.json` exists in the given path or its parent → follow its `source` field
|
|
238
|
+
3. Auto-discover: scan one level of subdirectories for screens (skips `showcase`, `showcase-mobile`, `showcase-web` output dirs)
|
|
239
|
+
4. Clear error with a suggestion to create `showcase.json`
|
|
240
|
+
|
|
241
|
+
### Supported input structures
|
|
242
|
+
|
|
243
|
+
| Structure | Example |
|
|
244
|
+
|-----------|---------|
|
|
245
|
+
| Project root with `showcase.json` | `project/showcase.json` → `{"source": "stitch"}` |
|
|
246
|
+
| Folder of individual zips | `folder/login.zip`, `folder/home.zip` |
|
|
247
|
+
| Folder of pre-extracted screen folders | `folder/login/code.html`, `folder/home/code.html` |
|
|
248
|
+
| Single mega-zip (Stitch "Export all") | `export.zip → stitch/screen1/code.html, stitch/screen2/code.html` |
|
|
249
|
+
| Single screen zip | `screen.zip → code.html + screen.png` |
|
|
250
|
+
|
|
251
|
+
## Screen Grouping
|
|
252
|
+
|
|
253
|
+
Screens are grouped into sections in this priority order:
|
|
254
|
+
|
|
255
|
+
1. **`DESIGN.md` sections** (best result) — explicit `### Section Name` blocks under `## Screens`
|
|
256
|
+
2. **Auto-grouping** (fallback) — keyword overlap between slugs; screens sharing a meaningful word are grouped together
|
|
257
|
+
|
|
258
|
+
When auto-grouping applies, offer to improve it:
|
|
259
|
+
- List the detected screen names for the user
|
|
260
|
+
- Suggest logical section groupings based on the app domain
|
|
261
|
+
- Write the sections to `DESIGN.md` in the source folder
|
|
262
|
+
- Re-run the script to apply them
|
|
263
|
+
|
|
264
|
+
**DESIGN.md section format for explicit grouping:**
|
|
265
|
+
```markdown
|
|
266
|
+
## Screens
|
|
267
|
+
### Onboarding
|
|
268
|
+
- splash_screen
|
|
269
|
+
- welcome
|
|
270
|
+
|
|
271
|
+
### Login & Registration
|
|
272
|
+
- login
|
|
273
|
+
- signup
|
|
274
|
+
- forgot_password
|
|
275
|
+
|
|
276
|
+
### Home
|
|
277
|
+
- home
|
|
278
|
+
- home_oscuro
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
The script merges DESIGN.md sections with slug auto-detection — slugs not listed in any section appear in an "Other screens" group at the end.
|
|
282
|
+
|
|
283
|
+
## Description Sources (priority)
|
|
284
|
+
|
|
285
|
+
1. `DESIGN.md` — screen list with descriptions
|
|
286
|
+
2. Individual `{num}-{name}.md` in source folder (per-screen prompt files)
|
|
287
|
+
3. `<meta name="description">` or `<meta property="og:description">` inside the HTML
|
|
288
|
+
4. First `<h1>` or `<h2>` visible text in the HTML body
|
|
289
|
+
5. `<title>` tag (skipped if generic: "Untitled", "index", "screen", etc.)
|
|
290
|
+
6. First meaningful visible text phrase found in the HTML body (strips scripts/styles/SVGs)
|
|
291
|
+
7. Formatted slug fallback ("splash_screen" → "Splash Screen")
|
|
292
|
+
|
|
293
|
+
Stitch-exported HTML rarely has `<title>` or meta descriptions — steps 4 and 6 are the most useful for those files.
|
|
294
|
+
|
|
295
|
+
## showcase.json
|
|
296
|
+
|
|
297
|
+
Optional config file in the project root. Tells the script where to find screens, the project type, and name — so you can point the script at any folder in the project.
|
|
298
|
+
|
|
299
|
+
```json
|
|
300
|
+
{
|
|
301
|
+
"source": "stitch",
|
|
302
|
+
"type": "mobile",
|
|
303
|
+
"name": "SNAP Gym"
|
|
304
|
+
}
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
| Field | Required | Description |
|
|
308
|
+
|-------|----------|-------------|
|
|
309
|
+
| `source` | yes | Relative path from the JSON file to the folder with screens |
|
|
310
|
+
| `type` | no | `"mobile"` or `"web"` (overridden by `--type` CLI flag) |
|
|
311
|
+
| `name` | no | Project name (overridden by `--name` CLI flag or DESIGN.md) |
|
|
312
|
+
|
|
313
|
+
The `--init` flag generates this file automatically alongside DESIGN.md.
|
|
314
|
+
|
|
315
|
+
## DESIGN.md Format
|
|
316
|
+
|
|
317
|
+
```markdown
|
|
318
|
+
# Project Name
|
|
319
|
+
|
|
320
|
+
## Type
|
|
321
|
+
mobile ← or "web"
|
|
322
|
+
|
|
323
|
+
## Screens
|
|
324
|
+
### Onboarding
|
|
325
|
+
- splash_screen
|
|
326
|
+
- login
|
|
327
|
+
|
|
328
|
+
### Home
|
|
329
|
+
- home_dashboard
|
|
330
|
+
|
|
331
|
+
## Colors
|
|
332
|
+
- Primary: #FDD900
|
|
333
|
+
- Background: #0A0A0A
|
|
334
|
+
|
|
335
|
+
## Typography
|
|
336
|
+
- **Inter**
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
The parser also accepts:
|
|
340
|
+
- Free-form bullets/numbered lists under `## Screens`
|
|
341
|
+
- Markdown table format: `| slug | title | description |`
|
|
342
|
+
- Color tokens in Stitch format: `` `primary-container` (#FDD900) `` or bare `surface (#0B1326)`
|
|
343
|
+
- Token named `primary-*` → accent color for tabs and hover
|
|
344
|
+
- Token named `surface` or `background` → used to compute smart showcase theme
|
|
345
|
+
|
|
346
|
+
The `--init` flag auto-generates a skeleton DESIGN.md from detected slugs.
|
|
347
|
+
|
|
348
|
+
## Color Strategy
|
|
349
|
+
|
|
350
|
+
**Do NOT use brand colors for showcase backgrounds** — if the app's background matches the showcase background, thumbnails disappear.
|
|
351
|
+
|
|
352
|
+
| Element | Value |
|
|
353
|
+
|---------|-------|
|
|
354
|
+
| Page background | Smart: dark (`#0d0d0d`) if app surface is light, light (`#f5f5f5`) if app surface is dark |
|
|
355
|
+
| Card background | `#1a1a1a` (dark mode) / `#ffffff` (light mode) |
|
|
356
|
+
| Accent (tabs, hover, borders) | From context `color_tokens.accent` or `colors.primary` → fallback `#6366f1` |
|
|
357
|
+
| Large surfaces | Always neutral — never brand color |
|
|
358
|
+
|
|
359
|
+
The smart default theme is computed from the `surface` color token luminance: dark surface (luminance < 100) → showcase opens in light mode for contrast, and vice versa. The user's preference is saved in `localStorage` and overrides the default on subsequent visits.
|
|
360
|
+
|
|
361
|
+
## Mobile vs Web Detection
|
|
362
|
+
|
|
363
|
+
### Project-level (from DESIGN.md):
|
|
364
|
+
- Keywords: "mobile", "iOS", "Android", "app"
|
|
365
|
+
- If ambiguous → pass `--type` flag
|
|
366
|
+
|
|
367
|
+
### Per-screen (from HTML analysis):
|
|
368
|
+
- Viewport meta `user-scalable=no`, `maximum-scale=1` → mobile
|
|
369
|
+
- Fixed widths 375-430px → mobile
|
|
370
|
+
- Desktop breakpoints, sidebars → web
|
|
371
|
+
- Stored as `detected_type` per screen in context JSON
|
|
372
|
+
|
|
373
|
+
## Scripts
|
|
374
|
+
|
|
375
|
+
| Script | Purpose |
|
|
376
|
+
|--------|---------|
|
|
377
|
+
| `scripts/build_showcase.py` | Main orchestrator — generates index.html + viewer.html |
|
|
378
|
+
| `scripts/extract_zips.py` | Extracts and renames zips → assets/ |
|
|
379
|
+
| `scripts/extract_text.py` | Extracts visible text from HTML files → compact summaries for LLM |
|
|
380
|
+
| `scripts/detect_components.py` | Detects shared components (nav, footer, tabbar) across screens |
|
|
381
|
+
| `scripts/extract_catalog.py` | Extracts atomic + composite components for visual catalog |
|
|
382
|
+
| `scripts/component_utils.py` | Shared HTML parsing helpers (stdlib html.parser) |
|
|
383
|
+
| `scripts/parse_design_md.py` | Parses DESIGN.md → metadata dict |
|
|
384
|
+
|
|
385
|
+
## Reference Templates
|
|
386
|
+
|
|
387
|
+
| Template | Purpose |
|
|
388
|
+
|----------|---------|
|
|
389
|
+
| `references/index.html` | Unified showcase — hero, design system, section tabs, grid/list toggle, mobile/web view mode toggle |
|
|
390
|
+
| `references/viewer.html` | Unified viewer — phone frame + browser chrome toggled by view mode, prev/next, fullscreen |
|
|
391
|
+
| `references/catalog-template.html` | Visual component catalog with tabs, previews, code snippets |
|
|
392
|
+
|
|
393
|
+
## Reference Guides (design documentation)
|
|
394
|
+
|
|
395
|
+
| Guide | Purpose |
|
|
396
|
+
|-------|---------|
|
|
397
|
+
| `references/01-navbar.md` through `references/09-quality-standards.md` | Design decisions documentation for each section |
|
|
398
|
+
| `references/10-component-standardization.md` | Component standardization design doc |
|
|
399
|
+
| `references/11-component-catalog.md` | Component catalog design doc |
|
|
400
|
+
|
|
401
|
+
## Common Errors
|
|
402
|
+
|
|
403
|
+
| Problem | Solution |
|
|
404
|
+
|---------|----------|
|
|
405
|
+
| No zips found | Point to project root (with `showcase.json`) or directly to the screens folder |
|
|
406
|
+
| Broken thumbnails | `screen.png` must be inside the zip alongside `code.html` |
|
|
407
|
+
| Ambiguous type | Pass `--type mobile` or `--type web` explicitly |
|
|
408
|
+
| Empty DESIGN.md | Pass `--name` and `--type` via CLI; descriptions inferred from HTML |
|
|
409
|
+
| Encoding errors | Stitch HTML files use UTF-8; verify terminal encoding matches |
|
|
410
|
+
| Web screens in phone frame | Use `--type web` to force web viewer |
|
|
411
|
+
| Poor/missing descriptions | Use Mode 2 (Enrich): extract text → improve DESIGN.md → rebuild |
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Section: Navbar
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Sticky header that orients the user: project identity, type badge, screen count, and quick-access controls (view toggle, theme toggle, search).
|
|
6
|
+
|
|
7
|
+
## Data Required (from showcase_context.json)
|
|
8
|
+
|
|
9
|
+
- `project_name` — display in header
|
|
10
|
+
- `type` — "mobile" or "web" badge
|
|
11
|
+
- `screen_count` — total screens badge
|
|
12
|
+
- `default_theme` — initial light/dark state
|
|
13
|
+
- `font_family` — apply as primary font
|
|
14
|
+
|
|
15
|
+
## Design Requirements
|
|
16
|
+
|
|
17
|
+
- **Sticky** `top-0 z-50` with subtle backdrop blur and bottom border
|
|
18
|
+
- **Left**: project name (truncated on mobile), type badge pill, screen count pill
|
|
19
|
+
- **Right**: search input (expandable on mobile), grid/list view toggle, light/dark theme toggle
|
|
20
|
+
- Height: 56px desktop, 48px mobile
|
|
21
|
+
- Background: translucent white (light) / translucent dark (dark) with `backdrop-filter: blur(12px)`
|
|
22
|
+
- Border bottom: `1px solid` with low-opacity color
|
|
23
|
+
- Typography: project name in `font-semibold text-sm`, badges in `text-xs`
|
|
24
|
+
|
|
25
|
+
## Functional Requirements
|
|
26
|
+
|
|
27
|
+
- **View toggle**: switches gallery between grid and list mode; persists choice in `localStorage('showcase-view')`
|
|
28
|
+
- **Theme toggle**: switches `<html>` class `dark`; persists in `localStorage('showcase-theme')`
|
|
29
|
+
- **Search**: filters screen cards by title/description; debounced input; shows "No results" empty state
|
|
30
|
+
- All buttons: `focus-visible:ring-2` for keyboard accessibility
|
|
31
|
+
|
|
32
|
+
## Anti-Patterns
|
|
33
|
+
|
|
34
|
+
- Do NOT use opaque backgrounds — the blur-through effect is essential for depth
|
|
35
|
+
- Do NOT put navigation links (there are no pages to navigate to)
|
|
36
|
+
- Do NOT use colored/branded backgrounds for the navbar — always neutral
|
|
37
|
+
|
|
38
|
+
## Structural Pattern
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
<header> sticky top-0 z-50 backdrop-blur
|
|
42
|
+
<div> max-w-7xl mx-auto flex items-center justify-between px-6
|
|
43
|
+
<div> left: project name + badges
|
|
44
|
+
<div> right: search + view toggle + theme toggle
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Contract (Required IDs/Classes)
|
|
48
|
+
|
|
49
|
+
- `id="theme-toggle"` — theme switch button
|
|
50
|
+
- `id="view-toggle"` — grid/list toggle button
|
|
51
|
+
- `id="search-input"` — search input field
|
|
52
|
+
- `.filter-tab` — section filter tab buttons (used by gallery filtering JS)
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Section: Hero
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
First impression section that introduces the project with visual impact. Establishes the design's identity and communicates scope at a glance.
|
|
6
|
+
|
|
7
|
+
## Data Required (from showcase_context.json)
|
|
8
|
+
|
|
9
|
+
- `project_name` — headline
|
|
10
|
+
- `type` — "Mobile App" or "Web App"
|
|
11
|
+
- `screen_count` — stat
|
|
12
|
+
- `sections` — count and names for description
|
|
13
|
+
- `font_family` — use for typographic emphasis
|
|
14
|
+
- `color_tokens` or `colors` — accent color for subtle decorative elements
|
|
15
|
+
|
|
16
|
+
## Design Requirements
|
|
17
|
+
|
|
18
|
+
- **Typographic hierarchy**: large project name (text-4xl to text-6xl depending on length), smaller subtitle describing scope
|
|
19
|
+
- **Visual rhythm**: generous vertical padding (py-16 to py-24), breathing room
|
|
20
|
+
- **Subtle accent**: use the project's primary/accent color for a decorative element (gradient line, dot, underline) — NOT as background
|
|
21
|
+
- **Stats row**: screen count, section count, type — displayed as a minimal horizontal row with dividers
|
|
22
|
+
- **Personality**: the hero should reflect the project's character. A fitness app feels different from a banking app. Use the project name and section names to infer tone.
|
|
23
|
+
- Background: inherits page background (no separate hero background color)
|
|
24
|
+
|
|
25
|
+
## Functional Requirements
|
|
26
|
+
|
|
27
|
+
- Static section — no interactive elements beyond scroll
|
|
28
|
+
- Smooth entrance: consider CSS-only fade-in with `@keyframes` (no JS animation library)
|
|
29
|
+
- Responsive: stack stats vertically on small screens
|
|
30
|
+
|
|
31
|
+
## Anti-Patterns
|
|
32
|
+
|
|
33
|
+
- Do NOT use generic stock-photo-style hero imagery
|
|
34
|
+
- Do NOT use full-width colored backgrounds or gradients as hero background
|
|
35
|
+
- Do NOT center everything — left-aligned text with asymmetric layout creates sophistication
|
|
36
|
+
- Do NOT use "Welcome to..." or "Introducing..." copywriting patterns
|
|
37
|
+
|
|
38
|
+
## Structural Pattern
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
<section> hero: max-w-7xl mx-auto px-6 py-20
|
|
42
|
+
<div> text content
|
|
43
|
+
<h1> project name — large, bold, tracking-tight
|
|
44
|
+
<p> auto-generated description from sections data
|
|
45
|
+
<div> stats row
|
|
46
|
+
<span> N screens
|
|
47
|
+
<span> divider
|
|
48
|
+
<span> N sections
|
|
49
|
+
<span> divider
|
|
50
|
+
<span> Mobile App / Web App
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Contract
|
|
54
|
+
|
|
55
|
+
- No required IDs (hero is static)
|
|
56
|
+
- Should be the first `<section>` after `<header>`
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Section: Design System (Manual de Identidad)
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
A rich, visual Manual de Identidad that showcases the project's design language — not just tokens, but **relationships between tokens**, typographic hierarchy in action, and surface layering. This is the most impactful section of the showcase.
|
|
6
|
+
|
|
7
|
+
## Data Required (from showcase_context.json)
|
|
8
|
+
|
|
9
|
+
- `color_tokens` — semantic color tokens with hex values (primary, secondary, surface, on-primary, etc.)
|
|
10
|
+
- `colors` — named color pairs from DESIGN.md
|
|
11
|
+
- `font_family` — primary typeface name
|
|
12
|
+
- `default_theme` — informs which surface colors to demonstrate first
|
|
13
|
+
- `design_system_screen` — if present, link to the dedicated design system screen in viewer
|
|
14
|
+
- `design_md_raw` — raw DESIGN.md text; may contain design philosophy, component descriptions, usage rules that the AI should interpret and visualize
|
|
15
|
+
|
|
16
|
+
## Design Requirements
|
|
17
|
+
|
|
18
|
+
### Color Palette (NOT just flat swatches)
|
|
19
|
+
|
|
20
|
+
- **Large color blocks** arranged horizontally, showing name + hex + semantic role
|
|
21
|
+
- **Relationship demonstrations**: show primary color ON surface, show on-primary text ON primary background, show secondary as accent alongside primary
|
|
22
|
+
- **Tonal layering**: if surface tokens exist (surface, surface-variant, background), show stacked/overlapping cards at different elevations to demonstrate the tonal hierarchy
|
|
23
|
+
- **Contrast pairs**: explicitly show which text colors work on which backgrounds (e.g., "on-primary" text on "primary" background)
|
|
24
|
+
- Minimum block height: 80px per color. No tiny circles or dots.
|
|
25
|
+
|
|
26
|
+
### Typography Specimen
|
|
27
|
+
|
|
28
|
+
- Show the font at **multiple sizes**: Display (48px), Heading (32px), Subheading (24px), Body (16px), Caption (12px)
|
|
29
|
+
- Show at **multiple weights** if available: Regular (400), Medium (500), Semibold (600), Bold (700)
|
|
30
|
+
- Use **real text from the project** (project name, section names) — not "The quick brown fox"
|
|
31
|
+
- Show a **type scale** visualization: a vertical stack where each level is progressively smaller
|
|
32
|
+
- Include the font name, source (Google Fonts), and fallback stack
|
|
33
|
+
|
|
34
|
+
### Surface Hierarchy (if color_tokens has surface data)
|
|
35
|
+
|
|
36
|
+
- Visualize 2-3 elevation layers: background → surface → surface-variant
|
|
37
|
+
- Use nested cards or overlapping panels to show depth
|
|
38
|
+
- If the project uses glassmorphism or ghost borders (check design_md_raw), demonstrate them
|
|
39
|
+
|
|
40
|
+
### Design System Screen Link
|
|
41
|
+
|
|
42
|
+
- If `design_system_screen` exists, show a prominent card linking to the full design system viewer
|
|
43
|
+
- Include the thumbnail (png_file) as a visual preview
|
|
44
|
+
|
|
45
|
+
### Component Showcase (if design_md_raw describes components)
|
|
46
|
+
|
|
47
|
+
- Parse design_md_raw for component mentions (buttons, cards, inputs, etc.)
|
|
48
|
+
- If found, render sample components using the project's color tokens and typography
|
|
49
|
+
- These are illustrative — they don't need to be interactive
|
|
50
|
+
|
|
51
|
+
## Functional Requirements
|
|
52
|
+
|
|
53
|
+
- Static section — no interactivity beyond hover states
|
|
54
|
+
- Color blocks should show hex on hover or always-visible
|
|
55
|
+
- If glassmorphism tokens exist, demonstrate with `backdrop-filter: blur()` and semi-transparent backgrounds
|
|
56
|
+
- Responsive: color blocks wrap to 2-column on mobile, type specimen stacks naturally
|
|
57
|
+
|
|
58
|
+
## Anti-Patterns
|
|
59
|
+
|
|
60
|
+
- **NEVER** render only flat square swatches as the entire "design system" — this is the #1 failure mode
|
|
61
|
+
- **NEVER** show just a font name with "Aa" — that's a placeholder, not a specimen
|
|
62
|
+
- **NEVER** use gray backgrounds when the project has specific surface tokens
|
|
63
|
+
- **NEVER** ignore the design_md_raw content — it contains the designer's intent and philosophy
|
|
64
|
+
- **NEVER** list colors without showing how they relate to each other
|
|
65
|
+
- Do NOT use a generic grid of circles for colors (this is the "boring AI" pattern)
|
|
66
|
+
|
|
67
|
+
## Structural Pattern
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
<section> design-system: max-w-7xl mx-auto px-6 py-12
|
|
71
|
+
<h2> "Design System" or "Manual de Identidad"
|
|
72
|
+
|
|
73
|
+
<div> color-palette
|
|
74
|
+
<div> large horizontal blocks with name + hex + role
|
|
75
|
+
<div> relationship demos: text-on-background pairs
|
|
76
|
+
|
|
77
|
+
<div> typography-specimen
|
|
78
|
+
<div> type scale: Display → Heading → Body → Caption
|
|
79
|
+
<div> weight showcase: Regular / Medium / Semibold / Bold
|
|
80
|
+
<p> font metadata: name, source, fallback
|
|
81
|
+
|
|
82
|
+
<div> surface-hierarchy (conditional)
|
|
83
|
+
<div> nested cards showing tonal layering
|
|
84
|
+
|
|
85
|
+
<div> ds-screen-link (conditional)
|
|
86
|
+
<a> card linking to viewer.html?screen=design_system
|
|
87
|
+
|
|
88
|
+
<div> components (conditional, from design_md_raw parsing)
|
|
89
|
+
rendered sample components
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Contract
|
|
93
|
+
|
|
94
|
+
- Section must have `id="design-system"`
|
|
95
|
+
- Color blocks: each with `data-token="token-name"` attribute
|
|
96
|
+
- If design_system_screen exists, link format: `viewer.html?screen={html_file}&title={title}&desc={description}`
|
|
97
|
+
|
|
98
|
+
## Skills to Invoke
|
|
99
|
+
|
|
100
|
+
When generating this section, the AI MUST invoke:
|
|
101
|
+
- `refactoring-ui` — for visual hierarchy, depth, and spacing decisions
|
|
102
|
+
- `ui-ux-pro-max` — for color palette presentation and typography best practices
|