open-wiki-spec 0.1.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 (487) hide show
  1. package/README.md +294 -0
  2. package/bin/open-wiki-spec.js +2 -0
  3. package/dist/cli/commands/apply.d.ts +3 -0
  4. package/dist/cli/commands/apply.d.ts.map +1 -0
  5. package/dist/cli/commands/apply.js +60 -0
  6. package/dist/cli/commands/apply.js.map +1 -0
  7. package/dist/cli/commands/archive.d.ts +20 -0
  8. package/dist/cli/commands/archive.d.ts.map +1 -0
  9. package/dist/cli/commands/archive.js +87 -0
  10. package/dist/cli/commands/archive.js.map +1 -0
  11. package/dist/cli/commands/continue.d.ts +6 -0
  12. package/dist/cli/commands/continue.d.ts.map +1 -0
  13. package/dist/cli/commands/continue.js +35 -0
  14. package/dist/cli/commands/continue.js.map +1 -0
  15. package/dist/cli/commands/formatters.d.ts +9 -0
  16. package/dist/cli/commands/formatters.d.ts.map +1 -0
  17. package/dist/cli/commands/formatters.js +55 -0
  18. package/dist/cli/commands/formatters.js.map +1 -0
  19. package/dist/cli/commands/init.d.ts +6 -0
  20. package/dist/cli/commands/init.d.ts.map +1 -0
  21. package/dist/cli/commands/init.js +36 -0
  22. package/dist/cli/commands/init.js.map +1 -0
  23. package/dist/cli/commands/list.d.ts +28 -0
  24. package/dist/cli/commands/list.d.ts.map +1 -0
  25. package/dist/cli/commands/list.js +85 -0
  26. package/dist/cli/commands/list.js.map +1 -0
  27. package/dist/cli/commands/migrate.d.ts +6 -0
  28. package/dist/cli/commands/migrate.d.ts.map +1 -0
  29. package/dist/cli/commands/migrate.js +103 -0
  30. package/dist/cli/commands/migrate.js.map +1 -0
  31. package/dist/cli/commands/propose.d.ts +3 -0
  32. package/dist/cli/commands/propose.d.ts.map +1 -0
  33. package/dist/cli/commands/propose.js +64 -0
  34. package/dist/cli/commands/propose.js.map +1 -0
  35. package/dist/cli/commands/query.d.ts +3 -0
  36. package/dist/cli/commands/query.d.ts.map +1 -0
  37. package/dist/cli/commands/query.js +62 -0
  38. package/dist/cli/commands/query.js.map +1 -0
  39. package/dist/cli/commands/status.d.ts +30 -0
  40. package/dist/cli/commands/status.d.ts.map +1 -0
  41. package/dist/cli/commands/status.js +144 -0
  42. package/dist/cli/commands/status.js.map +1 -0
  43. package/dist/cli/commands/verify.d.ts +3 -0
  44. package/dist/cli/commands/verify.d.ts.map +1 -0
  45. package/dist/cli/commands/verify.js +38 -0
  46. package/dist/cli/commands/verify.js.map +1 -0
  47. package/dist/cli/index.d.ts +6 -0
  48. package/dist/cli/index.d.ts.map +1 -0
  49. package/dist/cli/index.js +40 -0
  50. package/dist/cli/index.js.map +1 -0
  51. package/dist/cli/init/init-engine.d.ts +6 -0
  52. package/dist/cli/init/init-engine.d.ts.map +1 -0
  53. package/dist/cli/init/init-engine.js +107 -0
  54. package/dist/cli/init/init-engine.js.map +1 -0
  55. package/dist/cli/init/meta-files.d.ts +9 -0
  56. package/dist/cli/init/meta-files.d.ts.map +1 -0
  57. package/dist/cli/init/meta-files.js +156 -0
  58. package/dist/cli/init/meta-files.js.map +1 -0
  59. package/dist/cli/init/skill-generator.d.ts +11 -0
  60. package/dist/cli/init/skill-generator.d.ts.map +1 -0
  61. package/dist/cli/init/skill-generator.js +753 -0
  62. package/dist/cli/init/skill-generator.js.map +1 -0
  63. package/dist/cli/init/types.d.ts +27 -0
  64. package/dist/cli/init/types.d.ts.map +1 -0
  65. package/dist/cli/init/types.js +5 -0
  66. package/dist/cli/init/types.js.map +1 -0
  67. package/dist/cli/vault-discovery.d.ts +9 -0
  68. package/dist/cli/vault-discovery.d.ts.map +1 -0
  69. package/dist/cli/vault-discovery.js +31 -0
  70. package/dist/cli/vault-discovery.js.map +1 -0
  71. package/dist/core/config/index.d.ts +2 -0
  72. package/dist/core/config/index.d.ts.map +1 -0
  73. package/dist/core/config/index.js +3 -0
  74. package/dist/core/config/index.js.map +1 -0
  75. package/dist/core/index/build.d.ts +10 -0
  76. package/dist/core/index/build.d.ts.map +1 -0
  77. package/dist/core/index/build.js +190 -0
  78. package/dist/core/index/build.js.map +1 -0
  79. package/dist/core/index/index.d.ts +7 -0
  80. package/dist/core/index/index.d.ts.map +1 -0
  81. package/dist/core/index/index.js +7 -0
  82. package/dist/core/index/index.js.map +1 -0
  83. package/dist/core/index/resolve.d.ts +41 -0
  84. package/dist/core/index/resolve.d.ts.map +1 -0
  85. package/dist/core/index/resolve.js +63 -0
  86. package/dist/core/index/resolve.js.map +1 -0
  87. package/dist/core/index/reverse.d.ts +7 -0
  88. package/dist/core/index/reverse.d.ts.map +1 -0
  89. package/dist/core/index/reverse.js +24 -0
  90. package/dist/core/index/reverse.js.map +1 -0
  91. package/dist/core/index/scan.d.ts +16 -0
  92. package/dist/core/index/scan.d.ts.map +1 -0
  93. package/dist/core/index/scan.js +19 -0
  94. package/dist/core/index/scan.js.map +1 -0
  95. package/dist/core/index/schema-version.d.ts +5 -0
  96. package/dist/core/index/schema-version.d.ts.map +1 -0
  97. package/dist/core/index/schema-version.js +19 -0
  98. package/dist/core/index/schema-version.js.map +1 -0
  99. package/dist/core/index/validate.d.ts +14 -0
  100. package/dist/core/index/validate.d.ts.map +1 -0
  101. package/dist/core/index/validate.js +77 -0
  102. package/dist/core/index/validate.js.map +1 -0
  103. package/dist/core/migrate/change-converter.d.ts +18 -0
  104. package/dist/core/migrate/change-converter.d.ts.map +1 -0
  105. package/dist/core/migrate/change-converter.js +475 -0
  106. package/dist/core/migrate/change-converter.js.map +1 -0
  107. package/dist/core/migrate/index.d.ts +8 -0
  108. package/dist/core/migrate/index.d.ts.map +1 -0
  109. package/dist/core/migrate/index.js +7 -0
  110. package/dist/core/migrate/index.js.map +1 -0
  111. package/dist/core/migrate/migrate.d.ts +15 -0
  112. package/dist/core/migrate/migrate.d.ts.map +1 -0
  113. package/dist/core/migrate/migrate.js +149 -0
  114. package/dist/core/migrate/migrate.js.map +1 -0
  115. package/dist/core/migrate/scanner.d.ts +10 -0
  116. package/dist/core/migrate/scanner.d.ts.map +1 -0
  117. package/dist/core/migrate/scanner.js +188 -0
  118. package/dist/core/migrate/scanner.js.map +1 -0
  119. package/dist/core/migrate/source-converter.d.ts +6 -0
  120. package/dist/core/migrate/source-converter.d.ts.map +1 -0
  121. package/dist/core/migrate/source-converter.js +63 -0
  122. package/dist/core/migrate/source-converter.js.map +1 -0
  123. package/dist/core/migrate/spec-converter.d.ts +16 -0
  124. package/dist/core/migrate/spec-converter.d.ts.map +1 -0
  125. package/dist/core/migrate/spec-converter.js +157 -0
  126. package/dist/core/migrate/spec-converter.js.map +1 -0
  127. package/dist/core/migrate/system-inferrer.d.ts +23 -0
  128. package/dist/core/migrate/system-inferrer.d.ts.map +1 -0
  129. package/dist/core/migrate/system-inferrer.js +118 -0
  130. package/dist/core/migrate/system-inferrer.js.map +1 -0
  131. package/dist/core/migrate/types.d.ts +125 -0
  132. package/dist/core/migrate/types.d.ts.map +1 -0
  133. package/dist/core/migrate/types.js +5 -0
  134. package/dist/core/migrate/types.js.map +1 -0
  135. package/dist/core/parser/delta-summary-parser.d.ts +10 -0
  136. package/dist/core/parser/delta-summary-parser.d.ts.map +1 -0
  137. package/dist/core/parser/delta-summary-parser.js +101 -0
  138. package/dist/core/parser/delta-summary-parser.js.map +1 -0
  139. package/dist/core/parser/frontmatter-parser.d.ts +21 -0
  140. package/dist/core/parser/frontmatter-parser.d.ts.map +1 -0
  141. package/dist/core/parser/frontmatter-parser.js +87 -0
  142. package/dist/core/parser/frontmatter-parser.js.map +1 -0
  143. package/dist/core/parser/index.d.ts +9 -0
  144. package/dist/core/parser/index.d.ts.map +1 -0
  145. package/dist/core/parser/index.js +8 -0
  146. package/dist/core/parser/index.js.map +1 -0
  147. package/dist/core/parser/note-parser.d.ts +9 -0
  148. package/dist/core/parser/note-parser.d.ts.map +1 -0
  149. package/dist/core/parser/note-parser.js +106 -0
  150. package/dist/core/parser/note-parser.js.map +1 -0
  151. package/dist/core/parser/requirement-parser.d.ts +13 -0
  152. package/dist/core/parser/requirement-parser.d.ts.map +1 -0
  153. package/dist/core/parser/requirement-parser.js +127 -0
  154. package/dist/core/parser/requirement-parser.js.map +1 -0
  155. package/dist/core/parser/section-parser.d.ts +15 -0
  156. package/dist/core/parser/section-parser.d.ts.map +1 -0
  157. package/dist/core/parser/section-parser.js +90 -0
  158. package/dist/core/parser/section-parser.js.map +1 -0
  159. package/dist/core/parser/task-parser.d.ts +9 -0
  160. package/dist/core/parser/task-parser.d.ts.map +1 -0
  161. package/dist/core/parser/task-parser.js +35 -0
  162. package/dist/core/parser/task-parser.js.map +1 -0
  163. package/dist/core/parser/types.d.ts +94 -0
  164. package/dist/core/parser/types.d.ts.map +1 -0
  165. package/dist/core/parser/types.js +2 -0
  166. package/dist/core/parser/types.js.map +1 -0
  167. package/dist/core/parser/wikilink-parser.d.ts +19 -0
  168. package/dist/core/parser/wikilink-parser.d.ts.map +1 -0
  169. package/dist/core/parser/wikilink-parser.js +74 -0
  170. package/dist/core/parser/wikilink-parser.js.map +1 -0
  171. package/dist/core/retrieval/classify.d.ts +11 -0
  172. package/dist/core/retrieval/classify.d.ts.map +1 -0
  173. package/dist/core/retrieval/classify.js +92 -0
  174. package/dist/core/retrieval/classify.js.map +1 -0
  175. package/dist/core/retrieval/constants.d.ts +49 -0
  176. package/dist/core/retrieval/constants.d.ts.map +1 -0
  177. package/dist/core/retrieval/constants.js +29 -0
  178. package/dist/core/retrieval/constants.js.map +1 -0
  179. package/dist/core/retrieval/graph-expand.d.ts +7 -0
  180. package/dist/core/retrieval/graph-expand.d.ts.map +1 -0
  181. package/dist/core/retrieval/graph-expand.js +20 -0
  182. package/dist/core/retrieval/graph-expand.js.map +1 -0
  183. package/dist/core/retrieval/helpers.d.ts +15 -0
  184. package/dist/core/retrieval/helpers.d.ts.map +1 -0
  185. package/dist/core/retrieval/helpers.js +36 -0
  186. package/dist/core/retrieval/helpers.js.map +1 -0
  187. package/dist/core/retrieval/index.d.ts +11 -0
  188. package/dist/core/retrieval/index.d.ts.map +1 -0
  189. package/dist/core/retrieval/index.js +9 -0
  190. package/dist/core/retrieval/index.js.map +1 -0
  191. package/dist/core/retrieval/lexical.d.ts +8 -0
  192. package/dist/core/retrieval/lexical.d.ts.map +1 -0
  193. package/dist/core/retrieval/lexical.js +107 -0
  194. package/dist/core/retrieval/lexical.js.map +1 -0
  195. package/dist/core/retrieval/retrieve.d.ts +16 -0
  196. package/dist/core/retrieval/retrieve.d.ts.map +1 -0
  197. package/dist/core/retrieval/retrieve.js +58 -0
  198. package/dist/core/retrieval/retrieve.js.map +1 -0
  199. package/dist/core/retrieval/scoring.d.ts +14 -0
  200. package/dist/core/retrieval/scoring.d.ts.map +1 -0
  201. package/dist/core/retrieval/scoring.js +169 -0
  202. package/dist/core/retrieval/scoring.js.map +1 -0
  203. package/dist/core/retrieval/warnings.d.ts +16 -0
  204. package/dist/core/retrieval/warnings.d.ts.map +1 -0
  205. package/dist/core/retrieval/warnings.js +73 -0
  206. package/dist/core/retrieval/warnings.js.map +1 -0
  207. package/dist/core/schema/base.schema.d.ts +31 -0
  208. package/dist/core/schema/base.schema.d.ts.map +1 -0
  209. package/dist/core/schema/base.schema.js +32 -0
  210. package/dist/core/schema/base.schema.js.map +1 -0
  211. package/dist/core/schema/change.schema.d.ts +96 -0
  212. package/dist/core/schema/change.schema.d.ts.map +1 -0
  213. package/dist/core/schema/change.schema.js +64 -0
  214. package/dist/core/schema/change.schema.js.map +1 -0
  215. package/dist/core/schema/decision.schema.d.ts +33 -0
  216. package/dist/core/schema/decision.schema.d.ts.map +1 -0
  217. package/dist/core/schema/decision.schema.js +19 -0
  218. package/dist/core/schema/decision.schema.js.map +1 -0
  219. package/dist/core/schema/delta-summary.d.ts +57 -0
  220. package/dist/core/schema/delta-summary.d.ts.map +1 -0
  221. package/dist/core/schema/delta-summary.js +38 -0
  222. package/dist/core/schema/delta-summary.js.map +1 -0
  223. package/dist/core/schema/feature.schema.d.ts +40 -0
  224. package/dist/core/schema/feature.schema.d.ts.map +1 -0
  225. package/dist/core/schema/feature.schema.js +25 -0
  226. package/dist/core/schema/feature.schema.js.map +1 -0
  227. package/dist/core/schema/frontmatter.d.ts +207 -0
  228. package/dist/core/schema/frontmatter.d.ts.map +1 -0
  229. package/dist/core/schema/frontmatter.js +23 -0
  230. package/dist/core/schema/frontmatter.js.map +1 -0
  231. package/dist/core/schema/index.d.ts +235 -0
  232. package/dist/core/schema/index.d.ts.map +1 -0
  233. package/dist/core/schema/index.js +52 -0
  234. package/dist/core/schema/index.js.map +1 -0
  235. package/dist/core/schema/query.schema.d.ts +39 -0
  236. package/dist/core/schema/query.schema.d.ts.map +1 -0
  237. package/dist/core/schema/query.schema.js +20 -0
  238. package/dist/core/schema/query.schema.js.map +1 -0
  239. package/dist/core/schema/requirement.d.ts +69 -0
  240. package/dist/core/schema/requirement.d.ts.map +1 -0
  241. package/dist/core/schema/requirement.js +35 -0
  242. package/dist/core/schema/requirement.js.map +1 -0
  243. package/dist/core/schema/source.schema.d.ts +33 -0
  244. package/dist/core/schema/source.schema.d.ts.map +1 -0
  245. package/dist/core/schema/source.schema.js +24 -0
  246. package/dist/core/schema/source.schema.js.map +1 -0
  247. package/dist/core/schema/system.schema.d.ts +27 -0
  248. package/dist/core/schema/system.schema.d.ts.map +1 -0
  249. package/dist/core/schema/system.schema.js +17 -0
  250. package/dist/core/schema/system.schema.js.map +1 -0
  251. package/dist/core/schema/templates.d.ts +14 -0
  252. package/dist/core/schema/templates.d.ts.map +1 -0
  253. package/dist/core/schema/templates.js +220 -0
  254. package/dist/core/schema/templates.js.map +1 -0
  255. package/dist/core/schema/validation-constants.d.ts +5 -0
  256. package/dist/core/schema/validation-constants.d.ts.map +1 -0
  257. package/dist/core/schema/validation-constants.js +5 -0
  258. package/dist/core/schema/validation-constants.js.map +1 -0
  259. package/dist/core/sequencing/analyze.d.ts +13 -0
  260. package/dist/core/sequencing/analyze.d.ts.map +1 -0
  261. package/dist/core/sequencing/analyze.js +107 -0
  262. package/dist/core/sequencing/analyze.js.map +1 -0
  263. package/dist/core/sequencing/index.d.ts +8 -0
  264. package/dist/core/sequencing/index.d.ts.map +1 -0
  265. package/dist/core/sequencing/index.js +8 -0
  266. package/dist/core/sequencing/index.js.map +1 -0
  267. package/dist/core/sequencing/ordering.d.ts +11 -0
  268. package/dist/core/sequencing/ordering.d.ts.map +1 -0
  269. package/dist/core/sequencing/ordering.js +148 -0
  270. package/dist/core/sequencing/ordering.js.map +1 -0
  271. package/dist/core/sequencing/out-of-order-detector.d.ts +9 -0
  272. package/dist/core/sequencing/out-of-order-detector.d.ts.map +1 -0
  273. package/dist/core/sequencing/out-of-order-detector.js +42 -0
  274. package/dist/core/sequencing/out-of-order-detector.js.map +1 -0
  275. package/dist/core/sequencing/priority-queue.d.ts +18 -0
  276. package/dist/core/sequencing/priority-queue.d.ts.map +1 -0
  277. package/dist/core/sequencing/priority-queue.js +31 -0
  278. package/dist/core/sequencing/priority-queue.js.map +1 -0
  279. package/dist/core/sequencing/requirement-conflict-detector.d.ts +9 -0
  280. package/dist/core/sequencing/requirement-conflict-detector.d.ts.map +1 -0
  281. package/dist/core/sequencing/requirement-conflict-detector.js +90 -0
  282. package/dist/core/sequencing/requirement-conflict-detector.js.map +1 -0
  283. package/dist/core/sequencing/stale-detector.d.ts +9 -0
  284. package/dist/core/sequencing/stale-detector.d.ts.map +1 -0
  285. package/dist/core/sequencing/stale-detector.js +49 -0
  286. package/dist/core/sequencing/stale-detector.js.map +1 -0
  287. package/dist/core/sequencing/touches-analyzer.d.ts +8 -0
  288. package/dist/core/sequencing/touches-analyzer.d.ts.map +1 -0
  289. package/dist/core/sequencing/touches-analyzer.js +91 -0
  290. package/dist/core/sequencing/touches-analyzer.js.map +1 -0
  291. package/dist/core/vault/index.d.ts +2 -0
  292. package/dist/core/vault/index.d.ts.map +1 -0
  293. package/dist/core/vault/index.js +3 -0
  294. package/dist/core/vault/index.js.map +1 -0
  295. package/dist/core/workflow/apply/apply.d.ts +17 -0
  296. package/dist/core/workflow/apply/apply.d.ts.map +1 -0
  297. package/dist/core/workflow/apply/apply.js +302 -0
  298. package/dist/core/workflow/apply/apply.js.map +1 -0
  299. package/dist/core/workflow/apply/delta-parser.d.ts +11 -0
  300. package/dist/core/workflow/apply/delta-parser.d.ts.map +1 -0
  301. package/dist/core/workflow/apply/delta-parser.js +164 -0
  302. package/dist/core/workflow/apply/delta-parser.js.map +1 -0
  303. package/dist/core/workflow/apply/feature-updater.d.ts +12 -0
  304. package/dist/core/workflow/apply/feature-updater.d.ts.map +1 -0
  305. package/dist/core/workflow/apply/feature-updater.js +75 -0
  306. package/dist/core/workflow/apply/feature-updater.js.map +1 -0
  307. package/dist/core/workflow/apply/index.d.ts +7 -0
  308. package/dist/core/workflow/apply/index.d.ts.map +1 -0
  309. package/dist/core/workflow/apply/index.js +6 -0
  310. package/dist/core/workflow/apply/index.js.map +1 -0
  311. package/dist/core/workflow/apply/stale-checker.d.ts +17 -0
  312. package/dist/core/workflow/apply/stale-checker.d.ts.map +1 -0
  313. package/dist/core/workflow/apply/stale-checker.js +99 -0
  314. package/dist/core/workflow/apply/stale-checker.js.map +1 -0
  315. package/dist/core/workflow/apply/types.d.ts +112 -0
  316. package/dist/core/workflow/apply/types.d.ts.map +1 -0
  317. package/dist/core/workflow/apply/types.js +2 -0
  318. package/dist/core/workflow/apply/types.js.map +1 -0
  319. package/dist/core/workflow/apply/verify-apply.d.ts +16 -0
  320. package/dist/core/workflow/apply/verify-apply.d.ts.map +1 -0
  321. package/dist/core/workflow/apply/verify-apply.js +81 -0
  322. package/dist/core/workflow/apply/verify-apply.js.map +1 -0
  323. package/dist/core/workflow/continue/continue.d.ts +17 -0
  324. package/dist/core/workflow/continue/continue.d.ts.map +1 -0
  325. package/dist/core/workflow/continue/continue.js +213 -0
  326. package/dist/core/workflow/continue/continue.js.map +1 -0
  327. package/dist/core/workflow/continue/decision-promoter.d.ts +20 -0
  328. package/dist/core/workflow/continue/decision-promoter.d.ts.map +1 -0
  329. package/dist/core/workflow/continue/decision-promoter.js +36 -0
  330. package/dist/core/workflow/continue/decision-promoter.js.map +1 -0
  331. package/dist/core/workflow/continue/index.d.ts +6 -0
  332. package/dist/core/workflow/continue/index.d.ts.map +1 -0
  333. package/dist/core/workflow/continue/index.js +5 -0
  334. package/dist/core/workflow/continue/index.js.map +1 -0
  335. package/dist/core/workflow/continue/next-action.d.ts +13 -0
  336. package/dist/core/workflow/continue/next-action.d.ts.map +1 -0
  337. package/dist/core/workflow/continue/next-action.js +129 -0
  338. package/dist/core/workflow/continue/next-action.js.map +1 -0
  339. package/dist/core/workflow/continue/section-checker.d.ts +18 -0
  340. package/dist/core/workflow/continue/section-checker.d.ts.map +1 -0
  341. package/dist/core/workflow/continue/section-checker.js +114 -0
  342. package/dist/core/workflow/continue/section-checker.js.map +1 -0
  343. package/dist/core/workflow/continue/types.d.ts +113 -0
  344. package/dist/core/workflow/continue/types.d.ts.map +1 -0
  345. package/dist/core/workflow/continue/types.js +2 -0
  346. package/dist/core/workflow/continue/types.js.map +1 -0
  347. package/dist/core/workflow/index.d.ts +11 -0
  348. package/dist/core/workflow/index.d.ts.map +1 -0
  349. package/dist/core/workflow/index.js +12 -0
  350. package/dist/core/workflow/index.js.map +1 -0
  351. package/dist/core/workflow/propose/index.d.ts +6 -0
  352. package/dist/core/workflow/propose/index.d.ts.map +1 -0
  353. package/dist/core/workflow/propose/index.js +5 -0
  354. package/dist/core/workflow/propose/index.js.map +1 -0
  355. package/dist/core/workflow/propose/note-creator.d.ts +35 -0
  356. package/dist/core/workflow/propose/note-creator.d.ts.map +1 -0
  357. package/dist/core/workflow/propose/note-creator.js +178 -0
  358. package/dist/core/workflow/propose/note-creator.js.map +1 -0
  359. package/dist/core/workflow/propose/prerequisites.d.ts +17 -0
  360. package/dist/core/workflow/propose/prerequisites.d.ts.map +1 -0
  361. package/dist/core/workflow/propose/prerequisites.js +78 -0
  362. package/dist/core/workflow/propose/prerequisites.js.map +1 -0
  363. package/dist/core/workflow/propose/propose.d.ts +13 -0
  364. package/dist/core/workflow/propose/propose.d.ts.map +1 -0
  365. package/dist/core/workflow/propose/propose.js +204 -0
  366. package/dist/core/workflow/propose/propose.js.map +1 -0
  367. package/dist/core/workflow/propose/query-normalizer.d.ts +7 -0
  368. package/dist/core/workflow/propose/query-normalizer.d.ts.map +1 -0
  369. package/dist/core/workflow/propose/query-normalizer.js +77 -0
  370. package/dist/core/workflow/propose/query-normalizer.js.map +1 -0
  371. package/dist/core/workflow/propose/types.d.ts +71 -0
  372. package/dist/core/workflow/propose/types.d.ts.map +1 -0
  373. package/dist/core/workflow/propose/types.js +2 -0
  374. package/dist/core/workflow/propose/types.js.map +1 -0
  375. package/dist/core/workflow/query/index.d.ts +6 -0
  376. package/dist/core/workflow/query/index.d.ts.map +1 -0
  377. package/dist/core/workflow/query/index.js +5 -0
  378. package/dist/core/workflow/query/index.js.map +1 -0
  379. package/dist/core/workflow/query/noteworthiness.d.ts +14 -0
  380. package/dist/core/workflow/query/noteworthiness.d.ts.map +1 -0
  381. package/dist/core/workflow/query/noteworthiness.js +48 -0
  382. package/dist/core/workflow/query/noteworthiness.js.map +1 -0
  383. package/dist/core/workflow/query/query-note-creator.d.ts +13 -0
  384. package/dist/core/workflow/query/query-note-creator.d.ts.map +1 -0
  385. package/dist/core/workflow/query/query-note-creator.js +168 -0
  386. package/dist/core/workflow/query/query-note-creator.js.map +1 -0
  387. package/dist/core/workflow/query/query-search.d.ts +19 -0
  388. package/dist/core/workflow/query/query-search.d.ts.map +1 -0
  389. package/dist/core/workflow/query/query-search.js +252 -0
  390. package/dist/core/workflow/query/query-search.js.map +1 -0
  391. package/dist/core/workflow/query/query.d.ts +18 -0
  392. package/dist/core/workflow/query/query.d.ts.map +1 -0
  393. package/dist/core/workflow/query/query.js +29 -0
  394. package/dist/core/workflow/query/query.js.map +1 -0
  395. package/dist/core/workflow/query/types.d.ts +67 -0
  396. package/dist/core/workflow/query/types.d.ts.map +1 -0
  397. package/dist/core/workflow/query/types.js +2 -0
  398. package/dist/core/workflow/query/types.js.map +1 -0
  399. package/dist/core/workflow/verify/coherence.d.ts +30 -0
  400. package/dist/core/workflow/verify/coherence.d.ts.map +1 -0
  401. package/dist/core/workflow/verify/coherence.js +206 -0
  402. package/dist/core/workflow/verify/coherence.js.map +1 -0
  403. package/dist/core/workflow/verify/completeness.d.ts +24 -0
  404. package/dist/core/workflow/verify/completeness.d.ts.map +1 -0
  405. package/dist/core/workflow/verify/completeness.js +172 -0
  406. package/dist/core/workflow/verify/completeness.js.map +1 -0
  407. package/dist/core/workflow/verify/correctness.d.ts +38 -0
  408. package/dist/core/workflow/verify/correctness.d.ts.map +1 -0
  409. package/dist/core/workflow/verify/correctness.js +352 -0
  410. package/dist/core/workflow/verify/correctness.js.map +1 -0
  411. package/dist/core/workflow/verify/index.d.ts +7 -0
  412. package/dist/core/workflow/verify/index.d.ts.map +1 -0
  413. package/dist/core/workflow/verify/index.js +6 -0
  414. package/dist/core/workflow/verify/index.js.map +1 -0
  415. package/dist/core/workflow/verify/vault-integrity.d.ts +45 -0
  416. package/dist/core/workflow/verify/vault-integrity.d.ts.map +1 -0
  417. package/dist/core/workflow/verify/vault-integrity.js +141 -0
  418. package/dist/core/workflow/verify/vault-integrity.js.map +1 -0
  419. package/dist/core/workflow/verify/verify.d.ts +23 -0
  420. package/dist/core/workflow/verify/verify.d.ts.map +1 -0
  421. package/dist/core/workflow/verify/verify.js +122 -0
  422. package/dist/core/workflow/verify/verify.js.map +1 -0
  423. package/dist/index.d.ts +10 -0
  424. package/dist/index.d.ts.map +1 -0
  425. package/dist/index.js +2 -0
  426. package/dist/index.js.map +1 -0
  427. package/dist/types/delta.d.ts +17 -0
  428. package/dist/types/delta.d.ts.map +1 -0
  429. package/dist/types/delta.js +2 -0
  430. package/dist/types/delta.js.map +1 -0
  431. package/dist/types/frontmatter.d.ts +51 -0
  432. package/dist/types/frontmatter.d.ts.map +1 -0
  433. package/dist/types/frontmatter.js +2 -0
  434. package/dist/types/frontmatter.js.map +1 -0
  435. package/dist/types/index-record.d.ts +46 -0
  436. package/dist/types/index-record.d.ts.map +1 -0
  437. package/dist/types/index-record.js +2 -0
  438. package/dist/types/index-record.js.map +1 -0
  439. package/dist/types/index.d.ts +11 -0
  440. package/dist/types/index.d.ts.map +1 -0
  441. package/dist/types/index.js +2 -0
  442. package/dist/types/index.js.map +1 -0
  443. package/dist/types/next-action.d.ts +10 -0
  444. package/dist/types/next-action.d.ts.map +1 -0
  445. package/dist/types/next-action.js +2 -0
  446. package/dist/types/next-action.js.map +1 -0
  447. package/dist/types/notes.d.ts +9 -0
  448. package/dist/types/notes.d.ts.map +1 -0
  449. package/dist/types/notes.js +2 -0
  450. package/dist/types/notes.js.map +1 -0
  451. package/dist/types/requirement.d.ts +19 -0
  452. package/dist/types/requirement.d.ts.map +1 -0
  453. package/dist/types/requirement.js +2 -0
  454. package/dist/types/requirement.js.map +1 -0
  455. package/dist/types/retrieval.d.ts +32 -0
  456. package/dist/types/retrieval.d.ts.map +1 -0
  457. package/dist/types/retrieval.js +2 -0
  458. package/dist/types/retrieval.js.map +1 -0
  459. package/dist/types/sequencing.d.ts +83 -0
  460. package/dist/types/sequencing.d.ts.map +1 -0
  461. package/dist/types/sequencing.js +2 -0
  462. package/dist/types/sequencing.js.map +1 -0
  463. package/dist/types/task.d.ts +7 -0
  464. package/dist/types/task.d.ts.map +1 -0
  465. package/dist/types/task.js +2 -0
  466. package/dist/types/task.js.map +1 -0
  467. package/dist/types/verify.d.ts +23 -0
  468. package/dist/types/verify.d.ts.map +1 -0
  469. package/dist/types/verify.js +2 -0
  470. package/dist/types/verify.js.map +1 -0
  471. package/dist/utils/hash.d.ts +6 -0
  472. package/dist/utils/hash.d.ts.map +1 -0
  473. package/dist/utils/hash.js +9 -0
  474. package/dist/utils/hash.js.map +1 -0
  475. package/dist/utils/id-generator.d.ts +17 -0
  476. package/dist/utils/id-generator.d.ts.map +1 -0
  477. package/dist/utils/id-generator.js +24 -0
  478. package/dist/utils/id-generator.js.map +1 -0
  479. package/dist/utils/index.d.ts +4 -0
  480. package/dist/utils/index.d.ts.map +1 -0
  481. package/dist/utils/index.js +4 -0
  482. package/dist/utils/index.js.map +1 -0
  483. package/dist/utils/normalize.d.ts +11 -0
  484. package/dist/utils/normalize.d.ts.map +1 -0
  485. package/dist/utils/normalize.js +15 -0
  486. package/dist/utils/normalize.js.map +1 -0
  487. package/package.json +61 -0
@@ -0,0 +1,753 @@
1
+ /**
2
+ * Generates Claude Code skill files for ows workflows.
3
+ */
4
+ import * as fs from 'node:fs';
5
+ import * as path from 'node:path';
6
+ export const WORKFLOW_SKILLS = {
7
+ propose: {
8
+ name: 'ows-propose',
9
+ description: 'Propose a new change to the codebase wiki.',
10
+ instructions: `Run the open-wiki-spec propose workflow.
11
+
12
+ **Input**: The argument after \`/ows-propose\` is a natural language description of what the user wants to build or change. If omitted, ask what they want to work on.
13
+
14
+ **Steps**
15
+
16
+ 1. **If no input provided, ask what they want to build**
17
+
18
+ Ask the user to describe what they want to build or change in the codebase.
19
+
20
+ **IMPORTANT**: Do NOT proceed without understanding what the user wants.
21
+
22
+ 2. **Run preflight retrieval (dry-run first)**
23
+ \`\`\`bash
24
+ ows propose "<user's description>" --dry-run --json
25
+ \`\`\`
26
+ Parse the JSON output to understand:
27
+ - \`retrieval.classification\`: one of \`existing_change\`, \`existing_feature\`, \`new_feature\`, \`needs_confirmation\`
28
+ - \`retrieval.confidence\`: \`high\`, \`medium\`, or \`low\`
29
+ - \`retrieval.candidates\`: scored candidate list with scores and match reasons
30
+ - \`classification.primary_candidate\`: the top matching note
31
+ - \`sequencing_warnings\`: any parallel work conflicts
32
+
33
+ 3. **Act based on classification**
34
+
35
+ ---
36
+
37
+ **If \`needs_confirmation\`**: Show the top candidates with their scores and match reasons. Ask the user to choose:
38
+ - Which existing Feature to attach to, OR
39
+ - Which existing Change to continue, OR
40
+ - Create a new Feature + Change
41
+
42
+ **If \`existing_feature\`**: Show which Feature matched and why. Confirm with the user before creating a new Change attached to it.
43
+
44
+ **If \`existing_change\`**: Show the matching active Change. Suggest continuing it instead of creating a new one. Offer \`/ows-continue\` as next step.
45
+
46
+ **If \`new_feature\`**: Confirm with the user that nothing similar exists and proceed.
47
+
48
+ ---
49
+
50
+ 4. **Execute the propose (if confirmed)**
51
+
52
+ For \`new_feature\` or \`existing_feature\` classification, run directly:
53
+ \`\`\`bash
54
+ ows propose "<user's description>" --json
55
+ \`\`\`
56
+
57
+ For \`needs_confirmation\` (after user chooses), use \`--force-classification\` to override:
58
+ \`\`\`bash
59
+ # User chose to create new Feature + Change:
60
+ ows propose "<user's description>" --force-classification new_feature --json
61
+ # User chose an existing Feature:
62
+ ows propose "<user's description>" --force-classification existing_feature --json
63
+ # User chose to continue an existing Change:
64
+ ows propose "<user's description>" --force-classification existing_change --json
65
+ \`\`\`
66
+
67
+ 5. **Show results**
68
+
69
+ Display:
70
+ - Classification decision and reasoning
71
+ - Created/updated Change note path and ID
72
+ - Linked Feature note (if applicable)
73
+ - Next step: "Run \`/ows-continue <changeId>\` to fill in Change sections."
74
+
75
+ **Output**
76
+
77
+ After completing, summarize:
78
+ - What was created or updated
79
+ - Why (classification reasoning from retrieval)
80
+ - What to do next
81
+
82
+ **Guardrails**
83
+ - Always show dry-run results before creating anything
84
+ - If classification is \`needs_confirmation\`, NEVER auto-decide — always ask the user
85
+ - If \`sequencing_warnings\` are present, show them prominently before proceeding
86
+ - If confidence is \`low\`, warn the user that results may be inaccurate`,
87
+ },
88
+ continue: {
89
+ name: 'ows-continue',
90
+ description: 'Continue work on an existing Change.',
91
+ instructions: `Continue working on an existing Change by filling sections or advancing status.
92
+
93
+ **Input**: Optionally specify a change ID after \`/ows-continue\` (e.g., \`/ows-continue change-add-auth\`). If omitted, prompt for selection.
94
+
95
+ **Steps**
96
+
97
+ 1. **If no change ID provided, prompt for selection**
98
+
99
+ Run \`ows list --json\` to get active changes. Show them and let the user pick.
100
+
101
+ **IMPORTANT**: Do NOT guess or auto-select. Always let the user choose.
102
+
103
+ 2. **Check current status**
104
+ \`\`\`bash
105
+ ows status <changeId> --json
106
+ \`\`\`
107
+ Parse the JSON to understand:
108
+ - Current status (proposed, planned, in_progress, applied)
109
+ - Section completeness (which sections are filled vs empty)
110
+ - Task progress (N/M done)
111
+ - \`nextAction\`: what should be done next (see all 7 types below)
112
+
113
+ 3. **Act based on nextAction**
114
+
115
+ The nextAction algorithm returns one of 7 deterministic action types based on current status and section/task state:
116
+
117
+ ---
118
+
119
+ **If \`fill_section\`** (status: proposed): A required section is missing. Help the user write the missing section content. Read the Change note, identify what's missing, and draft content. Required sections for planned transition: Why, Delta Summary, Tasks, Validation.
120
+
121
+ **If \`transition\`** (status: proposed -> planned): All required sections are filled. Run \`ows continue <changeId> --json\` to advance the status from proposed to planned.
122
+
123
+ **If \`blocked\`** (status: planned): The Change has unresolved \`depends_on\` entries. Show blocking dependencies (change IDs that are not yet applied) and help resolve them.
124
+
125
+ **If \`start_implementation\`** (status: planned -> in_progress): Dependencies are resolved and tasks exist. The CLI will auto-transition to in_progress. Show the first unchecked task and help the user begin implementing.
126
+
127
+ **If \`continue_task\`** (status: in_progress): Show the next unchecked task and help the user work through it.
128
+
129
+ **If \`ready_to_apply\`** (status: in_progress): All tasks are complete. Suggest running \`/ows-apply <changeId>\` to apply the Change to canonical Feature notes. Do NOT attempt to transition status here -- the apply workflow owns the in_progress -> applied transition.
130
+
131
+ **If \`verify_then_archive\`** (status: applied): The Change has been applied. Suggest running \`/ows-verify\` and then archiving.
132
+
133
+ ---
134
+
135
+ 4. **After each action, show updated status**
136
+ \`\`\`bash
137
+ ows status <changeId>
138
+ \`\`\`
139
+
140
+ **Output**
141
+
142
+ After each invocation, show:
143
+ - Current status and what changed
144
+ - Section/task progress
145
+ - What to do next
146
+
147
+ **Guardrails**
148
+ - Perform ONE section fill or ONE status transition per invocation
149
+ - Always read the Change note before modifying it
150
+ - If context is unclear, ask the user before writing
151
+ - Show status after every change
152
+ - The continue workflow owns proposed->planned and planned->in_progress transitions ONLY
153
+ - The in_progress->applied transition is owned exclusively by the apply workflow`,
154
+ },
155
+ apply: {
156
+ name: 'ows-apply',
157
+ description: 'Apply a Change to canonical Feature notes.',
158
+ instructions: `Apply a completed Change to canonical Feature notes, updating the wiki's current state.
159
+
160
+ **Input**: Specify a change ID after \`/ows-apply\` (e.g., \`/ows-apply change-add-auth\`). The change ID is **required** by the CLI. If the user does not provide one, run \`ows list --json\` and let them choose from changes with status \`in_progress\`.
161
+
162
+ **Prerequisites**: The CLI enforces these before applying:
163
+ - Change status MUST be \`in_progress\` (use \`/ows-continue\` to advance if needed)
164
+ - ALL tasks in the Change note must be checked (\`[x]\`)
165
+
166
+ **Available flags**:
167
+ - \`--json\`: Output structured JSON result
168
+ - \`--dry-run\`: Validate without writing any files (use this to preview)
169
+ - \`--force-stale\`: Apply even when stale base fingerprints are detected
170
+
171
+ **Steps**
172
+
173
+ 1. **If no change ID provided, prompt for selection**
174
+
175
+ Run \`ows list --json\` to get applicable changes. Show only changes with status \`in_progress\`.
176
+
177
+ **IMPORTANT**: Do NOT guess or auto-select. Always let the user choose.
178
+
179
+ 2. **Preview with dry-run first**
180
+ \`\`\`bash
181
+ ows apply <changeId> --dry-run --json
182
+ \`\`\`
183
+ Parse the result to check for stale entries or validation errors before committing.
184
+
185
+ 3. **Handle dry-run results**
186
+
187
+ ---
188
+
189
+ **If stale_base detected** (\`staleReport.blocked: true\`): Show which Feature requirements have changed since the Change was created (base fingerprint mismatch). Ask the user how to resolve:
190
+ - Re-run with \`--force-stale\` to apply anyway
191
+ - Update the Change's Delta Summary to reflect current state
192
+ - Abort and investigate
193
+
194
+ **If validation errors**: Show pre-validation errors (e.g., ADDED requirement already exists, MODIFIED requirement not found). These must be fixed in the Change note.
195
+
196
+ **If clean**: Proceed to actual apply.
197
+
198
+ ---
199
+
200
+ 4. **Execute the apply (if confirmed)**
201
+ \`\`\`bash
202
+ ows apply <changeId> --json
203
+ \`\`\`
204
+
205
+ The apply uses a **two-phase commit** pattern:
206
+ - **Phase 1** (validate & compute): Parse Delta Summary, stale-check all entries, pre-validate operations. No files written.
207
+ - **Phase 2** (write): Only if Phase 1 passes. Apply operations in **atomic order**: RENAMED -> REMOVED -> MODIFIED -> ADDED.
208
+
209
+ Programmatic operations (RENAMED, REMOVED) are executed directly. Agent-driven operations (MODIFIED, ADDED) may require the agent to write content.
210
+
211
+ 5. **Show final state**
212
+ \`\`\`bash
213
+ ows status <changeId>
214
+ \`\`\`
215
+
216
+ **Output On Success**
217
+
218
+ \`\`\`
219
+ ## Apply Complete
220
+
221
+ **Change:** <changeId>
222
+ **Status:** applied
223
+
224
+ ### Updated Features
225
+ - Feature: Auth Login — updated Requirements section
226
+ - Feature: User Profile — added new requirement
227
+
228
+ The canonical wiki state now reflects this change.
229
+ \`\`\`
230
+
231
+ **Guardrails**
232
+ - The change ID is required -- always ensure one is provided before calling \`ows apply\`
233
+ - Always dry-run first to catch stale entries and validation errors
234
+ - If stale_base is detected, NEVER auto-resolve -- always ask the user
235
+ - Show a clear diff of what will change in each Feature before applying
236
+ - After apply, suggest archiving if appropriate
237
+ - Only the apply workflow can transition a Change from in_progress to applied`,
238
+ },
239
+ verify: {
240
+ name: 'ows-verify',
241
+ description: 'Verify vault consistency.',
242
+ instructions: `Verify vault consistency across multiple dimensions.
243
+
244
+ **Input**: Optionally specify a change ID after \`/ows-verify\` to verify a specific change. If omitted, verify the entire vault.
245
+
246
+ **Available flags**:
247
+ - \`--json\`: Output structured JSON result
248
+ - \`--strict\`: Treat warnings as errors (both errors and warnings must be zero for pass)
249
+
250
+ **Steps**
251
+
252
+ 1. **Run verification**
253
+ \`\`\`bash
254
+ ows verify --json
255
+ # or for a specific change:
256
+ ows verify <changeId> --json
257
+ # strict mode:
258
+ ows verify --strict --json
259
+ \`\`\`
260
+
261
+ 2. **Parse the VerifyReport**
262
+
263
+ The report includes \`pass\` (boolean), \`total_notes\`, \`issues\` array, and a \`summary\` object with counts per dimension. The four verification dimensions are:
264
+
265
+ - **completeness**: Required sections present, feature/change section coverage, minimum headings
266
+ - **correctness**: Status lifecycle validity, stale base detection, operation validation matrix, schema version match, drift detection
267
+ - **coherence**: Parallel change conflict detection (via sequencing engine), description consistency, decision consistency, depends_on integrity
268
+ - **vault_integrity**: Duplicate IDs, missing IDs, unresolved wikilinks, ambiguous aliases, orphan notes, archive placement, invalid frontmatter types
269
+
270
+ Each issue in the \`issues\` array has:
271
+ - \`dimension\`: one of the four dimensions above
272
+ - \`severity\`: \`error\`, \`warning\`, or \`info\`
273
+ - \`code\`: machine-readable issue code (e.g., \`DUPLICATE_ID\`, \`STALE_BASE\`)
274
+ - \`message\`: human-readable description
275
+ - \`note_path\`: file path of the affected note (use for navigation)
276
+ - \`note_id\`: ID of the affected note
277
+ - \`suggestion\`: recommended fix
278
+
279
+ 3. **Present results**
280
+
281
+ **If pass**:
282
+ \`\`\`
283
+ ## Vault Verification: PASS
284
+ No issues found across N notes.
285
+ \`\`\`
286
+
287
+ **If issues found**:
288
+ Show errors first, then warnings, then info. Group by dimension for clarity:
289
+
290
+ \`\`\`
291
+ ## Vault Verification: FAIL
292
+
293
+ ### Errors (must fix)
294
+ - [vault_integrity] Feature: Auth Login — missing required "id" in frontmatter
295
+ - [vault_integrity] Change: Add Passkey — wikilink [[Feature: Auth]] does not resolve
296
+ - [correctness] Change: Add Auth — stale base detected for Feature: User Profile
297
+
298
+ ### Warnings (should fix)
299
+ - [vault_integrity] Ambiguous alias "login" matches 2 notes
300
+ - [coherence] Changes "add-auth" and "fix-login" both touch Feature: Auth Login
301
+
302
+ ### Info
303
+ - [coherence] Active Feature "auth" references archived Decision "use-jwt"
304
+ \`\`\`
305
+
306
+ For each issue, include the \`suggestion\` field and \`note_path\` from the report.
307
+
308
+ **Guardrails**
309
+ - Always show the full report, don't summarize away issues
310
+ - Present errors before warnings before info
311
+ - Include file paths (\`note_path\`) so the user can navigate to issues
312
+ - If verification fails, suggest specific fixes for each issue
313
+ - Use \`--strict\` when preparing for release or archiving`,
314
+ },
315
+ query: {
316
+ name: 'ows-query',
317
+ description: 'Search the vault graph and optionally create a Query note.',
318
+ instructions: `Search the vault knowledge graph to answer questions or find related notes.
319
+
320
+ **Input**: The argument after \`/ows-query\` is a natural language question (e.g., \`/ows-query "how does authentication work?"\`).
321
+
322
+ **Steps**
323
+
324
+ 1. **Run the query**
325
+ \`\`\`bash
326
+ ows query "<question>" --json
327
+ \`\`\`
328
+
329
+ 2. **Parse the result**
330
+
331
+ The JSON output includes:
332
+ - \`searchResult\`: scored candidates from the vault graph
333
+ - \`contextDocument\`: a synthesized context document built from matching notes
334
+ - \`assessment\`: whether a Query note should be created (\`shouldCreate\`, \`confidence\`, \`reasons\`)
335
+
336
+ 3. **Present findings**
337
+
338
+ Show the context document and top matching notes:
339
+ - Note title, type, score, and match reasons
340
+ - Relevant sections from each matching note
341
+ - Links to related notes for further exploration
342
+
343
+ 4. **If assessment recommends note creation**
344
+
345
+ Ask the user if they want to save the findings as a Query note:
346
+ > "This query surfaced enough novel findings to be worth saving. Create a Query note?"
347
+
348
+ If yes:
349
+ \`\`\`bash
350
+ ows query "<question>" --json --save
351
+ \`\`\`
352
+
353
+ 5. **Offer next steps**
354
+
355
+ Based on findings, suggest:
356
+ - Reading specific vault notes for deeper context
357
+ - Running \`/ows-propose\` if the query reveals work to be done
358
+ - Running \`/ows-query\` with a more specific question
359
+
360
+ **Guardrails**
361
+ - Always show match reasons so the user understands WHY notes were surfaced
362
+ - Don't auto-save Query notes — always ask the user first
363
+ - If no candidates found, suggest refining the question or checking vault content`,
364
+ },
365
+ status: {
366
+ name: 'ows-status',
367
+ description: 'Show the current state of a Change.',
368
+ instructions: `Show the current state and progress of a Change.
369
+
370
+ **Input**: Optionally specify a change ID after \`/ows-status\` (e.g., \`/ows-status change-add-auth\`). If omitted, show all active changes.
371
+
372
+ **Steps**
373
+
374
+ 1. **If change ID provided**:
375
+ \`\`\`bash
376
+ ows status <changeId> --json
377
+ \`\`\`
378
+
379
+ The JSON output includes:
380
+ - \`changeId\`: the change's ID
381
+ - \`status\`: one of \`proposed\`, \`planned\`, \`in_progress\`, \`applied\`, \`archived\`
382
+ - \`features\`: linked Feature IDs
383
+ - \`sectionCompleteness\`: \`{ why, deltaSummary, tasks, validation, designApproach? }\`
384
+ - \`taskProgress\`: \`{ total, completed }\`
385
+ - \`nextAction\`: the recommended next step (see below)
386
+ - \`blockedBy\`: array of blocking change IDs
387
+
388
+ **nextAction types** (deterministic based on status and progress):
389
+ - \`fill_section\` (proposed): A required section is missing. \`target\` names the section.
390
+ - \`transition\` (proposed): All sections filled. \`to\` is the target status (planned).
391
+ - \`start_implementation\` (planned): Ready to begin implementing.
392
+ - \`continue_task\` (in_progress): Tasks remain. \`target\` is the next task description.
393
+ - \`blocked\` (any): \`blockers\` lists the blocking change IDs.
394
+ - \`ready_to_apply\` (in_progress): All tasks complete. Suggest \`/ows-apply\`.
395
+ - \`verify_then_archive\` (applied): Change applied. Suggest \`/ows-verify\` then archiving.
396
+
397
+ 2. **If no change ID (list all)**:
398
+ \`\`\`bash
399
+ ows list --json
400
+ \`\`\`
401
+
402
+ Show a summary table of all active changes:
403
+ \`\`\`
404
+ | Change ID | Status | Tasks | Next Action |
405
+ |---------------------|-------------|-------|---------------------|
406
+ | change-add-auth | in_progress | 3/7 | continue_task |
407
+ | change-fix-routing | proposed | 0/0 | fill_section |
408
+ | change-add-passkey | in_progress | 5/5 | ready_to_apply |
409
+ | change-old-refactor | applied | 4/4 | verify_then_archive |
410
+ \`\`\`
411
+
412
+ **Guardrails**
413
+ - Show actionable next steps, not just raw status
414
+ - If blocked, explain what is blocking and suggest resolution
415
+ - For \`ready_to_apply\`, suggest \`/ows-apply <changeId>\`
416
+ - For \`verify_then_archive\`, suggest \`/ows-verify\` followed by \`ows archive <changeId>\``,
417
+ },
418
+ retrieve: {
419
+ name: 'ows-retrieve',
420
+ description: 'Run a standalone retrieval scan against the vault graph (retrieval subagent).',
421
+ instructions: `Run the open-wiki-spec retrieval subagent.
422
+
423
+ This skill is the **retrieval subagent** described in overview.md section 9.3. It delegates vault similarity scan to \`ows propose --dry-run --json\`, which runs the full retrieval pipeline (lexical retrieval, graph expansion, scoring, classification) without creating or modifying any notes.
424
+
425
+ **Input**: The argument after \`/ows-retrieve\` is a natural language description of what the user wants to find or check against the vault.
426
+
427
+ **When to use**:
428
+ - Before proposing a change, to check what already exists in the vault
429
+ - To answer "is there already a Feature/Change for X?" without side effects
430
+ - As a preflight check before any vault-modifying workflow
431
+ - When you need structured search results for decision-making
432
+
433
+ **Steps**
434
+
435
+ 1. **Run retrieval (dry-run)**
436
+ \`\`\`bash
437
+ ows propose "<user's description>" --dry-run --json
438
+ \`\`\`
439
+
440
+ 2. **Parse the JSON output**
441
+
442
+ The key fields are:
443
+ - \`retrieval.classification\`: one of \`existing_change\`, \`existing_feature\`, \`new_feature\`, \`needs_confirmation\`
444
+ - \`retrieval.confidence\`: \`high\`, \`medium\`, or \`low\`
445
+ - \`retrieval.candidates\`: scored candidate list with \`id\`, \`type\`, \`title\`, \`score\`, \`reasons\`
446
+ - \`retrieval.warnings\`: any index quality warnings
447
+ - \`retrieval.sequencing\`: parallel safety and related change info (\`status\`: \`parallel_safe\`, \`needs_review\`, \`conflict_candidate\`, \`conflict_critical\`, or \`blocked\`)
448
+
449
+ 3. **Present results to user**
450
+
451
+ Show a summary table of top candidates:
452
+ \`\`\`
453
+ ## Retrieval Results: "<query>"
454
+
455
+ Classification: existing_feature (confidence: high)
456
+
457
+ | # | Note | Type | Score | Key Reasons |
458
+ |---|----------------------------|---------|-------|--------------------------------|
459
+ | 1 | Feature: Auth Login | feature | 87 | alias match, same system |
460
+ | 2 | Change: Improve Auth UX | change | 61 | active overlap, shared source |
461
+ \`\`\`
462
+
463
+ Then explain the classification:
464
+ - \`existing_feature\`: A matching Feature already exists. Attach new work to it.
465
+ - \`existing_change\`: An active Change with the same purpose exists. Continue it instead of creating a new one.
466
+ - \`new_feature\`: Nothing similar found. Safe to create new Feature + Change.
467
+ - \`needs_confirmation\`: Ambiguous results. Show candidates and ask for user choice.
468
+
469
+ 4. **Suggest next steps**
470
+
471
+ Based on classification:
472
+ - \`existing_feature\` / \`new_feature\`: "Run \`/ows-propose\` to create the Change."
473
+ - \`existing_change\`: "Run \`/ows-continue <changeId>\` to continue the existing Change."
474
+ - \`needs_confirmation\`: "Which of these candidates is the right match?"
475
+
476
+ **Contract**:
477
+ - **Input**: natural language description (same as \`ows propose\`)
478
+ - **Output**: structured ProposeResult JSON (in dry-run mode) with \`action\`, \`retrieval\`, \`classification\`, \`target_change\`, \`target_feature\`, \`prerequisites\`, \`transitioned_to_planned\`, \`sequencing_warnings\`
479
+ - **Side effects**: NONE (dry-run mode)
480
+
481
+ **Example**:
482
+ \`\`\`bash
483
+ ows propose "add passkey login support" --dry-run --json
484
+ \`\`\`
485
+
486
+ Output (abbreviated):
487
+ \`\`\`json
488
+ {
489
+ "action": "created_change",
490
+ "retrieval": {
491
+ "query": "add passkey login support",
492
+ "classification": "existing_feature",
493
+ "confidence": "high",
494
+ "candidates": [
495
+ { "id": "feature-auth-login", "type": "feature", "title": "Feature: Auth Login", "score": 87, "reasons": ["alias match: login", "same system: authentication"] }
496
+ ],
497
+ "sequencing": { "status": "parallel_safe", "related_changes": [], "reasons": [] },
498
+ "warnings": []
499
+ },
500
+ "classification": {
501
+ "classification": "existing_feature",
502
+ "confidence": "high",
503
+ "primary_candidate": { "id": "feature-auth-login", "type": "feature", "title": "Feature: Auth Login", "score": 87 },
504
+ "secondary_candidate": null,
505
+ "reasons": ["alias match: login", "same system: authentication"]
506
+ },
507
+ "target_change": null,
508
+ "target_feature": null,
509
+ "prerequisites": null,
510
+ "transitioned_to_planned": false,
511
+ "sequencing_warnings": []
512
+ }
513
+ \`\`\`
514
+
515
+ **Guardrails**
516
+ - This is READ-ONLY — never create or modify vault notes
517
+ - Always show match reasons so the user can verify the classification
518
+ - If confidence is \`low\`, explicitly warn the user
519
+ - If warnings are present, show them prominently
520
+ - If \`sequencing.status\` is not \`parallel_safe\`, warn about potential conflicts with active Changes`,
521
+ },
522
+ archive: {
523
+ name: 'ows-archive',
524
+ description: 'Archive an applied Change to 99-archive/.',
525
+ instructions: `Archive a completed Change, moving it from the active changes directory to 99-archive/.
526
+
527
+ **Input**: Specify a change ID after \`/ows-archive\` (e.g., \`/ows-archive change-add-auth\`). The change ID is **required** by the CLI. If the user does not provide one, run \`ows list --json\` and let them choose from changes with status \`applied\`.
528
+
529
+ **Prerequisites**: The CLI enforces that only \`applied\` changes can be archived. If the change is not applied, guide the user through \`/ows-apply\` first.
530
+
531
+ **Available flags**:
532
+ - \`--json\`: Output structured JSON result
533
+ - \`--force\`: Archive even if verify finds errors
534
+
535
+ **Steps**
536
+
537
+ 1. **If no change ID provided, prompt for selection**
538
+
539
+ Run \`ows list --json\` to get changes. Show only changes with status \`applied\`.
540
+
541
+ **IMPORTANT**: Do NOT guess or auto-select. Always let the user choose.
542
+
543
+ 2. **Verify before archiving**
544
+
545
+ The archive command automatically runs \`ows verify\` on the change before archiving. If verify finds errors, the archive will fail unless \`--force\` is used.
546
+
547
+ Suggest running \`/ows-verify <changeId>\` first so the user can review issues.
548
+
549
+ 3. **Execute the archive**
550
+ \`\`\`bash
551
+ ows archive <changeId> --json
552
+ \`\`\`
553
+
554
+ 4. **Handle results**
555
+
556
+ ---
557
+
558
+ **If successful**: Show the old and new paths.
559
+
560
+ **If verify failed**: Show the verify errors and ask the user:
561
+ - Fix the issues and retry
562
+ - Force archive with \`ows archive <changeId> --force --json\`
563
+
564
+ ---
565
+
566
+ **Output On Success**
567
+
568
+ \`\`\`
569
+ ## Archive Complete
570
+
571
+ **Change:** <changeId>
572
+ **From:** wiki/04-changes/<filename>.md
573
+ **To:** wiki/99-archive/<filename>.md
574
+
575
+ The change has been archived. Decision history is preserved.
576
+ \`\`\`
577
+
578
+ **Guardrails**
579
+ - Only applied changes can be archived
580
+ - Always show verify results before forcing an archive
581
+ - If verify fails, explain the issues before offering --force
582
+ - After archiving, the change is no longer active in the vault`,
583
+ },
584
+ init: {
585
+ name: 'ows-init',
586
+ description: 'Initialize a new open-wiki-spec vault.',
587
+ instructions: `Initialize a new open-wiki-spec vault in the current project or a specified path.
588
+
589
+ **Input**: Optionally specify a target path after \`/ows-init\` (e.g., \`/ows-init ./my-project\`). If omitted, initializes in the current working directory.
590
+
591
+ **Available flags**:
592
+ - \`--json\`: Output structured JSON result
593
+ - \`--force\`: Force re-initialization, recreating meta files even if they exist
594
+
595
+ **Steps**
596
+
597
+ 1. **Run initialization**
598
+ \`\`\`bash
599
+ ows init --json
600
+ # or with a path:
601
+ ows init <path> --json
602
+ # force re-init:
603
+ ows init --force --json
604
+ \`\`\`
605
+
606
+ 2. **Parse the result**
607
+
608
+ The JSON output includes:
609
+ - \`mode\`: \`fresh\` (new vault) or \`extend\` (existing directory)
610
+ - \`wikiPath\`: path to the created wiki directory
611
+ - \`directoriesCreated\`: list of directories created
612
+ - \`metaFilesCreated\`: list of meta files created (log.md, index, etc.)
613
+ - \`skillFilesGenerated\`: list of Claude Code skill files generated
614
+ - \`warnings\`: any warnings during initialization
615
+
616
+ 3. **Present results**
617
+
618
+ **If fresh init**:
619
+ \`\`\`
620
+ ## Vault Initialized
621
+
622
+ Created new vault at: <wikiPath>
623
+ - N directories created
624
+ - N meta files created
625
+ - N skill files generated
626
+
627
+ Next steps:
628
+ - Run \`/ows-propose\` to create your first Change
629
+ - Run \`/ows-query\` to search the vault
630
+ \`\`\`
631
+
632
+ **If extend** (existing directory):
633
+ \`\`\`
634
+ ## Vault Extended
635
+
636
+ Extended existing vault at: <wikiPath>
637
+ - N new directories added
638
+ - N meta files updated
639
+
640
+ Your existing notes are preserved.
641
+ \`\`\`
642
+
643
+ **Guardrails**
644
+ - If the vault already exists and --force is not used, the init will extend rather than overwrite
645
+ - Never destroy existing vault content
646
+ - Show warnings if any files were skipped`,
647
+ },
648
+ migrate: {
649
+ name: 'ows-migrate',
650
+ description: 'Migrate an existing OpenSpec project to open-wiki-spec format.',
651
+ instructions: `Migrate an existing OpenSpec project to open-wiki-spec format.
652
+
653
+ This converts an OpenSpec directory structure (\`openspec/changes/\`, \`openspec/specs/\`) to the open-wiki-spec flat wiki format (\`wiki/\`).
654
+
655
+ **Input**: Optionally specify the OpenSpec directory path after \`/ows-migrate\`. If omitted, the CLI will auto-detect \`openspec/\` in the current directory.
656
+
657
+ **Available flags**:
658
+ - \`--json\`: Output structured JSON result
659
+ - \`--dry-run\`: Show what would be migrated without writing files
660
+ - \`--skip-archive\`: Skip migrating archived changes
661
+
662
+ **Steps**
663
+
664
+ 1. **Always dry-run first**
665
+ \`\`\`bash
666
+ ows migrate --dry-run --json
667
+ # or with explicit path:
668
+ ows migrate <openspec-dir> --dry-run --json
669
+ \`\`\`
670
+
671
+ 2. **Parse the migration plan**
672
+
673
+ The dry-run returns a plan with:
674
+ - \`openspecPath\`: detected OpenSpec source directory
675
+ - \`wikiPath\`: target wiki directory
676
+ - \`steps\`: list of migration steps, each with:
677
+ - \`name\`: step name
678
+ - \`description\`: what it does
679
+ - \`outputs\`: files to create (with \`targetPath\` and \`sourceDescription\`)
680
+ - \`warnings\`: any issues detected
681
+ - \`totalFiles\`: total files to create
682
+ - \`totalWarnings\`: total warning count
683
+
684
+ 3. **Show the plan to the user**
685
+
686
+ Present a summary of what will be migrated:
687
+ \`\`\`
688
+ ## Migration Plan
689
+
690
+ **Source:** openspec/
691
+ **Target:** wiki/
692
+
693
+ Files to create: N
694
+ Warnings: M
695
+
696
+ ### Steps
697
+ 1. <step name> - <description> (N files)
698
+ 2. ...
699
+ \`\`\`
700
+
701
+ If there are warnings, show them prominently.
702
+ Ask the user to confirm before proceeding.
703
+
704
+ 4. **Execute migration (if confirmed)**
705
+ \`\`\`bash
706
+ ows migrate --json
707
+ \`\`\`
708
+
709
+ 5. **Show results**
710
+
711
+ Display:
712
+ - Files written
713
+ - Files skipped (already exist)
714
+ - Errors (if any)
715
+ - Warnings
716
+
717
+ Suggest running \`/ows-verify\` after migration to check vault consistency.
718
+
719
+ **Guardrails**
720
+ - Always dry-run before migrating
721
+ - Never overwrite existing files in the target wiki directory
722
+ - Show all warnings before proceeding
723
+ - After migration, suggest running \`/ows-verify\` to validate the result`,
724
+ },
725
+ };
726
+ /**
727
+ * Generate a skill markdown file.
728
+ */
729
+ export function generateSkillFile(skillDef) {
730
+ return `---
731
+ name: ${skillDef.name}
732
+ description: ${skillDef.description}
733
+ ---
734
+
735
+ ${skillDef.instructions}
736
+ `;
737
+ }
738
+ /**
739
+ * Write all skill files to the Claude Code commands directory.
740
+ */
741
+ export function writeAllSkillFiles(projectPath) {
742
+ const claudeDir = path.join(projectPath, '.claude', 'commands');
743
+ fs.mkdirSync(claudeDir, { recursive: true });
744
+ const generated = [];
745
+ for (const [workflowName, skillDef] of Object.entries(WORKFLOW_SKILLS)) {
746
+ const skillPath = path.join(claudeDir, `ows-${workflowName}.md`);
747
+ const content = generateSkillFile(skillDef);
748
+ fs.writeFileSync(skillPath, content);
749
+ generated.push(skillPath);
750
+ }
751
+ return generated;
752
+ }
753
+ //# sourceMappingURL=skill-generator.js.map