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
package/manifest.cox ADDED
@@ -0,0 +1,106 @@
1
+ CoxVersion: "1.0"
2
+ FileType: "manifest"
3
+ Slug: "local_app_manager"
4
+ Schema: "cox.manifest.v1"
5
+ ProjectName: "LocalAppManager"
6
+ PackageName: "cox_protocol_package_corrected.zip"
7
+ ProtocolExtension: ".cox"
8
+ MimeType: "application/vnd.cox+yaml"
9
+ Encoding: "UTF-8"
10
+ SyntaxBase: "YAML-compatible structured text"
11
+ EntryPoint: "manifest.cox"
12
+ ReferenceDocs:
13
+ - "README.md"
14
+ - "COX_FILE_FORMAT_SPECIFICATION_v1.0.md"
15
+ - "verification_report.txt"
16
+ - "zip_content_listing.txt"
17
+ GuideDocs:
18
+ - "guides/imported-packages/cox_protocol_package_compiled.md"
19
+ - "guides/npm-installation.md"
20
+ ProtocolDocs:
21
+ - "protocols/llm_agent_zip_recreation_instructions.cox"
22
+ - "protocols/deterministic_naming_convention.cox"
23
+ - "protocols/recursive_decomposition_protocol.cox"
24
+ - "protocols/screenshot_partitioning_protocol.cox"
25
+ - "protocols/evidence_and_uncertainty_protocol.cox"
26
+ - "protocols/sub_agents_orchestration.cox"
27
+ - "protocols/design_tokens.cox"
28
+ - "protocols/component_binding_graph.cox"
29
+ - "protocols/website_logic_and_functionality.cox"
30
+ - "protocols/coding_agent_starting_point.cox"
31
+ - "protocols/visual_acceptance_checklist.cox"
32
+ SkillBundles:
33
+ - "skills/design-spec-writer"
34
+ - "skills/package-docs-writer"
35
+ - "skills/screenshot-semantic-namer"
36
+ - "skills/visual-token-extractor"
37
+ - "skills/zip-design-orchestrator"
38
+ - "skills/zip-packager"
39
+ Schemas:
40
+ - "schemas/cox.manifest.v1.schema.json"
41
+ - "schemas/cox.page.v1.schema.json"
42
+ - "schemas/cox.component.v1.schema.json"
43
+ - "schemas/cox.protocol.v1.schema.json"
44
+ - "schemas/cox.crop_metadata.v1.schema.json"
45
+ ToolingFiles:
46
+ - "LICENSE"
47
+ - ".gitignore"
48
+ - ".npmignore"
49
+ - "package.json"
50
+ - "bin/cox-protocol.js"
51
+ - "pyproject.toml"
52
+ - "requirements.txt"
53
+ - "templates/ComponentName.cox.template"
54
+ - "templates/Page.cox.template"
55
+ - "templates/crop_metadata.cox.template"
56
+ - "tools/__init__.py"
57
+ - "tools/cox_cli.py"
58
+ - "tools/cox_lib.py"
59
+ - "tools/package_target.py"
60
+ - "tools/react_target.py"
61
+ - "editor-support/vscode/package.json"
62
+ - "editor-support/vscode/language-configuration.json"
63
+ - "editor-support/vscode/syntaxes/cox.tmLanguage.json"
64
+ - "editor-support/vscode/.vscodeignore"
65
+ - "editor-support/vscode/LICENSE"
66
+ - "editor-support/vscode/README.md"
67
+ - "editor-support/vscode/CHANGELOG.md"
68
+ - "editor-support/vscode/snippets/cox-common.json"
69
+ - "editor-support/vscode/snippets/cox-manifest.json"
70
+ - "editor-support/vscode/snippets/cox-page.json"
71
+ - "editor-support/vscode/snippets/cox-component.json"
72
+ - "editor-support/vscode/snippets/cox-protocol.json"
73
+ - "editor-support/vscode/snippets/cox-crop-metadata.json"
74
+ Pages:
75
+ - PageName: "Dashboard"
76
+ Slug: "dashboard"
77
+ Folder: "LocalAppManager/Dashboard"
78
+ PageInstruction: "LocalAppManager/Dashboard/dashboard.cox"
79
+ PageScreenshotPlaceholder: "LocalAppManager/Dashboard/dashboard_screenshot.placeholder.txt"
80
+ Components:
81
+ - Slug: "left_navigation_sidebar"
82
+ Folder: "LocalAppManager/Dashboard/left_navigation_sidebar"
83
+ ComponentInstruction: "LocalAppManager/Dashboard/left_navigation_sidebar/left_navigation_sidebar.cox"
84
+ ComponentScreenshotPlaceholder: "LocalAppManager/Dashboard/left_navigation_sidebar/left_navigation_sidebar_screenshot.placeholder.txt"
85
+ - Slug: "top_header_stats_bar"
86
+ Folder: "LocalAppManager/Dashboard/top_header_stats_bar"
87
+ ComponentInstruction: "LocalAppManager/Dashboard/top_header_stats_bar/top_header_stats_bar.cox"
88
+ ComponentScreenshotPlaceholder: "LocalAppManager/Dashboard/top_header_stats_bar/top_header_stats_bar_screenshot.placeholder.txt"
89
+ - Slug: "projects_grid_cards"
90
+ Folder: "LocalAppManager/Dashboard/projects_grid_cards"
91
+ ComponentInstruction: "LocalAppManager/Dashboard/projects_grid_cards/projects_grid_cards.cox"
92
+ ComponentScreenshotPlaceholder: "LocalAppManager/Dashboard/projects_grid_cards/projects_grid_cards_screenshot.placeholder.txt"
93
+ - Slug: "analytics_sidebar_panels"
94
+ Folder: "LocalAppManager/Dashboard/analytics_sidebar_panels"
95
+ ComponentInstruction: "LocalAppManager/Dashboard/analytics_sidebar_panels/analytics_sidebar_panels.cox"
96
+ ComponentScreenshotPlaceholder: "LocalAppManager/Dashboard/analytics_sidebar_panels/analytics_sidebar_panels_screenshot.placeholder.txt"
97
+ BuildTargets:
98
+ - "json"
99
+ - "react"
100
+ - "package"
101
+ VerificationRules:
102
+ - "Zip must contain this manifest."
103
+ - "Every manifest-listed .cox file must exist on disk before compilation."
104
+ - "Screenshots may be placeholders in this protocol package because no real screenshots were supplied in the request."
105
+ - "When real screenshots are supplied, placeholders must be replaced by actual image files."
106
+ - "Validation must parse YAML, apply JSON Schema, and check referenced paths."
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "cox-protocol-package",
3
+ "version": "1.0.0",
4
+ "description": "NPM wrapper and distribution package for the COX protocol CLI.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "bin": {
8
+ "cox-protocol": "./bin/cox-protocol.js"
9
+ },
10
+ "files": [
11
+ "bin",
12
+ "COX_FILE_FORMAT_SPECIFICATION_v1.0.md",
13
+ "LICENSE",
14
+ "README.md",
15
+ "editor-support/vscode",
16
+ "guides",
17
+ "manifest.cox",
18
+ "protocols",
19
+ "pyproject.toml",
20
+ "requirements.txt",
21
+ "schemas",
22
+ "skills",
23
+ "templates",
24
+ "tools",
25
+ "!**/__pycache__/**",
26
+ "!**/*.pyc",
27
+ "!**/*.pyo"
28
+ ],
29
+ "keywords": [
30
+ "cox",
31
+ "design-spec",
32
+ "schema",
33
+ "ui-reconstruction",
34
+ "agent-protocol",
35
+ "yaml"
36
+ ],
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "git+https://github.com/charbelmalo/cox-protocol-package.git"
40
+ },
41
+ "homepage": "https://github.com/charbelmalo/cox-protocol-package#readme",
42
+ "bugs": {
43
+ "url": "https://github.com/charbelmalo/cox-protocol-package/issues"
44
+ },
45
+ "scripts": {
46
+ "pack:dry-run": "npm pack --dry-run",
47
+ "package:vscode": "cd editor-support/vscode && npm run package",
48
+ "smoke:python": "cox validate . && cox compile . --target json --target react --target package --out build"
49
+ },
50
+ "engines": {
51
+ "node": ">=18"
52
+ }
53
+ }
@@ -0,0 +1,67 @@
1
+ CoxVersion: "1.0"
2
+ FileType: "protocol_doc"
3
+ Slug: "coding_agent_starting_point"
4
+ Schema: "cox.protocol.v1"
5
+ ProtocolName: "Coding Agent Starting Point"
6
+ Purpose: "Give implementation agents a staged plan for turning COX specs into working software."
7
+
8
+ Mission:
9
+ Evidence: UserSpecified
10
+ Summary: "Build the UI from COX specs before wiring local system integrations."
11
+
12
+ RecommendedStack:
13
+ Evidence: Recommended
14
+ Frontend: "React or Next.js with componentized layout"
15
+ Styling: "Tailwind or token-driven CSS variables"
16
+ Charts: "Recharts or similar declarative chart library"
17
+ Backend: "Node/Electron/Tauri/local service depending on deployment target"
18
+ Storage: "Local JSON or SQLite for early prototype"
19
+
20
+ RepositoryStructure:
21
+ Evidence: Recommended
22
+ Example:
23
+ - "src/app"
24
+ - "src/components/shell"
25
+ - "src/components/projects"
26
+ - "src/components/analytics"
27
+ - "src/lib/runtime"
28
+ - "src/lib/storage"
29
+ - "src/lib/screenshots"
30
+ - "src/mock"
31
+
32
+ ImplementationPhases:
33
+ - Phase: 1
34
+ Name: "Static visual reconstruction"
35
+ Tasks:
36
+ - "Implement layout, design tokens, and component hierarchy."
37
+ - "Use mocked data only."
38
+ - Phase: 2
39
+ Name: "Project discovery and metadata"
40
+ Tasks:
41
+ - "Add safe folder scanning abstraction."
42
+ - "Populate project cards from mocked-then-real data."
43
+ - Phase: 3
44
+ Name: "Runtime controls"
45
+ Tasks:
46
+ - "Add start/stop/restart behind explicit safe API boundaries."
47
+ - "Add confirmation for destructive or risky actions."
48
+ - Phase: 4
49
+ Name: "Previews and analytics"
50
+ Tasks:
51
+ - "Generate/cache screenshots."
52
+ - "Add commit/activity charts and AI usage provider rows."
53
+ - Phase: 5
54
+ Name: "Testing and hardening"
55
+ Tasks:
56
+ - "Add visual regression tests, accessibility checks, and state-transition tests."
57
+
58
+ AcceptanceCriteria:
59
+ - "The UI matches COX visual hierarchy, spacing, card surfaces, and responsive behavior."
60
+ - "Every implemented component maps to a COX component slug."
61
+ - "Inferred features remain behind safe defaults."
62
+ - "No destructive file operation occurs without explicit confirmation."
63
+
64
+ NonGoals:
65
+ - "Do not implement real system-level process control before visual shell is stable."
66
+ - "Do not assume a specific backend framework unless selected by the user."
67
+ - "Do not add unrelated product features beyond COX scope."
@@ -0,0 +1,52 @@
1
+ CoxVersion: "1.0"
2
+ FileType: "protocol_doc"
3
+ Slug: "component_binding_graph"
4
+ Schema: "cox.protocol.v1"
5
+ ProtocolName: "Component Binding Graph"
6
+ Purpose: "Bind recurring components across pages so coding agents can implement reusable UI primitives."
7
+
8
+ Components:
9
+ left_navigation_sidebar:
10
+ CanonicalRole: "Global navigation rail"
11
+ AppearsIn:
12
+ - "LocalAppManager/Dashboard"
13
+ SharedTokens:
14
+ - "Color.SurfaceGlass"
15
+ - "Shape.PanelRadius"
16
+ - "Typography.Meta"
17
+ ReuseGuidance: "Implement as a stable shell component when multiple pages share it."
18
+
19
+ top_header_stats_bar:
20
+ CanonicalRole: "Page-level header, search/actions, and KPI summary"
21
+ AppearsIn:
22
+ - "LocalAppManager/Dashboard"
23
+ SharedTokens:
24
+ - "Color.SurfaceElevated"
25
+ - "Shape.CardRadius"
26
+ - "Motion.General"
27
+
28
+ projects_grid_cards:
29
+ CanonicalRole: "Reusable project discovery and launch surface"
30
+ AppearsIn:
31
+ - "LocalAppManager/Dashboard"
32
+ SharedTokens:
33
+ - "Color.SurfaceGlass"
34
+ - "Motion.CardHover"
35
+ - "Shape.CardRadius"
36
+ ChildCandidates:
37
+ - "project_card_preview_stage"
38
+ - "project_card_metadata"
39
+ - "project_card_runtime_badges"
40
+
41
+ analytics_sidebar_panels:
42
+ CanonicalRole: "Right-side status, activity, and usage analytics stack"
43
+ AppearsIn:
44
+ - "LocalAppManager/Dashboard"
45
+ SharedTokens:
46
+ - "Color.SurfaceGlass"
47
+ - "Motion.ChartLoad"
48
+
49
+ BindingRules:
50
+ - "If the same visual/behavioral component appears on multiple pages, keep the same component slug."
51
+ - "If the same component changes layout by viewport, use responsive variants, not a new component name."
52
+ - "If a component changes purpose, create a new component slug even if it looks similar."
@@ -0,0 +1,42 @@
1
+ CoxVersion: "1.0"
2
+ FileType: "protocol_doc"
3
+ Slug: "design_tokens"
4
+ Schema: "cox.protocol.v1"
5
+ ProtocolName: "Design Tokens"
6
+ Purpose: "Reusable visual system tokens shared by all Page and Component .cox files."
7
+
8
+ Color:
9
+ BackgroundCanvas: "soft white / misty blue glass canvas"
10
+ SurfaceGlass: "translucent white surface with subtle blue-gray stroke"
11
+ SurfaceElevated: "slightly brighter translucent card with soft shadow"
12
+ PrimaryAccent: "blue-violet gradient"
13
+ SuccessAccent: "green for running, healthy, positive deltas"
14
+ WarningAccent: "amber for stopped, paused, degraded states"
15
+ ErrorAccent: "red for destructive or unavailable states"
16
+ MutedText: "blue-gray secondary copy"
17
+ PrimaryText: "near-black high contrast text"
18
+
19
+ Typography:
20
+ FontFamily: "native system UI stack"
21
+ Heading: "bold, compact, high contrast"
22
+ Body: "medium weight, readable, neutral"
23
+ Meta: "small, muted, structured"
24
+
25
+ Shape:
26
+ CardRadius: "large rounded macOS-style corners"
27
+ ButtonRadius: "pill or rounded-rect"
28
+ PanelRadius: "large soft rectangle"
29
+
30
+ Spacing:
31
+ PagePadding: "generous desktop spacing, reduced mobile spacing"
32
+ CardGap: "consistent grid rhythm"
33
+ InnerPadding: "comfortable card and panel padding"
34
+
35
+ Motion:
36
+ General: "smooth native-feeling transitions"
37
+ CardHover: "subtle lift and shadow increase"
38
+ Menu: "fade and slight scale"
39
+ ChartLoad: "fluid line/area animation"
40
+
41
+ UsageRule:
42
+ - "Reference tokens by name inside .cox files instead of restating full styles repeatedly."
@@ -0,0 +1,159 @@
1
+ CoxVersion: "1.0"
2
+ FileType: "protocol_doc"
3
+ Slug: "deterministic_naming_convention"
4
+ Schema: "cox.protocol.v1"
5
+ ProtocolName: "Deterministic Naming Convention"
6
+ Purpose: "Resolve visual-to-spec naming ambiguity using a stable recursive naming formula."
7
+ AppliesTo:
8
+ - "ProjectName"
9
+ - "PageName"
10
+ - "ComponentName"
11
+ - "ComplexSubcomponentName"
12
+ - "Screenshot file names"
13
+ - ".cox file names"
14
+
15
+ GlobalRules:
16
+ ProjectName:
17
+ Format: "PascalCase"
18
+ Example: "LocalAppManager"
19
+ SourcePriority:
20
+ - "User-provided project name"
21
+ - "Visible product/app title"
22
+ - "Conversation-derived product purpose"
23
+ - "Fallback: Project"
24
+ PageName:
25
+ Format: "PascalCase"
26
+ Example: "Dashboard"
27
+ SourcePriority:
28
+ - "Visible page title"
29
+ - "User-provided page name"
30
+ - "Dominant route or workflow name"
31
+ - "Canonical page taxonomy"
32
+ - "Fallback: Page01, Page02"
33
+ ComponentName:
34
+ Format: "lowercase_snake_case"
35
+ Example: "projects_grid_cards"
36
+ ComplexSubcomponentName:
37
+ Format: "lowercase_snake_case"
38
+ Example: "project_card_preview_stage"
39
+ ForbiddenFinalNamePatterns:
40
+ - "screenshot_001"
41
+ - "image_1"
42
+ - "screen_final"
43
+ - "capture_date_time"
44
+ - "temp"
45
+ - "copy"
46
+ - "untitled"
47
+
48
+ SlugResolutionOrder:
49
+ - Step: 1
50
+ Rule: "Use explicit user-provided semantic name if supplied."
51
+ - Step: 2
52
+ Rule: "Use visible title/header text if it clearly identifies the section."
53
+ - Step: 3
54
+ Rule: "Use dominant UI region role."
55
+ - Step: 4
56
+ Rule: "Use component type plus primary content domain."
57
+ - Step: 5
58
+ Rule: "Use canonical taxonomy."
59
+ - Step: 6
60
+ Rule: "Add a short differentiator if two names are too close."
61
+ - Step: 7
62
+ Rule: "Append numeric suffix only for true same-role siblings after semantic differentiation fails."
63
+
64
+ ComponentNameFormula:
65
+ PreferredPattern: "{domain_or_purpose}_{layout_or_component_type}_{optional_distinguishing_trait}"
66
+ MinimalExamples:
67
+ - "left_navigation_sidebar"
68
+ - "top_header_stats_bar"
69
+ - "projects_grid_cards"
70
+ - "analytics_sidebar_panels"
71
+ - "runtime_status_toolbar"
72
+ - "project_card_preview_stage"
73
+ AvoidOverSpecificExamples:
74
+ Bad: "nested_sidebar"
75
+ Reason: "Too open to interpretation."
76
+ Better: "left_navigation_sidebar"
77
+ AvoidNearDuplicateExamples:
78
+ BadPair: ["left_sidebar", "left_navigation"]
79
+ Reason: "Too close; both may refer to same visual region."
80
+ BetterPair: ["left_navigation_sidebar", "project_filters_sidebar"]
81
+
82
+ CanonicalComponentTaxonomy:
83
+ Navigation:
84
+ - "left_navigation_sidebar"
85
+ - "top_navigation_bar"
86
+ - "breadcrumb_trail"
87
+ - "tab_navigation"
88
+ Header:
89
+ - "top_header_bar"
90
+ - "top_header_stats_bar"
91
+ - "page_title_toolbar"
92
+ Content:
93
+ - "projects_grid_cards"
94
+ - "detail_content_panel"
95
+ - "settings_form_panel"
96
+ - "activity_feed_list"
97
+ Analytics:
98
+ - "analytics_sidebar_panels"
99
+ - "usage_metrics_chart"
100
+ - "commit_activity_chart"
101
+ Controls:
102
+ - "floating_action_button"
103
+ - "filter_sort_toolbar"
104
+ - "search_command_input"
105
+ - "runtime_status_toolbar"
106
+ Feedback:
107
+ - "empty_state_panel"
108
+ - "error_state_banner"
109
+ - "loading_skeleton_grid"
110
+ - "confirmation_modal"
111
+
112
+ AmbiguityValidationPass:
113
+ Objective: "Ensure names are easy to understand, distinguishable, and recursively stable."
114
+ Checks:
115
+ - NameIsSemantic: "Name describes purpose or visible role, not crop position alone."
116
+ - NameIsNotTooGeneric: "Avoid component, section, panel, area unless qualified."
117
+ - NameIsNotTooSpecific: "Avoid long descriptions that hide the concept."
118
+ - NameIsNotNearDuplicate: "Reject sibling names that differ only by vague synonyms."
119
+ - NameHasStableScope: "Name still makes sense if the screenshot is reused later."
120
+ NearDuplicateResolution:
121
+ - "Compare sibling slugs inside the same page folder."
122
+ - "If two names share same head noun and unclear differentiator, rename one using purpose/domain."
123
+ - "Prefer relation-preserving pairs: navigation sidebar vs filters sidebar, not sidebar_a vs sidebar_b."
124
+
125
+ RecursiveNamingPattern:
126
+ PageLevel:
127
+ Folder: "{ProjectName}/{PageName}/"
128
+ Instruction: "{page_slug}.cox"
129
+ Screenshot: "{page_slug}_screenshot.{ext}"
130
+ ComponentLevel:
131
+ Folder: "{ProjectName}/{PageName}/{component_slug}/"
132
+ Instruction: "{component_slug}.cox"
133
+ Screenshot: "{component_slug}_screenshot.{ext}"
134
+ ComplexSubcomponentLevel:
135
+ Folder: "{ProjectName}/{PageName}/{component_slug}/{subcomponent_slug}/"
136
+ Instruction: "{subcomponent_slug}.cox"
137
+ Screenshot: "{subcomponent_slug}_screenshot.{ext}"
138
+
139
+ ResponsiveVariantNaming:
140
+ Rule: "Keep variants attached to the same page or component unless the variant introduces a materially different layout."
141
+ PageVariantPattern: "{page_slug}_screenshot_{viewport}.{ext}"
142
+ ComponentVariantPattern: "{component_slug}_screenshot_{viewport}.{ext}"
143
+ AllowedViewportSuffixes:
144
+ - "desktop"
145
+ - "tablet"
146
+ - "mobile"
147
+ Examples:
148
+ - "dashboard_screenshot_desktop.png"
149
+ - "dashboard_screenshot_mobile.png"
150
+ - "projects_grid_cards_screenshot_tablet.png"
151
+
152
+ FinalNamingDecisionRecord:
153
+ RequiredInEachCoxFile: true
154
+ Fields:
155
+ - "ChosenName"
156
+ - "Reason"
157
+ - "RejectedAlternatives"
158
+ - "AmbiguityRisk"
159
+ - "EvidenceLevel"
@@ -0,0 +1,42 @@
1
+ CoxVersion: "1.0"
2
+ FileType: "protocol_doc"
3
+ Slug: "evidence_and_uncertainty_protocol"
4
+ Schema: "cox.protocol.v1"
5
+ ProtocolName: "Evidence And Uncertainty Protocol"
6
+ Purpose: "Prevent agents from confusing visible evidence, user requirements, inference, and recommendations."
7
+
8
+ EvidenceLevels:
9
+ Visible:
10
+ Definition: "Directly shown in the screenshot."
11
+ Example: "A left sidebar exists."
12
+ UserSpecified:
13
+ Definition: "Explicitly stated in the conversation or uploaded requirements."
14
+ Example: "Package must use .cox files."
15
+ Inferred:
16
+ Definition: "Reasonable assumption from screenshot context or common app behavior."
17
+ Example: "Status dot likely maps to running/stopped state."
18
+ Intended:
19
+ Definition: "Desired behavior implied by the product direction but not directly visible."
20
+ Example: "Charts animate smoothly on load."
21
+ Recommended:
22
+ Definition: "Best-practice addition that helps implementation but was not requested or visible."
23
+ Example: "Add keyboard navigation to project cards."
24
+
25
+ RequiredUse:
26
+ - "Every behavior in protocols/website_logic_and_functionality.cox must include an evidence level."
27
+ - "Every component .cox must include EvidenceSummary, VisibleStructure, and Interactions, with visible, inferred, intended, and recommended behavior clearly labeled inside those sections."
28
+ - "Security, persistence, runtime controls, analytics, and AI-provider metrics must not be marked Visible unless actually shown."
29
+
30
+ ClaimStyle:
31
+ Allowed:
32
+ - "Visible: The card grid uses rounded glass cards."
33
+ - "Inferred: Clicking a project card opens or launches the project."
34
+ - "Recommended: Add confirmation before destructive file operations."
35
+ Forbidden:
36
+ - "The app definitely launches projects from the grid" # unless visible/user-specified
37
+ - "The backend uses Node.js" # unless supplied
38
+
39
+ CoxFileRequiredSections:
40
+ - "EvidenceSummary"
41
+ - "VisibleStructure"
42
+ - "Interactions"
@@ -0,0 +1,87 @@
1
+ CoxVersion: "1.0"
2
+ FileType: "protocol_doc"
3
+ Slug: "llm_agent_zip_recreation_instructions"
4
+ Schema: "cox.protocol.v1"
5
+ ProtocolName: "LLM Agent ZIP Recreation Instructions"
6
+ Purpose: "Teach coding/design LLM agents how to recreate complete design-spec ZIP packages from screenshots and requirements."
7
+ Name: "COX deterministic design binding protocol"
8
+ Extension: ".cox"
9
+ OutputArtifact: "single downloadable zip containing screenshots, partitioned screenshots, .cox files, manifests, implementation docs, and validation reports"
10
+ ProjectAgnostic: true
11
+
12
+ RequiredBehavior:
13
+ - "Do not assume files were created unless they exist on disk."
14
+ - "Preserve user-provided visual intent, naming conventions, and project vocabulary."
15
+ - "Use deterministic folder names, file names, and document structures."
16
+ - "Use .cox as the canonical design/spec/instruction file extension."
17
+ - "Mark uncertain behavior as Inferred, Intended, or Recommended."
18
+ - "Never describe invisible features as certain unless user-specified."
19
+ - "Use recursive decomposition only when it improves clarity."
20
+
21
+ CanonicalOutputStructure:
22
+ ProjectFolder: "{ProjectName}/"
23
+ PageFolder: "{ProjectName}/{PageName}/"
24
+ PageInstructionFile: "{ProjectName}/{PageName}/{page_slug}.cox"
25
+ PageScreenshotFile: "{ProjectName}/{PageName}/{page_slug}_screenshot.{extension}"
26
+ ComponentFolder: "{ProjectName}/{PageName}/{component_slug}/"
27
+ ComponentInstructionFile: "{ProjectName}/{PageName}/{component_slug}/{component_slug}.cox"
28
+ ComponentScreenshotFile: "{ProjectName}/{PageName}/{component_slug}/{component_slug}_screenshot.{extension}"
29
+ ComplexSubcomponentFolder: "{ProjectName}/{PageName}/{component_slug}/{subcomponent_slug}/"
30
+ ComplexSubcomponentInstructionFile: "{ProjectName}/{PageName}/{component_slug}/{subcomponent_slug}/{subcomponent_slug}.cox"
31
+ ComplexSubcomponentScreenshotFile: "{ProjectName}/{PageName}/{component_slug}/{subcomponent_slug}/{subcomponent_slug}_screenshot.{extension}"
32
+
33
+ RootPackageDocs:
34
+ - "README.md"
35
+ - "protocols/llm_agent_zip_recreation_instructions.cox"
36
+ - "protocols/deterministic_naming_convention.cox"
37
+ - "protocols/recursive_decomposition_protocol.cox"
38
+ - "protocols/screenshot_partitioning_protocol.cox"
39
+ - "protocols/evidence_and_uncertainty_protocol.cox"
40
+ - "protocols/sub_agents_orchestration.cox"
41
+ - "protocols/design_tokens.cox"
42
+ - "protocols/component_binding_graph.cox"
43
+ - "protocols/website_logic_and_functionality.cox"
44
+ - "protocols/coding_agent_starting_point.cox"
45
+ - "protocols/visual_acceptance_checklist.cox"
46
+ - "manifest.cox"
47
+
48
+ Workflow:
49
+ Step01_CollectInputs:
50
+ Actions:
51
+ - "List all screenshots, crops, mockups, visual references, existing zips, and user requirements."
52
+ - "Open/inspect each image visually."
53
+ - "Record original file names before renaming."
54
+ Step02_ConstructHierarchy:
55
+ Actions:
56
+ - "Identify ProjectName."
57
+ - "Identify PageName for each full-screen or page-level screenshot."
58
+ - "Attach responsive variants at the page level unless they are isolated component variants."
59
+ - "Map each page screenshot to exactly one Page folder."
60
+ Step03_RecursiveDecomposition:
61
+ Actions:
62
+ - "Keep simple pages as one {page_slug}.cox file."
63
+ - "Split complex pages into distinguishable component folders."
64
+ - "Split components into subcomponents only when naming or reasoning becomes ambiguous."
65
+ Step04_DeterministicNaming:
66
+ Actions:
67
+ - "Generate names using the slug resolution ladder."
68
+ - "Run ambiguity and near-duplicate validation."
69
+ - "Prefer names that balance differentiation and relation."
70
+ Step05_PartitionScreenshots:
71
+ Actions:
72
+ - "Estimate section boundaries and crop components where possible."
73
+ - "Use border/region estimation without inventing hidden layout."
74
+ - "Preserve original full-page screenshot at page level."
75
+ Step06_WriteCoxFiles:
76
+ Actions:
77
+ - "Create {page_slug}.cox for every page folder."
78
+ - "Create component_slug.cox for every component folder."
79
+ - "Create subcomponent_slug.cox only for complex subcomponent folders."
80
+ Step07_GenerateGlobalDocs:
81
+ Actions:
82
+ - "Write manifest, design tokens, component graph, logic doc, coding-agent doc, and acceptance checklist."
83
+ Step08_VerifyAndZip:
84
+ Actions:
85
+ - "Verify every referenced file exists on disk."
86
+ - "List zip contents after compression."
87
+ - "Do not claim completion unless the zip exists and contains expected files."