@waoooo/claude-skills 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 (264) hide show
  1. package/README.md +48 -0
  2. package/package.json +28 -0
  3. package/registry.json +431 -0
  4. package/skills/acceptance-review/SKILL.md +537 -0
  5. package/skills/all-plan/SKILL.md +19 -0
  6. package/skills/all-plan/references/flow.md +750 -0
  7. package/skills/api-docs-generate/SKILL.md +204 -0
  8. package/skills/api-docs-generate/assets/templates/api.mdx +140 -0
  9. package/skills/api-docs-generate/scripts/generate-api-docs.ts +308 -0
  10. package/skills/ask/SKILL.md +42 -0
  11. package/skills/autonew/SKILL.md +34 -0
  12. package/skills/capability-analyze/SKILL.md +300 -0
  13. package/skills/capability-analyze/scripts/analyze-capabilities.ts +531 -0
  14. package/skills/capability-docs-generate/SKILL.md +155 -0
  15. package/skills/capability-docs-generate/assets/templates/capability.mdx +271 -0
  16. package/skills/capability-docs-generate/scripts/generate-capability-docs.ts +358 -0
  17. package/skills/capability-tree-query/SKILL.md +112 -0
  18. package/skills/capability-tree-query/scripts/build-capability-tree.ts +402 -0
  19. package/skills/changelog-generator/SKILL.md +104 -0
  20. package/skills/continue/SKILL.md +39 -0
  21. package/skills/continue/agents/openai.yaml +3 -0
  22. package/skills/creating-skills/SKILL.md +158 -0
  23. package/skills/creating-skills/references/official_best_practices.md +128 -0
  24. package/skills/creating-skills/references/skill_examples.md +199 -0
  25. package/skills/docx/LICENSE.txt +30 -0
  26. package/skills/docx/SKILL.md +197 -0
  27. package/skills/docx/docx-js.md +350 -0
  28. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  29. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  30. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  31. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  32. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  33. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  34. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  35. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  36. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  37. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  38. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  39. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  40. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  41. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  42. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  43. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  44. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  45. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  46. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  47. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  48. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  49. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  50. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  51. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  52. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  53. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  54. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  55. package/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  56. package/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  57. package/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  58. package/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  59. package/skills/docx/ooxml/schemas/mce/mc.xsd +75 -0
  60. package/skills/docx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
  61. package/skills/docx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
  62. package/skills/docx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
  63. package/skills/docx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
  64. package/skills/docx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
  65. package/skills/docx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  66. package/skills/docx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
  67. package/skills/docx/ooxml/scripts/pack.py +159 -0
  68. package/skills/docx/ooxml/scripts/unpack.py +29 -0
  69. package/skills/docx/ooxml/scripts/validate.py +69 -0
  70. package/skills/docx/ooxml/scripts/validation/__init__.py +15 -0
  71. package/skills/docx/ooxml/scripts/validation/base.py +951 -0
  72. package/skills/docx/ooxml/scripts/validation/docx.py +274 -0
  73. package/skills/docx/ooxml/scripts/validation/pptx.py +315 -0
  74. package/skills/docx/ooxml/scripts/validation/redlining.py +279 -0
  75. package/skills/docx/ooxml.md +610 -0
  76. package/skills/docx/scripts/__init__.py +1 -0
  77. package/skills/docx/scripts/document.py +1276 -0
  78. package/skills/docx/scripts/templates/comments.xml +3 -0
  79. package/skills/docx/scripts/templates/commentsExtended.xml +3 -0
  80. package/skills/docx/scripts/templates/commentsExtensible.xml +3 -0
  81. package/skills/docx/scripts/templates/commentsIds.xml +3 -0
  82. package/skills/docx/scripts/templates/people.xml +3 -0
  83. package/skills/docx/scripts/utilities.py +374 -0
  84. package/skills/git-branch-create/SKILL.md +170 -0
  85. package/skills/git-branch-merge/SKILL.md +176 -0
  86. package/skills/git-commit/SKILL.md +56 -0
  87. package/skills/git-commit/references/commit_examples.md +311 -0
  88. package/skills/github-actions-trigger/SKILL.md +367 -0
  89. package/skills/github-issue-create/SKILL.md +294 -0
  90. package/skills/github-pr-creation/SKILL.md +137 -0
  91. package/skills/github-pr-creation/references/pr_templates.md +187 -0
  92. package/skills/github-pr-merge/SKILL.md +112 -0
  93. package/skills/github-pr-review/SKILL.md +110 -0
  94. package/skills/github-pr-review/references/severity_guide.md +168 -0
  95. package/skills/job-create/SKILL.md +294 -0
  96. package/skills/job-create/scripts/create-job.ts +105 -0
  97. package/skills/job-workflow/SKILL.md +212 -0
  98. package/skills/keyword-extract/SKILL.md +229 -0
  99. package/skills/mcp-builder/LICENSE.txt +202 -0
  100. package/skills/mcp-builder/SKILL.md +236 -0
  101. package/skills/mcp-builder/reference/evaluation.md +602 -0
  102. package/skills/mcp-builder/reference/mcp_best_practices.md +249 -0
  103. package/skills/mcp-builder/reference/node_mcp_server.md +970 -0
  104. package/skills/mcp-builder/reference/python_mcp_server.md +719 -0
  105. package/skills/mcp-builder/scripts/connections.py +151 -0
  106. package/skills/mcp-builder/scripts/evaluation.py +373 -0
  107. package/skills/mcp-builder/scripts/example_evaluation.xml +22 -0
  108. package/skills/mcp-builder/scripts/requirements.txt +2 -0
  109. package/skills/mdx-to-openspec/SKILL.md +827 -0
  110. package/skills/mdx-to-openspec/scripts/mdx-to-openspec.ts +320 -0
  111. package/skills/mounted/SKILL.md +20 -0
  112. package/skills/multi-model-review/SKILL.md +459 -0
  113. package/skills/notion-automation/SKILL.md +215 -0
  114. package/skills/openspec-review/SKILL.md +513 -0
  115. package/skills/pdf/LICENSE.txt +30 -0
  116. package/skills/pdf/SKILL.md +294 -0
  117. package/skills/pdf/forms.md +205 -0
  118. package/skills/pdf/reference.md +612 -0
  119. package/skills/pdf/scripts/check_bounding_boxes.py +70 -0
  120. package/skills/pdf/scripts/check_bounding_boxes_test.py +226 -0
  121. package/skills/pdf/scripts/check_fillable_fields.py +12 -0
  122. package/skills/pdf/scripts/convert_pdf_to_images.py +35 -0
  123. package/skills/pdf/scripts/create_validation_image.py +41 -0
  124. package/skills/pdf/scripts/extract_form_field_info.py +152 -0
  125. package/skills/pdf/scripts/fill_fillable_fields.py +114 -0
  126. package/skills/pdf/scripts/fill_pdf_form_with_annotations.py +108 -0
  127. package/skills/pend/SKILL.md +33 -0
  128. package/skills/ping/SKILL.md +39 -0
  129. package/skills/pptx/LICENSE.txt +30 -0
  130. package/skills/pptx/SKILL.md +484 -0
  131. package/skills/pptx/html2pptx.md +625 -0
  132. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  133. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  134. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  135. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  136. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  137. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  138. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  139. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  140. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  141. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  142. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  143. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  144. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  145. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  146. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  147. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  148. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  149. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  150. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  151. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  152. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  153. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  154. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  155. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  156. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  157. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  158. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  159. package/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  160. package/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  161. package/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  162. package/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  163. package/skills/pptx/ooxml/schemas/mce/mc.xsd +75 -0
  164. package/skills/pptx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
  165. package/skills/pptx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
  166. package/skills/pptx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
  167. package/skills/pptx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
  168. package/skills/pptx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
  169. package/skills/pptx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  170. package/skills/pptx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
  171. package/skills/pptx/ooxml/scripts/pack.py +159 -0
  172. package/skills/pptx/ooxml/scripts/unpack.py +29 -0
  173. package/skills/pptx/ooxml/scripts/validate.py +69 -0
  174. package/skills/pptx/ooxml/scripts/validation/__init__.py +15 -0
  175. package/skills/pptx/ooxml/scripts/validation/base.py +951 -0
  176. package/skills/pptx/ooxml/scripts/validation/docx.py +274 -0
  177. package/skills/pptx/ooxml/scripts/validation/pptx.py +315 -0
  178. package/skills/pptx/ooxml/scripts/validation/redlining.py +279 -0
  179. package/skills/pptx/ooxml.md +427 -0
  180. package/skills/pptx/scripts/html2pptx.js +979 -0
  181. package/skills/pptx/scripts/inventory.py +1020 -0
  182. package/skills/pptx/scripts/rearrange.py +231 -0
  183. package/skills/pptx/scripts/replace.py +385 -0
  184. package/skills/pptx/scripts/thumbnail.py +450 -0
  185. package/skills/progress-update/SKILL.md +394 -0
  186. package/skills/progress-update/scripts/update-progress.ts +221 -0
  187. package/skills/release-automation/SKILL.md +306 -0
  188. package/skills/requirement-parse/SKILL.md +212 -0
  189. package/skills/requirement-parse/scripts/infer-builder-config.ts +346 -0
  190. package/skills/requirement-parse/scripts/merge-requirements.ts +228 -0
  191. package/skills/requirement-parse/scripts/parse-docs.ts +206 -0
  192. package/skills/requirement-parse/scripts/parse-openspec.ts +168 -0
  193. package/skills/roadmap-docs-generate/SKILL.md +483 -0
  194. package/skills/roadmap-docs-generate/assets/templates/ROADMAP.mdx +75 -0
  195. package/skills/roadmap-docs-generate/assets/templates/ROADMAP.mdx.template +330 -0
  196. package/skills/roadmap-docs-generate/assets/templates/TODO.mdx +56 -0
  197. package/skills/roadmap-docs-generate/assets/templates/TODO.mdx.template +363 -0
  198. package/skills/roadmap-docs-generate/scripts/json-to-mdx.ts +445 -0
  199. package/skills/roadmap-docs-generate/scripts/json-to-mdx.ts.backup +411 -0
  200. package/skills/roadmap-generate/SKILL.md +396 -0
  201. package/skills/roadmap-generate/scripts/generate-roadmap.ts +496 -0
  202. package/skills/skill-creator/LICENSE.txt +202 -0
  203. package/skills/skill-creator/SKILL.md +356 -0
  204. package/skills/skill-creator/references/output-patterns.md +82 -0
  205. package/skills/skill-creator/references/workflows.md +28 -0
  206. package/skills/skill-creator/scripts/init_skill.py +303 -0
  207. package/skills/skill-creator/scripts/package_skill.py +110 -0
  208. package/skills/skill-creator/scripts/quick_validate.py +95 -0
  209. package/skills/spec-generate/SKILL.md +408 -0
  210. package/skills/spec-generate/scripts/generate-specs.ts +538 -0
  211. package/skills/spec-generate/scripts/generate-tasks.ts +174 -0
  212. package/skills/specs-review/SKILL.md +370 -0
  213. package/skills/task-execute/SKILL.md +399 -0
  214. package/skills/task-update-status/SKILL.md +349 -0
  215. package/skills/task-update-status/scripts/update-task-status.ts +192 -0
  216. package/skills/task-verify/SKILL.md +407 -0
  217. package/skills/ui-ux-pro-max/SKILL.md +386 -0
  218. package/skills/ui-ux-pro-max/data/charts.csv +26 -0
  219. package/skills/ui-ux-pro-max/data/colors.csv +97 -0
  220. package/skills/ui-ux-pro-max/data/icons.csv +101 -0
  221. package/skills/ui-ux-pro-max/data/landing.csv +31 -0
  222. package/skills/ui-ux-pro-max/data/products.csv +97 -0
  223. package/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
  224. package/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
  225. package/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  226. package/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  227. package/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  228. package/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  229. package/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  230. package/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  231. package/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  232. package/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
  233. package/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  234. package/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  235. package/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  236. package/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  237. package/skills/ui-ux-pro-max/data/styles.csv +68 -0
  238. package/skills/ui-ux-pro-max/data/typography.csv +58 -0
  239. package/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  240. package/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  241. package/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
  242. package/skills/ui-ux-pro-max/scripts/core.py +253 -0
  243. package/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
  244. package/skills/ui-ux-pro-max/scripts/search.py +114 -0
  245. package/skills/vercel-automation/SKILL.md +226 -0
  246. package/skills/webapp-testing/LICENSE.txt +202 -0
  247. package/skills/webapp-testing/SKILL.md +96 -0
  248. package/skills/webapp-testing/examples/console_logging.py +35 -0
  249. package/skills/webapp-testing/examples/element_discovery.py +40 -0
  250. package/skills/webapp-testing/examples/static_html_automation.py +33 -0
  251. package/skills/webapp-testing/scripts/with_server.py +106 -0
  252. package/skills/worktree-manager/SKILL.md +725 -0
  253. package/skills/worktree-manager/config.json +15 -0
  254. package/skills/worktree-manager/scripts/allocate-ports.sh +100 -0
  255. package/skills/worktree-manager/scripts/cleanup.sh +185 -0
  256. package/skills/worktree-manager/scripts/launch-agent.sh +155 -0
  257. package/skills/worktree-manager/scripts/register.sh +125 -0
  258. package/skills/worktree-manager/scripts/release-ports.sh +48 -0
  259. package/skills/worktree-manager/scripts/status.sh +169 -0
  260. package/skills/worktree-manager/scripts/sync.sh +168 -0
  261. package/skills/worktree-manager/templates/worktree.json +23 -0
  262. package/skills/xlsx/LICENSE.txt +30 -0
  263. package/skills/xlsx/SKILL.md +289 -0
  264. package/skills/xlsx/recalc.py +178 -0
@@ -0,0 +1,320 @@
1
+ /**
2
+ * Convert MDX document to OpenSpec format
3
+ *
4
+ * This script:
5
+ * 1. Uses OpenSpec CLI to create standard structure
6
+ * 2. Parses MDX document
7
+ * 3. Fills OpenSpec files (proposal.md, design.md, tasks.md)
8
+ *
9
+ * Usage:
10
+ * npx tsx .claude/skills/mdx-to-openspec/scripts/mdx-to-openspec.ts \
11
+ * --mdx-path <path> \
12
+ * --change-name <name>
13
+ */
14
+
15
+ import fs from 'fs';
16
+ import path from 'path';
17
+ import { execSync } from 'child_process';
18
+ import matter from 'gray-matter';
19
+
20
+ interface MdxContent {
21
+ frontmatter: Record<string, any>;
22
+ content: string;
23
+ title: string;
24
+ description: string;
25
+ sections: Record<string, string>;
26
+ }
27
+
28
+ function parseMdx(mdxPath: string): MdxContent {
29
+ const content = fs.readFileSync(mdxPath, 'utf-8');
30
+ const { data: frontmatter, content: body } = matter(content);
31
+
32
+ // Extract title
33
+ let title = frontmatter.title || '';
34
+ if (!title) {
35
+ const titleMatch = body.match(/^#\s+(.+)$/m);
36
+ if (titleMatch) {
37
+ title = titleMatch[1];
38
+ }
39
+ }
40
+
41
+ const description = frontmatter.description || '';
42
+
43
+ // Extract sections by ## headings
44
+ const sections: Record<string, string> = {};
45
+ const parts = body.split(/^##\s+/m);
46
+
47
+ for (let i = 1; i < parts.length; i++) {
48
+ const lines = parts[i].split('\n');
49
+ const heading = lines[0].trim();
50
+ const sectionBody = lines.slice(1).join('\n').trim();
51
+ sections[heading] = sectionBody;
52
+ }
53
+
54
+ return {
55
+ frontmatter,
56
+ content: body,
57
+ title,
58
+ description,
59
+ sections
60
+ };
61
+ }
62
+
63
+ function extractTasks(content: string): string[] {
64
+ const tasks: string[] = [];
65
+
66
+ // Extract checkbox items
67
+ const checkboxPattern = /^[-*]\s+\[[ x]\]\s+(.+)$/gm;
68
+ let match;
69
+
70
+ while ((match = checkboxPattern.exec(content)) !== null) {
71
+ tasks.push(match[1]);
72
+ }
73
+
74
+ // Extract numbered lists if no checkboxes found
75
+ if (tasks.length === 0) {
76
+ const numberedPattern = /^\d+\.\s+(.+)$/gm;
77
+ while ((match = numberedPattern.exec(content)) !== null) {
78
+ tasks.push(match[1]);
79
+ }
80
+ }
81
+
82
+ return tasks;
83
+ }
84
+
85
+ function generateProposal(mdxContent: MdxContent): string {
86
+ const { title, description, sections } = mdxContent;
87
+
88
+ const goals = sections['目标'] || sections['Goals'] || sections['战略目标'] ||
89
+ sections['Strategic Goals'] || '从 MDX 文档中提取的目标';
90
+
91
+ const background = sections['背景'] || sections['Background'] || sections['愿景'] ||
92
+ sections['Vision'] || '从 MDX 文档中提取的背景信息';
93
+
94
+ const scope = sections['范围'] || sections['Scope'] || sections['功能范围'] ||
95
+ '从 MDX 文档中提取的范围说明';
96
+
97
+ return `# ${title}
98
+
99
+ ## 概述
100
+
101
+ ${description || '从 MDX 文档转换的提案'}
102
+
103
+ ## 目标
104
+
105
+ ${goals}
106
+
107
+ ## 背景
108
+
109
+ ${background}
110
+
111
+ ## 范围
112
+
113
+ ${scope}
114
+
115
+ ## 非目标
116
+
117
+ (请补充非目标内容)
118
+
119
+ ## 成功标准
120
+
121
+ (请补充成功标准)
122
+
123
+ ## 时间线
124
+
125
+ (请补充时间线)
126
+
127
+ ---
128
+
129
+ **来源**: 从 MDX 文档自动生成
130
+ **状态**: 草稿
131
+ **创建时间**: ${new Date().toISOString()}
132
+ `;
133
+ }
134
+
135
+ function generateDesign(mdxContent: MdxContent): string {
136
+ const { title, sections } = mdxContent;
137
+
138
+ const architecture = sections['架构'] || sections['Architecture'] ||
139
+ sections['架构设计'] || sections['整体架构'] ||
140
+ sections['设计'] || sections['Design'] ||
141
+ '(请补充架构设计)';
142
+
143
+ const implementation = sections['实现'] || sections['Implementation'] ||
144
+ sections['技术方案'] || sections['Technical Solution'] ||
145
+ sections['实现细节'] || sections['前端实现'] ||
146
+ '(请补充实现细节)';
147
+
148
+ return `# ${title} - 技术设计
149
+
150
+ ## 架构设计
151
+
152
+ ${architecture}
153
+
154
+ ## 实现细节
155
+
156
+ ${implementation}
157
+
158
+ ## 数据模型
159
+
160
+ (请补充数据模型)
161
+
162
+ ## API 设计
163
+
164
+ (请补充 API 设计)
165
+
166
+ ## 安全考虑
167
+
168
+ (请补充安全考虑)
169
+
170
+ ## 性能考虑
171
+
172
+ (请补充性能考虑)
173
+
174
+ ## 测试策略
175
+
176
+ (请补充测试策略)
177
+
178
+ ---
179
+
180
+ **来源**: 从 MDX 文档自动生成
181
+ **状态**: 草稿
182
+ **创建时间**: ${new Date().toISOString()}
183
+ `;
184
+ }
185
+
186
+ function generateTasks(mdxContent: MdxContent): string {
187
+ const { title, content } = mdxContent;
188
+
189
+ // Extract tasks from MDX
190
+ const tasks = extractTasks(content);
191
+
192
+ let tasksSection = '';
193
+ if (tasks.length > 0) {
194
+ tasksSection = tasks.map(task => `- [ ] ${task}`).join('\n');
195
+ } else {
196
+ tasksSection = `- [ ] 任务 1:(请补充)
197
+ - [ ] 任务 2:(请补充)
198
+ - [ ] 任务 3:(请补充)`;
199
+ }
200
+
201
+ return `# ${title} - 任务清单
202
+
203
+ ## 开发任务
204
+
205
+ ${tasksSection}
206
+
207
+ ## 测试任务
208
+
209
+ - [ ] 单元测试
210
+ - [ ] 集成测试
211
+ - [ ] 端到端测试
212
+
213
+ ## 文档任务
214
+
215
+ - [ ] 更新 API 文档
216
+ - [ ] 更新用户文档
217
+ - [ ] 更新 CHANGELOG
218
+
219
+ ## 验证标准
220
+
221
+ - [ ] 所有测试通过
222
+ - [ ] 代码审查完成
223
+ - [ ] 文档更新完成
224
+
225
+ ---
226
+
227
+ **来源**: 从 MDX 文档自动生成
228
+ **状态**: 草稿
229
+ **创建时间**: ${new Date().toISOString()}
230
+ `;
231
+ }
232
+
233
+ function main() {
234
+ const args = process.argv.slice(2);
235
+
236
+ let mdxPath = '';
237
+ let changeName = '';
238
+ let openspecRoot = '/Users/danlio/Repositories/waoooo/openspec';
239
+
240
+ for (let i = 0; i < args.length; i++) {
241
+ if (args[i] === '--mdx-path' && args[i + 1]) {
242
+ mdxPath = args[i + 1];
243
+ i++;
244
+ } else if (args[i] === '--change-name' && args[i + 1]) {
245
+ changeName = args[i + 1];
246
+ i++;
247
+ } else if (args[i] === '--openspec-root' && args[i + 1]) {
248
+ openspecRoot = args[i + 1];
249
+ i++;
250
+ }
251
+ }
252
+
253
+ if (!mdxPath || !changeName) {
254
+ console.error('Usage: tsx mdx-to-openspec.ts --mdx-path <path> --change-name <name>');
255
+ console.error('');
256
+ console.error('Example:');
257
+ console.error(' tsx mdx-to-openspec.ts \\');
258
+ console.error(' --mdx-path /path/to/pricing-system.mdx \\');
259
+ console.error(' --change-name pricing-frontend-refactor');
260
+ process.exit(1);
261
+ }
262
+
263
+ if (!fs.existsSync(mdxPath)) {
264
+ console.error(`❌ Error: MDX file not found: ${mdxPath}`);
265
+ process.exit(1);
266
+ }
267
+
268
+ console.log('📖 Parsing MDX document...');
269
+ const mdxContent = parseMdx(mdxPath);
270
+ console.log(`✅ Parsed: ${mdxContent.title}`);
271
+
272
+ console.log('\n📁 Creating OpenSpec structure...');
273
+ const changesDir = path.join(openspecRoot, 'changes', changeName);
274
+
275
+ if (fs.existsSync(changesDir)) {
276
+ console.error(`❌ Error: OpenSpec change already exists: ${changeName}`);
277
+ console.error(`📁 Directory: ${changesDir}`);
278
+ console.error('');
279
+ console.error('💡 Options:');
280
+ console.error(' 1. Use a different change name');
281
+ console.error(' 2. Delete the existing change');
282
+ console.error(' 3. Update the existing change');
283
+ process.exit(1);
284
+ }
285
+
286
+ fs.mkdirSync(changesDir, { recursive: true });
287
+ fs.mkdirSync(path.join(changesDir, 'specs'), { recursive: true });
288
+ console.log(`✅ Created: ${changesDir}`);
289
+
290
+ console.log('\n📝 Generating OpenSpec files...');
291
+
292
+ console.log(' - proposal.md');
293
+ const proposal = generateProposal(mdxContent);
294
+ fs.writeFileSync(path.join(changesDir, 'proposal.md'), proposal, 'utf-8');
295
+
296
+ console.log(' - design.md');
297
+ const design = generateDesign(mdxContent);
298
+ fs.writeFileSync(path.join(changesDir, 'design.md'), design, 'utf-8');
299
+
300
+ console.log(' - tasks.md');
301
+ const tasks = generateTasks(mdxContent);
302
+ fs.writeFileSync(path.join(changesDir, 'tasks.md'), tasks, 'utf-8');
303
+
304
+ console.log('\n✅ OpenSpec created successfully!');
305
+ console.log(`\n📂 Location: ${changesDir}`);
306
+ console.log('📄 Files:');
307
+ console.log(' - proposal.md');
308
+ console.log(' - design.md');
309
+ console.log(' - tasks.md');
310
+ console.log('\n💡 Next steps:');
311
+ console.log(' 1. Review and complete the generated files');
312
+ console.log(' 2. Run: openspec validate ' + changeName);
313
+ console.log(' 3. Run: openspec approve ' + changeName);
314
+ }
315
+
316
+ if (import.meta.url === `file://${process.argv[1]}`) {
317
+ main();
318
+ }
319
+
320
+ export { parseMdx, generateProposal, generateDesign, generateTasks };
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: mounted
3
+ description: Report which CCB providers are mounted (session exists AND daemon is online). Outputs JSON.
4
+ metadata:
5
+ short-description: Show mounted CCB providers as JSON
6
+ ---
7
+
8
+ # Mounted Providers
9
+
10
+ Reports which CCB providers are considered "mounted" for the current project.
11
+
12
+ ## Definition
13
+
14
+ `mounted = has_session && daemon_on`
15
+
16
+ ## Execution
17
+
18
+ ```bash
19
+ ccb-mounted
20
+ ```