create-yss-spec 1.1.2 → 1.1.3

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 (239) hide show
  1. package/package.json +1 -1
  2. package/template/.codex/skills/data-analytics/.app.json +84 -0
  3. package/template/.codex/skills/data-analytics/.codex-plugin/plugin.json +66 -0
  4. package/template/.codex/skills/data-analytics/.mcp.json +30 -0
  5. package/template/.codex/skills/data-analytics/AGENTS.md +20 -0
  6. package/template/.codex/skills/data-analytics/DEPENDENCIES.MD +27 -0
  7. package/template/.codex/skills/data-analytics/README.md +60 -0
  8. package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html +16 -0
  9. package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html.gz.b64.part001 +1 -0
  10. package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html.gz.b64.part002 +1 -0
  11. package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html.gz.b64.part003 +1 -0
  12. package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html.gz.b64.part004 +1 -0
  13. package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html.gz.b64.part005 +1 -0
  14. package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html.gz.b64.part006 +1 -0
  15. package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html +16 -0
  16. package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part001 +1 -0
  17. package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part002 +1 -0
  18. package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part003 +1 -0
  19. package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part004 +1 -0
  20. package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part005 +1 -0
  21. package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part006 +1 -0
  22. package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part007 +1 -0
  23. package/template/.codex/skills/data-analytics/assets/datascience-small.svg +5 -0
  24. package/template/.codex/skills/data-analytics/assets/datascience-table-widget.html +16 -0
  25. package/template/.codex/skills/data-analytics/assets/datascience-table-widget.html.gz.b64.part001 +1 -0
  26. package/template/.codex/skills/data-analytics/assets/datascience-table-widget.html.gz.b64.part002 +1 -0
  27. package/template/.codex/skills/data-analytics/assets/datascience-table-widget.html.gz.b64.part003 +1 -0
  28. package/template/.codex/skills/data-analytics/assets/datascience-table-widget.html.gz.b64.part004 +1 -0
  29. package/template/.codex/skills/data-analytics/assets/datascience.png +0 -0
  30. package/template/.codex/skills/data-analytics/assets/datascience.svg +10 -0
  31. package/template/.codex/skills/data-analytics/mcp/server.cjs +2963 -0
  32. package/template/.codex/skills/data-analytics/package-lock.json +3048 -0
  33. package/template/.codex/skills/data-analytics/package.json +43 -0
  34. package/template/.codex/skills/data-analytics/scripts/normalize-widget-assets.mjs +75 -0
  35. package/template/.codex/skills/data-analytics/skills/analyze-data-quality/SKILL.md +160 -0
  36. package/template/.codex/skills/data-analytics/skills/analyze-data-quality/agents/openai.yaml +6 -0
  37. package/template/.codex/skills/data-analytics/skills/build-dashboard/SKILL.md +148 -0
  38. package/template/.codex/skills/data-analytics/skills/build-dashboard/agents/openai.yaml +6 -0
  39. package/template/.codex/skills/data-analytics/skills/build-dashboard/specifications/bi-platform-dashboard.md +18 -0
  40. package/template/.codex/skills/data-analytics/skills/build-dashboard/specifications/html-dashboard.md +24 -0
  41. package/template/.codex/skills/data-analytics/skills/build-dashboard/specifications/mcp-artifact-dashboard.md +71 -0
  42. package/template/.codex/skills/data-analytics/skills/build-dashboard/specifications/streamlit-dashboard.md +85 -0
  43. package/template/.codex/skills/data-analytics/skills/build-report/SKILL.md +207 -0
  44. package/template/.codex/skills/data-analytics/skills/build-report/agents/openai.yaml +6 -0
  45. package/template/.codex/skills/data-analytics/skills/build-report/assets/executive-report-shell.html +70 -0
  46. package/template/.codex/skills/data-analytics/skills/build-report/assets/technical-report-shell.html +66 -0
  47. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/SKILL.md +118 -0
  48. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/agents/openai.yaml +6 -0
  49. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/__init__.py +1 -0
  50. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/cli.py +57 -0
  51. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/constants.py +61 -0
  52. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/docx_writer.py +362 -0
  53. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/html_parser.py +829 -0
  54. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/model.py +30 -0
  55. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/plan.py +129 -0
  56. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/quality.py +374 -0
  57. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/rendering.py +613 -0
  58. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/table_utils.py +54 -0
  59. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/utils.py +16 -0
  60. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc_plan.py +9 -0
  61. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-slides/SKILL.md +78 -0
  62. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-slides/agents/openai.yaml +6 -0
  63. package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-slides/scripts/report_to_google_slides.py +2379 -0
  64. package/template/.codex/skills/data-analytics/skills/build-report/report-to-pdf/SKILL.md +88 -0
  65. package/template/.codex/skills/data-analytics/skills/build-report/report-to-pdf/agents/openai.yaml +6 -0
  66. package/template/.codex/skills/data-analytics/skills/build-report/specifications/executive-report.md +97 -0
  67. package/template/.codex/skills/data-analytics/skills/build-report/specifications/mcp-app-report.md +59 -0
  68. package/template/.codex/skills/data-analytics/skills/build-report/specifications/technical-report.md +75 -0
  69. package/template/.codex/skills/data-analytics/skills/design-kpis/SKILL.md +103 -0
  70. package/template/.codex/skills/data-analytics/skills/design-kpis/agents/openai.yaml +6 -0
  71. package/template/.codex/skills/data-analytics/skills/gather-business-context/SKILL.md +68 -0
  72. package/template/.codex/skills/data-analytics/skills/gather-business-context/agents/openai.yaml +6 -0
  73. package/template/.codex/skills/data-analytics/skills/index/SKILL.md +251 -0
  74. package/template/.codex/skills/data-analytics/skills/index/agents/openai.yaml +6 -0
  75. package/template/.codex/skills/data-analytics/skills/jupyter-notebooks/SKILL.md +131 -0
  76. package/template/.codex/skills/data-analytics/skills/jupyter-notebooks/agents/openai.yaml +6 -0
  77. package/template/.codex/skills/data-analytics/skills/kpi-reporting/SKILL.md +141 -0
  78. package/template/.codex/skills/data-analytics/skills/kpi-reporting/agents/openai.yaml +6 -0
  79. package/template/.codex/skills/data-analytics/skills/kpi-reporting/references/report-templates.md +32 -0
  80. package/template/.codex/skills/data-analytics/skills/market-sizing/SKILL.md +106 -0
  81. package/template/.codex/skills/data-analytics/skills/market-sizing/agents/openai.yaml +6 -0
  82. package/template/.codex/skills/data-analytics/skills/metric-diagnostics/SKILL.md +130 -0
  83. package/template/.codex/skills/data-analytics/skills/metric-diagnostics/agents/openai.yaml +6 -0
  84. package/template/.codex/skills/data-analytics/skills/product-business-analysis/SKILL.md +141 -0
  85. package/template/.codex/skills/data-analytics/skills/product-business-analysis/agents/openai.yaml +6 -0
  86. package/template/.codex/skills/data-analytics/skills/spreadsheets/SKILL.md +178 -0
  87. package/template/.codex/skills/data-analytics/skills/spreadsheets/agents/openai.yaml +9 -0
  88. package/template/.codex/skills/data-analytics/skills/spreadsheets/assets/file-spreadsheet.png +0 -0
  89. package/template/.codex/skills/data-analytics/skills/spreadsheets/charts.md +31 -0
  90. package/template/.codex/skills/data-analytics/skills/spreadsheets/references/artifact_tool_api.md +466 -0
  91. package/template/.codex/skills/data-analytics/skills/spreadsheets/style_guidelines.md +99 -0
  92. package/template/.codex/skills/data-analytics/skills/user-context/SKILL.md +195 -0
  93. package/template/.codex/skills/data-analytics/skills/user-context/agents/openai.yaml +6 -0
  94. package/template/.codex/skills/data-analytics/skills/user-context/plugin-author-config/automation-config.md +26 -0
  95. package/template/.codex/skills/data-analytics/skills/user-context/plugin-author-config/source-category-config.json +51 -0
  96. package/template/.codex/skills/data-analytics/skills/user-context/plugin-author-config/user-context-config.md +66 -0
  97. package/template/.codex/skills/data-analytics/skills/user-context/references/automation.md +69 -0
  98. package/template/.codex/skills/data-analytics/skills/user-context/references/onboarding-examples.md +204 -0
  99. package/template/.codex/skills/data-analytics/skills/user-context/references/onboarding-state-template.json +87 -0
  100. package/template/.codex/skills/data-analytics/skills/user-context/references/onboarding.md +497 -0
  101. package/template/.codex/skills/data-analytics/skills/user-context/references/semantic-layer/connector-playbook.md +74 -0
  102. package/template/.codex/skills/data-analytics/skills/user-context/references/semantic-layer/setup.md +65 -0
  103. package/template/.codex/skills/data-analytics/skills/user-context/references/semantic-layer/skill-template.md +160 -0
  104. package/template/.codex/skills/data-analytics/skills/user-context/references/semantic-layer/source-intake.md +75 -0
  105. package/template/.codex/skills/data-analytics/skills/user-context/references/semantic-layer/weekly-polling-automation.md +96 -0
  106. package/template/.codex/skills/data-analytics/skills/user-context/references/source-category-runtime.md +263 -0
  107. package/template/.codex/skills/data-analytics/skills/user-context/scripts/data_analytics_preflight.py +1460 -0
  108. package/template/.codex/skills/data-analytics/skills/user-context/scripts/init_user_context_state.py +128 -0
  109. package/template/.codex/skills/data-analytics/skills/user-context/scripts/reset_user_context_state.py +101 -0
  110. package/template/.codex/skills/data-analytics/skills/user-context/scripts/validate_user_context_preflight.py +499 -0
  111. package/template/.codex/skills/data-analytics/skills/user-context/tests/test_state_helpers.py +978 -0
  112. package/template/.codex/skills/data-analytics/skills/validate-data/SKILL.md +190 -0
  113. package/template/.codex/skills/data-analytics/skills/validate-data/agents/openai.yaml +6 -0
  114. package/template/.codex/skills/data-analytics/skills/visualize-data/SKILL.md +157 -0
  115. package/template/.codex/skills/data-analytics/skills/visualize-data/agents/openai.yaml +6 -0
  116. package/template/.codex/skills/data-analytics/skills/visualize-data/references/seaborn-templates.md +774 -0
  117. package/template/.codex/skills/data-analytics/src/DESIGN.md +222 -0
  118. package/template/.codex/skills/data-analytics/src/analytics-app/App.tsx +3666 -0
  119. package/template/.codex/skills/data-analytics/src/analytics-app/analytics-layout.test.mjs +136 -0
  120. package/template/.codex/skills/data-analytics/src/analytics-app/charting/ChartFrame.tsx +54 -0
  121. package/template/.codex/skills/data-analytics/src/analytics-app/charting/ChartLegend.tsx +96 -0
  122. package/template/.codex/skills/data-analytics/src/analytics-app/charting/ChartRenderer.tsx +1647 -0
  123. package/template/.codex/skills/data-analytics/src/analytics-app/charting/ChartTooltip.tsx +245 -0
  124. package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-app-helpers.tsx +462 -0
  125. package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-capabilities.ts +107 -0
  126. package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-compatibility.ts +164 -0
  127. package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-contract.ts +192 -0
  128. package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-theme.ts +203 -0
  129. package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-tokens.css +619 -0
  130. package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-transforms.ts +402 -0
  131. package/template/.codex/skills/data-analytics/src/analytics-app/fonts/SystemSansVariableVF.woff2 +0 -0
  132. package/template/.codex/skills/data-analytics/src/analytics-app/imageExport.ts +370 -0
  133. package/template/.codex/skills/data-analytics/src/analytics-app/layout/AnalyticsLayoutCanvas.tsx +536 -0
  134. package/template/.codex/skills/data-analytics/src/analytics-app/layout/RichMarkdown.tsx +681 -0
  135. package/template/.codex/skills/data-analytics/src/analytics-app/layout/analyticsLayoutCore.ts +164 -0
  136. package/template/.codex/skills/data-analytics/src/analytics-app/main.tsx +21 -0
  137. package/template/.codex/skills/data-analytics/src/analytics-app/scripts/chart_contract.py +472 -0
  138. package/template/.codex/skills/data-analytics/src/analytics-app/scripts/check_analytics_app_runtime_links.py +75 -0
  139. package/template/.codex/skills/data-analytics/src/analytics-app/scripts/design_contract.py +142 -0
  140. package/template/.codex/skills/data-analytics/src/analytics-app/scripts/package_utils.py +142 -0
  141. package/template/.codex/skills/data-analytics/src/analytics-app/scripts/tests/test_package_utils.py +377 -0
  142. package/template/.codex/skills/data-analytics/src/analytics-app/styles.css +3468 -0
  143. package/template/.codex/skills/data-analytics/src/analytics-app/tables/DataTable.d.ts +44 -0
  144. package/template/.codex/skills/data-analytics/src/analytics-app/tables/DataTable.jsx +639 -0
  145. package/template/.codex/skills/data-analytics/src/analytics-app/tables/data-table.css +327 -0
  146. package/template/.codex/skills/data-analytics/src/analytics-app/tokens.css +225 -0
  147. package/template/.codex/skills/data-analytics/src/analytics-app/types.ts +204 -0
  148. package/template/.codex/skills/data-analytics/src/analytics-app-core.md +85 -0
  149. package/template/.codex/skills/data-analytics/src/codex-style-contract.md +30 -0
  150. package/template/.codex/skills/data-analytics/src/datascience-artifact-widget.html +12 -0
  151. package/template/.codex/skills/data-analytics/src/datascience-artifact-widget.jsx +1008 -0
  152. package/template/.codex/skills/data-analytics/src/datascience-chart-widget.css +2117 -0
  153. package/template/.codex/skills/data-analytics/src/datascience-chart-widget.html +122 -0
  154. package/template/.codex/skills/data-analytics/src/datascience-chart-widget.js +3588 -0
  155. package/template/.codex/skills/data-analytics/src/datascience-table-widget.css +483 -0
  156. package/template/.codex/skills/data-analytics/src/datascience-table-widget.html +32 -0
  157. package/template/.codex/skills/data-analytics/src/datascience-table-widget.js +333 -0
  158. package/template/.codex/skills/data-analytics/src/mcp-host.js +153 -0
  159. package/template/.codex/skills/data-analytics/src/recharts-config.js +315 -0
  160. package/template/.codex/skills/data-analytics/src/recharts-renderer.jsx +294 -0
  161. package/template/.codex/skills/data-analytics/src/sql-source-view.css +33 -0
  162. package/template/.codex/skills/data-analytics/src/sql-source-view.js +157 -0
  163. package/template/.codex/skills/data-analytics/src/styles/codex-theme.css +121 -0
  164. package/template/.codex/skills/data-analytics/src/table-renderer.jsx +28 -0
  165. package/template/.codex/skills/data-analytics/tests/chart-transforms.test.mjs +87 -0
  166. package/template/.codex/skills/data-analytics/tests/funnel-smoke.html +105 -0
  167. package/template/.codex/skills/data-analytics/tests/inline-widget-compare.html +233 -0
  168. package/template/.codex/skills/data-analytics/tests/mcp-server.test.mjs +1500 -0
  169. package/template/.codex/skills/data-analytics/tests/native-style-contract.test.mjs +219 -0
  170. package/template/.codex/skills/data-analytics/tests/recharts-config.test.mjs +144 -0
  171. package/template/.codex/skills/data-analytics/tests/recharts-renderer.test.mjs +11 -0
  172. package/template/.codex/skills/data-analytics/tests/rich-markdown.test.mjs +54 -0
  173. package/template/.codex/skills/data-analytics/tests/widget-render-harness.html +321 -0
  174. package/template/.codex/skills/data-analytics/tsconfig.json +19 -0
  175. package/template/.codex/skills/data-analytics/vite.config.ts +46 -0
  176. package/template/.codex/skills/product-design/.app.json +7 -0
  177. package/template/.codex/skills/product-design/.codex-plugin/plugin.json +50 -0
  178. package/template/.codex/skills/product-design/README.md +50 -0
  179. package/template/.codex/skills/product-design/agents/openai.yaml +4 -0
  180. package/template/.codex/skills/product-design/assets/composerIcon.svg +9 -0
  181. package/template/.codex/skills/product-design/assets/logo.png +0 -0
  182. package/template/.codex/skills/product-design/package.json +11 -0
  183. package/template/.codex/skills/product-design/references/browser-order.md +9 -0
  184. package/template/.codex/skills/product-design/references/communication-protocol.md +45 -0
  185. package/template/.codex/skills/product-design/references/critical-overrides.md +58 -0
  186. package/template/.codex/skills/product-design/references/local-prototype-preflight.md +16 -0
  187. package/template/.codex/skills/product-design/scripts/bootstrap-prototype.mjs +147 -0
  188. package/template/.codex/skills/product-design/skills/audit/SKILL.md +159 -0
  189. package/template/.codex/skills/product-design/skills/audit/agents/openai.yaml +6 -0
  190. package/template/.codex/skills/product-design/skills/audit/references/design-audit-framework.md +73 -0
  191. package/template/.codex/skills/product-design/skills/design-qa/SKILL.md +133 -0
  192. package/template/.codex/skills/product-design/skills/design-qa/agents/openai.yaml +6 -0
  193. package/template/.codex/skills/product-design/skills/design-qa/references/qa-rubric.md +61 -0
  194. package/template/.codex/skills/product-design/skills/get-context/SKILL.md +81 -0
  195. package/template/.codex/skills/product-design/skills/get-context/agents/openai.yaml +6 -0
  196. package/template/.codex/skills/product-design/skills/ideate/SKILL.md +179 -0
  197. package/template/.codex/skills/product-design/skills/ideate/agents/openai.yaml +6 -0
  198. package/template/.codex/skills/product-design/skills/image-to-code/SKILL.md +105 -0
  199. package/template/.codex/skills/product-design/skills/image-to-code/agents/openai.yaml +6 -0
  200. package/template/.codex/skills/product-design/skills/index/SKILL.md +126 -0
  201. package/template/.codex/skills/product-design/skills/index/agents/openai.yaml +6 -0
  202. package/template/.codex/skills/product-design/skills/prototype/SKILL.md +128 -0
  203. package/template/.codex/skills/product-design/skills/prototype/agents/openai.yaml +6 -0
  204. package/template/.codex/skills/product-design/skills/prototype/references/existing-codebase-edits.md +18 -0
  205. package/template/.codex/skills/product-design/skills/research/SKILL.md +92 -0
  206. package/template/.codex/skills/product-design/skills/research/agents/openai.yaml +6 -0
  207. package/template/.codex/skills/product-design/skills/share/SKILL.md +41 -0
  208. package/template/.codex/skills/product-design/skills/share/agents/openai.yaml +6 -0
  209. package/template/.codex/skills/product-design/skills/url-to-code/SKILL.md +124 -0
  210. package/template/.codex/skills/product-design/skills/url-to-code/agents/openai.yaml +6 -0
  211. package/template/.codex/skills/product-design/skills/user-context/SKILL.md +147 -0
  212. package/template/.codex/skills/product-design/skills/user-context/agents/openai.yaml +6 -0
  213. package/template/.codex/skills/product-design/skills/user-context/plugin-author-config/user-context-template.md +63 -0
  214. package/template/.codex/skills/product-design/skills/user-context/references/onboarding.md +66 -0
  215. package/template/.codex/skills/product-design/skills/user-context/scripts/init_user_context.py +86 -0
  216. package/template/.codex/skills/product-design/skills/user-context/scripts/user_context_preflight.py +204 -0
  217. package/template/.codex/skills/product-design/templates/prototype/AGENTS.md +7 -0
  218. package/template/.codex/skills/product-design/templates/prototype/index.html +12 -0
  219. package/template/.codex/skills/product-design/templates/prototype/package.json +18 -0
  220. package/template/.codex/skills/product-design/templates/prototype/src/App.jsx +5 -0
  221. package/template/.codex/skills/product-design/templates/prototype/src/main.jsx +10 -0
  222. package/template/.codex/skills/product-design/templates/prototype/src/styles.css +13 -0
  223. package/template/.codex/skills/product-design/templates/prototype/vite.config.mjs +14 -0
  224. package/template/.codex/skills/yss-product-lifecycle/SKILL.md +3 -3
  225. package/template/AGENTS.md +3 -3
  226. package/template/docs/adr/adr-product-design-prototype-entrypoint.md +54 -0
  227. package/template/docs/api/templates/openapi-draft-review-checklist.md +4 -2
  228. package/template/docs/design/README.md +8 -4
  229. package/template/docs/design/templates/interaction-spec-template.md +4 -1
  230. package/template/docs/design/templates/prototype-confirmation-template.md +57 -0
  231. package/template/docs/design/templates/prototype-review-checklist.md +6 -2
  232. package/template/docs/design/templates/state-matrix-template.md +1 -1
  233. package/template/docs/process/harness-executive-blueprint.md +2 -1
  234. package/template/docs/process/harness-process-tailoring.md +1 -1
  235. package/template/docs/process/harness-work-unit-map.md +1 -1
  236. package/template/docs/process/lifecycle-artifact-map.md +4 -3
  237. package/template/docs/process/product-prototype-workflow.md +82 -0
  238. package/template/docs/user-guide/product-lifecycle-workflow.md +2 -2
  239. package/template/docs/user-guide/product-rd-lifecycle-best-practices.md +15 -10
@@ -0,0 +1,92 @@
1
+ ---
2
+ name: research
3
+ description: "Run fast, source-grounded UX research on the highest-signal problems users are experiencing with a user-specified digital product. Use when the user asks to research user pain, UX friction, onboarding issues, docs/help problems, developer experience friction, support pain, product workflow issues, or current user complaints for a named product."
4
+ ---
5
+
6
+ # Research
7
+
8
+ Run a fresh UX research scan for the product the user specifies.
9
+
10
+ Focus on current, evidence-backed user problems. Prioritize logged-in product experience, self-serve flows, onboarding, docs/help, developer experience, support friction, and product workflows.
11
+
12
+ ## Critical Overrides
13
+
14
+ - Refer to the Plugin router [$index](../index/SKILL.md) before proceeding.
15
+ - Follow [$critical-overrides](../../references/critical-overrides.md).
16
+
17
+ ## User Context
18
+
19
+ Before starting, load [$user-context](../user-context/SKILL.md) and run its preflight script when local shell access is available.
20
+
21
+ Use saved product URLs, Figma files, screenshots, reference images, codebase paths, Storybook, tokens, design systems, brand assets, component refs, browser preferences, and share targets as grounding material when relevant.
22
+
23
+ Do not inspect every saved reference. Inspect only what the current task needs.
24
+
25
+ ## Contract
26
+
27
+ - Restate the product, audience, time horizon, and research scope before scanning.
28
+ - Use public sources by default. Use internal sources when the connectors are available and the user request allows it.
29
+ - Cite sources wherever available.
30
+ - Separate observed evidence from inference.
31
+ - Do not overclaim from anecdotes.
32
+ - Do not return a dump of complaints. Tell a clear product story.
33
+ - Say clearly when source access is missing or weak.
34
+
35
+ ## Workflow
36
+
37
+ 1. Restate the research scope.
38
+
39
+ 2. Search public sources:
40
+
41
+ - Reddit
42
+ - X/Twitter
43
+ - Hacker News
44
+ - Stack Overflow
45
+ - GitHub issues/discussions
46
+ - forums, blogs, reviews, YouTube comments, and developer communities where relevant
47
+
48
+ 3. Search internal sources when available:
49
+
50
+ - Slack
51
+ - Gong
52
+ - Notion
53
+ - Google Drive/docs
54
+ - Linear/Jira/GitHub
55
+ - support or CRM notes if available
56
+
57
+ 4. Cluster evidence into the highest-signal UX problems.
58
+
59
+ 5. Separate:
60
+
61
+ - product UI/workflow friction
62
+ - docs/help friction
63
+ - onboarding friction
64
+ - account, billing, permissions, or setup friction
65
+ - developer/API/SDK friction
66
+ - reliability/performance issues
67
+ - feature requests
68
+
69
+ 6. Rank problems by severity, frequency, confidence, and product leverage.
70
+
71
+ 7. Tell a clear product story.
72
+
73
+ ## Output
74
+
75
+ Default to an in-chat research brief unless the user asks for another format.
76
+
77
+ Include:
78
+
79
+ - Executive read: the core story in 5-7 sentences.
80
+ - Ranked UX problems: for each problem, include the problem, user goal, surface, what breaks, evidence, severity, frequency signal, confidence, and recommended product move.
81
+ - Source map: what was searched, what each source contributed, and where signal was weak.
82
+ - Opportunity map: group recommendations into fix this week, fix this quarter, and needs deeper research.
83
+
84
+ ## Rules
85
+
86
+ - Use citations wherever available.
87
+ - Do not overclaim from anecdotes.
88
+ - Separate loud complaints from frequent problems.
89
+ - Separate UX friction from missing features.
90
+ - Separate reliability/performance issues from UX workflow issues.
91
+ - Mark internal-only evidence separately from public evidence.
92
+ - Keep the brief sharp, specific, and easy to consume.
@@ -0,0 +1,6 @@
1
+ interface:
2
+ display_name: "Research"
3
+ short_description: "Research UX pain and workflow friction for a digital product"
4
+ default_prompt: "Research user pain and workflow friction for this product."
5
+ policy:
6
+ allow_implicit_invocation: false
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: share
3
+ description: "Share a runnable prototype using the user's preferred deployment tool."
4
+ ---
5
+
6
+ # Share
7
+
8
+ Deploy the user's runnable prototype so they can share it with others.
9
+
10
+ ## Critical Overrides
11
+
12
+ - Refer to the Plugin router [$index](../index/SKILL.md) before proceeding.
13
+ - Follow [$critical-overrides](../../references/critical-overrides.md).
14
+
15
+ ## User Context
16
+
17
+ Before starting, load [$user-context](../user-context/SKILL.md) and run its preflight script when local shell access is available.
18
+
19
+ Use saved product URLs, Figma files, screenshots, reference images, codebase paths, Storybook, tokens, design systems, brand assets, component refs, browser preferences, and share targets as grounding material when relevant.
20
+
21
+ Do not inspect every saved reference. Inspect only what the current task needs.
22
+
23
+ ## Workflow
24
+
25
+ 1. Confirm the prototype directory and the user's preferred deployment target.
26
+ 2. If the user invokes Product Design with @Sites, @Vercel, or another deployment tool, treat that as the selected hosting target.
27
+ 3. If the user did not choose a target, ask one question:
28
+
29
+ > Where should I deploy this: @Sites, @Vercel, or another target?
30
+
31
+ 4. Use the selected deployment tool when it is available.
32
+ 5. If the selected tool is not available, say that clearly and ask whether to use another target.
33
+ 6. Run the deployment when possible. Do not give setup instructions if you can complete the deployment directly.
34
+ 7. Return the shareable URL.
35
+ 8. State any misses or manual follow-up the user still needs to do.
36
+
37
+ ## Rules
38
+
39
+ - Do not deploy before the user chooses or confirms the target.
40
+ - Do not claim the prototype is shared until you have a working URL.
41
+ - If the selected tool is not available, say that clearly and ask whether to use another target.
@@ -0,0 +1,6 @@
1
+ interface:
2
+ display_name: "Share"
3
+ short_description: "Deploy a runnable prototype and return a shareable URL"
4
+ default_prompt: "Share my runnable prototype."
5
+ policy:
6
+ allow_implicit_invocation: false
@@ -0,0 +1,124 @@
1
+ ---
2
+ name: url-to-code
3
+ description: "Clone a live URL as a runnable frontend-only local app using Browser/Chrome source evidence after Product Design get-context has confirmed the design brief."
4
+ ---
5
+
6
+ # URL To Code
7
+
8
+ Clone `<target-url>` as a real interactive, frontend-only local app or website. The clone should look and interact like the source.
9
+
10
+ ## Critical Overrides
11
+
12
+ - Refer to the Plugin router [$index](../index/SKILL.md) before proceeding.
13
+ - Follow [$critical-overrides](../../references/critical-overrides.md).
14
+
15
+ ## User Context
16
+
17
+ Before starting, load [$user-context](../user-context/SKILL.md) and run its preflight script when local shell access is available.
18
+
19
+ Use saved product URLs, Figma files, screenshots, reference images, codebase paths, Storybook, tokens, design systems, brand assets, component refs, browser preferences, and share targets as grounding material when relevant.
20
+
21
+ Do not inspect every saved reference. Inspect only what the current task needs.
22
+
23
+ ## Workflow
24
+
25
+ 0. Do not start unless `$get-context` has played back and confirmed the design brief for this exact request. If this skill was invoked directly and the current thread does not already contain that confirmed brief, route to [$get-context](../get-context/SKILL.md) first.
26
+
27
+ 1. CRITICAL STEP: Warn the user that they must follow the target website's terms before proceeding. This workflow is only for apps and websites the user owns, or has permission to recreate.
28
+
29
+ 2. Open the source URL using [browser-order](../../references/browser-order.md).
30
+
31
+ 3. Check that the page is correct.
32
+
33
+ - Do not continue if it shows the wrong page, a blocked page, a login page, a promo page, a loading screen, an error page, an app-install page, or an unrelated redirect.
34
+ - If the page is wrong, try again with another available browser.
35
+ - If every browser shows the wrong page, stop and tell the user what you can see.
36
+
37
+ 4. Capture the source page carefully.
38
+
39
+ - Start at the top of the page.
40
+ - Scroll down in small steps.
41
+ - At each step, capture what is visible.
42
+ - Note any new sections, controls, sticky elements, animations, or lazy-loaded assets.
43
+ - Continue until the full page has been seen.
44
+ - Scroll back to the top and check whether anything changed.
45
+ - Repeat on mobile at `390 x 844`.
46
+
47
+ 5. Use the browser DOM tools to gather everything needed to recreate the source.
48
+
49
+ - Elements
50
+ - Components
51
+ - Text
52
+ - Links
53
+ - Buttons and controls
54
+ - States
55
+ - Images
56
+ - Icons
57
+ - Fonts
58
+ - Videos
59
+ - SVGs
60
+ - Style sheets
61
+ - Colors
62
+ - Spacing
63
+ - Layout sizes
64
+ - Responsive behavior
65
+
66
+ 6. Find and test the page interactions.
67
+
68
+ - Use the screenshots and browser DOM tools to find visible controls.
69
+ - Include navigation, buttons, links, inputs, menus, drawers, modals, tabs, carousels, hover states, sticky elements, and anything else the user can interact with.
70
+ - Test one control at a time.
71
+ - Return to the starting state before testing the next control.
72
+ - Save the result when the page visibly changes or the browser tools show a state change.
73
+
74
+ 7. Copy the real assets from the source page.
75
+
76
+ - If the page loads the asset, treat it as available unless the browser cannot access or save it.
77
+ - If an image, logo, icon, font, video, SVG, sprite, mask, cursor, or background image is used by the page, copy it locally.
78
+ - If an image asset cannot be copied, generate a replacement with ImageGen using a screenshot of the original.
79
+ - If a font file cannot be copied, use the closest open source font match.
80
+ - If an icon or glyph cannot be copied, use the closest matching open source icon set. Do not default to Lucide unless it is the closest match.
81
+ - Briefly note any asset, font, or icon you replaced and why.
82
+
83
+ 8. Create the local app with [local-prototype-preflight](../../references/local-prototype-preflight.md).
84
+
85
+ 9. Build only from what you captured, copied, or gathered from the source.
86
+
87
+ - Do not add new visual ideas.
88
+ - Do not use hotlinked source assets.
89
+ - Do not guess when source proof is available.
90
+
91
+ 10. Run the local app.
92
+
93
+ 11. Compare the local app against the original.
94
+
95
+ - Check desktop.
96
+ - Check mobile.
97
+ - Check every interaction you captured.
98
+ - Fix any obvious mismatch before running final QA.
99
+
100
+ 12. Run [design-qa](../design-qa/SKILL.md) as the blocking build gate.
101
+
102
+ - Save the QA report as `design-qa.md` in the project root.
103
+ - Fix P0/P1/P2 issues, capture the app again, and repeat until the QA report says `final result: passed`.
104
+ - Do not keep looping on P3 polish. Include any remaining P3s as follow-up iteration notes.
105
+ - If source capture, prototype capture, or visual comparison is blocked, stop. `design-qa.md` must say `final result: blocked`.
106
+ - Do not hand off unless `design-qa.md` exists and says `final result: passed`.
107
+
108
+ 13. Handoff the app or website
109
+
110
+ - Only hand off after [design-qa](../design-qa/SKILL.md) passes.
111
+ - Keep the prototype running locally.
112
+ - Provide the clickable local URL.
113
+ - Briefly describe the work as a designer would.
114
+ - Include the post-build iteration and share nudge from [critical-overrides](../../references/critical-overrides.md#build-handoff).
115
+
116
+ ## Hard Rules
117
+
118
+ - Capture source evidence first. Do not scaffold, write app code, start a server, or create the local prototype until desktop capture, mobile capture, key states, and every required asset, icon, control mark, and font is captured or replaced.
119
+ - Do not hand off until every single interaction and state is captured from the target.
120
+ - Do not build from memory, screenshots alone, guessed CSS, generic assets, or prior chats.
121
+ - Do not implement a saved state without source screenshot plus the available DOM/style/layout evidence for that state.
122
+ - Do not use hotlinked source assets in the final app.
123
+ - Do not create temporary CSS icons, text glyphs, emoji marks, placeholder blocks, or handmade SVGs while "waiting" to resolve assets. Resolve assets first, then build.
124
+ - If Browser and Chrome fail, ask before using Playwright. If no approved tool can capture valid source and prototype evidence, stop and report the design-qa blocker.
@@ -0,0 +1,6 @@
1
+ interface:
2
+ display_name: "URL To Code"
3
+ short_description: "Clone a live URL into a runnable frontend prototype after brief confirmation"
4
+ default_prompt: "Confirm the design brief, then clone this URL as a runnable frontend prototype."
5
+ policy:
6
+ allow_implicit_invocation: false
@@ -0,0 +1,147 @@
1
+ ---
2
+ name: user-context
3
+ description: Load or manage Product Design's saved user context. Use when the user asks to set up Product Design, get started, onboard, save product or design sources, see what Product Design remembers, update saved context, or remember Product Design preferences. Examples include product URLs, Figma files, screenshots, reference images, codebase paths, Storybook, tokens, design systems, brand assets, and general product/design notes.
4
+ ---
5
+
6
+ # User Context
7
+
8
+ User Context stores the product and design references a designer uses often, so future Product Design work starts from the right sources.
9
+
10
+ Use this skill when the user asks to:
11
+
12
+ - set up Product Design
13
+ - get started with Product Design
14
+ - onboard with Product Design
15
+ - save product or design sources
16
+ - see what Product Design remembers
17
+ - update saved product or design context
18
+ - remember a Product Design preference
19
+ - setup my plugin
20
+
21
+ ## Critical Overrides
22
+
23
+ - Refer to the Plugin router [$index](../index/SKILL.md) before proceeding.
24
+ - Follow [$critical-overrides](../../references/critical-overrides.md).
25
+
26
+ ## Saved User Context
27
+
28
+ If `user-context.md` exists, use it by default.
29
+
30
+ Use saved product URLs, Figma files, screenshots, reference images, codebase paths, Storybook, tokens, design systems, brand assets, component refs, browser preferences, and share targets to ground Product Design work.
31
+
32
+ Ideation, prototypes, audits, clones, and critiques should match the saved product context unless the user asks for something different.
33
+
34
+ When a workflow needs visual grounding, attach or include relevant saved screenshots, reference images, tokens, design language, and component references in ImageGen, ideation, prototype, audit, and critique work.
35
+
36
+ ## State File
37
+
38
+ Saved context lives here:
39
+
40
+ ```text
41
+ $CODEX_HOME/state/plugins/product-design/user-context.md
42
+ ```
43
+
44
+ Saved screenshots and reference images live next to it:
45
+
46
+ ```text
47
+ $CODEX_HOME/state/plugins/product-design/assets/
48
+ ```
49
+
50
+ If the file does not exist, continue normally unless the user asks to set up Product Design, save context, or the current task is blocked by missing product/design context.
51
+
52
+ ## Preflight
53
+
54
+ When any Product Design workflow needs saved context, run:
55
+
56
+ ```bash
57
+ python3 scripts/user_context_preflight.py
58
+ ```
59
+
60
+ Use the returned saved entries as the starting context for the task.
61
+
62
+ If the script reports that no saved context exists, continue from the current user prompt unless setup context is required.
63
+
64
+ Do not browse, open, or inspect every saved reference during preflight. Inspect only the saved references needed for the current task.
65
+
66
+ ## Setup
67
+
68
+ Use [references/onboarding.md](references/onboarding.md) when the user asks to set up Product Design, asks what Product Design can remember, asks what Product Design knows about their product, or provides product/design references to save.
69
+
70
+ For setup-only requests, explain what Product Design can remember and ask for useful sources.
71
+
72
+ Adjust the context-gathering request to match the user's request. First-time setup differs from updating existing context.
73
+
74
+ Do not inspect the workspace, install dependencies, scaffold a prototype, generate images, run audits, or start implementation during setup.
75
+
76
+ After the user provides references to save, run:
77
+
78
+ ```bash
79
+ python3 scripts/init_user_context.py
80
+ ```
81
+
82
+ Then add the references to the created `user-context.md`.
83
+
84
+ ## Save
85
+
86
+ Save useful, durable Product Design context:
87
+
88
+ - Product URLs
89
+ - Figma files
90
+ - Screenshots and reference images
91
+ - Codebase paths
92
+ - Storybook and component docs
93
+ - Design tokens and theme sources
94
+ - Brand, logo, icon, illustration, image, and asset sources
95
+ - Preferred browser, capture tools, and share targets
96
+ - Team conventions that make future Product Design work more accurate
97
+
98
+ When the user provides screenshots or reference images to save, copy them into `assets/` next to `user-context.md` and link them from the saved entry.
99
+
100
+ Give each saved image a clear, descriptive filename that says what the image shows. Use names future Product Design runs can understand without opening the file.
101
+
102
+ Good image names:
103
+
104
+ ```text
105
+ assets/chatgpt-settings-modal-dark-mode.png
106
+ assets/payment-sheet-mobile-error-state.png
107
+ assets/product-dashboard-sidebar-navigation.png
108
+ assets/storybook-primary-button-states.png
109
+ assets/brand-logo-lockup-purple-gradient.png
110
+ assets/onboarding-flow-welcome-step.png
111
+ assets/checkout-confirmation-screen.png
112
+ assets/account-menu-open-state.png
113
+ ```
114
+
115
+ Do not save secrets, credentials, API keys, private tokens, copied customer data, or anything that should not persist.
116
+
117
+ Use this structure:
118
+
119
+ ```md
120
+ # {Category}
121
+
122
+ - Description: {what this category is and when future Product Design runs should use it}
123
+
124
+ ## Saved Links And Context
125
+
126
+ {Saved reference or fact}
127
+ - Date Added: YYYY-MM-DD.
128
+ - File: assets/{clear-descriptive-name}.png
129
+ - Useful Context: {what this reference represents}
130
+ - Future Use: {how future Product Design work should use it}
131
+ ```
132
+
133
+ Include `File:` only when the saved entry has a local image file.
134
+
135
+ When a category has no saved references yet, use exactly:
136
+
137
+ ```md
138
+ status: not provided
139
+ ```
140
+
141
+ Keep saved context curated. Prefer a few high-value references over a dump of every possible URL or file.
142
+
143
+ ## Read
144
+
145
+ - Do not treat `status: not provided` as a fact.
146
+ - Read through `scripts/user_context_preflight.py` when local shell access is available.
147
+ - Use saved context as default grounding, then inspect only what the current task needs.
@@ -0,0 +1,6 @@
1
+ interface:
2
+ display_name: "User Context"
3
+ short_description: "Save and read Product Design user context"
4
+ default_prompt: "Set up Product Design with my product URLs, Figma files, screenshots, codebase paths, Storybook, tokens, and brand assets."
5
+ policy:
6
+ allow_implicit_invocation: false
@@ -0,0 +1,63 @@
1
+ # Product URLs
2
+
3
+ - Description: Production, staging, local app, docs, admin, or key flow URLs Product Design can use as likely source surfaces.
4
+
5
+ ## Saved Links And Context
6
+
7
+ status: not provided
8
+
9
+ # Figma Sources
10
+
11
+ - Description: Product files, design-system files, component libraries, prototypes, FigJam boards, or other Figma sources.
12
+
13
+ ## Saved Links And Context
14
+
15
+ status: not provided
16
+
17
+ # Screenshots And Reference Images
18
+
19
+ - Description: Local screenshots and reference images saved under `assets/` next to `user-context.md`.
20
+
21
+ ## Saved Links And Context
22
+
23
+ status: not provided
24
+
25
+ # Codebase References
26
+
27
+ - Description: Repo roots, app packages, component folders, token files, theme files, CSS entrypoints, or implementation notes.
28
+
29
+ ## Saved Links And Context
30
+
31
+ status: not provided
32
+
33
+ # Storybook And Component Docs
34
+
35
+ - Description: Storybook URLs, component docs, design-system docs, UI kit docs, or local component preview commands.
36
+
37
+ ## Saved Links And Context
38
+
39
+ status: not provided
40
+
41
+ # Design Tokens And Theme Sources
42
+
43
+ - Description: Tokens, typography, spacing, color, radius, icon, motion, CSS variable, Tailwind, or theme sources.
44
+
45
+ ## Saved Links And Context
46
+
47
+ status: not provided
48
+
49
+ # Brand And Asset Sources
50
+
51
+ - Description: Logos, app icons, illustration libraries, product imagery, icon sets, image libraries, and brand guidelines.
52
+
53
+ ## Saved Links And Context
54
+
55
+ status: not provided
56
+
57
+ # Tool And Sharing Preferences
58
+
59
+ - Description: Preferred browser, capture tool, Figma usage, share target, deployment target, and team workflow preferences.
60
+
61
+ ## Saved Links And Context
62
+
63
+ status: not provided
@@ -0,0 +1,66 @@
1
+ # Product Design Setup
2
+
3
+ Use this reference when saved user context is missing, when the user asks what Product Design can remember, when the user asks to set up Product Design, or when the user provides product/design references to save.
4
+
5
+ Setup is short. It is not a questionnaire and not a formal onboarding state machine.
6
+
7
+ ## Step 1: Orientation
8
+
9
+ Render this first. Do not write files, inspect tools, browse URLs, open Figma, create prototypes, generate images, or run audits before this message.
10
+
11
+ ```md
12
+ Product Design can remember the product surfaces and design sources you use most, so future work starts from the right place.
13
+
14
+ Useful things to save:
15
+ 1. Product URLs
16
+ 2. Figma files
17
+ 3. Screenshots or reference images
18
+ 4. Codebase paths
19
+ 5. Storybook or component docs
20
+ 6. Design-system refs
21
+ 7. Brand and asset sources
22
+ 8. Preferred tools and share targets
23
+
24
+ Send any of those now, or say `skip` and I'll work from each task's source.
25
+ ```
26
+
27
+ ## Step 2: Save Context
28
+
29
+ When the user provides references, save them to:
30
+
31
+ ```text
32
+ $CODEX_HOME/state/plugins/product-design/user-context.md
33
+ ```
34
+
35
+ Create the file first if needed:
36
+
37
+ ```bash
38
+ python3 scripts/init_user_context.py
39
+ ```
40
+
41
+ Use the category structure from `../SKILL.md`.
42
+
43
+ If the user provides screenshots or reference images, copy them into:
44
+
45
+ ```text
46
+ $CODEX_HOME/state/plugins/product-design/assets/
47
+ ```
48
+
49
+ Give saved images clear names that say what they show, such as `assets/payment-sheet-mobile-error-state.png` or `assets/account-menu-open-state.png`.
50
+
51
+ Do not save secrets, API keys, credentials, private tokens, or unsupported claims.
52
+
53
+ Use this save recap:
54
+
55
+ ```md
56
+ Saved Product Design context:
57
+ - {Category}: {what was saved}
58
+
59
+ I'll use this as a starting map for future Product Design work. The source you provide in a task still wins.
60
+ ```
61
+
62
+ ## Step 3: Read Context
63
+
64
+ When the user asks what Product Design knows, read `user-context.md` and summarize only saved entries.
65
+
66
+ If no saved context exists, say that plainly and offer the Step 1 setup prompt.
@@ -0,0 +1,86 @@
1
+ #!/usr/bin/env python3
2
+ """Create the local Product Design context file."""
3
+
4
+ from __future__ import annotations
5
+
6
+ import argparse
7
+ import os
8
+ import sys
9
+ from pathlib import Path
10
+
11
+ SKILL_ROOT = Path(__file__).resolve().parents[1]
12
+ TEMPLATE_PATH = SKILL_ROOT / "plugin-author-config/user-context-template.md"
13
+ PLUGIN_STATE_DIR = Path("state/plugins/product-design")
14
+
15
+ CONTEXT_NOTE = """<!--
16
+ Product Design context. This file is user-editable.
17
+ Unresolved `status: not provided` entries are setup prompts, not saved facts.
18
+ Saved references should include Date Added, Useful Context, and Future Use when available.
19
+ -->
20
+
21
+ """
22
+
23
+
24
+ def parse_args() -> argparse.Namespace:
25
+ parser = argparse.ArgumentParser(
26
+ description=(
27
+ "Create $CODEX_HOME/state/plugins/product-design/user-context.md "
28
+ "from the bundled Product Design template."
29
+ )
30
+ )
31
+ parser.add_argument(
32
+ "--codex-home",
33
+ type=Path,
34
+ default=None,
35
+ help="Codex home directory. Defaults to $CODEX_HOME or ~/.codex.",
36
+ )
37
+ parser.add_argument(
38
+ "--state-dir",
39
+ type=Path,
40
+ default=None,
41
+ help="Override the Product Design state directory.",
42
+ )
43
+ parser.add_argument(
44
+ "--overwrite",
45
+ action="store_true",
46
+ help="Overwrite an existing user-context.md file.",
47
+ )
48
+ return parser.parse_args()
49
+
50
+
51
+ def resolve_state_dir(codex_home: Path | None, state_dir: Path | None) -> Path:
52
+ if state_dir is not None:
53
+ return state_dir.expanduser().resolve()
54
+ home = codex_home or Path(os.environ.get("CODEX_HOME", "~/.codex"))
55
+ return (home.expanduser() / PLUGIN_STATE_DIR).resolve()
56
+
57
+
58
+ def main() -> int:
59
+ args = parse_args()
60
+ state_dir = resolve_state_dir(args.codex_home, args.state_dir)
61
+ context_path = state_dir / "user-context.md"
62
+
63
+ if not TEMPLATE_PATH.exists():
64
+ print("Missing Product Design context template.", file=sys.stderr)
65
+ print(f"- {TEMPLATE_PATH.relative_to(SKILL_ROOT)}", file=sys.stderr)
66
+ return 1
67
+
68
+ state_dir.mkdir(parents=True, exist_ok=True)
69
+ (state_dir / "assets").mkdir(parents=True, exist_ok=True)
70
+
71
+ existed = context_path.exists()
72
+ if existed and not args.overwrite:
73
+ result = "preserved"
74
+ else:
75
+ context_path.write_text(
76
+ CONTEXT_NOTE + TEMPLATE_PATH.read_text(encoding="utf-8"), encoding="utf-8"
77
+ )
78
+ result = "overwritten" if existed else "created"
79
+
80
+ print(f"Product Design state directory: {state_dir}")
81
+ print(f"user-context.md: {result}")
82
+ return 0
83
+
84
+
85
+ if __name__ == "__main__":
86
+ sys.exit(main())