@kynetic-ai/spec 0.11.0 → 0.12.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 (501) hide show
  1. package/README.md +55 -455
  2. package/dist/agent-runtime/bootstrap.d.ts +31 -0
  3. package/dist/agent-runtime/bootstrap.d.ts.map +1 -0
  4. package/dist/agent-runtime/bootstrap.js +302 -0
  5. package/dist/agent-runtime/bootstrap.js.map +1 -0
  6. package/dist/agent-runtime/dispatch.d.ts +119 -10
  7. package/dist/agent-runtime/dispatch.d.ts.map +1 -1
  8. package/dist/agent-runtime/dispatch.js +1154 -219
  9. package/dist/agent-runtime/dispatch.js.map +1 -1
  10. package/dist/agent-runtime/invocation.d.ts +28 -1
  11. package/dist/agent-runtime/invocation.d.ts.map +1 -1
  12. package/dist/agent-runtime/invocation.js +171 -59
  13. package/dist/agent-runtime/invocation.js.map +1 -1
  14. package/dist/agent-runtime/prompts.d.ts +9 -0
  15. package/dist/agent-runtime/prompts.d.ts.map +1 -1
  16. package/dist/agent-runtime/prompts.js +42 -7
  17. package/dist/agent-runtime/prompts.js.map +1 -1
  18. package/dist/agent-runtime/session-event-accumulator.d.ts +83 -0
  19. package/dist/agent-runtime/session-event-accumulator.d.ts.map +1 -0
  20. package/dist/agent-runtime/session-event-accumulator.js +203 -0
  21. package/dist/agent-runtime/session-event-accumulator.js.map +1 -0
  22. package/dist/agent-runtime/session-event-types.d.ts +67 -0
  23. package/dist/agent-runtime/session-event-types.d.ts.map +1 -0
  24. package/dist/agent-runtime/session-event-types.js +13 -0
  25. package/dist/agent-runtime/session-event-types.js.map +1 -0
  26. package/dist/agent-runtime/workspace.d.ts +244 -0
  27. package/dist/agent-runtime/workspace.d.ts.map +1 -0
  28. package/dist/agent-runtime/workspace.js +2025 -0
  29. package/dist/agent-runtime/workspace.js.map +1 -0
  30. package/dist/agents/adapters.d.ts.map +1 -1
  31. package/dist/agents/adapters.js +58 -13
  32. package/dist/agents/adapters.js.map +1 -1
  33. package/dist/agents/spawner.d.ts +8 -0
  34. package/dist/agents/spawner.d.ts.map +1 -1
  35. package/dist/agents/spawner.js +25 -3
  36. package/dist/agents/spawner.js.map +1 -1
  37. package/dist/cli/batch-exec.js +1 -1
  38. package/dist/cli/batch-exec.js.map +1 -1
  39. package/dist/cli/command-annotations.d.ts +15 -3
  40. package/dist/cli/command-annotations.d.ts.map +1 -1
  41. package/dist/cli/command-annotations.js +23 -3
  42. package/dist/cli/command-annotations.js.map +1 -1
  43. package/dist/cli/commands/agent.d.ts +2 -0
  44. package/dist/cli/commands/agent.d.ts.map +1 -1
  45. package/dist/cli/commands/agent.js +144 -27
  46. package/dist/cli/commands/agent.js.map +1 -1
  47. package/dist/cli/commands/agents.d.ts.map +1 -1
  48. package/dist/cli/commands/agents.js +5 -5
  49. package/dist/cli/commands/agents.js.map +1 -1
  50. package/dist/cli/commands/derive.d.ts.map +1 -1
  51. package/dist/cli/commands/derive.js +118 -3
  52. package/dist/cli/commands/derive.js.map +1 -1
  53. package/dist/cli/commands/guard.d.ts.map +1 -1
  54. package/dist/cli/commands/guard.js +8 -6
  55. package/dist/cli/commands/guard.js.map +1 -1
  56. package/dist/cli/commands/index.d.ts +1 -0
  57. package/dist/cli/commands/index.d.ts.map +1 -1
  58. package/dist/cli/commands/index.js +1 -0
  59. package/dist/cli/commands/index.js.map +1 -1
  60. package/dist/cli/commands/init.d.ts.map +1 -1
  61. package/dist/cli/commands/init.js +20 -0
  62. package/dist/cli/commands/init.js.map +1 -1
  63. package/dist/cli/commands/item.d.ts.map +1 -1
  64. package/dist/cli/commands/item.js +205 -47
  65. package/dist/cli/commands/item.js.map +1 -1
  66. package/dist/cli/commands/log.d.ts.map +1 -1
  67. package/dist/cli/commands/log.js +24 -10
  68. package/dist/cli/commands/log.js.map +1 -1
  69. package/dist/cli/commands/plan-import.d.ts +3 -3
  70. package/dist/cli/commands/plan-import.d.ts.map +1 -1
  71. package/dist/cli/commands/plan-import.js +213 -528
  72. package/dist/cli/commands/plan-import.js.map +1 -1
  73. package/dist/cli/commands/plan.d.ts.map +1 -1
  74. package/dist/cli/commands/plan.js +533 -83
  75. package/dist/cli/commands/plan.js.map +1 -1
  76. package/dist/cli/commands/review.d.ts +14 -0
  77. package/dist/cli/commands/review.d.ts.map +1 -0
  78. package/dist/cli/commands/review.js +1142 -0
  79. package/dist/cli/commands/review.js.map +1 -0
  80. package/dist/cli/commands/serve.d.ts +1 -0
  81. package/dist/cli/commands/serve.d.ts.map +1 -1
  82. package/dist/cli/commands/serve.js +33 -10
  83. package/dist/cli/commands/serve.js.map +1 -1
  84. package/dist/cli/commands/session/checkpoint.d.ts +2 -4
  85. package/dist/cli/commands/session/checkpoint.d.ts.map +1 -1
  86. package/dist/cli/commands/session/checkpoint.js +6 -107
  87. package/dist/cli/commands/session/checkpoint.js.map +1 -1
  88. package/dist/cli/commands/session/commands.d.ts.map +1 -1
  89. package/dist/cli/commands/session/commands.js +33 -23
  90. package/dist/cli/commands/session/commands.js.map +1 -1
  91. package/dist/cli/commands/session/compact.js +4 -4
  92. package/dist/cli/commands/session/compact.js.map +1 -1
  93. package/dist/cli/commands/session/create.js +2 -2
  94. package/dist/cli/commands/session/create.js.map +1 -1
  95. package/dist/cli/commands/session/format.d.ts.map +1 -1
  96. package/dist/cli/commands/session/format.js +1 -6
  97. package/dist/cli/commands/session/format.js.map +1 -1
  98. package/dist/cli/commands/session/log.d.ts +32 -7
  99. package/dist/cli/commands/session/log.d.ts.map +1 -1
  100. package/dist/cli/commands/session/log.js +166 -60
  101. package/dist/cli/commands/session/log.js.map +1 -1
  102. package/dist/cli/commands/session/migrate.d.ts +9 -0
  103. package/dist/cli/commands/session/migrate.d.ts.map +1 -0
  104. package/dist/cli/commands/session/migrate.js +46 -0
  105. package/dist/cli/commands/session/migrate.js.map +1 -0
  106. package/dist/cli/commands/session/stale-close.d.ts.map +1 -1
  107. package/dist/cli/commands/session/stale-close.js +5 -8
  108. package/dist/cli/commands/session/stale-close.js.map +1 -1
  109. package/dist/cli/commands/session/types.d.ts +1 -1
  110. package/dist/cli/commands/session/types.d.ts.map +1 -1
  111. package/dist/cli/commands/setup.d.ts +2 -2
  112. package/dist/cli/commands/setup.d.ts.map +1 -1
  113. package/dist/cli/commands/setup.js +287 -257
  114. package/dist/cli/commands/setup.js.map +1 -1
  115. package/dist/cli/commands/shadow.d.ts.map +1 -1
  116. package/dist/cli/commands/shadow.js +147 -31
  117. package/dist/cli/commands/shadow.js.map +1 -1
  118. package/dist/cli/commands/skill-crud.d.ts +7 -0
  119. package/dist/cli/commands/skill-crud.d.ts.map +1 -1
  120. package/dist/cli/commands/skill-crud.js +41 -18
  121. package/dist/cli/commands/skill-crud.js.map +1 -1
  122. package/dist/cli/commands/skill-diff.d.ts.map +1 -1
  123. package/dist/cli/commands/skill-diff.js +29 -3
  124. package/dist/cli/commands/skill-diff.js.map +1 -1
  125. package/dist/cli/commands/skill-install.d.ts.map +1 -1
  126. package/dist/cli/commands/skill-install.js +5 -4
  127. package/dist/cli/commands/skill-install.js.map +1 -1
  128. package/dist/cli/commands/task.d.ts.map +1 -1
  129. package/dist/cli/commands/task.js +359 -49
  130. package/dist/cli/commands/task.js.map +1 -1
  131. package/dist/cli/commands/trait.d.ts.map +1 -1
  132. package/dist/cli/commands/trait.js +5 -27
  133. package/dist/cli/commands/trait.js.map +1 -1
  134. package/dist/cli/commands/validate.d.ts.map +1 -1
  135. package/dist/cli/commands/validate.js +113 -52
  136. package/dist/cli/commands/validate.js.map +1 -1
  137. package/dist/cli/index.d.ts.map +1 -1
  138. package/dist/cli/index.js +69 -2
  139. package/dist/cli/index.js.map +1 -1
  140. package/dist/cli/output.d.ts +26 -0
  141. package/dist/cli/output.d.ts.map +1 -1
  142. package/dist/cli/output.js +108 -1
  143. package/dist/cli/output.js.map +1 -1
  144. package/dist/cli/sync-mode.d.ts +44 -0
  145. package/dist/cli/sync-mode.d.ts.map +1 -0
  146. package/dist/cli/sync-mode.js +64 -0
  147. package/dist/cli/sync-mode.js.map +1 -0
  148. package/dist/daemon/middleware/project-context.ts +25 -7
  149. package/dist/daemon/project-context.ts +18 -0
  150. package/dist/daemon/routes/agent-dispatch.ts +99 -22
  151. package/dist/daemon/routes/aggregation.ts +184 -0
  152. package/dist/daemon/routes/inbox.ts +5 -0
  153. package/dist/daemon/routes/items.ts +145 -0
  154. package/dist/daemon/routes/meta.ts +1 -1
  155. package/dist/daemon/routes/projects.ts +28 -6
  156. package/dist/daemon/routes/ref-resolution.ts +119 -0
  157. package/dist/daemon/routes/refs.ts +42 -0
  158. package/dist/daemon/routes/session-related.ts +140 -0
  159. package/dist/daemon/routes/sessions.ts +420 -19
  160. package/dist/daemon/routes/tasks.ts +62 -5
  161. package/dist/daemon/routes/triage.ts +40 -1
  162. package/dist/daemon/server.ts +143 -49
  163. package/dist/daemon/session-sync.ts +11 -0
  164. package/dist/daemon/shadow-sync.ts +11 -0
  165. package/dist/daemon/watcher.ts +56 -5
  166. package/dist/daemon/websocket/project-resolution.ts +77 -0
  167. package/dist/export/json.d.ts.map +1 -1
  168. package/dist/export/json.js +104 -1
  169. package/dist/export/json.js.map +1 -1
  170. package/dist/export/types.d.ts +52 -1
  171. package/dist/export/types.d.ts.map +1 -1
  172. package/dist/index.d.ts +1 -0
  173. package/dist/index.d.ts.map +1 -1
  174. package/dist/index.js +1 -0
  175. package/dist/index.js.map +1 -1
  176. package/dist/parser/agent-detection.d.ts +1 -1
  177. package/dist/parser/agent-detection.d.ts.map +1 -1
  178. package/dist/parser/agent-detection.js +10 -0
  179. package/dist/parser/agent-detection.js.map +1 -1
  180. package/dist/parser/config.d.ts +397 -2
  181. package/dist/parser/config.d.ts.map +1 -1
  182. package/dist/parser/config.js +125 -3
  183. package/dist/parser/config.js.map +1 -1
  184. package/dist/parser/dispatch-workspaces.d.ts +18 -0
  185. package/dist/parser/dispatch-workspaces.d.ts.map +1 -0
  186. package/dist/parser/dispatch-workspaces.js +209 -0
  187. package/dist/parser/dispatch-workspaces.js.map +1 -0
  188. package/dist/parser/doctor.d.ts.map +1 -1
  189. package/dist/parser/doctor.js +27 -8
  190. package/dist/parser/doctor.js.map +1 -1
  191. package/dist/parser/file-lock.d.ts.map +1 -1
  192. package/dist/parser/file-lock.js +9 -2
  193. package/dist/parser/file-lock.js.map +1 -1
  194. package/dist/parser/index.d.ts +6 -0
  195. package/dist/parser/index.d.ts.map +1 -1
  196. package/dist/parser/index.js +6 -0
  197. package/dist/parser/index.js.map +1 -1
  198. package/dist/parser/plans.d.ts.map +1 -1
  199. package/dist/parser/plans.js +1 -0
  200. package/dist/parser/plans.js.map +1 -1
  201. package/dist/parser/refs.d.ts +8 -1
  202. package/dist/parser/refs.d.ts.map +1 -1
  203. package/dist/parser/refs.js +27 -1
  204. package/dist/parser/refs.js.map +1 -1
  205. package/dist/parser/review-operations.d.ts +72 -0
  206. package/dist/parser/review-operations.d.ts.map +1 -0
  207. package/dist/parser/review-operations.js +185 -0
  208. package/dist/parser/review-operations.js.map +1 -0
  209. package/dist/parser/review-task-integration.d.ts +78 -0
  210. package/dist/parser/review-task-integration.d.ts.map +1 -0
  211. package/dist/parser/review-task-integration.js +173 -0
  212. package/dist/parser/review-task-integration.js.map +1 -0
  213. package/dist/parser/review-threads.d.ts +101 -0
  214. package/dist/parser/review-threads.d.ts.map +1 -0
  215. package/dist/parser/review-threads.js +222 -0
  216. package/dist/parser/review-threads.js.map +1 -0
  217. package/dist/parser/review-validation.d.ts +69 -0
  218. package/dist/parser/review-validation.d.ts.map +1 -0
  219. package/dist/parser/review-validation.js +207 -0
  220. package/dist/parser/review-validation.js.map +1 -0
  221. package/dist/parser/reviews.d.ts +58 -0
  222. package/dist/parser/reviews.d.ts.map +1 -0
  223. package/dist/parser/reviews.js +230 -0
  224. package/dist/parser/reviews.js.map +1 -0
  225. package/dist/parser/session-branch.d.ts +91 -0
  226. package/dist/parser/session-branch.d.ts.map +1 -0
  227. package/dist/parser/session-branch.js +565 -0
  228. package/dist/parser/session-branch.js.map +1 -0
  229. package/dist/parser/session-sync-scheduler.d.ts +53 -0
  230. package/dist/parser/session-sync-scheduler.d.ts.map +1 -0
  231. package/dist/parser/session-sync-scheduler.js +100 -0
  232. package/dist/parser/session-sync-scheduler.js.map +1 -0
  233. package/dist/parser/setup-status.d.ts +7 -1
  234. package/dist/parser/setup-status.d.ts.map +1 -1
  235. package/dist/parser/setup-status.js +104 -39
  236. package/dist/parser/setup-status.js.map +1 -1
  237. package/dist/parser/shadow-sync-scheduler.d.ts +71 -0
  238. package/dist/parser/shadow-sync-scheduler.d.ts.map +1 -0
  239. package/dist/parser/shadow-sync-scheduler.js +139 -0
  240. package/dist/parser/shadow-sync-scheduler.js.map +1 -0
  241. package/dist/parser/shadow.d.ts +121 -14
  242. package/dist/parser/shadow.d.ts.map +1 -1
  243. package/dist/parser/shadow.js +752 -27
  244. package/dist/parser/shadow.js.map +1 -1
  245. package/dist/parser/skill-render.d.ts +24 -0
  246. package/dist/parser/skill-render.d.ts.map +1 -1
  247. package/dist/parser/skill-render.js +98 -26
  248. package/dist/parser/skill-render.js.map +1 -1
  249. package/dist/parser/validate.d.ts +43 -3
  250. package/dist/parser/validate.d.ts.map +1 -1
  251. package/dist/parser/validate.js +204 -30
  252. package/dist/parser/validate.js.map +1 -1
  253. package/dist/parser/yaml.d.ts +47 -11
  254. package/dist/parser/yaml.d.ts.map +1 -1
  255. package/dist/parser/yaml.js +329 -149
  256. package/dist/parser/yaml.js.map +1 -1
  257. package/dist/review/checks.d.ts +97 -0
  258. package/dist/review/checks.d.ts.map +1 -0
  259. package/dist/review/checks.js +175 -0
  260. package/dist/review/checks.js.map +1 -0
  261. package/dist/review/index.d.ts +3 -0
  262. package/dist/review/index.d.ts.map +1 -0
  263. package/dist/review/index.js +3 -0
  264. package/dist/review/index.js.map +1 -0
  265. package/dist/review/subject-bindings.d.ts +83 -0
  266. package/dist/review/subject-bindings.d.ts.map +1 -0
  267. package/dist/review/subject-bindings.js +175 -0
  268. package/dist/review/subject-bindings.js.map +1 -0
  269. package/dist/schema/common.d.ts +26 -0
  270. package/dist/schema/common.d.ts.map +1 -1
  271. package/dist/schema/common.js +13 -0
  272. package/dist/schema/common.js.map +1 -1
  273. package/dist/schema/dispatch-workspace.d.ts +2643 -0
  274. package/dist/schema/dispatch-workspace.d.ts.map +1 -0
  275. package/dist/schema/dispatch-workspace.js +187 -0
  276. package/dist/schema/dispatch-workspace.js.map +1 -0
  277. package/dist/schema/inbox.d.ts +8 -8
  278. package/dist/schema/index.d.ts +2 -0
  279. package/dist/schema/index.d.ts.map +1 -1
  280. package/dist/schema/index.js +2 -0
  281. package/dist/schema/index.js.map +1 -1
  282. package/dist/schema/meta.d.ts +648 -116
  283. package/dist/schema/meta.d.ts.map +1 -1
  284. package/dist/schema/meta.js +27 -0
  285. package/dist/schema/meta.js.map +1 -1
  286. package/dist/schema/plan.d.ts +30 -19
  287. package/dist/schema/plan.d.ts.map +1 -1
  288. package/dist/schema/plan.js +3 -1
  289. package/dist/schema/plan.js.map +1 -1
  290. package/dist/schema/review-records.d.ts +2676 -0
  291. package/dist/schema/review-records.d.ts.map +1 -0
  292. package/dist/schema/review-records.js +232 -0
  293. package/dist/schema/review-records.js.map +1 -0
  294. package/dist/schema/spec.d.ts +32 -14
  295. package/dist/schema/spec.d.ts.map +1 -1
  296. package/dist/schema/spec.js +5 -0
  297. package/dist/schema/spec.js.map +1 -1
  298. package/dist/schema/task.d.ts +187 -29
  299. package/dist/schema/task.d.ts.map +1 -1
  300. package/dist/schema/task.js +12 -2
  301. package/dist/schema/task.js.map +1 -1
  302. package/dist/schema/triage.d.ts +22 -22
  303. package/dist/sessions/cache.d.ts +119 -0
  304. package/dist/sessions/cache.d.ts.map +1 -0
  305. package/dist/sessions/cache.js +284 -0
  306. package/dist/sessions/cache.js.map +1 -0
  307. package/dist/sessions/index.d.ts +1 -0
  308. package/dist/sessions/index.d.ts.map +1 -1
  309. package/dist/sessions/index.js +2 -0
  310. package/dist/sessions/index.js.map +1 -1
  311. package/dist/sessions/legacy.d.ts +77 -0
  312. package/dist/sessions/legacy.d.ts.map +1 -0
  313. package/dist/sessions/legacy.js +146 -0
  314. package/dist/sessions/legacy.js.map +1 -0
  315. package/dist/sessions/store.d.ts +103 -73
  316. package/dist/sessions/store.d.ts.map +1 -1
  317. package/dist/sessions/store.js +335 -186
  318. package/dist/sessions/store.js.map +1 -1
  319. package/dist/sessions/types.d.ts +44 -16
  320. package/dist/sessions/types.d.ts.map +1 -1
  321. package/dist/sessions/types.js +11 -2
  322. package/dist/sessions/types.js.map +1 -1
  323. package/dist/strings/errors.d.ts +32 -0
  324. package/dist/strings/errors.d.ts.map +1 -1
  325. package/dist/strings/errors.js +17 -0
  326. package/dist/strings/errors.js.map +1 -1
  327. package/dist/strings/labels.d.ts +1 -0
  328. package/dist/strings/labels.d.ts.map +1 -1
  329. package/dist/strings/labels.js +1 -0
  330. package/dist/strings/labels.js.map +1 -1
  331. package/dist/utils/activity.d.ts +101 -0
  332. package/dist/utils/activity.d.ts.map +1 -0
  333. package/dist/utils/activity.js +408 -0
  334. package/dist/utils/activity.js.map +1 -0
  335. package/dist/utils/git.d.ts +31 -0
  336. package/dist/utils/git.d.ts.map +1 -1
  337. package/dist/utils/git.js +87 -0
  338. package/dist/utils/git.js.map +1 -1
  339. package/dist/utils/index.d.ts +2 -0
  340. package/dist/utils/index.d.ts.map +1 -1
  341. package/dist/utils/index.js +1 -0
  342. package/dist/utils/index.js.map +1 -1
  343. package/dist/web-ui/_app/immutable/assets/0.tmlwn-Ih.css +1 -0
  344. package/dist/web-ui/_app/immutable/assets/9.BwwJybWx.css +1 -0
  345. package/dist/web-ui/_app/immutable/chunks/2KqE8gtn.js +1 -0
  346. package/dist/web-ui/_app/immutable/chunks/70-t_QvE.js +1 -0
  347. package/dist/web-ui/_app/immutable/chunks/AiWQj974.js +1 -0
  348. package/dist/web-ui/_app/immutable/chunks/{CPPfDSei.js → B25nWFyA.js} +4 -4
  349. package/dist/web-ui/_app/immutable/chunks/{DBYE9jOd.js → B2bcA_Q_.js} +1 -1
  350. package/dist/web-ui/_app/immutable/chunks/B5e5HYyB.js +1 -0
  351. package/dist/web-ui/_app/immutable/chunks/B7-5z6eA.js +1 -0
  352. package/dist/web-ui/_app/immutable/chunks/B7bGmhK0.js +1 -0
  353. package/dist/web-ui/_app/immutable/chunks/{DzO4hlg9.js → B8tYZKAE.js} +1 -1
  354. package/dist/web-ui/_app/immutable/chunks/{B5LJFxqa.js → BFGAyJjD.js} +1 -1
  355. package/dist/web-ui/_app/immutable/chunks/BG0850zf.js +1 -0
  356. package/dist/web-ui/_app/immutable/chunks/{DAMmvwn4.js → BG8eSzAd.js} +1 -1
  357. package/dist/web-ui/_app/immutable/chunks/BIMxXS8I.js +1 -0
  358. package/dist/web-ui/_app/immutable/chunks/BSzL1fpU.js +1 -0
  359. package/dist/web-ui/_app/immutable/chunks/BYtjHfeq.js +1 -0
  360. package/dist/web-ui/_app/immutable/chunks/{DxCk-KHc.js → Bp5pFYXL.js} +1 -1
  361. package/dist/web-ui/_app/immutable/chunks/{B8a0xDxR.js → BsJFsuAT.js} +1 -1
  362. package/dist/web-ui/_app/immutable/chunks/BvpNHcD6.js +1 -0
  363. package/dist/web-ui/_app/immutable/chunks/BypqA25-.js +1 -0
  364. package/dist/web-ui/_app/immutable/chunks/{BVA9Exy-.js → C0w6WDm5.js} +1 -1
  365. package/dist/web-ui/_app/immutable/chunks/C5_PAZ0y.js +1 -0
  366. package/dist/web-ui/_app/immutable/chunks/CDRO15Iv.js +1 -0
  367. package/dist/web-ui/_app/immutable/chunks/CF1CoqD5.js +1 -0
  368. package/dist/web-ui/_app/immutable/chunks/CS2sa4_m.js +1 -0
  369. package/dist/web-ui/_app/immutable/chunks/{BJ0JX3ea.js → CWUQwB9H.js} +1 -1
  370. package/dist/web-ui/_app/immutable/chunks/CY5FDdSU.js +1 -0
  371. package/dist/web-ui/_app/immutable/chunks/C_7MTDoj.js +1 -0
  372. package/dist/web-ui/_app/immutable/chunks/{D3vxvonu.js → CaAJD3dl.js} +1 -1
  373. package/dist/web-ui/_app/immutable/chunks/{BP352uRn.js → ChB5iyEL.js} +1 -1
  374. package/dist/web-ui/_app/immutable/chunks/{pE6cYWlS.js → ChQD-6N8.js} +1 -1
  375. package/dist/web-ui/_app/immutable/chunks/{Eo4gF7ih.js → CqbsoCwA.js} +1 -1
  376. package/dist/web-ui/_app/immutable/chunks/DCeJW50p.js +1 -0
  377. package/dist/web-ui/_app/immutable/chunks/{Cncwi6fQ.js → DJtZNgcs.js} +1 -1
  378. package/dist/web-ui/_app/immutable/chunks/DKIeaprD.js +1 -0
  379. package/dist/web-ui/_app/immutable/chunks/DLd2uVIA.js +1 -0
  380. package/dist/web-ui/_app/immutable/chunks/{DjcCz-PU.js → DW_subyT.js} +2 -2
  381. package/dist/web-ui/_app/immutable/chunks/DbU6lVn0.js +1 -0
  382. package/dist/web-ui/_app/immutable/chunks/Dc7ZCC5m.js +1 -0
  383. package/dist/web-ui/_app/immutable/chunks/Dd5umPsk.js +2 -0
  384. package/dist/web-ui/_app/immutable/chunks/{BysXJlZb.js → Dg_zDpDS.js} +1 -1
  385. package/dist/web-ui/_app/immutable/chunks/Dgqu8Yuc.js +1 -0
  386. package/dist/web-ui/_app/immutable/chunks/DmxsPZTB.js +1 -0
  387. package/dist/web-ui/_app/immutable/chunks/DphTaFUB.js +1 -0
  388. package/dist/web-ui/_app/immutable/chunks/DqK4iHp0.js +1 -0
  389. package/dist/web-ui/_app/immutable/chunks/{D9QNBZM2.js → DqT6OH_u.js} +2 -2
  390. package/dist/web-ui/_app/immutable/chunks/Ds9I9wQb.js +1 -0
  391. package/dist/web-ui/_app/immutable/chunks/Du5ng3u4.js +1 -0
  392. package/dist/web-ui/_app/immutable/chunks/DxJw79Wi.js +1 -0
  393. package/dist/web-ui/_app/immutable/chunks/GFTX8GgV.js +1 -0
  394. package/dist/web-ui/_app/immutable/chunks/{C076q4JN.js → HNjs76Zz.js} +1 -1
  395. package/dist/web-ui/_app/immutable/chunks/HVMjDi4_.js +1 -0
  396. package/dist/web-ui/_app/immutable/chunks/{BkOJ8DkV.js → P0A_fJvS.js} +1 -1
  397. package/dist/web-ui/_app/immutable/chunks/T3vGWjIL.js +1 -0
  398. package/dist/web-ui/_app/immutable/chunks/VTmrX9Qu.js +1 -0
  399. package/dist/web-ui/_app/immutable/chunks/{k_Qegko0.js → Xvwhx_F1.js} +1 -1
  400. package/dist/web-ui/_app/immutable/chunks/Yyz1XMQA.js +1 -0
  401. package/dist/web-ui/_app/immutable/chunks/{62JVKtnb.js → dh5HeqUr.js} +1 -1
  402. package/dist/web-ui/_app/immutable/chunks/fZMteyca.js +62 -0
  403. package/dist/web-ui/_app/immutable/chunks/{D82RulSH.js → gPrj-hqC.js} +1 -1
  404. package/dist/web-ui/_app/immutable/chunks/htcWMiYN.js +1 -0
  405. package/dist/web-ui/_app/immutable/chunks/{CwELQvbx.js → oTsvd9y4.js} +1 -1
  406. package/dist/web-ui/_app/immutable/chunks/qJfLUwU4.js +1 -0
  407. package/dist/web-ui/_app/immutable/chunks/xCtiO_JE.js +1 -0
  408. package/dist/web-ui/_app/immutable/chunks/{DvA-KON-.js → y4GeEH6k.js} +1 -1
  409. package/dist/web-ui/_app/immutable/entry/app.C4h_eOn6.js +2 -0
  410. package/dist/web-ui/_app/immutable/entry/start.CQFTf9ep.js +1 -0
  411. package/dist/web-ui/_app/immutable/nodes/0.Dh1xO970.js +1 -0
  412. package/dist/web-ui/_app/immutable/nodes/1.l75D3Opx.js +1 -0
  413. package/dist/web-ui/_app/immutable/nodes/10.DBidBPc-.js +1 -0
  414. package/dist/web-ui/_app/immutable/nodes/11.Ab0gUKWe.js +1 -0
  415. package/dist/web-ui/_app/immutable/nodes/12.CMsnoxfs.js +1 -0
  416. package/dist/web-ui/_app/immutable/nodes/13.D8YKuknB.js +1 -0
  417. package/dist/web-ui/_app/immutable/nodes/14.DZ0aan7y.js +1 -0
  418. package/dist/web-ui/_app/immutable/nodes/15.CUIKreDL.js +2 -0
  419. package/dist/web-ui/_app/immutable/nodes/16.BWc8--BO.js +1 -0
  420. package/dist/web-ui/_app/immutable/nodes/2.CDUonbuh.js +1 -0
  421. package/dist/web-ui/_app/immutable/nodes/3.Ctg3M00i.js +1 -0
  422. package/dist/web-ui/_app/immutable/nodes/4.Ci-JDwbA.js +2 -0
  423. package/dist/web-ui/_app/immutable/nodes/5.CTyEDAq0.js +1 -0
  424. package/dist/web-ui/_app/immutable/nodes/6.BTZZqsAb.js +1 -0
  425. package/dist/web-ui/_app/immutable/nodes/7.BI52g_Jo.js +137 -0
  426. package/dist/web-ui/_app/immutable/nodes/8.3hZPaB9x.js +1 -0
  427. package/dist/web-ui/_app/immutable/nodes/9.DS49kvwl.js +29 -0
  428. package/dist/web-ui/_app/version.json +1 -1
  429. package/dist/web-ui/favicon-192.png +0 -0
  430. package/dist/web-ui/favicon-32.png +0 -0
  431. package/dist/web-ui/favicon.ico +0 -0
  432. package/dist/web-ui/index.html +14 -14
  433. package/package.json +12 -6
  434. package/plugin/.claude-plugin/marketplace.json +1 -1
  435. package/plugin/.claude-plugin/plugin.json +1 -1
  436. package/plugin/plugins/kspec/skills/merge/SKILL.md +127 -0
  437. package/plugin/plugins/kspec/skills/plan/SKILL.md +55 -26
  438. package/plugin/plugins/kspec/skills/review/SKILL.md +350 -133
  439. package/plugin/plugins/kspec/skills/task-work/SKILL.md +96 -106
  440. package/templates/agents-sections/04-pr-workflow.md +15 -12
  441. package/templates/agents-sections/06-ralph-loop.md +15 -10
  442. package/templates/skills/manifest.yaml +25 -7
  443. package/templates/skills/merge/SKILL.md +120 -0
  444. package/templates/skills/plan/SKILL.md +55 -26
  445. package/templates/skills/review/SKILL.md +346 -130
  446. package/templates/skills/task-work/SKILL.md +93 -103
  447. package/dist/web-ui/_app/immutable/assets/0.BJaYkGW2.css +0 -1
  448. package/dist/web-ui/_app/immutable/assets/9.SzGLxi4x.css +0 -1
  449. package/dist/web-ui/_app/immutable/chunks/-lc0BifF.js +0 -1
  450. package/dist/web-ui/_app/immutable/chunks/8RBjHMN1.js +0 -1
  451. package/dist/web-ui/_app/immutable/chunks/B5wTVqxm.js +0 -1
  452. package/dist/web-ui/_app/immutable/chunks/B6VSmczZ.js +0 -1
  453. package/dist/web-ui/_app/immutable/chunks/BEOQc37C.js +0 -1
  454. package/dist/web-ui/_app/immutable/chunks/BHtYorjv.js +0 -1
  455. package/dist/web-ui/_app/immutable/chunks/BMuCqDX8.js +0 -1
  456. package/dist/web-ui/_app/immutable/chunks/BUZujXJ2.js +0 -1
  457. package/dist/web-ui/_app/immutable/chunks/BWET-efb.js +0 -1
  458. package/dist/web-ui/_app/immutable/chunks/BXkNecpt.js +0 -1
  459. package/dist/web-ui/_app/immutable/chunks/BYzrIfX8.js +0 -1
  460. package/dist/web-ui/_app/immutable/chunks/BpuwufMc.js +0 -1
  461. package/dist/web-ui/_app/immutable/chunks/BwMO4RrG.js +0 -1
  462. package/dist/web-ui/_app/immutable/chunks/C33JaVbg.js +0 -1
  463. package/dist/web-ui/_app/immutable/chunks/CGtqifKp.js +0 -1
  464. package/dist/web-ui/_app/immutable/chunks/CHDZZ7OG.js +0 -1
  465. package/dist/web-ui/_app/immutable/chunks/CUir3f4J.js +0 -60
  466. package/dist/web-ui/_app/immutable/chunks/CrCIbn0C.js +0 -1
  467. package/dist/web-ui/_app/immutable/chunks/D6TVmR9T.js +0 -1
  468. package/dist/web-ui/_app/immutable/chunks/D7LTux4W.js +0 -1
  469. package/dist/web-ui/_app/immutable/chunks/DAh4Wfku.js +0 -1
  470. package/dist/web-ui/_app/immutable/chunks/DAx07bEQ.js +0 -1
  471. package/dist/web-ui/_app/immutable/chunks/DOno4cA2.js +0 -1
  472. package/dist/web-ui/_app/immutable/chunks/DQA8NZIH.js +0 -2
  473. package/dist/web-ui/_app/immutable/chunks/DRfPm2bo.js +0 -1
  474. package/dist/web-ui/_app/immutable/chunks/DhQhksaB.js +0 -1
  475. package/dist/web-ui/_app/immutable/chunks/DjG7s6hm.js +0 -1
  476. package/dist/web-ui/_app/immutable/chunks/DkltRNvh.js +0 -1
  477. package/dist/web-ui/_app/immutable/chunks/DlaTnPKL.js +0 -1
  478. package/dist/web-ui/_app/immutable/chunks/ExCq5swK.js +0 -1
  479. package/dist/web-ui/_app/immutable/chunks/T3zZGv51.js +0 -1
  480. package/dist/web-ui/_app/immutable/chunks/XZumBYeP.js +0 -1
  481. package/dist/web-ui/_app/immutable/chunks/_ySfNjkF.js +0 -1
  482. package/dist/web-ui/_app/immutable/chunks/iEtR5cV6.js +0 -1
  483. package/dist/web-ui/_app/immutable/entry/app.Cgu6uKeS.js +0 -2
  484. package/dist/web-ui/_app/immutable/entry/start.9XifnLoB.js +0 -1
  485. package/dist/web-ui/_app/immutable/nodes/0.DISwcKSK.js +0 -1
  486. package/dist/web-ui/_app/immutable/nodes/1.Cx2Ufqp1.js +0 -1
  487. package/dist/web-ui/_app/immutable/nodes/10.C3z8ijXL.js +0 -1
  488. package/dist/web-ui/_app/immutable/nodes/11.DZdIjZmM.js +0 -1
  489. package/dist/web-ui/_app/immutable/nodes/12.FsIGfAOa.js +0 -1
  490. package/dist/web-ui/_app/immutable/nodes/13.DZoFwagf.js +0 -1
  491. package/dist/web-ui/_app/immutable/nodes/14.DaIzDKbQ.js +0 -1
  492. package/dist/web-ui/_app/immutable/nodes/15.BYyt4XWF.js +0 -2
  493. package/dist/web-ui/_app/immutable/nodes/16.CQkSqpOe.js +0 -1
  494. package/dist/web-ui/_app/immutable/nodes/2.Bkf_j2UJ.js +0 -1
  495. package/dist/web-ui/_app/immutable/nodes/3.kaMCurJG.js +0 -1
  496. package/dist/web-ui/_app/immutable/nodes/4.BSsFPTHG.js +0 -2
  497. package/dist/web-ui/_app/immutable/nodes/5.CpPlcCEZ.js +0 -1
  498. package/dist/web-ui/_app/immutable/nodes/6.BN4FqQmY.js +0 -1
  499. package/dist/web-ui/_app/immutable/nodes/7.9kBYIZik.js +0 -1
  500. package/dist/web-ui/_app/immutable/nodes/8.BuijtZ6B.js +0 -1
  501. package/dist/web-ui/_app/immutable/nodes/9.C-Weba8R.js +0 -1
@@ -1,225 +1,441 @@
1
1
  # Review
2
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.
3
+ How to review work and use kspec review records. Covers both the reviewer perspective (creating reviews, structuring findings) and the worker perspective (reading feedback, addressing issues). Bakes in review principles, AC coverage verification, and the full review record interface.
4
4
 
5
5
  ## When to Use
6
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
7
+ - Reviewing submitted work (as reviewer)
8
+ - Reading and addressing review feedback (as worker)
9
+ - Creating or managing review records
10
+ - Verifying AC coverage before submitting work
10
11
 
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
+ ## Two Perspectives
12
13
 
13
- ## Spec Context Discovery
14
+ This skill serves both sides of the review process:
14
15
 
15
- If a spec ref is not explicitly provided, discover it before proceeding with AC checks:
16
+ - **As a reviewer:** Create reviews, investigate code, structure findings as threads, record checks, submit verdicts
17
+ - **As a worker:** Read review threads, understand what's blocking, address findings, request re-review
16
18
 
17
- ```bash
18
- # 1. Check commit messages for Task: or Spec: trailers
19
- git log --format='%B' main..HEAD | grep -E '^(Task|Spec):'
19
+ Both perspectives use the same review record system.
20
20
 
21
- # 2. Check changed files for // AC: annotations pointing to specs
22
- git diff main..HEAD | grep '// AC: @'
21
+ ---
23
22
 
24
- # 3. If a task ref is found, get its spec_ref
25
- kspec task get @task-ref --json | jq '.spec_ref'
23
+ ## Review Principles
26
24
 
27
- # 4. Search recent tasks matching the scope of changes
28
- kspec tasks list | grep -i "<keywords from changed files>"
29
- ```
25
+ ### Adversarial Investigation
30
26
 
31
- If a spec is found through any method, proceed with full AC validation below.
32
- If no spec context is found after all discovery steps, skip AC coverage checks and focus on code quality and regression checks.
27
+ **Worker claims are hypotheses, not facts.** When a commit message says "all tests pass," verify it. When a note says "fixed the type errors," check they're actually fixed and not suppressed. Workers are not lying — but they are biased toward believing their own work is correct. Your job is to independently verify.
33
28
 
34
- **Principle:** The absence of a trailer is a signal to look harder, not permission to skip validation.
29
+ **Read the code before the description.** Start by reading the diff — what changed, what was added, what was removed. Form your own understanding. Only then read the task notes or PR description and compare. This prevents anchoring bias.
35
30
 
36
- ## CLI Lookups
31
+ **Treat justifications as claims to verify.** "Pre-existing issue," "out of scope," "will be addressed in follow-up," "this is the standard pattern" — these require evidence, not acceptance.
37
32
 
38
- Use CLI commands to resolve specs and traits. **Do NOT search `.kspec/` YAML files manually.**
33
+ **A clean review is valid.** Not every submission has bugs. If you investigate thoroughly and find nothing wrong, approve. Do not invent findings to justify time spent. The goal is accuracy, not a finding quota.
39
34
 
40
- | Need | Command |
41
- |------|---------|
42
- | Spec + all ACs (own + inherited) | `kspec item get @spec-ref` |
43
- | Trait definition + ACs | `kspec item get @trait-slug` |
44
- | All traits on a spec | shown in `kspec item get @spec-ref` output |
45
- | Search by keyword | `kspec search "keyword"` |
46
- | All traits | `kspec trait list` |
35
+ ### Cognitive Biases to Counteract
36
+
37
+ **Satisfaction of search** After finding the first issue, your detection rate drops 25-50%. Finding one issue makes it MORE likely there are others. Deliberately increase scrutiny after your first finding.
38
+
39
+ **Complexity bias** Simple-looking changes (renames, test rewrites, config changes) receive less scrutiny because they "look safe." These are where semantic bugs hide. Every submission gets the same investigation depth.
47
40
 
48
- **Resolving inherited traits:** When `kspec item get` shows "Inherited from @trait-slug", run `kspec item get @trait-slug` to see the full trait ACs. This is one command — never grep through `.kspec/modules/*.yaml` files.
41
+ **Anchoring** Don't frame analysis around the author's stated intent. Assess what the code actually does, not what the author says it does.
49
42
 
50
- ## Spec Alignment
43
+ **Decision fatigue** — On the Nth review, reviewers default to approval. Every approval must be backed by specific evidence of verification.
51
44
 
52
- Implementation must match spec intent, not just pass tests.
45
+ ### Structured Exploration
53
46
 
54
- ### How to Verify
47
+ Before rendering any verdict, complete both deterministic and analytical checks:
55
48
 
49
+ **Deterministic checks** (run these, don't reason about them):
56
50
  ```bash
57
- # Read the spec all ACs (own + inherited)
58
- kspec item get @spec-ref
51
+ kspec item get @spec-ref # Own ACs + inherited trait ACs
52
+ kspec validate # Trait coverage warnings
53
+ # Run the project's test suite
54
+ grep -rn "AC: @spec-ref" tests/ # Own AC annotations (adapt path/syntax)
55
+ grep -rn "AC: @trait-" tests/ # Trait AC annotations
59
56
  ```
60
57
 
61
- For each AC, verify:
62
- 1. **Implementation exists**Code handles the described behavior
63
- 2. **Test exists**A test validates the behavior
64
- 3. **Behavior matches**The test actually proves the AC, not just syntactically passes
58
+ **Analytical checks** (require reading and judgment):
59
+ 1. Read the diff every changed file, not just the interesting ones
60
+ 2. Read surrounding context unchanged files that interact with changed code
61
+ 3. Verify spec alignment for each AC, confirm the code satisfies the behavior
62
+ 4. Verify at least one worker claim independently
63
+ 5. Search across categories — correctness, edge cases, error handling, security, test quality, integration
65
64
 
66
- ### What to Flag
65
+ ---
67
66
 
68
- | Issue | Severity |
69
- |-------|----------|
70
- | AC has no implementation | MUST-FIX |
71
- | AC has no test | MUST-FIX |
72
- | Implementation deviates from spec | MUST-FIX |
73
- | Undocumented behavior (not in any AC) | SHOULD-FIX |
74
- | Spec is vague, implementation chose reasonable interpretation | Note it |
67
+ ## AC Coverage Verification
75
68
 
76
- ## Own AC Coverage
69
+ ### Own AC Coverage
77
70
 
78
71
  Every acceptance criterion on the spec MUST have at least one annotated test.
79
72
 
80
- ### Annotation Format
73
+ ```bash
74
+ # Get all ACs (own + inherited from traits)
75
+ kspec item get @spec-ref
76
+
77
+ # Search for annotations in test files (adapt to your language/paths)
78
+ grep -rn "AC: @spec-ref" tests/
79
+ ```
80
+
81
+ Annotations use language-appropriate comment syntax:
81
82
 
82
83
  ```javascript
83
- // AC: @spec-ref ac-N
84
- it('should validate input when given invalid data', () => { ... });
84
+ // AC: @spec-ref ac-1
85
+ it('should validate input', () => { ... });
85
86
  ```
86
87
 
87
88
  ```python
88
- # AC: @spec-ref ac-N
89
+ # AC: @spec-ref ac-1
89
90
  def test_validates_input():
90
91
  ...
91
92
  ```
92
93
 
93
- ### Checking Coverage
94
+ Before accepting coverage, confirm each annotation matches the AC text from `kspec item get` — not just the `ac-N` number. A test must actually prove the AC, not just touch the code path.
95
+
96
+ ### Trait AC Coverage
97
+
98
+ When a spec implements traits, it inherits their ACs. Every inherited AC needs test coverage using the **trait's** ref:
99
+
100
+ ```javascript
101
+ // AC: @trait-json-output ac-1
102
+ it('should output valid JSON with --json flag', () => { ... });
103
+ ```
94
104
 
95
105
  ```bash
96
- # Get all ACs for the spec
97
- kspec item get @spec-ref
106
+ # kspec validate reports uncovered trait ACs
107
+ kspec validate
108
+ ```
109
+
110
+ Any "inherited trait AC(s) without test coverage" warning is a blocker.
111
+
112
+ If a trait AC genuinely doesn't apply, annotate it with a reason:
113
+
114
+ ```javascript
115
+ // AC: @trait-json-output ac-3 — N/A: this command has no tabular output
116
+ ```
117
+
118
+ Annotations must be standalone line comments, not embedded in block comments.
119
+
120
+ ### Spec Alignment
121
+
122
+ Implementation must match spec intent, not just pass tests:
123
+
124
+ 1. **Implementation exists** — Code handles the described behavior
125
+ 2. **Test exists** — A test validates the behavior
126
+ 3. **Behavior matches** — The test actually proves the AC, not just syntactically passes
127
+
128
+ ---
129
+
130
+ ## Review Records
131
+
132
+ kspec stores first-party review records as durable artifacts in the shadow branch. They track the full lifecycle of reviewing work — threaded comments, check results, verdicts, and audit history.
98
133
 
99
- # Search for annotations in test files
100
- # (adapt grep path to your project's test directories)
101
- grep -rn "// AC: @spec-ref" tests/
134
+ ### Review Lifecycle
135
+
136
+ ```
137
+ draft → open → closed
138
+
139
+ archived (terminal)
102
140
  ```
103
141
 
104
- Each AC listed in the spec output must have a corresponding annotation. Missing annotations are MUST-FIX.
105
- Before accepting coverage, confirm each annotation matches the AC text from `kspec item get @spec-ref` (not only the `ac-N` label).
142
+ | State | Meaning |
143
+ |-------|---------|
144
+ | `draft` | Review created but not yet started |
145
+ | `open` | Active review in progress |
146
+ | `closed` | Review concluded (auto-closed on approve/request_changes verdict) |
147
+ | `archived` | Permanently archived |
148
+
149
+ **Auto-close on verdict:** When a reviewer submits an `approve` or `request_changes` verdict, the review record automatically transitions to `closed`. A `comment` verdict leaves the review open since it doesn't represent a final assessment. Each closed review is a point-in-time artifact.
106
150
 
107
- ## Trait AC Coverage
151
+ ### Per-Cycle Review Model
108
152
 
109
- When a spec implements traits, it inherits their ACs. Every inherited trait AC must also have test coverage.
153
+ Each review cycle produces its own review record. This is analogous to individual PR reviews on GitHub — each review is a discrete artifact with its own verdict, and the collection of reviews across cycles comprises the full review history for the task.
110
154
 
111
- ### How It Works
155
+ **How it works:**
156
+ - When a task enters `pending_review`, the reviewer creates a **new** review record
157
+ - If a prior closed review exists, it remains as a historical artifact
158
+ - The task's `review_ref` is updated to point to the new record
159
+ - Historical reviews are accessible via `kspec review for-task @ref` (returns all linked reviews)
160
+
161
+ **Do NOT reopen old reviews.** Instead, create a fresh review for each cycle. This keeps each review's findings, verdict, and context self-contained.
162
+
163
+ ### Disposition (Computed)
164
+
165
+ The disposition is computed from verdicts, checks, and threads — not set directly:
166
+
167
+ | Disposition | Condition |
168
+ |-------------|-----------|
169
+ | `pending` | No verdicts, or only `comment` verdicts |
170
+ | `approved` | At least one `approve` verdict matching current version, no blocking `request_changes`, all required gates passing, no unresolved blocker threads |
171
+ | `changes_requested` | Any `request_changes` verdict matching current version, or required gates failing, or unresolved blocker threads |
172
+
173
+ ### Creating Reviews
112
174
 
113
175
  ```bash
114
- # kspec item get shows inherited ACs under "Inherited from @trait-slug" sections
115
- kspec item get @spec-ref
176
+ # Review a task (auto-links review_ref on the task)
177
+ kspec review add --title "Review task-add-auth" \
178
+ --subject-type task --subject-ref @task-add-auth
179
+
180
+ # Review committed code (requires base/head commits)
181
+ kspec review add --title "Review feature branch" \
182
+ --subject-type code --base abc1234 --head def5678 \
183
+ --base-branch main --head-branch feat/auth \
184
+ --related-ref @task-add-auth
185
+
186
+ # Review a plan or spec
187
+ kspec review add --title "Review auth plan" \
188
+ --subject-type plan --subject-ref @plan-auth
116
189
  ```
117
190
 
118
- Each inherited AC needs a test annotated with the **trait's** ref, not the spec's ref:
191
+ **Subject types:** `task`, `code`, `plan`, `spec`, `external`
119
192
 
120
- ```javascript
121
- // AC: @trait-json-output ac-1
122
- it('should output valid JSON with --json flag', () => { ... });
193
+ ### Structuring Findings as Threads
194
+
195
+ Each finding becomes a thread with a kind that determines its impact:
196
+
197
+ ```bash
198
+ # Blocker — must be resolved before approval
199
+ kspec review comment @review-ref \
200
+ --body "Missing error handling for invalid input" --kind blocker
201
+
202
+ # Question — non-blocking, needs clarification
203
+ kspec review comment @review-ref \
204
+ --body "Why was this approach chosen over X?" --kind question
205
+
206
+ # Nit — non-blocking, minor suggestion (default)
207
+ kspec review comment @review-ref \
208
+ --body "Consider renaming this variable" --kind nit
123
209
  ```
124
210
 
125
- ### Checking Coverage
211
+ **Thread kinds:** `blocker` (blocks approval), `question` (non-blocking), `nit` (non-blocking, default).
212
+
213
+ Only blocker threads affect disposition. Unresolved nits and questions do not block approval.
214
+
215
+ #### Code-Targeted Comments
216
+
217
+ Anchor findings to specific lines for code reviews:
126
218
 
127
219
  ```bash
128
- # kspec validate reports uncovered trait ACs
129
- kspec validate
220
+ kspec review comment @review-ref --body "Off-by-one error" --kind blocker \
221
+ --path src/parser/validate.ts --side head --line-start 42 --line-end 42 \
222
+ --commit def5678
223
+ ```
224
+
225
+ #### Structured Anchors (for plans/specs)
130
226
 
131
- # Search for specific trait annotations
132
- grep -rn "// AC: @trait-json-output" tests/
227
+ ```bash
228
+ kspec review comment @review-ref --body "AC is too vague" --kind blocker \
229
+ --section acceptance_criteria --field ac-3 --anchor-ref @spec-ref
133
230
  ```
134
231
 
135
- Any "inherited trait AC(s) without test coverage" warning from `kspec validate` is a MUST-FIX blocker.
232
+ ### Recording Checks
136
233
 
137
- ### When a Trait AC Doesn't Apply
234
+ Checks record verification evidence bound to the reviewed state:
138
235
 
139
- If a trait AC genuinely doesn't apply to this spec, annotate it with a reason:
236
+ ```bash
237
+ # Passing test run
238
+ kspec review check @review-ref --name "vitest" --status pass \
239
+ --runner vitest --evidence "All 342 tests passed" \
240
+ --version-base abc1234 --version-head def5678
241
+
242
+ # Failing check
243
+ kspec review check @review-ref --name "lint" --status fail \
244
+ --runner eslint --evidence "3 errors found" \
245
+ --version-base abc1234 --version-head def5678
246
+
247
+ # Informational (non-required) check
248
+ kspec review check @review-ref --name "coverage" --status pass \
249
+ --no-required --evidence "87% coverage" \
250
+ --version-base abc1234 --version-head def5678
251
+ ```
140
252
 
141
- ```javascript
142
- // AC: @trait-json-output ac-3 — N/A: this command has no tabular output to format
253
+ **Check statuses:** `pass`, `fail`, `running`, `skipped`
254
+
255
+ Checks whose `applies_to_version` does not match the current subject version are stale.
256
+
257
+ ### Submitting Verdicts
258
+
259
+ Verdicts record individual reviewer decisions:
260
+
261
+ ```bash
262
+ # Approve
263
+ kspec review verdict @review-ref --decision approve \
264
+ --reviewer agent@example.com \
265
+ --version-base abc1234 --version-head def5678
266
+
267
+ # Request changes (triggers needs_work on linked task)
268
+ kspec review verdict @review-ref --decision request_changes \
269
+ --reviewer agent@example.com \
270
+ --version-base abc1234 --version-head def5678
271
+
272
+ # Comment (non-blocking)
273
+ kspec review verdict @review-ref --decision comment \
274
+ --reviewer agent@example.com \
275
+ --version-base abc1234 --version-head def5678
276
+ ```
277
+
278
+ Verdicts are per-reviewer. A later verdict from the same reviewer replaces the earlier one for the same version. Verdicts not matching the current subject version are stale.
279
+
280
+ ### Replying and Resolving Threads
281
+
282
+ ```bash
283
+ # Reply to a thread
284
+ kspec review reply @review-ref --thread <thread-ulid> \
285
+ --body "Fixed in commit abc1234"
286
+
287
+ # Resolve a thread
288
+ kspec review resolve @review-ref --thread <thread-ulid>
289
+
290
+ # Reopen if fix was insufficient
291
+ kspec review reopen @review-ref --thread <thread-ulid>
143
292
  ```
144
293
 
145
- The annotation must exist so coverage tooling can track it.
146
- Annotations must be standalone line comments (`// AC:` or `# AC:`), not embedded inside block/JSDoc comments.
294
+ ### Fix Cycles (Re-review After Changes)
147
295
 
148
- ### No Traits?
296
+ When a task returns to `pending_review` after a fix cycle, the reviewer creates a **new** review record rather than updating the old one:
149
297
 
150
- If the spec has no traits (`kspec item get` shows no "Inherited from" sections), skip this step entirely.
298
+ ```bash
299
+ # The old review is already closed (auto-closed on verdict)
300
+ # Create a fresh review for the new cycle
301
+ kspec review add --title "Review task-foo (cycle 2)" \
302
+ --subject-type task --subject-ref @task-foo
303
+
304
+ # The task's review_ref now points to this new review
305
+ # The prior review remains accessible via for-task
306
+ kspec review for-task @task-foo # Shows all reviews, current + historical
307
+ ```
151
308
 
152
- ## Validation Integration
309
+ If dispatch workspace metadata is available, the new review's orientation will include a diff summary showing what changed since the prior review's examined commit.
310
+
311
+ **Subject refresh** is still available for within-cycle updates (e.g., reviewer pushes a minor fix before verdicting):
153
312
 
154
313
  ```bash
155
- kspec validate
314
+ kspec review refresh @review-ref --head new-commit-sha
156
315
  ```
157
316
 
158
- Validation catches spec-level issues:
159
- - Missing acceptance criteria on specs
160
- - Broken references (dangling `@slug`)
161
- - Missing descriptions
162
- - Uncovered trait ACs (the most common review finding)
163
- - Orphaned specs (no linked tasks)
317
+ ### Task Integration
318
+
319
+ Reviews integrate with the task lifecycle:
164
320
 
165
- **Exit codes:** `0` = clean, `4` = errors, `6` = warnings only.
321
+ - Creating a task review auto-sets `task.review_ref` to the new review
322
+ - A `request_changes` verdict auto-transitions `pending_review` tasks to `needs_work` and auto-closes the review
323
+ - An `approve` verdict auto-closes the review
324
+ - `kspec review for-task @ref` finds **all** linked reviews (current + historical)
166
325
 
167
- Treat errors as MUST-FIX. Treat warnings as SHOULD-FIX (especially trait AC warnings).
326
+ ---
168
327
 
169
- ## Review Checklist
328
+ ## Finding Validation
170
329
 
171
- Use this checklist when reviewing implementation against a spec:
330
+ Before emitting any finding, apply the **claim-disprove-emit** cycle:
172
331
 
173
- ### MUST-FIX (Blocks PR)
332
+ 1. **State the claim.** What exactly is wrong? Be specific: file, line, behavior.
333
+ 2. **Try to disprove it.** Look for evidence the code is correct — guard clauses, tests covering the case, spec decisions justifying the approach.
334
+ 3. **If disproved, drop it.** Dropped candidates are the process working correctly.
335
+ 4. **If still valid, assess severity and confidence.**
174
336
 
175
- - [ ] Every own AC has at least one annotated test
176
- - [ ] Every inherited trait AC has at least one annotated test (or N/A annotation)
177
- - [ ] `kspec validate` reports no errors for this spec
178
- - [ ] Implementation matches spec behavior (not just syntactically correct tests)
179
- - [ ] No regressions — existing tests still pass
337
+ ### Finding Quality
180
338
 
181
- ### SHOULD-FIX
339
+ Every finding must include:
340
+ - **Path and line** — exactly where the issue is
341
+ - **Claim** — what is wrong, stated precisely
342
+ - **Impact** — what breaks, what guarantee is lost
343
+ - **Evidence** — what you observed that proves the claim
182
344
 
183
- - [ ] `kspec validate` warnings addressed (especially trait AC coverage)
184
- - [ ] Undocumented behavior has spec coverage or is flagged
185
- - [ ] Test annotations reference correct spec/trait refs
345
+ ### Severity Guide
186
346
 
187
- ### SUGGESTION
347
+ | Severity | When to use |
348
+ |----------|-------------|
349
+ | **MUST-FIX** | Correctness, security, spec violation, coverage loss. High or medium confidence required. |
350
+ | **SHOULD-FIX** | Likely correctness issue, missing boundary case, fragile code. |
351
+ | **SUGGESTION** | Pure style, naming, formatting. Zero correctness implications. |
188
352
 
189
- - [ ] Tests are meaningful (would fail if feature breaks)
190
- - [ ] Prefer E2E over unit where practical
191
- - [ ] Tests run in isolation (temp dirs, not project repo)
353
+ **Default to MUST-FIX.** Only downgrade when you are certain the issue is cosmetic.
192
354
 
193
- ## Severity Guide
355
+ ---
194
356
 
195
- | Finding | Severity | Action |
196
- |---------|----------|--------|
197
- | Missing own AC test annotation | MUST-FIX | Add test with `// AC: @spec-ref ac-N` |
198
- | Missing trait AC test annotation | MUST-FIX | Add test with `// AC: @trait-slug ac-N` |
199
- | `kspec validate` error | MUST-FIX | Fix the validation error |
200
- | Implementation doesn't match spec | MUST-FIX | Fix implementation or update spec |
201
- | `kspec validate` warning | SHOULD-FIX | Address warning |
202
- | Undocumented behavior | SHOULD-FIX | Add AC or note deviation |
203
- | Test doesn't prove its AC | SHOULD-FIX | Rewrite test |
204
- | No E2E tests | SUGGESTION | Consider adding |
357
+ ## As a Worker: Reading Review Feedback
205
358
 
206
- ## Using in Project Reviews
359
+ When your task is in `needs_work`:
207
360
 
208
- This skill provides the kspec-specific gates. Wrap it in your project's review:
361
+ ```bash
362
+ # Find all reviews for the task (current + historical)
363
+ kspec review for-task @ref
364
+
365
+ # Read the most recent review (the one that kicked back to needs_work)
366
+ kspec review get @review-ref
209
367
 
368
+ # Focus on blocker threads — these must be resolved
369
+ # Address questions and nits where reasonable
370
+ # Reply to threads explaining your fix
371
+ kspec review reply @review-ref --thread <ulid> --body "Fixed in commit abc1234"
210
372
  ```
211
- Project Review = kspec:review gates + project-specific gates
373
+
374
+ **Historical context:** If the task has been through multiple fix cycles, `kspec review for-task @ref` returns all reviews. Each is a closed artifact with its own findings and verdict. Read prior reviews to understand the full review history and avoid re-introducing previously flagged issues.
375
+
376
+ After fixing:
377
+ ```bash
378
+ kspec task submit @ref # Back to pending_review — reviewer creates a new review record
212
379
  ```
213
380
 
214
- Project-specific gates to add in your own review skill:
215
- - **Test commands** — How to run your test suite
216
- - **Test patterns** — Project-specific test helpers and isolation patterns
217
- - **Code style** — Naming, error handling, import conventions
218
- - **E2E specifics** — How E2E tests work in your project
219
- - **Regression check** — Full suite command and expectations
381
+ ---
382
+
383
+ ## Reviewer Workflow Summary
384
+
385
+ 1. **Discover context** — `kspec task get @ref`, `kspec item get @spec-ref`
386
+ 2. **Create review** — `kspec review add --subject-type task --subject-ref @ref` (creates a new record each cycle)
387
+ 3. **Open review** — `kspec review open @review-ref`
388
+ 4. **Investigate** — deterministic checks, then analytical checks
389
+ 5. **Record findings** — `kspec review comment` for each finding with appropriate kind
390
+ 6. **Record checks** — `kspec review check` for test/lint results
391
+ 7. **Submit verdict** — `kspec review verdict` (approve or request_changes — auto-closes the review)
392
+
393
+ ---
394
+
395
+ ## CLI Lookups
396
+
397
+ | Need | Command |
398
+ |------|---------|
399
+ | Spec + all ACs (own + inherited) | `kspec item get @spec-ref` |
400
+ | Trait definition + ACs | `kspec item get @trait-slug` |
401
+ | Review details | `kspec review get @review-ref` |
402
+ | Reviews for a task | `kspec review for-task @task-ref` |
403
+ | All open reviews | `kspec review list --status open` |
404
+ | Search by keyword | `kspec search "keyword"` |
405
+ | All traits | `kspec trait list` |
406
+ | Validation | `kspec validate` |
407
+
408
+ ## Command Reference
409
+
410
+ ```bash
411
+ # Create and query
412
+ kspec review add [options] # Create a review record
413
+ kspec review get <ref> # Show review details
414
+ kspec review list [--status, --disposition, --subject-type, --reviewer, --task]
415
+ kspec review for-task <ref> # Find reviews linked to a task
416
+
417
+ # Comments and threads
418
+ kspec review comment <ref> [options] # Add a comment thread
419
+ kspec review reply <ref> --thread <ulid> --body "..."
420
+ kspec review resolve <ref> --thread <ulid>
421
+ kspec review reopen <ref> --thread <ulid>
422
+
423
+ # Checks and verdicts
424
+ kspec review check <ref> [options] # Record a check result
425
+ kspec review verdict <ref> [options] # Set a reviewer verdict
426
+
427
+ # Lifecycle
428
+ kspec review open <ref> # draft → open
429
+ kspec review close <ref> # → closed
430
+ kspec review archive <ref> # → archived (permanent)
431
+
432
+ # Subject management
433
+ kspec review refresh <ref> --head <commit> [--base <commit>]
434
+ ```
220
435
 
221
436
  ## Integration
222
437
 
223
- - **`{skill:task-work}`** — Run review before submitting tasks
438
+ - **`{skill:task-work}`** — Workers read review feedback during fix cycles
439
+ - **`{skill:merge}`** — Merge gate checks review disposition before merging
224
440
  - **`{skill:writing-specs}`** — If review reveals spec gaps, update specs first
225
441
  - **`kspec validate`** — Automated validation complements manual review