@kynetic-ai/spec 0.1.2 → 0.4.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 (540) hide show
  1. package/README.md +250 -17
  2. package/dist/acp/client.d.ts +18 -4
  3. package/dist/acp/client.d.ts.map +1 -1
  4. package/dist/acp/client.js +44 -26
  5. package/dist/acp/client.js.map +1 -1
  6. package/dist/acp/framing.d.ts +2 -2
  7. package/dist/acp/framing.d.ts.map +1 -1
  8. package/dist/acp/framing.js +37 -29
  9. package/dist/acp/framing.js.map +1 -1
  10. package/dist/acp/index.d.ts +6 -7
  11. package/dist/acp/index.d.ts.map +1 -1
  12. package/dist/acp/index.js +3 -3
  13. package/dist/acp/index.js.map +1 -1
  14. package/dist/acp/types.d.ts +5 -5
  15. package/dist/acp/types.d.ts.map +1 -1
  16. package/dist/acp/types.js +18 -18
  17. package/dist/acp/types.js.map +1 -1
  18. package/dist/agents/adapters.d.ts.map +1 -1
  19. package/dist/agents/adapters.js +24 -13
  20. package/dist/agents/adapters.js.map +1 -1
  21. package/dist/agents/index.d.ts +2 -2
  22. package/dist/agents/index.js +2 -2
  23. package/dist/agents/spawner.d.ts +4 -4
  24. package/dist/agents/spawner.d.ts.map +1 -1
  25. package/dist/agents/spawner.js +6 -6
  26. package/dist/agents/spawner.js.map +1 -1
  27. package/dist/cli/batch-context.d.ts +43 -0
  28. package/dist/cli/batch-context.d.ts.map +1 -0
  29. package/dist/cli/batch-context.js +93 -0
  30. package/dist/cli/batch-context.js.map +1 -0
  31. package/dist/cli/batch-exec.d.ts +107 -0
  32. package/dist/cli/batch-exec.d.ts.map +1 -0
  33. package/dist/cli/batch-exec.js +706 -0
  34. package/dist/cli/batch-exec.js.map +1 -0
  35. package/dist/cli/batch.d.ts +4 -2
  36. package/dist/cli/batch.d.ts.map +1 -1
  37. package/dist/cli/batch.js +15 -14
  38. package/dist/cli/batch.js.map +1 -1
  39. package/dist/cli/command-annotations.d.ts +23 -0
  40. package/dist/cli/command-annotations.d.ts.map +1 -0
  41. package/dist/cli/command-annotations.js +27 -0
  42. package/dist/cli/command-annotations.js.map +1 -0
  43. package/dist/cli/commands/agents.d.ts +46 -0
  44. package/dist/cli/commands/agents.d.ts.map +1 -0
  45. package/dist/cli/commands/agents.js +377 -0
  46. package/dist/cli/commands/agents.js.map +1 -0
  47. package/dist/cli/commands/batch.d.ts +20 -0
  48. package/dist/cli/commands/batch.d.ts.map +1 -0
  49. package/dist/cli/commands/batch.js +214 -0
  50. package/dist/cli/commands/batch.js.map +1 -0
  51. package/dist/cli/commands/clone-for-testing.d.ts +1 -1
  52. package/dist/cli/commands/clone-for-testing.d.ts.map +1 -1
  53. package/dist/cli/commands/clone-for-testing.js +37 -47
  54. package/dist/cli/commands/clone-for-testing.js.map +1 -1
  55. package/dist/cli/commands/derive.d.ts +1 -1
  56. package/dist/cli/commands/derive.d.ts.map +1 -1
  57. package/dist/cli/commands/derive.js +141 -88
  58. package/dist/cli/commands/derive.js.map +1 -1
  59. package/dist/cli/commands/doctor.d.ts +11 -0
  60. package/dist/cli/commands/doctor.d.ts.map +1 -0
  61. package/dist/cli/commands/doctor.js +152 -0
  62. package/dist/cli/commands/doctor.js.map +1 -0
  63. package/dist/cli/commands/export.d.ts +12 -0
  64. package/dist/cli/commands/export.d.ts.map +1 -0
  65. package/dist/cli/commands/export.js +134 -0
  66. package/dist/cli/commands/export.js.map +1 -0
  67. package/dist/cli/commands/help.d.ts +1 -1
  68. package/dist/cli/commands/help.d.ts.map +1 -1
  69. package/dist/cli/commands/help.js +163 -37
  70. package/dist/cli/commands/help.js.map +1 -1
  71. package/dist/cli/commands/inbox.d.ts +1 -1
  72. package/dist/cli/commands/inbox.d.ts.map +1 -1
  73. package/dist/cli/commands/inbox.js +178 -56
  74. package/dist/cli/commands/inbox.js.map +1 -1
  75. package/dist/cli/commands/index.d.ts +31 -19
  76. package/dist/cli/commands/index.d.ts.map +1 -1
  77. package/dist/cli/commands/index.js +31 -19
  78. package/dist/cli/commands/index.js.map +1 -1
  79. package/dist/cli/commands/init.d.ts +5 -1
  80. package/dist/cli/commands/init.d.ts.map +1 -1
  81. package/dist/cli/commands/init.js +108 -57
  82. package/dist/cli/commands/init.js.map +1 -1
  83. package/dist/cli/commands/item.d.ts +1 -1
  84. package/dist/cli/commands/item.d.ts.map +1 -1
  85. package/dist/cli/commands/item.js +557 -274
  86. package/dist/cli/commands/item.js.map +1 -1
  87. package/dist/cli/commands/link.d.ts +1 -1
  88. package/dist/cli/commands/link.d.ts.map +1 -1
  89. package/dist/cli/commands/link.js +55 -46
  90. package/dist/cli/commands/link.js.map +1 -1
  91. package/dist/cli/commands/log.d.ts +1 -1
  92. package/dist/cli/commands/log.d.ts.map +1 -1
  93. package/dist/cli/commands/log.js +58 -51
  94. package/dist/cli/commands/log.js.map +1 -1
  95. package/dist/cli/commands/merge-driver.d.ts +19 -0
  96. package/dist/cli/commands/merge-driver.d.ts.map +1 -0
  97. package/dist/cli/commands/merge-driver.js +398 -0
  98. package/dist/cli/commands/merge-driver.js.map +1 -0
  99. package/dist/cli/commands/meta.d.ts +1 -1
  100. package/dist/cli/commands/meta.d.ts.map +1 -1
  101. package/dist/cli/commands/meta.js +534 -399
  102. package/dist/cli/commands/meta.js.map +1 -1
  103. package/dist/cli/commands/module.d.ts +1 -1
  104. package/dist/cli/commands/module.d.ts.map +1 -1
  105. package/dist/cli/commands/module.js +30 -25
  106. package/dist/cli/commands/module.js.map +1 -1
  107. package/dist/cli/commands/plan-import.d.ts +11 -0
  108. package/dist/cli/commands/plan-import.d.ts.map +1 -0
  109. package/dist/cli/commands/plan-import.js +547 -0
  110. package/dist/cli/commands/plan-import.js.map +1 -0
  111. package/dist/cli/commands/plan.d.ts +10 -0
  112. package/dist/cli/commands/plan.d.ts.map +1 -0
  113. package/dist/cli/commands/plan.js +421 -0
  114. package/dist/cli/commands/plan.js.map +1 -0
  115. package/dist/cli/commands/ralph.d.ts +1 -1
  116. package/dist/cli/commands/ralph.d.ts.map +1 -1
  117. package/dist/cli/commands/ralph.js +1109 -170
  118. package/dist/cli/commands/ralph.js.map +1 -1
  119. package/dist/cli/commands/refs.d.ts +13 -0
  120. package/dist/cli/commands/refs.d.ts.map +1 -0
  121. package/dist/cli/commands/refs.js +283 -0
  122. package/dist/cli/commands/refs.js.map +1 -0
  123. package/dist/cli/commands/search.d.ts +1 -1
  124. package/dist/cli/commands/search.d.ts.map +1 -1
  125. package/dist/cli/commands/search.js +199 -37
  126. package/dist/cli/commands/search.js.map +1 -1
  127. package/dist/cli/commands/serve.d.ts +10 -0
  128. package/dist/cli/commands/serve.d.ts.map +1 -0
  129. package/dist/cli/commands/serve.js +491 -0
  130. package/dist/cli/commands/serve.js.map +1 -0
  131. package/dist/cli/commands/session.d.ts +25 -6
  132. package/dist/cli/commands/session.d.ts.map +1 -1
  133. package/dist/cli/commands/session.js +810 -127
  134. package/dist/cli/commands/session.js.map +1 -1
  135. package/dist/cli/commands/setup-seeding.d.ts +81 -0
  136. package/dist/cli/commands/setup-seeding.d.ts.map +1 -0
  137. package/dist/cli/commands/setup-seeding.js +292 -0
  138. package/dist/cli/commands/setup-seeding.js.map +1 -0
  139. package/dist/cli/commands/setup.d.ts +77 -3
  140. package/dist/cli/commands/setup.d.ts.map +1 -1
  141. package/dist/cli/commands/setup.js +1267 -274
  142. package/dist/cli/commands/setup.js.map +1 -1
  143. package/dist/cli/commands/shadow.d.ts +1 -1
  144. package/dist/cli/commands/shadow.d.ts.map +1 -1
  145. package/dist/cli/commands/shadow.js +70 -50
  146. package/dist/cli/commands/shadow.js.map +1 -1
  147. package/dist/cli/commands/skill-crud.d.ts +58 -0
  148. package/dist/cli/commands/skill-crud.d.ts.map +1 -0
  149. package/dist/cli/commands/skill-crud.js +753 -0
  150. package/dist/cli/commands/skill-crud.js.map +1 -0
  151. package/dist/cli/commands/skill-diff.d.ts +27 -0
  152. package/dist/cli/commands/skill-diff.d.ts.map +1 -0
  153. package/dist/cli/commands/skill-diff.js +840 -0
  154. package/dist/cli/commands/skill-diff.js.map +1 -0
  155. package/dist/cli/commands/skill-install.d.ts +56 -0
  156. package/dist/cli/commands/skill-install.d.ts.map +1 -0
  157. package/dist/cli/commands/skill-install.js +509 -0
  158. package/dist/cli/commands/skill-install.js.map +1 -0
  159. package/dist/cli/commands/skill.d.ts +20 -0
  160. package/dist/cli/commands/skill.d.ts.map +1 -0
  161. package/dist/cli/commands/skill.js +36 -0
  162. package/dist/cli/commands/skill.js.map +1 -0
  163. package/dist/cli/commands/task.d.ts +1 -1
  164. package/dist/cli/commands/task.d.ts.map +1 -1
  165. package/dist/cli/commands/task.js +584 -350
  166. package/dist/cli/commands/task.js.map +1 -1
  167. package/dist/cli/commands/tasks.d.ts +26 -1
  168. package/dist/cli/commands/tasks.d.ts.map +1 -1
  169. package/dist/cli/commands/tasks.js +225 -122
  170. package/dist/cli/commands/tasks.js.map +1 -1
  171. package/dist/cli/commands/trait.d.ts +1 -1
  172. package/dist/cli/commands/trait.d.ts.map +1 -1
  173. package/dist/cli/commands/trait.js +166 -101
  174. package/dist/cli/commands/trait.js.map +1 -1
  175. package/dist/cli/commands/triage.d.ts +7 -0
  176. package/dist/cli/commands/triage.d.ts.map +1 -0
  177. package/dist/cli/commands/triage.js +483 -0
  178. package/dist/cli/commands/triage.js.map +1 -0
  179. package/dist/cli/commands/util.d.ts +7 -0
  180. package/dist/cli/commands/util.d.ts.map +1 -0
  181. package/dist/cli/commands/util.js +30 -0
  182. package/dist/cli/commands/util.js.map +1 -0
  183. package/dist/cli/commands/validate.d.ts +1 -1
  184. package/dist/cli/commands/validate.d.ts.map +1 -1
  185. package/dist/cli/commands/validate.js +264 -83
  186. package/dist/cli/commands/validate.js.map +1 -1
  187. package/dist/cli/commands/workflow.d.ts +16 -0
  188. package/dist/cli/commands/workflow.d.ts.map +1 -0
  189. package/dist/cli/commands/workflow.js +851 -0
  190. package/dist/cli/commands/workflow.js.map +1 -0
  191. package/dist/cli/exit-codes.d.ts +7 -0
  192. package/dist/cli/exit-codes.d.ts.map +1 -1
  193. package/dist/cli/exit-codes.js +26 -18
  194. package/dist/cli/exit-codes.js.map +1 -1
  195. package/dist/cli/help/content.d.ts.map +1 -1
  196. package/dist/cli/help/content.js +86 -71
  197. package/dist/cli/help/content.js.map +1 -1
  198. package/dist/cli/index.d.ts +1 -1
  199. package/dist/cli/index.d.ts.map +1 -1
  200. package/dist/cli/index.js +131 -19
  201. package/dist/cli/index.js.map +1 -1
  202. package/dist/cli/introspection.d.ts +6 -2
  203. package/dist/cli/introspection.d.ts.map +1 -1
  204. package/dist/cli/introspection.js +11 -8
  205. package/dist/cli/introspection.js.map +1 -1
  206. package/dist/cli/output.d.ts +64 -4
  207. package/dist/cli/output.d.ts.map +1 -1
  208. package/dist/cli/output.js +237 -85
  209. package/dist/cli/output.js.map +1 -1
  210. package/dist/cli/parse-utils.d.ts +21 -0
  211. package/dist/cli/parse-utils.d.ts.map +1 -0
  212. package/dist/cli/parse-utils.js +32 -0
  213. package/dist/cli/parse-utils.js.map +1 -0
  214. package/dist/cli/pid-utils.d.ts +72 -0
  215. package/dist/cli/pid-utils.d.ts.map +1 -0
  216. package/dist/cli/pid-utils.js +174 -0
  217. package/dist/cli/pid-utils.js.map +1 -0
  218. package/dist/cli/suggest.d.ts.map +1 -1
  219. package/dist/cli/suggest.js +1 -2
  220. package/dist/cli/suggest.js.map +1 -1
  221. package/dist/cli/validators.d.ts +43 -0
  222. package/dist/cli/validators.d.ts.map +1 -0
  223. package/dist/cli/validators.js +84 -0
  224. package/dist/cli/validators.js.map +1 -0
  225. package/dist/daemon/index.ts +52 -0
  226. package/dist/daemon/middleware/project-context.ts +126 -0
  227. package/dist/daemon/pid.ts +179 -0
  228. package/dist/daemon/project-context.ts +343 -0
  229. package/dist/daemon/routes/inbox.ts +164 -0
  230. package/dist/daemon/routes/items.ts +322 -0
  231. package/dist/daemon/routes/meta.ts +118 -0
  232. package/dist/daemon/routes/projects.ts +162 -0
  233. package/dist/daemon/routes/tasks.ts +327 -0
  234. package/dist/daemon/routes/triage.ts +402 -0
  235. package/dist/daemon/routes/validation.ts +248 -0
  236. package/dist/daemon/server.ts +408 -0
  237. package/dist/daemon/watcher.ts +195 -0
  238. package/dist/daemon/websocket/handler.ts +138 -0
  239. package/dist/daemon/websocket/heartbeat.ts +71 -0
  240. package/dist/daemon/websocket/pubsub.ts +125 -0
  241. package/dist/daemon/websocket/types.ts +66 -0
  242. package/dist/export/html.d.ts +19 -0
  243. package/dist/export/html.d.ts.map +1 -0
  244. package/dist/export/html.js +239 -0
  245. package/dist/export/html.js.map +1 -0
  246. package/dist/export/index.d.ts +10 -0
  247. package/dist/export/index.d.ts.map +1 -0
  248. package/dist/export/index.js +10 -0
  249. package/dist/export/index.js.map +1 -0
  250. package/dist/export/json.d.ts +24 -0
  251. package/dist/export/json.d.ts.map +1 -0
  252. package/dist/export/json.js +198 -0
  253. package/dist/export/json.js.map +1 -0
  254. package/dist/export/triage.d.ts +51 -0
  255. package/dist/export/triage.d.ts.map +1 -0
  256. package/dist/export/triage.js +83 -0
  257. package/dist/export/triage.js.map +1 -0
  258. package/dist/export/types.d.ts +122 -0
  259. package/dist/export/types.d.ts.map +1 -0
  260. package/dist/export/types.js +9 -0
  261. package/dist/export/types.js.map +1 -0
  262. package/dist/index.d.ts +2 -2
  263. package/dist/index.js +2 -2
  264. package/dist/lib/claude-plugin-registry.d.ts +66 -0
  265. package/dist/lib/claude-plugin-registry.d.ts.map +1 -0
  266. package/dist/lib/claude-plugin-registry.js +318 -0
  267. package/dist/lib/claude-plugin-registry.js.map +1 -0
  268. package/dist/merge/arrays.d.ts +87 -0
  269. package/dist/merge/arrays.d.ts.map +1 -0
  270. package/dist/merge/arrays.js +164 -0
  271. package/dist/merge/arrays.js.map +1 -0
  272. package/dist/merge/file-type.d.ts +32 -0
  273. package/dist/merge/file-type.d.ts.map +1 -0
  274. package/dist/merge/file-type.js +70 -0
  275. package/dist/merge/file-type.js.map +1 -0
  276. package/dist/merge/index.d.ts +14 -0
  277. package/dist/merge/index.d.ts.map +1 -0
  278. package/dist/merge/index.js +11 -0
  279. package/dist/merge/index.js.map +1 -0
  280. package/dist/merge/objects.d.ts +46 -0
  281. package/dist/merge/objects.d.ts.map +1 -0
  282. package/dist/merge/objects.js +193 -0
  283. package/dist/merge/objects.js.map +1 -0
  284. package/dist/merge/parse.d.ts +23 -0
  285. package/dist/merge/parse.d.ts.map +1 -0
  286. package/dist/merge/parse.js +78 -0
  287. package/dist/merge/parse.js.map +1 -0
  288. package/dist/merge/resolve.d.ts +66 -0
  289. package/dist/merge/resolve.d.ts.map +1 -0
  290. package/dist/merge/resolve.js +189 -0
  291. package/dist/merge/resolve.js.map +1 -0
  292. package/dist/merge/types.d.ts +82 -0
  293. package/dist/merge/types.d.ts.map +1 -0
  294. package/dist/merge/types.js +8 -0
  295. package/dist/merge/types.js.map +1 -0
  296. package/dist/parser/agent-data-sections.d.ts +53 -0
  297. package/dist/parser/agent-data-sections.d.ts.map +1 -0
  298. package/dist/parser/agent-data-sections.js +118 -0
  299. package/dist/parser/agent-data-sections.js.map +1 -0
  300. package/dist/parser/alignment.d.ts +4 -4
  301. package/dist/parser/alignment.d.ts.map +1 -1
  302. package/dist/parser/alignment.js +27 -22
  303. package/dist/parser/alignment.js.map +1 -1
  304. package/dist/parser/assess.d.ts +5 -5
  305. package/dist/parser/assess.d.ts.map +1 -1
  306. package/dist/parser/assess.js +36 -32
  307. package/dist/parser/assess.js.map +1 -1
  308. package/dist/parser/config.d.ts +457 -0
  309. package/dist/parser/config.d.ts.map +1 -0
  310. package/dist/parser/config.js +373 -0
  311. package/dist/parser/config.js.map +1 -0
  312. package/dist/parser/convention-validation.d.ts +1 -1
  313. package/dist/parser/convention-validation.d.ts.map +1 -1
  314. package/dist/parser/convention-validation.js +21 -16
  315. package/dist/parser/convention-validation.js.map +1 -1
  316. package/dist/parser/coverage-cache.d.ts +49 -0
  317. package/dist/parser/coverage-cache.d.ts.map +1 -0
  318. package/dist/parser/coverage-cache.js +123 -0
  319. package/dist/parser/coverage-cache.js.map +1 -0
  320. package/dist/parser/daemon-status.d.ts +37 -0
  321. package/dist/parser/daemon-status.d.ts.map +1 -0
  322. package/dist/parser/daemon-status.js +67 -0
  323. package/dist/parser/daemon-status.js.map +1 -0
  324. package/dist/parser/doctor.d.ts +107 -0
  325. package/dist/parser/doctor.d.ts.map +1 -0
  326. package/dist/parser/doctor.js +366 -0
  327. package/dist/parser/doctor.js.map +1 -0
  328. package/dist/parser/fix.d.ts +1 -1
  329. package/dist/parser/fix.d.ts.map +1 -1
  330. package/dist/parser/fix.js +31 -27
  331. package/dist/parser/fix.js.map +1 -1
  332. package/dist/parser/index.d.ts +16 -11
  333. package/dist/parser/index.d.ts.map +1 -1
  334. package/dist/parser/index.js +16 -11
  335. package/dist/parser/index.js.map +1 -1
  336. package/dist/parser/items.d.ts +8 -2
  337. package/dist/parser/items.d.ts.map +1 -1
  338. package/dist/parser/items.js +71 -35
  339. package/dist/parser/items.js.map +1 -1
  340. package/dist/parser/meta.d.ts +167 -9
  341. package/dist/parser/meta.d.ts.map +1 -1
  342. package/dist/parser/meta.js +379 -46
  343. package/dist/parser/meta.js.map +1 -1
  344. package/dist/parser/plan-document.d.ts +197 -0
  345. package/dist/parser/plan-document.d.ts.map +1 -0
  346. package/dist/parser/plan-document.js +341 -0
  347. package/dist/parser/plan-document.js.map +1 -0
  348. package/dist/parser/plans.d.ts +59 -0
  349. package/dist/parser/plans.d.ts.map +1 -0
  350. package/dist/parser/plans.js +239 -0
  351. package/dist/parser/plans.js.map +1 -0
  352. package/dist/parser/refs.d.ts +22 -9
  353. package/dist/parser/refs.d.ts.map +1 -1
  354. package/dist/parser/refs.js +102 -50
  355. package/dist/parser/refs.js.map +1 -1
  356. package/dist/parser/setup-status.d.ts +71 -0
  357. package/dist/parser/setup-status.d.ts.map +1 -0
  358. package/dist/parser/setup-status.js +269 -0
  359. package/dist/parser/setup-status.js.map +1 -0
  360. package/dist/parser/shadow.d.ts +150 -19
  361. package/dist/parser/shadow.d.ts.map +1 -1
  362. package/dist/parser/shadow.js +548 -187
  363. package/dist/parser/shadow.js.map +1 -1
  364. package/dist/parser/skill-render.d.ts +317 -0
  365. package/dist/parser/skill-render.d.ts.map +1 -0
  366. package/dist/parser/skill-render.js +943 -0
  367. package/dist/parser/skill-render.js.map +1 -0
  368. package/dist/parser/traits.d.ts +3 -3
  369. package/dist/parser/traits.d.ts.map +1 -1
  370. package/dist/parser/traits.js +2 -2
  371. package/dist/parser/traits.js.map +1 -1
  372. package/dist/parser/validate-skills.d.ts +32 -0
  373. package/dist/parser/validate-skills.d.ts.map +1 -0
  374. package/dist/parser/validate-skills.js +202 -0
  375. package/dist/parser/validate-skills.js.map +1 -0
  376. package/dist/parser/validate.d.ts +45 -3
  377. package/dist/parser/validate.d.ts.map +1 -1
  378. package/dist/parser/validate.js +622 -105
  379. package/dist/parser/validate.js.map +1 -1
  380. package/dist/parser/yaml.d.ts +83 -19
  381. package/dist/parser/yaml.d.ts.map +1 -1
  382. package/dist/parser/yaml.js +478 -173
  383. package/dist/parser/yaml.js.map +1 -1
  384. package/dist/ralph/cli-renderer.d.ts +8 -1
  385. package/dist/ralph/cli-renderer.d.ts.map +1 -1
  386. package/dist/ralph/cli-renderer.js +105 -34
  387. package/dist/ralph/cli-renderer.js.map +1 -1
  388. package/dist/ralph/events.d.ts +10 -10
  389. package/dist/ralph/events.d.ts.map +1 -1
  390. package/dist/ralph/events.js +301 -98
  391. package/dist/ralph/events.js.map +1 -1
  392. package/dist/ralph/index.d.ts +5 -2
  393. package/dist/ralph/index.d.ts.map +1 -1
  394. package/dist/ralph/index.js +9 -3
  395. package/dist/ralph/index.js.map +1 -1
  396. package/dist/ralph/loop-errors.d.ts +83 -0
  397. package/dist/ralph/loop-errors.d.ts.map +1 -0
  398. package/dist/ralph/loop-errors.js +150 -0
  399. package/dist/ralph/loop-errors.js.map +1 -0
  400. package/dist/ralph/subagent.d.ts +94 -0
  401. package/dist/ralph/subagent.d.ts.map +1 -0
  402. package/dist/ralph/subagent.js +193 -0
  403. package/dist/ralph/subagent.js.map +1 -0
  404. package/dist/ralph/wrap-up.d.ts +125 -0
  405. package/dist/ralph/wrap-up.d.ts.map +1 -0
  406. package/dist/ralph/wrap-up.js +270 -0
  407. package/dist/ralph/wrap-up.js.map +1 -0
  408. package/dist/schema/batch.d.ts +97 -0
  409. package/dist/schema/batch.d.ts.map +1 -0
  410. package/dist/schema/batch.js +24 -0
  411. package/dist/schema/batch.js.map +1 -0
  412. package/dist/schema/common.d.ts +8 -2
  413. package/dist/schema/common.d.ts.map +1 -1
  414. package/dist/schema/common.js +42 -31
  415. package/dist/schema/common.js.map +1 -1
  416. package/dist/schema/inbox.d.ts +12 -12
  417. package/dist/schema/inbox.js +4 -4
  418. package/dist/schema/inbox.js.map +1 -1
  419. package/dist/schema/index.d.ts +8 -5
  420. package/dist/schema/index.d.ts.map +1 -1
  421. package/dist/schema/index.js +8 -5
  422. package/dist/schema/index.js.map +1 -1
  423. package/dist/schema/meta.d.ts +1454 -27
  424. package/dist/schema/meta.d.ts.map +1 -1
  425. package/dist/schema/meta.js +198 -21
  426. package/dist/schema/meta.js.map +1 -1
  427. package/dist/schema/plan.d.ts +285 -0
  428. package/dist/schema/plan.d.ts.map +1 -0
  429. package/dist/schema/plan.js +81 -0
  430. package/dist/schema/plan.js.map +1 -0
  431. package/dist/schema/spec.d.ts +72 -33
  432. package/dist/schema/spec.d.ts.map +1 -1
  433. package/dist/schema/spec.js +22 -9
  434. package/dist/schema/spec.js.map +1 -1
  435. package/dist/schema/task.d.ts +172 -161
  436. package/dist/schema/task.d.ts.map +1 -1
  437. package/dist/schema/task.js +21 -12
  438. package/dist/schema/task.js.map +1 -1
  439. package/dist/schema/triage.d.ts +266 -0
  440. package/dist/schema/triage.d.ts.map +1 -0
  441. package/dist/schema/triage.js +134 -0
  442. package/dist/schema/triage.js.map +1 -0
  443. package/dist/sessions/index.d.ts +2 -2
  444. package/dist/sessions/index.d.ts.map +1 -1
  445. package/dist/sessions/index.js +3 -3
  446. package/dist/sessions/index.js.map +1 -1
  447. package/dist/sessions/store.d.ts +241 -1
  448. package/dist/sessions/store.d.ts.map +1 -1
  449. package/dist/sessions/store.js +810 -31
  450. package/dist/sessions/store.js.map +1 -1
  451. package/dist/sessions/types.d.ts +10 -10
  452. package/dist/sessions/types.d.ts.map +1 -1
  453. package/dist/sessions/types.js +10 -9
  454. package/dist/sessions/types.js.map +1 -1
  455. package/dist/strings/errors.d.ts +55 -0
  456. package/dist/strings/errors.d.ts.map +1 -1
  457. package/dist/strings/errors.js +138 -106
  458. package/dist/strings/errors.js.map +1 -1
  459. package/dist/strings/guidance.d.ts.map +1 -1
  460. package/dist/strings/guidance.js +16 -16
  461. package/dist/strings/guidance.js.map +1 -1
  462. package/dist/strings/index.d.ts +4 -4
  463. package/dist/strings/index.d.ts.map +1 -1
  464. package/dist/strings/index.js +4 -4
  465. package/dist/strings/index.js.map +1 -1
  466. package/dist/strings/labels.d.ts +4 -0
  467. package/dist/strings/labels.d.ts.map +1 -1
  468. package/dist/strings/labels.js +45 -41
  469. package/dist/strings/labels.js.map +1 -1
  470. package/dist/strings/validation.d.ts.map +1 -1
  471. package/dist/strings/validation.js +71 -71
  472. package/dist/strings/validation.js.map +1 -1
  473. package/dist/triage/actions.d.ts +27 -0
  474. package/dist/triage/actions.d.ts.map +1 -0
  475. package/dist/triage/actions.js +95 -0
  476. package/dist/triage/actions.js.map +1 -0
  477. package/dist/triage/constants.d.ts +6 -0
  478. package/dist/triage/constants.d.ts.map +1 -0
  479. package/dist/triage/constants.js +7 -0
  480. package/dist/triage/constants.js.map +1 -0
  481. package/dist/triage/index.d.ts +3 -0
  482. package/dist/triage/index.d.ts.map +1 -0
  483. package/dist/triage/index.js +3 -0
  484. package/dist/triage/index.js.map +1 -0
  485. package/dist/utils/commit.d.ts +1 -1
  486. package/dist/utils/commit.d.ts.map +1 -1
  487. package/dist/utils/commit.js +28 -26
  488. package/dist/utils/commit.js.map +1 -1
  489. package/dist/utils/git.d.ts +1 -1
  490. package/dist/utils/git.d.ts.map +1 -1
  491. package/dist/utils/git.js +40 -38
  492. package/dist/utils/git.js.map +1 -1
  493. package/dist/utils/grep.js +11 -11
  494. package/dist/utils/grep.js.map +1 -1
  495. package/dist/utils/index.d.ts +7 -7
  496. package/dist/utils/index.d.ts.map +1 -1
  497. package/dist/utils/index.js +4 -4
  498. package/dist/utils/index.js.map +1 -1
  499. package/dist/utils/time.d.ts.map +1 -1
  500. package/dist/utils/time.js +10 -10
  501. package/dist/utils/time.js.map +1 -1
  502. package/package.json +28 -5
  503. package/plugin/.claude-plugin/marketplace.json +17 -0
  504. package/plugin/.claude-plugin/plugin.json +5 -0
  505. package/plugin/plugins/kspec/skills/create-workflow/SKILL.md +235 -0
  506. package/plugin/plugins/kspec/skills/help/SKILL.md +42 -0
  507. package/plugin/plugins/kspec/skills/observations/SKILL.md +143 -0
  508. package/plugin/plugins/kspec/skills/plan/SKILL.md +343 -0
  509. package/plugin/plugins/kspec/skills/reflect/SKILL.md +161 -0
  510. package/plugin/plugins/kspec/skills/review/SKILL.md +193 -0
  511. package/plugin/plugins/kspec/skills/task-work/SKILL.md +303 -0
  512. package/plugin/plugins/kspec/skills/triage/SKILL.md +206 -0
  513. package/plugin/plugins/kspec/skills/triage/docs/automation.md +120 -0
  514. package/plugin/plugins/kspec/skills/triage/docs/inbox.md +144 -0
  515. package/plugin/plugins/kspec/skills/triage/docs/observations.md +85 -0
  516. package/plugin/plugins/kspec/skills/triage-automation/SKILL.md +140 -0
  517. package/plugin/plugins/kspec/skills/triage-inbox/SKILL.md +232 -0
  518. package/plugin/plugins/kspec/skills/writing-specs/SKILL.md +340 -0
  519. package/templates/agents-sections/01-quick-start.md +22 -0
  520. package/templates/agents-sections/02-shadow-branch.md +34 -0
  521. package/templates/agents-sections/03-task-lifecycle.md +48 -0
  522. package/templates/agents-sections/04-pr-workflow.md +17 -0
  523. package/templates/agents-sections/05-commit-convention.md +27 -0
  524. package/templates/agents-sections/06-ralph-loop.md +45 -0
  525. package/templates/hooks/pre-commit +34 -0
  526. package/templates/skills/create-workflow/SKILL.md +228 -0
  527. package/templates/skills/help/SKILL.md +37 -0
  528. package/templates/skills/manifest.yaml +60 -0
  529. package/templates/skills/observations/SKILL.md +137 -0
  530. package/templates/skills/plan/SKILL.md +336 -0
  531. package/templates/skills/reflect/SKILL.md +155 -0
  532. package/templates/skills/review/SKILL.md +186 -0
  533. package/templates/skills/task-work/SKILL.md +296 -0
  534. package/templates/skills/triage/SKILL.md +199 -0
  535. package/templates/skills/triage/docs/automation.md +120 -0
  536. package/templates/skills/triage/docs/inbox.md +144 -0
  537. package/templates/skills/triage/docs/observations.md +85 -0
  538. package/templates/skills/triage-automation/SKILL.md +134 -0
  539. package/templates/skills/triage-inbox/SKILL.md +225 -0
  540. package/templates/skills/writing-specs/SKILL.md +333 -0
@@ -0,0 +1,336 @@
1
+ # Plan to Spec Translation
2
+
3
+ Translate approved plans into specs and tasks. Plans are durable artifacts — they persist in the shadow branch, link to derived work, and provide auditable planning history across sessions.
4
+
5
+ ## When to Use
6
+
7
+ - After plan mode approval — turning an approved plan into trackable specs and tasks
8
+ - Creating specs for new features or multi-spec capabilities
9
+ - Translating design documents into the spec hierarchy
10
+
11
+ **Not for:** Raw ideas (use `kspec inbox add`), single spec creation (use `/kspec:writing-specs`), or triage (use `/kspec:triage`).
12
+
13
+ ## Two Paths
14
+
15
+ ### Import Path (Recommended for 3+ Specs)
16
+
17
+ Write a structured markdown document, then import it. All specs, tasks, and notes created atomically.
18
+
19
+ ```bash
20
+ kspec plan import ./plan.md --module @target-module --dry-run # Preview
21
+ kspec plan import ./plan.md --module @target-module # Execute
22
+ ```
23
+
24
+ ### Manual Path (1-2 Specs)
25
+
26
+ Create plan record and specs incrementally via CLI.
27
+
28
+ ```bash
29
+ kspec plan add --title "Plan Title" --content "Description" --status approved
30
+ kspec item add --under @parent --title "Feature" --type feature --slug slug
31
+ kspec item ac add @slug --given "..." --when "..." --then "..."
32
+ kspec derive @slug
33
+ ```
34
+
35
+ ### When to Use Which
36
+
37
+ | Situation | Path |
38
+ |-----------|------|
39
+ | Plan mode just approved, complex feature | Import |
40
+ | Adding a requirement to existing feature | Manual |
41
+ | Multiple related specs with parent/child | Import |
42
+ | Quick bug fix that needs spec coverage | Manual |
43
+ | Translating design doc with many specs | Import |
44
+ | Iterating on previously imported plan | Import (`--update`) |
45
+
46
+ ## Three-Phase Workflow
47
+
48
+ ### Phase 1: Design
49
+
50
+ Always start here — never skip research.
51
+
52
+ ```bash
53
+ kspec workflow start @spec-plan-design
54
+ ```
55
+
56
+ 1. **Explore** — Read relevant code, understand current state
57
+ 2. **Clarify** — Identify ambiguities, resolve with user
58
+ 3. **Design** — Spec structure, AC coverage, trait selection
59
+ 4. **Review** — Check for completeness and gaps
60
+
61
+ Design concludes by choosing import or manual path.
62
+
63
+ ### Phase 2: Execute
64
+
65
+ Run the chosen workflow:
66
+
67
+ ```bash
68
+ # Import path
69
+ kspec workflow start @spec-plan-import
70
+
71
+ # Manual path
72
+ kspec workflow start @spec-plan-manual
73
+ ```
74
+
75
+ ### Phase 3: Validate
76
+
77
+ After creating specs:
78
+
79
+ ```bash
80
+ kspec validate # Check spec quality
81
+ kspec validate --alignment # Verify spec-task links
82
+ ```
83
+
84
+ ## Plan Document Format
85
+
86
+ The import parser extracts specs, tasks, and notes from this markdown structure:
87
+
88
+ ````markdown
89
+ # Plan Title
90
+
91
+ ## Specs
92
+
93
+ ```yaml
94
+ - title: OAuth Provider Support
95
+ slug: oauth-provider
96
+ type: feature
97
+ parent: "@auth"
98
+ description: Support third-party OAuth providers for authentication
99
+ traits:
100
+ - trait-error-guidance
101
+ acceptance_criteria:
102
+ - id: ac-1
103
+ given: User clicks sign-in with Google
104
+ when: OAuth flow completes successfully
105
+ then: User session is created with provider metadata
106
+ - id: ac-2
107
+ given: OAuth provider returns an error
108
+ when: Error callback is received
109
+ then: User sees descriptive error with retry option
110
+ implementation_notes: |
111
+ Use passport.js for OAuth. Per-spec notes go to this spec's derived task.
112
+
113
+ - title: Token Refresh
114
+ slug: token-refresh
115
+ type: requirement
116
+ parent: "@oauth-provider"
117
+ acceptance_criteria:
118
+ - id: ac-1
119
+ given: Access token is within 5 minutes of expiry
120
+ when: User makes an API request
121
+ then: Token is silently refreshed before the request proceeds
122
+ ```
123
+
124
+ ## Tasks
125
+
126
+ derive_from_specs: true
127
+
128
+ ```yaml
129
+ - title: Write migration guide
130
+ slug: migration-guide
131
+ priority: 2
132
+ tags:
133
+ - docs
134
+ ```
135
+
136
+ ## Implementation Notes
137
+
138
+ General architecture notes. Attached to the plan record.
139
+ Use passport.js for OAuth, following existing auth patterns.
140
+ ````
141
+
142
+ ### Section Reference
143
+
144
+ | Section | Content | Notes |
145
+ |---------|---------|-------|
146
+ | `## Specs` | YAML code block — array of spec objects | **Must** use fenced code block (triple-backtick yaml) |
147
+ | `## Tasks` | `derive_from_specs: true` + optional manual tasks | Manual tasks get `plan_ref` but no `spec_ref` |
148
+ | `## Implementation Notes` | Plain text | Attached to plan record; per-spec notes use `implementation_notes` field |
149
+
150
+ ### Spec Fields
151
+
152
+ | Field | Required | Description |
153
+ |-------|----------|-------------|
154
+ | `title` | Yes | Spec title |
155
+ | `slug` | No | Human-friendly ID (auto-generated if omitted) |
156
+ | `type` | No | `feature`, `requirement`, `constraint`, `decision` (default: `feature`) |
157
+ | `parent` | No | Parent ref (e.g., `"@parent-slug"`) |
158
+ | `description` | No | What and why |
159
+ | `acceptance_criteria` | No | Array of `{id, given, when, then}` |
160
+ | `traits` | No | Array of trait slugs (e.g., `trait-json-output`) |
161
+ | `implementation_notes` | No | Scoped to this spec's derived task |
162
+
163
+ ## Trait Selection
164
+
165
+ Before writing specs, review available traits:
166
+
167
+ ```bash
168
+ kspec trait list
169
+ kspec trait get @trait-json-output # See inherited ACs
170
+ ```
171
+
172
+ ### Common Trait Applications
173
+
174
+ | Building... | Consider these traits |
175
+ |-------------|---------------------|
176
+ | CLI command with output | `@trait-json-output`, `@trait-semantic-exit-codes` |
177
+ | Destructive operation | `@trait-confirmation-prompt`, `@trait-dry-run` |
178
+ | List/search command | `@trait-filterable-list`, `@trait-json-output` |
179
+ | Shadow branch mutation | `@trait-shadow-commit` |
180
+ | User-facing error paths | `@trait-error-guidance` |
181
+ | Batch operations | `@trait-multi-ref-batch` |
182
+ | API endpoint | `@trait-api-endpoint`, `@trait-localhost-security` |
183
+ | WebSocket feature | `@trait-websocket-protocol` |
184
+
185
+ ### Trait Naming in Plan Documents
186
+
187
+ Use the **full trait slug** — import only auto-prefixes `@`, not `@trait-`:
188
+
189
+ ```yaml
190
+ # Wrong — resolves to nonexistent item
191
+ traits:
192
+ - json-output
193
+
194
+ # Correct — full slug
195
+ traits:
196
+ - trait-json-output
197
+ ```
198
+
199
+ ## YAML Pitfalls
200
+
201
+ Plan documents embed YAML that is parsed as structured data. Common issues:
202
+
203
+ ### Block Scalars for Complex Text
204
+
205
+ Use `|` (literal block scalar) when AC text contains quotes, colons, or special characters:
206
+
207
+ ```yaml
208
+ # Problem — mixed quoting breaks parser
209
+ acceptance_criteria:
210
+ - id: ac-1
211
+ when: "kspec foo" is run
212
+
213
+ # Solution — block scalar preserves content literally
214
+ acceptance_criteria:
215
+ - id: ac-1
216
+ when: |
217
+ "kspec foo" is run
218
+ ```
219
+
220
+ ### Colons in Values
221
+
222
+ YAML treats `: ` (colon-space) as a key-value separator:
223
+
224
+ ```yaml
225
+ # Problem — parsed as nested key
226
+ then: output shows time: 10:30
227
+
228
+ # Solution — quote the value
229
+ then: "output shows time: 10:30"
230
+ ```
231
+
232
+ ### Best Practice
233
+
234
+ Use block scalars (`|`) for ALL given/when/then text. This avoids every quoting issue:
235
+
236
+ ```yaml
237
+ acceptance_criteria:
238
+ - id: ac-1
239
+ given: |
240
+ user has an existing session
241
+ when: |
242
+ user runs "kspec session start"
243
+ then: |
244
+ session context shows: active tasks, recent notes, inbox count
245
+ ```
246
+
247
+ ## Always Dry-Run First
248
+
249
+ ```bash
250
+ kspec plan import ./plan.md --module @target --dry-run
251
+ ```
252
+
253
+ Dry-run catches:
254
+ - YAML syntax errors before partial state is created
255
+ - Missing parent refs
256
+ - Invalid trait references
257
+ - Duplicate slugs
258
+
259
+ ## Post-Import Checklist
260
+
261
+ After importing, verify the results:
262
+
263
+ ```bash
264
+ # Verify each spec has ACs
265
+ kspec item get @spec-slug
266
+
267
+ # Check trait coverage
268
+ kspec validate
269
+
270
+ # Set task dependencies (import doesn't infer these)
271
+ kspec task set @task-slug --depends-on @other-task
272
+
273
+ # Review plan record
274
+ kspec plan get @plan-slug
275
+ ```
276
+
277
+ ## Plan Lifecycle
278
+
279
+ ```
280
+ draft → approved → active → completed
281
+
282
+ rejected
283
+ ```
284
+
285
+ - **Import** auto-creates plan as `active`
286
+ - **Manual** creates plan as `approved`
287
+ - Mark completed when all derived work is done:
288
+
289
+ ```bash
290
+ kspec plan set @plan --status completed
291
+ ```
292
+
293
+ ## Programmatic Alternative: Batch
294
+
295
+ For fully programmatic creation (scripts, agent pipelines):
296
+
297
+ ```bash
298
+ kspec batch --commands '[
299
+ {"command":"item add","args":{"under":"@parent","title":"Feature X","type":"feature","slug":"feature-x"}},
300
+ {"command":"item ac add","args":{"ref":"@feature-x","given":"...","when":"...","then":"..."}},
301
+ {"command":"derive","args":{"ref":"@feature-x"}}
302
+ ]'
303
+ ```
304
+
305
+ Atomic — all succeed or all roll back. Use `--dry-run` to preview.
306
+
307
+ ## Command Reference
308
+
309
+ ```bash
310
+ # Design phase
311
+ kspec workflow start @spec-plan-design
312
+
313
+ # Import path
314
+ kspec plan import <path> --module @module --dry-run # Preview
315
+ kspec plan import <path> --module @module # Create
316
+ kspec plan import <path> --module @module --update # Re-import
317
+
318
+ # Manual path
319
+ kspec plan add --title "..." --content "..." --status approved
320
+ kspec plan get <ref>
321
+ kspec plan set <ref> --status <status>
322
+ kspec plan note <ref> "..."
323
+ kspec plan list
324
+
325
+ # Validation
326
+ kspec validate
327
+ kspec validate --completeness
328
+ kspec validate --alignment
329
+ ```
330
+
331
+ ## Integration
332
+
333
+ - **`/kspec:writing-specs`** — Spec authoring details (types, AC format, traits)
334
+ - **`/kspec:task-work`** — After specs are created, work on derived tasks
335
+ - **`/kspec:triage`** — Inbox items may trigger plan creation
336
+ - **`/kspec:observations`** — Friction during planning becomes observations
@@ -0,0 +1,155 @@
1
+ # Session Reflection
2
+
3
+ Structured reflection at the end of a work session. Identifies learnings, friction points, and improvements — the raw material for system evolution.
4
+
5
+ ## When to Use
6
+
7
+ - End of a work session (interactive or automated)
8
+ - After completing a significant piece of work
9
+ - When you notice recurring patterns worth capturing
10
+
11
+ ## Workflow
12
+
13
+ ### Interactive Mode
14
+
15
+ ```bash
16
+ kspec workflow start @session-reflect
17
+ ```
18
+
19
+ Six steps, guided by the workflow engine:
20
+
21
+ 1. **What Worked Well** — Identify effective practices
22
+ 2. **Friction Points** — Where things were harder than needed
23
+ 3. **Check Coverage** — Search for existing tracking before proposing new items
24
+ 4. **Propose Improvements** — Concrete ideas for untracked friction
25
+ 5. **Discussion** — Present to user, get approval one at a time
26
+ 6. **Capture** — Add approved items to inbox/observations
27
+
28
+ Use `kspec workflow show` to see progress, `kspec workflow next --notes "..."` to advance.
29
+
30
+ ### Loop Mode (Automated)
31
+
32
+ ```bash
33
+ kspec workflow start @session-reflect-loop
34
+ ```
35
+
36
+ Key differences from interactive:
37
+ - **High confidence only** — Only capture what you're certain about
38
+ - **Search first** — MUST search before capturing anything
39
+ - **No user prompts** — Skip discussion, auto-resolve
40
+ - **Lower volume** — Better to capture nothing than capture noise
41
+ - **Higher bar for tasks** — Prefer `inbox add` over `task add` without user confirmation
42
+
43
+ ## Gate: Is There Anything to Reflect On?
44
+
45
+ Before starting, check if the session had meaningful work:
46
+
47
+ 1. **Tasks completed recently** — Any `completed_at` timestamps from the current session?
48
+ 2. **Code changes** — Any staged, unstaged, or untracked files?
49
+ 3. **Recent commits** — Any commits from the current session?
50
+
51
+ **Skip reflection if** no tasks completed, working tree is clean, and no commits made. Don't manufacture reflection from nothing.
52
+
53
+ ## The Reflection Process
54
+
55
+ ### Step 1: What Worked Well
56
+
57
+ Be specific — "categorizing items first" not "good planning."
58
+
59
+ - Workflows that flowed smoothly
60
+ - Tools or commands that helped
61
+ - Decisions that proved correct
62
+ - Patterns worth replicating
63
+
64
+ ### Step 2: Friction Points
65
+
66
+ Focus on systemic issues, not one-off mistakes.
67
+
68
+ - Repetitive manual steps
69
+ - Missing commands or options
70
+ - Context loss or re-explanation needed
71
+ - Workarounds used
72
+
73
+ ### Step 3: Check Existing Coverage
74
+
75
+ **Before proposing anything, search ALL sources:**
76
+
77
+ ```bash
78
+ kspec search "<keyword>" # Searches specs, tasks, AND inbox
79
+ ```
80
+
81
+ For each friction point:
82
+ - **Already tracked** — Reference the existing item, don't duplicate
83
+ - **Partially covered** — Note what's missing
84
+ - **Not tracked** — Candidate for capture
85
+
86
+ ### Step 4: Propose Improvements
87
+
88
+ For untracked friction, propose:
89
+ - What it would do
90
+ - How it would help
91
+ - Rough scope (small/medium/large)
92
+
93
+ ### Step 5: Discussion (Interactive Only)
94
+
95
+ Present findings one at a time:
96
+ - Is this worth capturing?
97
+ - Any refinements?
98
+ - Related ideas from user perspective?
99
+
100
+ ### Step 6: Capture
101
+
102
+ Route each item to the right destination:
103
+
104
+ | What you found | Where | Why |
105
+ |----------------|-------|-----|
106
+ | Clear scope (know what and where) | `task add` | Ready to implement |
107
+ | Unclear scope (vague, needs triage) | `inbox add` | Will be triaged later |
108
+ | Systemic friction pattern | `meta observe friction` | Informs process improvement |
109
+ | Success pattern | `meta observe success` | Worth documenting |
110
+ | Behavior change needing spec work | Ask user | May need spec-first workflow |
111
+
112
+ **Inbox vs Task:** Can you describe the change and where it goes? Use `task add`. Only use inbox when scope is genuinely unclear.
113
+
114
+ When capturing 2+ items, use `kspec batch`:
115
+
116
+ ```bash
117
+ kspec batch --commands '[
118
+ {"command":"inbox add","args":{"text":"Improvement idea","tag":["reflection"]}},
119
+ {"command":"meta observe","args":{"type":"friction","content":"Friction pattern"}},
120
+ {"command":"meta observe","args":{"type":"success","content":"Success pattern"}}
121
+ ]'
122
+ ```
123
+
124
+ ## Reflection Prompts
125
+
126
+ Use these to surface insights:
127
+
128
+ - **Process:** What did I repeat 3+ times? What workarounds did I use?
129
+ - **Tools:** What command or flag did I wish existed?
130
+ - **Communication:** Where was the user surprised? What should I have asked earlier?
131
+ - **Learning:** What do I know now that I didn't at session start?
132
+
133
+ ## Key Principles
134
+
135
+ - **Specific over general** — "No bulk AC add" not "CLI could be better"
136
+ - **Systemic over incidental** — Focus on repeatable friction
137
+ - **Ask don't assume** — User decides what's worth capturing (interactive mode)
138
+ - **Brief on successes** — Friction points are the primary value
139
+ - **Search before capture** — Never duplicate existing tracking
140
+
141
+ ## Workflow Commands
142
+
143
+ ```bash
144
+ kspec workflow show # Check current step
145
+ kspec workflow next --notes "..." # Advance with notes
146
+ kspec workflow next --skip --notes "reason" # Skip a step
147
+ kspec workflow pause # Pause for later
148
+ kspec workflow resume # Resume
149
+ ```
150
+
151
+ ## Integration
152
+
153
+ - Observations created during reflection feed into `/kspec:triage observations`
154
+ - Friction observations may be promoted to tasks via `kspec meta promote @ref`
155
+ - Success patterns may inform AGENTS.md or convention updates
@@ -0,0 +1,186 @@
1
+ # Review
2
+
3
+ Kspec-specific review concerns for verifying spec alignment, AC coverage, and trait coverage. A building block that projects reference in their own review skills and workflows.
4
+
5
+ ## When to Use
6
+
7
+ - Before creating a PR — verify implementation meets spec
8
+ - As part of a project-specific local review workflow
9
+ - When reviewing code changes against acceptance criteria
10
+
11
+ **This is NOT a complete review workflow.** It covers kspec-specific quality gates (spec alignment, AC coverage, trait coverage, validation). Projects should wrap this in their own review skill that adds project-specific concerns (test commands, E2E patterns, coding standards).
12
+
13
+ ## Spec Alignment
14
+
15
+ Implementation must match spec intent, not just pass tests.
16
+
17
+ ### How to Verify
18
+
19
+ ```bash
20
+ # Read the spec — all ACs (own + inherited)
21
+ kspec item get @spec-ref
22
+ ```
23
+
24
+ For each AC, verify:
25
+ 1. **Implementation exists** — Code handles the described behavior
26
+ 2. **Test exists** — A test validates the behavior
27
+ 3. **Behavior matches** — The test actually proves the AC, not just syntactically passes
28
+
29
+ ### What to Flag
30
+
31
+ | Issue | Severity |
32
+ |-------|----------|
33
+ | AC has no implementation | MUST-FIX |
34
+ | AC has no test | MUST-FIX |
35
+ | Implementation deviates from spec | MUST-FIX |
36
+ | Undocumented behavior (not in any AC) | SHOULD-FIX |
37
+ | Spec is vague, implementation chose reasonable interpretation | Note it |
38
+
39
+ ## Own AC Coverage
40
+
41
+ Every acceptance criterion on the spec MUST have at least one annotated test.
42
+
43
+ ### Annotation Format
44
+
45
+ ```javascript
46
+ // AC: @spec-ref ac-N
47
+ it('should validate input when given invalid data', () => { ... });
48
+ ```
49
+
50
+ ```python
51
+ # AC: @spec-ref ac-N
52
+ def test_validates_input():
53
+ ...
54
+ ```
55
+
56
+ ### Checking Coverage
57
+
58
+ ```bash
59
+ # Get all ACs for the spec
60
+ kspec item get @spec-ref
61
+
62
+ # Search for annotations in test files
63
+ # (adapt grep path to your project's test directories)
64
+ grep -rn "// AC: @spec-ref" tests/
65
+ ```
66
+
67
+ Each AC listed in the spec output must have a corresponding annotation. Missing annotations are MUST-FIX.
68
+
69
+ ## Trait AC Coverage
70
+
71
+ When a spec implements traits, it inherits their ACs. Every inherited trait AC must also have test coverage.
72
+
73
+ ### How It Works
74
+
75
+ ```bash
76
+ # kspec item get shows inherited ACs under "Inherited from @trait-slug" sections
77
+ kspec item get @spec-ref
78
+ ```
79
+
80
+ Each inherited AC needs a test annotated with the **trait's** ref, not the spec's ref:
81
+
82
+ ```javascript
83
+ // AC: @trait-json-output ac-1
84
+ it('should output valid JSON with --json flag', () => { ... });
85
+ ```
86
+
87
+ ### Checking Coverage
88
+
89
+ ```bash
90
+ # kspec validate reports uncovered trait ACs
91
+ kspec validate
92
+
93
+ # Search for specific trait annotations
94
+ grep -rn "// AC: @trait-json-output" tests/
95
+ ```
96
+
97
+ Any "inherited trait AC(s) without test coverage" warning from `kspec validate` is a MUST-FIX blocker.
98
+
99
+ ### When a Trait AC Doesn't Apply
100
+
101
+ If a trait AC genuinely doesn't apply to this spec, annotate it with a reason:
102
+
103
+ ```javascript
104
+ // AC: @trait-json-output ac-3 — N/A: this command has no tabular output to format
105
+ ```
106
+
107
+ The annotation must exist so coverage tooling can track it.
108
+
109
+ ### No Traits?
110
+
111
+ If the spec has no traits (`kspec item get` shows no "Inherited from" sections), skip this step entirely.
112
+
113
+ ## Validation Integration
114
+
115
+ ```bash
116
+ kspec validate
117
+ ```
118
+
119
+ Validation catches spec-level issues:
120
+ - Missing acceptance criteria on specs
121
+ - Broken references (dangling `@slug`)
122
+ - Missing descriptions
123
+ - Uncovered trait ACs (the most common review finding)
124
+ - Orphaned specs (no linked tasks)
125
+
126
+ **Exit codes:** `0` = clean, `4` = errors, `6` = warnings only.
127
+
128
+ Treat errors as MUST-FIX. Treat warnings as SHOULD-FIX (especially trait AC warnings).
129
+
130
+ ## Review Checklist
131
+
132
+ Use this checklist when reviewing implementation against a spec:
133
+
134
+ ### MUST-FIX (Blocks PR)
135
+
136
+ - [ ] Every own AC has at least one annotated test
137
+ - [ ] Every inherited trait AC has at least one annotated test (or N/A annotation)
138
+ - [ ] `kspec validate` reports no errors for this spec
139
+ - [ ] Implementation matches spec behavior (not just syntactically correct tests)
140
+ - [ ] No regressions — existing tests still pass
141
+
142
+ ### SHOULD-FIX
143
+
144
+ - [ ] `kspec validate` warnings addressed (especially trait AC coverage)
145
+ - [ ] Undocumented behavior has spec coverage or is flagged
146
+ - [ ] Test annotations reference correct spec/trait refs
147
+
148
+ ### SUGGESTION
149
+
150
+ - [ ] Tests are meaningful (would fail if feature breaks)
151
+ - [ ] Prefer E2E over unit where practical
152
+ - [ ] Tests run in isolation (temp dirs, not project repo)
153
+
154
+ ## Severity Guide
155
+
156
+ | Finding | Severity | Action |
157
+ |---------|----------|--------|
158
+ | Missing own AC test annotation | MUST-FIX | Add test with `// AC: @spec-ref ac-N` |
159
+ | Missing trait AC test annotation | MUST-FIX | Add test with `// AC: @trait-slug ac-N` |
160
+ | `kspec validate` error | MUST-FIX | Fix the validation error |
161
+ | Implementation doesn't match spec | MUST-FIX | Fix implementation or update spec |
162
+ | `kspec validate` warning | SHOULD-FIX | Address warning |
163
+ | Undocumented behavior | SHOULD-FIX | Add AC or note deviation |
164
+ | Test doesn't prove its AC | SHOULD-FIX | Rewrite test |
165
+ | No E2E tests | SUGGESTION | Consider adding |
166
+
167
+ ## Using in Project Reviews
168
+
169
+ This skill provides the kspec-specific gates. Wrap it in your project's review:
170
+
171
+ ```
172
+ Project Review = kspec:review gates + project-specific gates
173
+ ```
174
+
175
+ Project-specific gates to add in your own review skill:
176
+ - **Test commands** — How to run your test suite
177
+ - **Test patterns** — Project-specific test helpers and isolation patterns
178
+ - **Code style** — Naming, error handling, import conventions
179
+ - **E2E specifics** — How E2E tests work in your project
180
+ - **Regression check** — Full suite command and expectations
181
+
182
+ ## Integration
183
+
184
+ - **`/kspec:task-work`** — Run review before submitting tasks
185
+ - **`/kspec:writing-specs`** — If review reveals spec gaps, update specs first
186
+ - **`kspec validate`** — Automated validation complements manual review