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