@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,296 @@
1
+ # Task Work
2
+
3
+ Structured workflow for working on tasks. Full lifecycle from start through PR merge.
4
+
5
+ ## When to Use
6
+
7
+ - Starting work on a ready task
8
+ - Continuing in-progress or needs_work tasks
9
+ - Ensuring consistent task lifecycle with notes and audit trail
10
+
11
+ **Not for:** Spec creation (use `/kspec:writing-specs`), plan translation (use `/kspec:plan`), or triage (use `/kspec:triage`).
12
+
13
+ ## Inherit Existing Work First
14
+
15
+ Before starting new work, check for existing work:
16
+
17
+ ```bash
18
+ kspec session start # Shows active work at the top
19
+ ```
20
+
21
+ Priority order:
22
+ 1. **needs_work** — Fix cycle: address review feedback (highest priority)
23
+ 2. **in_progress** — Continue work already started
24
+ 3. **ready (pending)** — New work to start
25
+
26
+ Always inherit existing work unless explicitly told otherwise. This prevents orphaned tasks.
27
+
28
+ ## Task Lifecycle
29
+
30
+ ```
31
+ pending → in_progress → pending_review → completed
32
+ ↓ ↓
33
+ blocked needs_work
34
+ (→ in_progress → pending_review)
35
+ ```
36
+
37
+ | Command | Transition | When |
38
+ |---------|-----------|------|
39
+ | `kspec task start @ref` | → in_progress | Beginning work |
40
+ | `kspec task submit @ref` | → pending_review | Code done, PR created |
41
+ | `kspec task complete @ref --reason "..."` | → completed | PR merged |
42
+ | `kspec task block @ref --reason "..."` | → blocked | External blocker |
43
+
44
+ ## Workflow Steps
45
+
46
+ ### 1. Choose Task
47
+
48
+ ```bash
49
+ kspec tasks ready # All ready tasks
50
+ kspec tasks ready --eligible # Automation-eligible only (loop mode)
51
+ ```
52
+
53
+ ### 2. Verify Work Is Needed
54
+
55
+ Before starting, check if work is already done:
56
+
57
+ ```bash
58
+ # Check git history
59
+ git log --oneline --grep="feature-name"
60
+ git log --oneline -- path/to/relevant/files
61
+
62
+ # Check existing implementation
63
+ kspec item get @spec-ref # View spec and ACs
64
+ ```
65
+
66
+ If already implemented: verify tests pass, AC coverage exists, then `kspec task complete @ref --reason "Already implemented"`.
67
+
68
+ **Notes are context, not proof.** If a task has notes saying "already done" — verify independently. Run tests, check code, validate against ACs. If a task is in the ready queue, there's a reason.
69
+
70
+ ### 3. Start Task
71
+
72
+ ```bash
73
+ kspec task start @ref
74
+ ```
75
+
76
+ ### 4. Work and Note
77
+
78
+ Read all ACs (own + trait) before implementing:
79
+
80
+ ```bash
81
+ kspec item get @spec-ref # Shows own ACs AND inherited trait ACs
82
+ ```
83
+
84
+ Add notes during work, not just at the end:
85
+
86
+ ```bash
87
+ # Good: explains decisions and context
88
+ kspec task note @ref "Using retry with exponential backoff. Chose 3 max retries based on API rate limits."
89
+
90
+ # Bad: no context
91
+ kspec task note @ref "Done"
92
+ ```
93
+
94
+ Note when you:
95
+ - Discover something unexpected
96
+ - Make a design decision
97
+ - Encounter a blocker
98
+ - Complete a significant piece
99
+
100
+ ### 5. Commit
101
+
102
+ Include task and spec trailers:
103
+
104
+ ```
105
+ feat: add user authentication
106
+
107
+ Implemented JWT-based auth with refresh tokens.
108
+
109
+ Task: @task-add-auth
110
+ Spec: @auth-feature
111
+ ```
112
+
113
+ Trailers enable `kspec log @ref` to find related commits.
114
+
115
+ ### 6. Local Review
116
+
117
+ Run quality checks before submitting. Verify:
118
+
119
+ - **Own AC coverage** — Each spec AC has a test annotated `// AC: @spec-ref ac-N`
120
+ - **Trait AC coverage** — Each inherited trait AC has a test annotated `// AC: @trait-slug ac-N`
121
+ - **Tests pass** — Full test suite, not just new tests
122
+ - **Code quality** — Matches existing patterns, no duplicated utilities
123
+ - **No regressions** — Existing tests still pass
124
+
125
+ ```bash
126
+ kspec validate # Reports uncovered trait ACs as warnings
127
+ ```
128
+
129
+ ### 7. Submit Task
130
+
131
+ ```bash
132
+ kspec task submit @ref
133
+ ```
134
+
135
+ Moves task to `pending_review`. Create PR after submitting.
136
+
137
+ ### 8. Complete Task
138
+
139
+ After PR is merged:
140
+
141
+ ```bash
142
+ kspec task complete @ref --reason "Merged in PR #N. Summary of what was done."
143
+ ```
144
+
145
+ ## Fix Cycle
146
+
147
+ When inheriting a `needs_work` task:
148
+
149
+ 1. **Find the PR** — Check for review comments
150
+ ```bash
151
+ gh pr list --search "Task: @task-ref" --json number,url
152
+ gh api repos/{owner}/{repo}/pulls/{number}/comments --jq '.[] | {path, line, body}'
153
+ ```
154
+
155
+ 2. **Fix findings** — Address MUST-FIX and SHOULD-FIX items
156
+
157
+ 3. **Push fixes** — Commit with descriptive message
158
+ ```bash
159
+ git add <files> && git commit -m "fix: address review feedback
160
+
161
+ Task: @task-slug"
162
+ git push
163
+ ```
164
+
165
+ 4. **Re-submit** — `kspec task submit @ref` (back to pending_review)
166
+
167
+ You do NOT merge in a fix cycle. The reviewer handles merge decisions.
168
+
169
+ ## Scope Management
170
+
171
+ ### What's In Scope
172
+
173
+ Tasks describe expected outcomes, not rigid boundaries:
174
+
175
+ - **Tests need implementation?** Implementing missing functionality is in scope — the goal is verified behavior
176
+ - **Implementation needs tests?** Proving it works is always in scope
177
+
178
+ ### When to Expand vs Escalate
179
+
180
+ **Expand** (do it yourself):
181
+ - Additional work is clearly implied by the goal
182
+ - Proportional to the original task
183
+ - You have the context
184
+
185
+ **Escalate** (capture separately):
186
+ - Scope expansion is major
187
+ - Uncertain about the right approach
188
+ - Outside your task's domain
189
+
190
+ **When you notice something outside your task:** Capture it separately (`kspec inbox add` or `kspec task note`). Don't fix it inline — even small detours compound into drift.
191
+
192
+ ## AC Test Annotations
193
+
194
+ Link tests to acceptance criteria:
195
+
196
+ ```javascript
197
+ // AC: @spec-item ac-N
198
+ it('should validate input', () => { ... });
199
+ ```
200
+
201
+ ```python
202
+ # AC: @spec-item ac-N
203
+ def test_validates_input():
204
+ ...
205
+ ```
206
+
207
+ Every AC should have at least one test with this annotation.
208
+
209
+ ## Implementation Quality
210
+
211
+ Before submitting:
212
+
213
+ - **Search for existing utilities** — Don't duplicate helpers that already exist
214
+ - **Match neighboring file style** — Naming conventions, error handling, imports
215
+ - **Run full test suite** — Not just your new tests
216
+ - **Validate** — `kspec validate` for spec alignment
217
+
218
+ ## Loop Mode
219
+
220
+ Autonomous task execution without human confirmation.
221
+
222
+ ```bash
223
+ kspec tasks ready --eligible # Only automation-eligible tasks
224
+ ```
225
+
226
+ ### Task Selection Priority
227
+
228
+ 1. `needs_work` — Fix review feedback
229
+ 2. `in_progress` — Continue existing work
230
+ 3. Tasks that unblock others
231
+ 4. Highest priority ready task
232
+
233
+ ### Key Behaviors
234
+
235
+ - Verify work is needed before starting (prevent duplicates)
236
+ - Decisions auto-resolve without prompts
237
+ - PR review handled externally (not this workflow)
238
+ - All actions are logged and auditable
239
+
240
+ ### Blocking Rules
241
+
242
+ **Block only for genuine external blockers:**
243
+ - Human architectural decision needed
244
+ - Spec clarification required
245
+ - External dependency unavailable
246
+ - Formal `depends_on` blocker
247
+
248
+ **Do NOT block for:**
249
+ - Task seems complex (do the work)
250
+ - Tests are failing (fix them)
251
+ - Service needs running (start it)
252
+
253
+ After blocking:
254
+ ```bash
255
+ kspec task block @ref --reason "Reason..."
256
+ kspec tasks ready --eligible # Check for other work
257
+ # If tasks exist: work on the next one
258
+ # If empty: stop responding (ralph auto-exits)
259
+ ```
260
+
261
+ ### Turn Completion
262
+
263
+ After creating a PR, **stop responding**. Ralph continues automatically — it checks for remaining eligible tasks and exits the loop when none remain.
264
+
265
+ **Do NOT call `end-loop`** after creating a PR. That ends ALL remaining iterations. It's a rare escape hatch for when work is stalling across multiple iterations.
266
+
267
+ ## Command Reference
268
+
269
+ ```bash
270
+ # Task lifecycle
271
+ kspec task start @ref
272
+ kspec task note @ref "..."
273
+ kspec task submit @ref
274
+ kspec task complete @ref --reason "..."
275
+ kspec task block @ref --reason "..."
276
+
277
+ # Task discovery
278
+ kspec tasks ready
279
+ kspec tasks ready --eligible
280
+ kspec task get @ref
281
+
282
+ # Validation
283
+ kspec validate
284
+ kspec validate --alignment
285
+
286
+ # Session context
287
+ kspec session start
288
+ ```
289
+
290
+ ## Integration
291
+
292
+ - **`/kspec:writing-specs`** — Create specs before deriving tasks
293
+ - **`/kspec:plan`** — Plans create specs that become tasks
294
+ - **`/kspec:review`** — Review checks AC coverage and code quality
295
+ - **`/kspec:observations`** — Capture friction found during task work
296
+ - **`/kspec:reflect`** — Session reflection after completing tasks
@@ -0,0 +1,199 @@
1
+ # Triage
2
+
3
+ Systematically process items: inbox, observations, or automation eligibility.
4
+
5
+ ## Focus Modes
6
+
7
+ Use `/triage <mode>` to focus on a specific area:
8
+
9
+ | Mode | Purpose | Documentation |
10
+ |------|---------|---------------|
11
+ | `inbox` | Process inbox items → specs/tasks | [docs/inbox.md](docs/inbox.md) |
12
+ | `observations` | Process pending observations | [docs/observations.md](docs/observations.md) |
13
+ | `automation` | Assess task automation eligibility | [docs/automation.md](docs/automation.md) |
14
+
15
+ Without a mode, follow the full triage session pattern below.
16
+
17
+ ## Core Concept: Record → Act
18
+
19
+ Triage uses a **two-step pattern** that separates decision-making from execution:
20
+
21
+ 1. **Record** the decision (what to do + why)
22
+ 2. **Act** on the decision (execute it)
23
+
24
+ This separation enables review, override, and audit trails.
25
+
26
+ ```bash
27
+ # Step 1: Record what you want to do
28
+ kspec triage record @inbox-ref --action promote --reasoning "Clear feature request"
29
+
30
+ # Step 2: Execute the decision
31
+ kspec triage act @triage-ref
32
+ ```
33
+
34
+ ### Actions
35
+
36
+ | Action | What `act` does |
37
+ |--------|-----------------|
38
+ | `promote` | Creates task from inbox item snapshot |
39
+ | `delete` | Deletes the inbox item |
40
+ | `defer` | Records deferral, no side effect |
41
+ | `spec-gap` | Creates observation tagged spec-gap |
42
+ | `duplicate` | Deletes the inbox item |
43
+
44
+ ### Lifecycle
45
+
46
+ ```
47
+ record (with action) override (optional) act
48
+ → triaged → triaged → acted_on
49
+ ```
50
+
51
+ ## Full Session Pattern
52
+
53
+ 1. **Get context**
54
+ ```bash
55
+ kspec session start --full
56
+ kspec inbox list
57
+ kspec meta observations --pending-resolution
58
+ kspec tasks assess automation
59
+ ```
60
+
61
+ 2. **Present overview to user**
62
+ - Inbox items by category
63
+ - Pending observations by type
64
+ - Unassessed tasks needing triage
65
+
66
+ 3. **Ask which focus area**
67
+ - Inbox items
68
+ - Observations
69
+ - Automation eligibility
70
+
71
+ 4. **Process that focus area**
72
+ - Use the relevant sub-document for guidance
73
+
74
+ 5. **Repeat or stop** when user indicates
75
+
76
+ ## Quick Start by Mode
77
+
78
+ ### `/triage inbox`
79
+
80
+ Process inbox items using the record → act pattern. See [docs/inbox.md](docs/inbox.md).
81
+
82
+ ```bash
83
+ kspec inbox list
84
+
85
+ # Interactive mode: triage all untriaged items one by one
86
+ kspec triage start
87
+
88
+ # Or record decisions individually
89
+ kspec triage record @ref --action promote --reasoning "Clear feature need"
90
+ kspec triage record @ref --action delete --reasoning "Outdated"
91
+ kspec triage record @ref --action defer --reasoning "Not ready yet"
92
+ kspec triage record @ref --action spec-gap --reasoning "Missing spec coverage"
93
+ kspec triage record @ref --action duplicate --reasoning "Covered by @other-ref"
94
+
95
+ # Then execute recorded decisions
96
+ kspec triage act @triage-ref
97
+ kspec triage act @triage-ref --dry-run # Preview first
98
+ ```
99
+
100
+ ### `/triage observations`
101
+
102
+ Process pending observations. See [docs/observations.md](docs/observations.md).
103
+
104
+ ```bash
105
+ kspec meta observations --pending-resolution
106
+ # For each: resolve, promote to task, or leave
107
+ kspec meta resolve @ref "Resolution notes"
108
+ kspec meta resolve @ref1 @ref2 "Batch resolution"
109
+ kspec meta observations promote @ref --title "..."
110
+ ```
111
+
112
+ ### `/triage automation`
113
+
114
+ Assess task automation eligibility. See [docs/automation.md](docs/automation.md).
115
+
116
+ ```bash
117
+ kspec tasks assess automation
118
+ # Review criteria, fix issues, or mark status
119
+ kspec task set @ref --automation eligible
120
+ kspec task set @ref --automation needs_review --reason "..."
121
+ ```
122
+
123
+ ## Triage Commands Reference
124
+
125
+ ### Recording Decisions
126
+
127
+ ```bash
128
+ # Record a triage decision for an inbox item
129
+ kspec triage record @inbox-ref --action <action> --reasoning "why"
130
+ kspec triage record @inbox-ref --action promote --reasoning "..." --evidence @spec-ref
131
+ kspec triage record @inbox-ref --action promote --reasoning "..." --json # JSON output
132
+
133
+ # Interactive mode: presents untriaged items one at a time
134
+ kspec triage start
135
+ # Ctrl+C preserves all previously committed records
136
+ ```
137
+
138
+ ### Reviewing Decisions
139
+
140
+ ```bash
141
+ # List all triage records
142
+ kspec triage list
143
+ kspec triage list --status triaged # Only pending execution
144
+ kspec triage list --status acted_on # Already executed
145
+ kspec triage list --action promote # Filter by action type
146
+
147
+ # Get details of a specific record
148
+ kspec triage get @triage-ref
149
+
150
+ # Export for agent handoff
151
+ kspec triage export --format context # Markdown context blocks
152
+ kspec triage export --format json # Full JSON array
153
+ ```
154
+
155
+ ### Executing and Overriding
156
+
157
+ ```bash
158
+ # Execute a recorded decision
159
+ kspec triage act @triage-ref
160
+ kspec triage act @triage-ref --dry-run # Preview without executing
161
+
162
+ # Override a previous decision (preserves audit trail)
163
+ kspec triage override @triage-ref --action defer --reasoning "Not ready yet"
164
+ # Then act on the updated decision
165
+ kspec triage act @triage-ref
166
+ ```
167
+
168
+ ## Bulk Operations with Batch
169
+
170
+ When processing many items at once, use `kspec batch`:
171
+
172
+ ```bash
173
+ # Record multiple triage decisions atomically
174
+ kspec batch --commands '[
175
+ {"command":"triage record","args":{"ref":"@ref1","action":"delete","reasoning":"Stale"}},
176
+ {"command":"triage record","args":{"ref":"@ref2","action":"delete","reasoning":"Duplicate"}},
177
+ {"command":"triage record","args":{"ref":"@ref3","action":"promote","reasoning":"Clear scope"}}
178
+ ]'
179
+ ```
180
+
181
+ Use `--dry-run` to preview. See `/kspec:help` for full batch documentation.
182
+
183
+ ## Key Principles
184
+
185
+ - **Record before act** - Separate decisions from execution for audit trail
186
+ - **Ask one question at a time** - Don't batch decisions
187
+ - **Spec before task** - Fill spec gaps before creating tasks
188
+ - **AC is required** - Specs without acceptance criteria are incomplete
189
+ - **Use CLI, not YAML** - All changes through kspec commands
190
+ - **Delete freely** - Outdated items should go
191
+
192
+ ## Progress Tracking
193
+
194
+ At session end, provide summary:
195
+ - Items triaged (recorded decisions)
196
+ - Actions executed (promoted, deleted, deferred, spec-gap, duplicate)
197
+ - Tasks created/updated
198
+ - Observations resolved
199
+ - Remaining items
@@ -0,0 +1,120 @@
1
+ # Automation Triage
2
+
3
+ Assess and prepare tasks for automation eligibility. Goal: make tasks self-contained so they can be automated.
4
+
5
+ ## Philosophy
6
+
7
+ - **Eligible is the goal** - Manual-only should be the exception
8
+ - **Criteria are for visibility** - Help identify what's missing, not auto-approve
9
+ - **Fix issues, don't just assess** - Guide toward making tasks automatable
10
+
11
+ ## Eligibility Criteria
12
+
13
+ A task is ready for automation when:
14
+ 1. Has `spec_ref` pointing to resolvable spec
15
+ 2. Spec has acceptance criteria (testable outcomes)
16
+ 3. Task type is not `spike` (spikes output knowledge, not code)
17
+
18
+ **Having spec + ACs is necessary but not sufficient** - you must also verify the spec is appropriate and ACs are adequate for the task.
19
+
20
+ **Task type does not determine automation eligibility.** Any non-spike task can be `automation: eligible` — including design tasks, refactoring tasks, documentation tasks, etc. The `automation` field is the definitive source. Once a task is marked `eligible`, do not second-guess it based on type, title, or description.
21
+
22
+ ## Workflow
23
+
24
+ ### 1. Get Assessment Overview
25
+
26
+ ```bash
27
+ # Show unassessed pending tasks with criteria status
28
+ kspec tasks assess automation
29
+
30
+ # See what auto mode would change
31
+ kspec tasks assess automation --auto --dry-run
32
+ ```
33
+
34
+ ### 2. Process Each Task
35
+
36
+ For each task shown:
37
+
38
+ **If spike:**
39
+ - Mark `manual_only` - spikes are inherently human work
40
+ - `kspec task set @ref --automation manual_only --reason "Spike - output is knowledge"`
41
+
42
+ **If missing spec_ref or no ACs:**
43
+ - Ask: "Fix now or mark for later?"
44
+ - **Fix now:**
45
+ 1. Create or find appropriate spec: `kspec item add --under @parent --title "..."`
46
+ 2. Add acceptance criteria: `kspec item ac add @spec --given "..." --when "..." --then "..."`
47
+ 3. Link task to spec: `kspec task set @ref --spec-ref @spec`
48
+ 4. Re-assess and mark eligible if appropriate
49
+ - **Mark for later:**
50
+ - `kspec task set @ref --automation needs_review --reason "Missing spec - needs spec creation"`
51
+
52
+ **If has spec + ACs:**
53
+ - Review for eligibility:
54
+ - Is the spec appropriate for this task?
55
+ - Are the ACs adequate and testable?
56
+ - Does the task have sufficient context?
57
+ - If yes: `kspec task set @ref --automation eligible`
58
+ - If no: Fix issues or mark `needs_review` with specific reason
59
+
60
+ ### 3. Batch Processing with Auto Mode
61
+
62
+ For fast triage of obvious cases:
63
+
64
+ ```bash
65
+ # Apply auto mode (spikes → manual_only, missing → needs_review)
66
+ kspec tasks assess automation --auto
67
+
68
+ # Then manually review the "review_for_eligible" tasks
69
+ kspec tasks ready --unassessed
70
+ ```
71
+
72
+ Auto mode is conservative:
73
+ - Spikes → `manual_only`
74
+ - Missing spec/ACs → `needs_review`
75
+ - Has spec + ACs → **NOT auto-marked** (requires review)
76
+
77
+ ## Quick Commands
78
+
79
+ ```bash
80
+ # Assessment
81
+ kspec tasks assess automation # Show unassessed with criteria
82
+ kspec tasks assess automation @ref # Single task
83
+ kspec tasks assess automation --all # Include already-assessed
84
+ kspec tasks assess automation --auto # Apply obvious cases
85
+ kspec tasks assess automation --dry-run # Preview changes
86
+
87
+ # Setting automation status
88
+ kspec task set @ref --automation eligible
89
+ kspec task set @ref --automation needs_review --reason "Why"
90
+ kspec task set @ref --automation manual_only --reason "Why"
91
+ kspec task set @ref --no-automation # Clear to unassessed
92
+
93
+ # Filtering tasks
94
+ kspec tasks ready --unassessed # Tasks needing assessment
95
+ kspec tasks ready --eligible # Automation-ready tasks
96
+ kspec tasks ready --needs-review # Tasks needing human triage
97
+ ```
98
+
99
+ ## Assessment Output
100
+
101
+ ```
102
+ @task-slug "Task title"
103
+ spec_ref: ✓ @feature-slug
104
+ has_acs: ✓ 3 acceptance criteria
105
+ not_spike: ✓ type: task
106
+ → review_for_eligible (verify spec/AC adequacy)
107
+ ```
108
+
109
+ | Recommendation | Meaning | Auto Mode Action |
110
+ |----------------|---------|------------------|
111
+ | `review_for_eligible` | Passes criteria, needs review | No change (manual review) |
112
+ | `needs_review` | Missing spec or ACs | Sets `needs_review` with reason |
113
+ | `manual_only` | Spike task | Sets `manual_only` |
114
+
115
+ ## Key Principles
116
+
117
+ - **CLI doesn't auto-mark eligible** - Requires agent/human review
118
+ - **Agents CAN mark eligible** - When reviewing based on user instruction
119
+ - **Add notes when setting status** - Document the "why"
120
+ - **Re-assess after fixes** - After adding spec/ACs, check again