cox-protocol-package 1.0.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 (53) hide show
  1. package/COX_FILE_FORMAT_SPECIFICATION_v1.0.md +236 -0
  2. package/LICENSE +21 -0
  3. package/README.md +192 -0
  4. package/bin/cox-protocol.js +57 -0
  5. package/editor-support/vscode/.vscodeignore +9 -0
  6. package/editor-support/vscode/CHANGELOG.md +12 -0
  7. package/editor-support/vscode/LICENSE +21 -0
  8. package/editor-support/vscode/README.md +32 -0
  9. package/editor-support/vscode/language-configuration.json +47 -0
  10. package/editor-support/vscode/package.json +90 -0
  11. package/editor-support/vscode/snippets/cox-common.json +12 -0
  12. package/editor-support/vscode/snippets/cox-component.json +41 -0
  13. package/editor-support/vscode/snippets/cox-crop-metadata.json +23 -0
  14. package/editor-support/vscode/snippets/cox-manifest.json +39 -0
  15. package/editor-support/vscode/snippets/cox-page.json +44 -0
  16. package/editor-support/vscode/snippets/cox-protocol.json +16 -0
  17. package/editor-support/vscode/syntaxes/cox.tmLanguage.json +30 -0
  18. package/guides/imported-packages/cox_protocol_package_compiled.md +32 -0
  19. package/guides/npm-installation.md +296 -0
  20. package/manifest.cox +106 -0
  21. package/package.json +53 -0
  22. package/protocols/coding_agent_starting_point.cox +67 -0
  23. package/protocols/component_binding_graph.cox +52 -0
  24. package/protocols/design_tokens.cox +42 -0
  25. package/protocols/deterministic_naming_convention.cox +159 -0
  26. package/protocols/evidence_and_uncertainty_protocol.cox +42 -0
  27. package/protocols/llm_agent_zip_recreation_instructions.cox +87 -0
  28. package/protocols/recursive_decomposition_protocol.cox +96 -0
  29. package/protocols/screenshot_partitioning_protocol.cox +64 -0
  30. package/protocols/sub_agents_orchestration.cox +85 -0
  31. package/protocols/visual_acceptance_checklist.cox +30 -0
  32. package/protocols/website_logic_and_functionality.cox +82 -0
  33. package/pyproject.toml +51 -0
  34. package/requirements.txt +4 -0
  35. package/schemas/cox.component.v1.schema.json +167 -0
  36. package/schemas/cox.crop_metadata.v1.schema.json +83 -0
  37. package/schemas/cox.manifest.v1.schema.json +172 -0
  38. package/schemas/cox.page.v1.schema.json +229 -0
  39. package/schemas/cox.protocol.v1.schema.json +38 -0
  40. package/skills/design-spec-writer/SKILL.md +182 -0
  41. package/skills/package-docs-writer/SKILL.md +270 -0
  42. package/skills/screenshot-semantic-namer/SKILL.md +96 -0
  43. package/skills/visual-token-extractor/SKILL.md +102 -0
  44. package/skills/zip-design-orchestrator/SKILL.md +113 -0
  45. package/skills/zip-packager/SKILL.md +127 -0
  46. package/templates/ComponentName.cox.template +33 -0
  47. package/templates/Page.cox.template +36 -0
  48. package/templates/crop_metadata.cox.template +15 -0
  49. package/tools/__init__.py +3 -0
  50. package/tools/cox_cli.py +127 -0
  51. package/tools/cox_lib.py +557 -0
  52. package/tools/package_target.py +214 -0
  53. package/tools/react_target.py +278 -0
@@ -0,0 +1,270 @@
1
+ ---
2
+ name: package-docs-writer
3
+ description: >
4
+ Expert at writing the four package-level documentation files for LLMAgentZipRecreation packages:
5
+ README.md, website_logic_and_functionality.md, coding_agent_starting_point.md, and
6
+ llm_agent_zip_recreation_instructions.yaml. Use this skill for Steps 06, 07, and 08 of the
7
+ LLMAgentZipRecreation workflow, or any time a user needs product logic documentation or a
8
+ coding-agent implementation guide generated from UI screenshots and requirements. Trigger on:
9
+ "write the README for this design package", "create a logic doc from these mockups", "generate
10
+ a coding agent starting point", "document the product behavior", or when the zip-design-orchestrator
11
+ delegates Steps 06–08. Also useful standalone for generating developer onboarding docs from
12
+ any set of UI references or product descriptions.
13
+ ---
14
+
15
+ # Package Docs Writer
16
+
17
+ You are the expert for **Steps 06, 07, and 08** of the LLMAgentZipRecreation workflow. Your job is
18
+ to write the four package-level documents that make the ZIP useful for both humans and AI coding
19
+ agents. These docs synthesize everything learned from the screenshots and specs.
20
+
21
+ ---
22
+
23
+ ## Step 06 — `README.md`
24
+
25
+ Keep it **short** — this is a navigation document, not an essay.
26
+
27
+ ```markdown
28
+ # {Project Name} Design Spec Package
29
+
30
+ This package was generated from {N} UI screenshots and contains everything needed to understand,
31
+ design, and implement the {product description}.
32
+
33
+ ## Contents
34
+
35
+ | File | Type | Description |
36
+ |------|------|-------------|
37
+ | `{slug}.png` | Screenshot | Renamed UI reference: {section name} |
38
+ | `{slug}.design.md` | Human spec | Compact nested component design notes |
39
+ | `{slug}.yaml` | Machine spec | Parseable component hierarchy for agents |
40
+ | `README.md` | Guide | This file |
41
+ | `website_logic_and_functionality.md` | Logic | Product behavior, state machine, data flows |
42
+ | `coding_agent_starting_point.md` | Build | Implementation roadmap for AI coding agents |
43
+ | `llm_agent_zip_recreation_instructions.yaml` | Meta | How to recreate this package |
44
+
45
+ ## How to Use
46
+
47
+ - **Designers**: Read `.design.md` files for layout and component guidance
48
+ - **Developers**: Parse `.yaml` files for component hierarchy; read logic doc for behavior
49
+ - **AI coding agents**: Start with `coding_agent_starting_point.md`, then reference `.yaml` specs
50
+ ```
51
+
52
+ ---
53
+
54
+ ## Step 07 — `website_logic_and_functionality.md`
55
+
56
+ This is the **behavior bible**. Describe what the product does, how it works, and how data flows.
57
+ Derive as much as possible from the screenshots; mark inferences clearly.
58
+
59
+ ### Required Sections
60
+
61
+ #### Product Purpose
62
+ What problem does this tool solve? Who uses it? One paragraph.
63
+
64
+ #### Core Entities
65
+ List the main data objects (e.g., Project, User, Tag, Provider, Port). For each:
66
+ - What is it?
67
+ - Key fields/attributes
68
+ - Relationships to other entities
69
+
70
+ #### Main User Flows
71
+ Numbered step-by-step flows for the 3–5 most important user journeys:
72
+ - Project discovery and launching
73
+ - Creating a new project
74
+ - Monitoring running services
75
+ - Viewing analytics/usage
76
+ - Filtering/searching
77
+
78
+ #### State Machine
79
+ Define all discrete states a core entity (usually Project) can be in:
80
+
81
+ ```
82
+ running → stopped → paused → archived
83
+ ↘ unhealthy → error
84
+ ↗ indexing → ready
85
+ missing (not found on disk)
86
+ ```
87
+
88
+ For each state: trigger, visual indicator, allowed transitions.
89
+
90
+ #### Local Runtime and Port Management
91
+ - How does the app detect running local services?
92
+ - How are ports assigned, tracked, and displayed?
93
+ - What happens when a port conflict occurs?
94
+
95
+ #### Health Monitoring
96
+ - How is project health determined?
97
+ - Polling interval, timeout logic, recovery behavior
98
+
99
+ #### Commit and Activity Analytics
100
+ - Data source (local git, API?)
101
+ - Aggregation window (7-day, 30-day)
102
+ - Chart types visible in screenshots
103
+
104
+ #### AI Usage Overview
105
+ - Up to 10 AI provider rows
106
+ - Metrics: requests, tokens/cost, usage percentage
107
+ - How is usage data collected and displayed?
108
+
109
+ #### Filtering, Sorting, Tags, Favorites
110
+ - Available sort fields and directions
111
+ - Tag creation, assignment, filtering logic
112
+ - Favorites behavior (pinned to top, star indicator)
113
+
114
+ #### Persistence Model
115
+ - What is stored locally vs. remotely?
116
+ - File formats (JSON, SQLite, config files)
117
+ - Cache invalidation strategy for previews
118
+
119
+ #### Error and Empty States
120
+ - Per-section empty state behavior
121
+ - Error recovery UX
122
+ - Missing project (directory deleted) handling
123
+
124
+ #### Security and Privacy Notes
125
+ - Is data sent to any remote service?
126
+ - Local-only vs. cloud-sync clarification
127
+ - Any auth flows visible in screenshots
128
+
129
+ ### Writing Rules
130
+ - Separate **frontend behavior** from **backend responsibilities** clearly
131
+ - Use `[Inferred]` for behavior not directly visible in screenshots
132
+ - Prefer bullet lists and short paragraphs over walls of text
133
+
134
+ ---
135
+
136
+ ## Step 08 — `coding_agent_starting_point.md`
137
+
138
+ This is the **implementation guide** for an AI coding agent starting from scratch. It should be
139
+ specific enough that an agent can begin immediately without additional clarification.
140
+
141
+ ### Required Sections
142
+
143
+ #### Mission
144
+ One sentence: what the agent is building and why.
145
+
146
+ #### Recommended Stack
147
+ List concrete technology choices:
148
+ ```
149
+ Frontend: React + TypeScript + Tailwind CSS
150
+ Charts: Recharts or Chart.js
151
+ Animation: GSAP
152
+ Backend: Electron main process or Node.js local server
153
+ Data: SQLite (better-sqlite3) or JSON flat files
154
+ IPC: Electron IPC or REST on localhost
155
+ ```
156
+ Mark as `[Suggested]` if the user didn't specify — agents should respect explicit stack choices.
157
+
158
+ #### Repository Structure
159
+ ```
160
+ src/
161
+ ├── main/ ← Electron/Node backend
162
+ ├── renderer/ ← React frontend
163
+ │ ├── components/
164
+ │ │ ├── layout/
165
+ │ │ ├── cards/
166
+ │ │ ├── analytics/
167
+ │ │ └── shared/
168
+ │ ├── pages/
169
+ │ ├── hooks/
170
+ │ └── store/
171
+ ├── shared/ ← Types shared between main + renderer
172
+ └── assets/
173
+ ```
174
+
175
+ #### Data Models
176
+ TypeScript interfaces for all core entities, derived from spec YAML DataBindings fields.
177
+
178
+ ```typescript
179
+ interface Project {
180
+ id: string;
181
+ name: string;
182
+ path: string;
183
+ status: 'running' | 'stopped' | 'paused' | 'unhealthy' | 'indexing' | 'missing' | 'archived';
184
+ port?: number;
185
+ tags: string[];
186
+ starred: boolean;
187
+ lastAccessed: Date;
188
+ previewImagePath?: string;
189
+ description?: string;
190
+ }
191
+ ```
192
+
193
+ #### API Routes (if applicable)
194
+ ```
195
+ GET /api/projects → list all projects
196
+ GET /api/projects/:id → single project
197
+ POST /api/projects/:id/start → launch project
198
+ POST /api/projects/:id/stop → stop project
199
+ GET /api/analytics/commits → commit history
200
+ GET /api/analytics/ai-usage → provider usage
201
+ ```
202
+
203
+ #### UI Component Map
204
+ Map spec slugs to React component names:
205
+ ```
206
+ left_navigation_sidebar → <NavigationSidebar />
207
+ top_header_stats_bar → <HeaderStatsBar />
208
+ projects_grid_cards → <ProjectsGrid /> + <ProjectCard />
209
+ analytics_sidebar_panels → <AnalyticsSidebar /> + <CommitsChart /> + <AIUsageTable />
210
+ ```
211
+
212
+ #### Implementation Phases
213
+
214
+ **Phase 1 — Layout + Static Data** (start here)
215
+ - Set up project structure, design tokens in Tailwind config
216
+ - Build all layout shells with hardcoded mock data
217
+ - Implement navigation, header, card grid with static projects
218
+ - No backend integration yet
219
+
220
+ **Phase 2 — Core Interactions**
221
+ - Project card hover, click, action menu
222
+ - Grid/list toggle, sorting, filtering
223
+ - Status dots and badges with mock statuses
224
+
225
+ **Phase 3 — Backend Integration**
226
+ - File system scanning for projects
227
+ - Local server/process spawning
228
+ - Port detection and management
229
+ - Real project status polling
230
+
231
+ **Phase 4 — Analytics + AI Usage**
232
+ - Git log parsing for commit history
233
+ - Chart rendering with real data
234
+ - AI usage data ingestion
235
+
236
+ **Phase 5 — Polish**
237
+ - GSAP animations for card grid
238
+ - Preview screenshot generation and caching
239
+ - Error states, empty states, loading skeletons
240
+
241
+ #### Acceptance Criteria
242
+ - All sections from screenshots are rendered and interactive
243
+ - Project status updates reflect real local state
244
+ - Analytics charts render with real git/usage data
245
+ - App works offline (local-first)
246
+ - No destructive file operations without explicit confirmation
247
+
248
+ #### Testing Strategy
249
+ - Unit: data models, filtering, sorting logic
250
+ - Integration: file scanner, process manager, git parser
251
+ - E2E: core user flows (launch project, stop project, view analytics)
252
+
253
+ #### Non-Goals
254
+ - Remote project management (unless user specifies)
255
+ - Multi-user collaboration
256
+ - Mobile responsiveness (unless explicitly required)
257
+ - Cloud sync (unless explicitly required)
258
+
259
+ ---
260
+
261
+ ## Step 08b — `llm_agent_zip_recreation_instructions.yaml`
262
+
263
+ Copy the canonical `LLMAgentZipRecreationInstructions` YAML into this file verbatim. This ensures
264
+ any future agent can reproduce the package from scratch by following the same workflow.
265
+
266
+ If the source YAML is available in conversation context, copy it. Otherwise, note:
267
+ ```yaml
268
+ # Source: LLMAgentZipRecreationInstructions canonical spec
269
+ # See conversation context or original system document for full content
270
+ ```
@@ -0,0 +1,96 @@
1
+ ---
2
+ name: screenshot-semantic-namer
3
+ description: >
4
+ Expert at collecting, inspecting, and semantically renaming UI screenshots for design-spec packages.
5
+ Use this skill for Steps 01 and 02 of the LLMAgentZipRecreation workflow, or any time the user
6
+ needs to rename a set of screenshots using meaningful, implementation-friendly slugs. Trigger on
7
+ phrases like "rename my screenshots", "give semantic names to these UI images", "organize these
8
+ mockups", or when the zip-design-orchestrator delegates Steps 01–02. Also trigger when a user
9
+ uploads multiple UI screenshots without clear names and asks to organize or document them.
10
+ ---
11
+
12
+ # Screenshot Semantic Namer
13
+
14
+ You are the expert for **Steps 01 and 02** of the LLMAgentZipRecreation workflow. Your job is to
15
+ inspect every input screenshot, understand what UI section it depicts, and assign it a precise,
16
+ implementation-friendly semantic name.
17
+
18
+ ## Step 01 — Collect and Inspect Inputs
19
+
20
+ 1. List all supplied image files from `/mnt/user-data/uploads/` or the conversation context.
21
+ 2. Visually examine each screenshot. Identify:
22
+ - Is it a **full layout** (entire page view)?
23
+ - A **cropped panel** (sidebar, header, footer, modal)?
24
+ - A **card grid**, **analytics view**, **settings page**, **dashboard**, or other specific section?
25
+ 3. Note whether any two screenshots look like the same section — flag duplicates but don't discard
26
+ unless clearly redundant.
27
+
28
+ Output a brief inspection table before proceeding:
29
+
30
+ ```
31
+ | File | Identified Section | Notes |
32
+ |-----------------|-------------------------|--------------------|
33
+ | image001.png | Left navigation sidebar | Has user profile |
34
+ | image002.png | Top header + KPI cards | Search bar visible |
35
+ ```
36
+
37
+ ## Step 02 — Create Semantic Names
38
+
39
+ ### Naming Rules
40
+
41
+ - Use **lowercase snake_case** exclusively
42
+ - Name by **section purpose**, not visual position or timestamp
43
+ - Be **specific**: `analytics_sidebar_panels` not just `sidebar`
44
+ - Avoid: dates, "screenshot", "crop", "temp", "untitled", index numbers alone
45
+
46
+ ### Reference Slug Vocabulary
47
+
48
+ Use these patterns as inspiration — adapt to what you actually see:
49
+
50
+ | Pattern | Example Slugs |
51
+ |---|---|
52
+ | Navigation | `left_navigation_sidebar`, `top_navbar`, `breadcrumb_rail` |
53
+ | Headers | `top_header_stats_bar`, `page_header_with_search` |
54
+ | Card grids | `projects_grid_cards`, `templates_card_gallery` |
55
+ | Analytics | `analytics_sidebar_panels`, `commit_overview_chart`, `ai_usage_breakdown` |
56
+ | Modals | `new_project_modal`, `confirm_delete_dialog` |
57
+ | Settings | `account_settings_page`, `integrations_panel` |
58
+ | Empty states | `empty_projects_state`, `onboarding_welcome_screen` |
59
+ | Detail views | `project_detail_header`, `file_explorer_tree` |
60
+
61
+ ### Action
62
+
63
+ For each screenshot:
64
+ 1. Assign a semantic slug
65
+ 2. Copy (or instruct the copy of) the file into the output folder using the slug as the new name,
66
+ preserving the original extension (`.png`, `.jpg`, `.webp`, etc.)
67
+ 3. Record the mapping for downstream skills to use
68
+
69
+ ### Output Mapping Table
70
+
71
+ After renaming, produce this table for the orchestrator and downstream skills:
72
+
73
+ ```
74
+ | Original File | Semantic Slug | New Filename |
75
+ |-----------------|------------------------------|-----------------------------------|
76
+ | image001.png | left_navigation_sidebar | left_navigation_sidebar.png |
77
+ | image002.png | top_header_stats_bar | top_header_stats_bar.png |
78
+ | image003.png | projects_grid_cards | projects_grid_cards.png |
79
+ | image004.png | analytics_sidebar_panels | analytics_sidebar_panels.png |
80
+ ```
81
+
82
+ ## Handling Edge Cases
83
+
84
+ - **Ambiguous section**: Use your best judgment, append `(inferred)` in the notes column, and ask
85
+ the user to confirm before the ZIP is finalized.
86
+ - **Very similar screenshots**: Name them `{section}_state_running` and `{section}_state_stopped`
87
+ to capture the difference.
88
+ - **Full-page screenshots that span multiple sections**: Pick the **dominant** section for the slug,
89
+ note the secondary sections in the inspection table.
90
+ - **Only one screenshot**: That's fine — one slug, one spec pair.
91
+
92
+ ## What You Hand Off
93
+
94
+ - A clean slug list (for use by visual-token-extractor and design-spec-writer)
95
+ - All renamed files copied into the project root folder
96
+ - The inspection + mapping tables (for the orchestrator's records)
@@ -0,0 +1,102 @@
1
+ ---
2
+ name: visual-token-extractor
3
+ description: >
4
+ Expert at analyzing UI screenshots and extracting a shared visual design token system — colors,
5
+ typography, shape language, spacing, and motion principles — for use in design-spec documentation.
6
+ Use this skill for Step 03 of the LLMAgentZipRecreation workflow, or any time the user wants a
7
+ design system extracted from screenshots. Trigger on: "extract the design tokens from these mockups",
8
+ "define the visual language of this UI", "what's the color palette and type system here", or when
9
+ the zip-design-orchestrator delegates Step 03. Also useful standalone when a designer or developer
10
+ wants to reverse-engineer a visual system from reference images.
11
+ ---
12
+
13
+ # Visual Token Extractor
14
+
15
+ You are the expert for **Step 03** of the LLMAgentZipRecreation workflow. Your job is to analyze all
16
+ screenshots together — as a unified visual system — and produce a structured design token block that
17
+ all downstream spec files will reference consistently.
18
+
19
+ ## How to Analyze
20
+
21
+ Look across ALL screenshots simultaneously. Ask yourself:
22
+
23
+ - What surface treatment is used? (flat, frosted glass, translucent, dark, light, paper-white)
24
+ - What is the background canvas? (solid, gradient, mesh, image)
25
+ - What accent colors appear on interactive elements, badges, status dots?
26
+ - What font weight and scale patterns repeat across headings, body, and meta text?
27
+ - What border-radius pattern appears on cards, buttons, modals?
28
+ - Are there consistent shadow or glow treatments?
29
+ - What motion language is implied? (snap, ease, spring, parallax)
30
+
31
+ ## Output: Visual Tokens Block
32
+
33
+ Produce this block in both **YAML** (for `.yaml` files) and **Markdown summary** (for `.design.md` files).
34
+
35
+ ### YAML Format
36
+
37
+ ```yaml
38
+ VisualTokens:
39
+ Color:
40
+ Background: "" # e.g. "soft white / misty blue glass canvas"
41
+ Surfaces: "" # e.g. "translucent cards, subtle border and shadow"
42
+ PrimaryAccent: "" # e.g. "blue-violet gradient, main actions + selected states"
43
+ SuccessAccent: "" # e.g. "green — running / healthy / positive deltas"
44
+ WarningAccent: "" # e.g. "amber — stopped / paused / degraded"
45
+ ErrorAccent: "" # e.g. "red — critical / destructive actions"
46
+ MutedText: "" # e.g. "blue-gray secondary copy"
47
+ Border: "" # e.g. "1px semi-transparent stroke"
48
+ Typography:
49
+ FontFamily: "" # e.g. "native system UI stack (-apple-system, Segoe UI)"
50
+ Headings: "" # e.g. "bold, compact, high contrast"
51
+ Body: "" # e.g. "medium weight, readable, neutral"
52
+ Meta: "" # e.g. "small, muted, structured (11–12px)"
53
+ CodeMono: "" # e.g. "monospace, dim background pill" (if present)
54
+ Shape:
55
+ CardRadius: "" # e.g. "16px large rounded (macOS-style)"
56
+ ButtonRadius: "" # e.g. "pill or rounded-rect (8–24px)"
57
+ InputRadius: "" # e.g. "8px"
58
+ BadgeRadius: "" # e.g. "full pill"
59
+ Spacing:
60
+ BaseUnit: "" # e.g. "8px grid"
61
+ CardPadding: "" # e.g. "16–24px inner"
62
+ SectionGap: "" # e.g. "24–32px between major blocks"
63
+ Shadow:
64
+ Card: "" # e.g. "0 2px 8px rgba(0,0,0,0.08)"
65
+ Elevated: "" # e.g. "0 8px 24px rgba(0,0,0,0.12) on hover"
66
+ Modal: "" # e.g. "large drop shadow with overlay backdrop"
67
+ Motion:
68
+ General: "" # e.g. "smooth, native-feeling, 200–300ms ease"
69
+ Cards: "" # e.g. "hover lift (translateY -2px), menu fade"
70
+ Charts: "" # e.g. "fluid line/area animation on load"
71
+ PageTransition: "" # e.g. "fade + slide, spring easing"
72
+ ```
73
+
74
+ ### Markdown Summary Format
75
+
76
+ ```markdown
77
+ ## Visual Token Summary
78
+
79
+ **Surface**: {description}
80
+ **Background**: {description}
81
+ **Primary Accent**: {description}
82
+ **Status Colors**: {success}, {warning}, {error}
83
+ **Typography**: {heading style} / {body style} / {meta style}
84
+ **Radius**: {card} cards, {button} buttons, {badge} badges
85
+ **Motion**: {general principle}
86
+ ```
87
+
88
+ ## Important Conventions
89
+
90
+ - **Describe visually**, not by hex codes (which can't be seen precisely in screenshots). Use
91
+ descriptive tokens like `"blue-violet gradient"`, `"warm amber"`, `"soft white"`.
92
+ - **Mark inferences**: If a token is not clearly visible, prefix it with `# Inferred:` in YAML.
93
+ - **Shared tokens first**: Define them once here; spec files reference this block rather than
94
+ repeating it per screenshot.
95
+ - **One visual system**: Even if some screenshots look slightly different (e.g., dark mode vs. light
96
+ mode), call out the variant rather than defining two separate systems.
97
+
98
+ ## What You Hand Off
99
+
100
+ A complete `VisualTokens` block (YAML + Markdown) that design-spec-writer will embed into every
101
+ `.design.md` and `.yaml` file it produces. If you're running standalone (not as part of the
102
+ orchestrator), output the block to the conversation so the user can copy it.
@@ -0,0 +1,113 @@
1
+ ---
2
+ name: zip-design-orchestrator
3
+ description: >
4
+ Master orchestrator for producing a complete design-spec ZIP package from UI screenshots and
5
+ conversational requirements. Use this skill whenever the user supplies screenshots (or crops, mockups,
6
+ visual references) and wants a downloadable ZIP containing renamed screenshots, per-screenshot design
7
+ specs (.design.md + .yaml), a logic doc, a coding-agent starting-point doc, a README, and this
8
+ recreation instructions sheet. Trigger on phrases like "create a design spec ZIP", "generate design
9
+ docs from screenshots", "make a build package from these mockups", "create an LLM agent ZIP",
10
+ or any request to package UI screenshots into structured developer documentation.
11
+ ---
12
+
13
+ # ZIP Design-Spec Orchestrator
14
+
15
+ You are the master coordinator for the LLMAgentZipRecreation workflow. Your job is to run all 9 steps
16
+ in order, delegating each step to the appropriate expert skill, and producing a complete, downloadable
17
+ ZIP package.
18
+
19
+ ## Workflow Overview
20
+
21
+ ```
22
+ Step 01 → screenshot-semantic-namer (collect + inspect inputs)
23
+ Step 02 → screenshot-semantic-namer (assign semantic slugs + rename)
24
+ Step 03 → visual-token-extractor (extract shared design tokens)
25
+ Step 04 → design-spec-writer (write per-screenshot .design.md)
26
+ Step 05 → design-spec-writer (write per-screenshot .yaml)
27
+ Step 06 → package-docs-writer (README.md)
28
+ Step 07 → package-docs-writer (website_logic_and_functionality.md)
29
+ Step 08 → package-docs-writer (coding_agent_starting_point.md)
30
+ Step 09 → zip-packager (assemble, verify, deliver ZIP)
31
+ ```
32
+
33
+ ## How to Run
34
+
35
+ ### 1. Capture Intent First
36
+
37
+ Before doing anything, confirm:
38
+ - The project slug (e.g. `product_ui` → folder `product_ui_design_specs`)
39
+ - All supplied screenshots (list them from `/mnt/user-data/uploads/` or inline images)
40
+ - Any product name, stack preferences, or special requirements the user has mentioned
41
+
42
+ ### 2. Execute Steps Sequentially
43
+
44
+ Because steps feed into each other (semantic names from Step 02 are used by Steps 04–09), run them
45
+ in order. After each step, briefly confirm progress to the user before moving on.
46
+
47
+ **Steps 01–02 (screenshot-semantic-namer):**
48
+ - List all input images
49
+ - Visually inspect each one
50
+ - Assign a semantic slug per screenshot
51
+ - Copy renamed files into `{project_slug}_design_specs/`
52
+
53
+ **Step 03 (visual-token-extractor):**
54
+ - Analyze all screenshots together for a shared visual language
55
+ - Output a `visual_tokens` block used by Steps 04–05
56
+
57
+ **Steps 04–05 (design-spec-writer):**
58
+ - For each renamed screenshot, write `{slug}.design.md` and `{slug}.yaml`
59
+ - Use the visual tokens from Step 03
60
+ - Output all files into the root design-specs folder
61
+
62
+ **Steps 06–08 (package-docs-writer):**
63
+ - Write `README.md`, `website_logic_and_functionality.md`, `coding_agent_starting_point.md`
64
+ - Also copy `llm_agent_zip_recreation_instructions.yaml` (recreate from the canonical structure)
65
+
66
+ **Step 09 (zip-packager):**
67
+ - Verify every screenshot has a matching `.design.md` and `.yaml`
68
+ - Compress the root folder into `{project_slug}_full_design_and_build_docs.zip`
69
+ - Verify ZIP contents
70
+ - Present the download link
71
+
72
+ ### 3. Output Structure
73
+
74
+ ```
75
+ {project_slug}_design_specs/
76
+ ├── {slug_1}.png ← renamed screenshot
77
+ ├── {slug_1}.design.md ← human-readable design spec
78
+ ├── {slug_1}.yaml ← machine-readable component spec
79
+ ├── {slug_2}.png
80
+ ├── {slug_2}.design.md
81
+ ├── {slug_2}.yaml
82
+ ├── ...
83
+ ├── README.md
84
+ ├── website_logic_and_functionality.md
85
+ ├── coding_agent_starting_point.md
86
+ └── llm_agent_zip_recreation_instructions.yaml
87
+ ```
88
+
89
+ Final ZIP: `{project_slug}_full_design_and_build_docs.zip`
90
+
91
+ ## Handling Uncertainty
92
+
93
+ - If a screenshot's section is ambiguous, label it with a best-guess slug and note it as `(inferred)`.
94
+ - If the user hasn't supplied a project name, derive one from visible UI content or use `project_ui`.
95
+ - If extending an existing ZIP, unzip it first, append new content, recompress with an updated name.
96
+ - Never overwrite the original ZIP unless the user explicitly asks.
97
+
98
+ ## Quality Gate Before Zipping
99
+
100
+ Before calling zip-packager, mentally run through this checklist:
101
+ - [ ] All screenshots renamed with semantic snake_case slugs
102
+ - [ ] Every screenshot has a matching `.design.md` AND `.yaml`
103
+ - [ ] Visual tokens are consistent across all spec files
104
+ - [ ] All 4 package docs are present
105
+ - [ ] No timestamp-named screenshots remain unless intentional
106
+ - [ ] All text files are UTF-8
107
+
108
+ ## Communication Style
109
+
110
+ Keep the user informed between steps with brief status lines like:
111
+ > "✓ Step 02 complete — 5 screenshots renamed. Starting design spec generation…"
112
+
113
+ Don't dump all outputs at once — checkpoint at the end of each major phase.