@rt-tools/agent-kit 0.37.1 → 0.39.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 (371) hide show
  1. package/README.md +5 -5
  2. package/assets/checks/action-of.mjs +154 -0
  3. package/assets/checks/board-runs.github.mjs +40 -5
  4. package/assets/checks/check-board.github.mjs +38 -7
  5. package/assets/checks/check-state-next.mjs +22 -10
  6. package/assets/checks/check-turn-map.mjs +26 -6
  7. package/assets/checks/check-work-steps.mjs +4 -173
  8. package/assets/checks/decide.mjs +285 -0
  9. package/assets/checks/decision-table.json +21432 -0
  10. package/assets/checks/decision-table.mjs +495 -0
  11. package/assets/checks/epic-window.mjs +98 -0
  12. package/assets/checks/flow-condition.mjs +64 -0
  13. package/assets/checks/flow-data.mjs +135 -0
  14. package/assets/checks/flow-forecast.mjs +334 -0
  15. package/assets/checks/flow-guard-run.mjs +90 -0
  16. package/assets/checks/flow-guard.mjs +496 -0
  17. package/assets/checks/flow-model.mjs +271 -0
  18. package/assets/checks/flow-override.mjs +130 -0
  19. package/assets/checks/flow-plan.mjs +206 -0
  20. package/assets/checks/flow-scaffold.mjs +224 -0
  21. package/assets/checks/flow-step.mjs +495 -0
  22. package/assets/checks/flow-sync.mjs +296 -0
  23. package/assets/checks/flow-syntax.mjs +292 -0
  24. package/assets/checks/flow-verdict.mjs +227 -0
  25. package/assets/checks/merge-read.mjs +239 -0
  26. package/assets/checks/owner-nudges.mjs +389 -0
  27. package/assets/checks/push-inputs.mjs +59 -16
  28. package/assets/checks/record-count.mjs +437 -0
  29. package/assets/checks/record-recount.mjs +187 -0
  30. package/assets/checks/record-turn.mjs +155 -0
  31. package/assets/checks/task-flow-script.mjs +318 -0
  32. package/assets/checks/tree-assignment.mjs +26 -7
  33. package/assets/checks/work-result.mjs +362 -0
  34. package/assets/checks/work-steps-lib.mjs +205 -0
  35. package/assets/commands/night.md +6 -6
  36. package/assets/defaults/gate-map.sh +39 -12
  37. package/assets/defaults/merges.sh +48 -0
  38. package/assets/defaults/project.sh +6 -5
  39. package/assets/defaults/turn-map.md +23 -22
  40. package/assets/docs/GLOSSARY.md +5 -1
  41. package/assets/hooks/ask-judge.md +67 -0
  42. package/assets/hooks/browser-guard-device-id.sh +11 -9
  43. package/assets/hooks/browser-guard-no-asking.sh +12 -6
  44. package/assets/hooks/browser-guard-no-listing.sh +13 -7
  45. package/assets/hooks/browser-guard-no-other-drivers.sh +25 -17
  46. package/assets/hooks/browser-guard-require-select.sh +15 -15
  47. package/assets/hooks/commit-msg.sh +13 -3
  48. package/assets/hooks/conscience-guard.sh +9 -25
  49. package/assets/hooks/decide.sh +141 -0
  50. package/assets/hooks/deny-tail.sh +16 -11
  51. package/assets/hooks/dev-server-guard.sh +27 -20
  52. package/assets/hooks/dispatch.sh +47 -4
  53. package/assets/hooks/docs-guard.sh +31 -200
  54. package/assets/hooks/end-conversation-guard.sh +12 -21
  55. package/assets/hooks/epic-stop-guard.sh +54 -152
  56. package/assets/hooks/exam-guard.sh +32 -65
  57. package/assets/hooks/facts-docs.sh +221 -0
  58. package/assets/hooks/facts-flow.sh +173 -0
  59. package/assets/hooks/facts.sh +374 -0
  60. package/assets/hooks/flow-step-guard.sh +93 -0
  61. package/assets/hooks/git-guard-delivery-body.sh +4 -4
  62. package/assets/hooks/git-guard-delivery-conflict.sh +16 -10
  63. package/assets/hooks/git-guard-delivery-draft.sh +3 -3
  64. package/assets/hooks/git-guard-delivery-epic.sh +18 -9
  65. package/assets/hooks/git-guard-delivery-folder.sh +32 -7
  66. package/assets/hooks/git-guard-delivery-merge.sh +2 -2
  67. package/assets/hooks/git-guard-delivery-merged.sh +12 -1
  68. package/assets/hooks/git-guard-delivery-pipeline.sh +1 -1
  69. package/assets/hooks/git-guard-delivery-rerun.sh +44 -0
  70. package/assets/hooks/git-guard-delivery-signature.sh +82 -45
  71. package/assets/hooks/git-guard-delivery-task.sh +47 -0
  72. package/assets/hooks/git-guard-delivery.sh +112 -101
  73. package/assets/hooks/git-guard-discard.sh +8 -18
  74. package/assets/hooks/git-guard-main.sh +13 -19
  75. package/assets/hooks/git-guard-no-verify.sh +56 -16
  76. package/assets/hooks/git-guard-push-ahead.sh +39 -6
  77. package/assets/hooks/git-guard-push-marks.sh +262 -13
  78. package/assets/hooks/git-guard-push-tests.sh +58 -52
  79. package/assets/hooks/git-guard-tree-assignment.sh +7 -4
  80. package/assets/hooks/guard-note.sh +8 -6
  81. package/assets/hooks/handoff-entry-guard.sh +19 -38
  82. package/assets/hooks/handoff-write.sh +3 -1
  83. package/assets/hooks/hook-input.sh +0 -41
  84. package/assets/hooks/metric-marks.sh +19 -7
  85. package/assets/hooks/observe.sh +1 -1
  86. package/assets/hooks/override-write-guard.sh +27 -9
  87. package/assets/hooks/pre-push.sh +40 -12
  88. package/assets/hooks/prose-style-guard.sh +6 -19
  89. package/assets/hooks/pull-merges.sh +76 -0
  90. package/assets/hooks/push-ahead-call-guard.sh +447 -0
  91. package/assets/hooks/push-set.sh +38 -8
  92. package/assets/hooks/qa-dataid-guard.sh +7 -17
  93. package/assets/hooks/record-turn.sh +52 -0
  94. package/assets/hooks/rerun-guard.sh +11 -16
  95. package/assets/hooks/reuse-first-guard.sh +7 -21
  96. package/assets/hooks/role-calls.sh +25 -3
  97. package/assets/hooks/rule-source-guard.sh +54 -21
  98. package/assets/hooks/skill-gate-rearm.sh +18 -5
  99. package/assets/hooks/skill-gate.sh +156 -20
  100. package/assets/hooks/skill-loaded.sh +18 -3
  101. package/assets/hooks/sql-guard-target.sh +2 -2
  102. package/assets/hooks/sql-guard-write.sh +12 -12
  103. package/assets/hooks/sql-guard.sh +58 -16
  104. package/assets/hooks/task-context-load.sh +3 -1
  105. package/assets/hooks/task-flow-context.sh +5 -18
  106. package/assets/hooks/task-flow-draft-guard.sh +25 -74
  107. package/assets/hooks/task-flow-guard.sh +28 -130
  108. package/assets/hooks/tree-assignment-guard.sh +25 -14
  109. package/assets/hooks/turn-entry-load.sh +3 -1
  110. package/assets/hooks/turn-exit-guard.sh +92 -452
  111. package/assets/hooks/turn-exit-role.sh +3 -1
  112. package/assets/hooks/turn-judge.md +113 -0
  113. package/assets/hooks/window-fill-guard.sh +22 -41
  114. package/assets/patterns/doc-style-human.md +36 -76
  115. package/assets/patterns/git-workflow-commit.azure.md +9 -155
  116. package/assets/patterns/git-workflow-commit.github.md +11 -269
  117. package/assets/patterns/git-workflow-commit.gitlab.md +9 -161
  118. package/assets/patterns/git-workflow-docker.md +8 -231
  119. package/assets/patterns/git-workflow-freshness.md +8 -56
  120. package/assets/patterns/git-workflow-merge.md +6 -176
  121. package/assets/patterns/git-workflow-migration.md +5 -75
  122. package/assets/patterns/git-workflow-pr-body.github.md +6 -159
  123. package/assets/patterns/git-workflow-pr-ready.md +9 -70
  124. package/assets/patterns/git-workflow-pr.azure.md +13 -285
  125. package/assets/patterns/git-workflow-pr.github.md +13 -251
  126. package/assets/patterns/git-workflow-pr.gitlab.md +13 -286
  127. package/assets/patterns/git-workflow-restart.md +5 -42
  128. package/assets/patterns/git-workflow-secrets.md +10 -76
  129. package/assets/patterns/git-workflow-stack.md +7 -207
  130. package/assets/patterns/status-report-table.github.md +1 -1
  131. package/assets/patterns/task-flow-archive.md +12 -233
  132. package/assets/patterns/task-flow-close.md +16 -292
  133. package/assets/patterns/task-flow-cycle.md +13 -39
  134. package/assets/patterns/task-flow-graph.needs-graph.md +8 -62
  135. package/assets/patterns/task-flow-handoff.md +13 -161
  136. package/assets/patterns/task-flow-resume.md +18 -218
  137. package/assets/patterns/task-flow-start.md +9 -247
  138. package/assets/patterns/turn-entry-map.md +2 -2
  139. package/assets/pitfalls/agent-kit-extend.md +200 -0
  140. package/assets/pitfalls/agent-kit.2.md +323 -0
  141. package/assets/pitfalls/angular-patterns.md +98 -0
  142. package/assets/pitfalls/browser-verification.md +265 -0
  143. package/assets/pitfalls/component-structure.md +98 -0
  144. package/assets/pitfalls/dependencies.md +92 -0
  145. package/assets/pitfalls/deploy-flow.azure.md +171 -0
  146. package/assets/pitfalls/deploy-flow.github.md +211 -0
  147. package/assets/pitfalls/deploy-flow.gitlab.md +173 -0
  148. package/assets/pitfalls/doc-style-human.md +112 -0
  149. package/assets/pitfalls/doc-style.2.md +286 -0
  150. package/assets/pitfalls/entity-conventions.needs-admin.md +96 -0
  151. package/assets/pitfalls/entity-models.md +89 -0
  152. package/assets/pitfalls/epic-flow.md +92 -0
  153. package/assets/pitfalls/git-workflow-commit.azure.md +190 -0
  154. package/assets/pitfalls/git-workflow-commit.github.md +307 -0
  155. package/assets/pitfalls/git-workflow-commit.gitlab.md +196 -0
  156. package/assets/pitfalls/git-workflow-docker.md +275 -0
  157. package/assets/pitfalls/git-workflow-freshness.md +88 -0
  158. package/assets/pitfalls/git-workflow-hosting.azure.md +31 -0
  159. package/assets/pitfalls/git-workflow-hosting.github.md +32 -0
  160. package/assets/pitfalls/git-workflow-hosting.gitlab.md +31 -0
  161. package/assets/pitfalls/git-workflow-merge.md +220 -0
  162. package/assets/pitfalls/git-workflow-migration.md +103 -0
  163. package/assets/pitfalls/git-workflow-pr-body.github.md +185 -0
  164. package/assets/pitfalls/git-workflow-pr-ready.md +104 -0
  165. package/assets/pitfalls/git-workflow-pr.2.azure.md +172 -0
  166. package/assets/pitfalls/git-workflow-pr.2.github.md +184 -0
  167. package/assets/pitfalls/git-workflow-pr.2.gitlab.md +180 -0
  168. package/assets/pitfalls/git-workflow-pr.azure.md +159 -0
  169. package/assets/pitfalls/git-workflow-pr.github.md +107 -0
  170. package/assets/pitfalls/git-workflow-pr.gitlab.md +151 -0
  171. package/assets/pitfalls/git-workflow-push.azure.md +30 -0
  172. package/assets/pitfalls/git-workflow-push.github.md +30 -0
  173. package/assets/pitfalls/git-workflow-push.gitlab.md +30 -0
  174. package/assets/pitfalls/git-workflow-queue.azure.md +30 -0
  175. package/assets/pitfalls/git-workflow-queue.github.md +30 -0
  176. package/assets/pitfalls/git-workflow-queue.gitlab.md +30 -0
  177. package/assets/pitfalls/git-workflow-restart.md +72 -0
  178. package/assets/pitfalls/git-workflow-secrets.md +114 -0
  179. package/assets/pitfalls/git-workflow-stack.md +254 -0
  180. package/assets/pitfalls/git-workflow.2.azure.md +291 -0
  181. package/assets/pitfalls/git-workflow.2.github.md +294 -0
  182. package/assets/pitfalls/git-workflow.2.gitlab.md +278 -0
  183. package/assets/pitfalls/lib-layers.md +114 -0
  184. package/assets/pitfalls/lists.md +117 -0
  185. package/assets/pitfalls/mockups.needs-mockups.md +87 -0
  186. package/assets/pitfalls/navigation.md +94 -0
  187. package/assets/pitfalls/observability.needs-app.md +186 -0
  188. package/assets/pitfalls/platform-access.md +94 -0
  189. package/assets/pitfalls/queue-audit.github.md +78 -0
  190. package/assets/pitfalls/reuse-first.md +201 -0
  191. package/assets/pitfalls/spec-driven.2.md +318 -0
  192. package/assets/pitfalls/styling-bem.2.md +125 -0
  193. package/assets/pitfalls/task-flow-archive.md +265 -0
  194. package/assets/pitfalls/task-flow-close.2.md +166 -0
  195. package/assets/pitfalls/task-flow-close.md +167 -0
  196. package/assets/pitfalls/task-flow-cycle.md +73 -0
  197. package/assets/pitfalls/task-flow-graph.needs-graph.md +98 -0
  198. package/assets/pitfalls/task-flow-handoff.md +200 -0
  199. package/assets/pitfalls/task-flow-handover.md +30 -0
  200. package/assets/pitfalls/task-flow-owner.md +58 -0
  201. package/assets/pitfalls/task-flow-plan.md +29 -0
  202. package/assets/pitfalls/task-flow-resume.md +257 -0
  203. package/assets/pitfalls/task-flow-start.md +287 -0
  204. package/assets/pitfalls/task-flow.2.md +303 -0
  205. package/assets/pitfalls/task-flow.md +4 -4
  206. package/assets/pitfalls/testing.2.md +279 -0
  207. package/assets/pitfalls/turn-conduct.md +16 -17
  208. package/assets/pitfalls/typescript-conventions.md +161 -0
  209. package/assets/pitfalls/write-a-skill.md +128 -0
  210. package/assets/rules/angular-patterns.md +21 -86
  211. package/assets/rules/autonomous-work.md +2 -2
  212. package/assets/rules/browser-verification.md +28 -256
  213. package/assets/rules/component-structure.md +25 -87
  214. package/assets/rules/dependencies.md +20 -78
  215. package/assets/rules/deploy-flow.azure.md +26 -156
  216. package/assets/rules/deploy-flow.github.md +34 -200
  217. package/assets/rules/deploy-flow.gitlab.md +27 -159
  218. package/assets/rules/doc-style.md +32 -286
  219. package/assets/rules/entity-conventions.needs-admin.md +26 -82
  220. package/assets/rules/entity-models.md +14 -63
  221. package/assets/rules/epic-flow.md +24 -63
  222. package/assets/rules/git-workflow-hosting.azure.md +26 -0
  223. package/assets/rules/git-workflow-hosting.github.md +38 -0
  224. package/assets/rules/git-workflow-hosting.gitlab.md +27 -0
  225. package/assets/rules/git-workflow-push.azure.md +28 -0
  226. package/assets/rules/git-workflow-push.github.md +28 -0
  227. package/assets/rules/git-workflow-push.gitlab.md +28 -0
  228. package/assets/rules/git-workflow-queue.azure.md +23 -0
  229. package/assets/rules/git-workflow-queue.github.md +30 -0
  230. package/assets/rules/git-workflow-queue.gitlab.md +23 -0
  231. package/assets/rules/git-workflow.azure.md +21 -282
  232. package/assets/rules/git-workflow.github.md +24 -284
  233. package/assets/rules/git-workflow.gitlab.md +21 -269
  234. package/assets/rules/lib-layers.md +30 -103
  235. package/assets/rules/lists.md +21 -105
  236. package/assets/rules/mockups.needs-mockups.md +25 -64
  237. package/assets/rules/navigation.md +10 -69
  238. package/assets/rules/observability.needs-app.md +43 -172
  239. package/assets/rules/platform-access.md +28 -75
  240. package/assets/rules/queue-audit.github.md +25 -52
  241. package/assets/rules/reuse-first.md +20 -195
  242. package/assets/rules/spec-driven.md +35 -308
  243. package/assets/rules/styling-bem.md +20 -117
  244. package/assets/rules/task-flow-handover.md +24 -0
  245. package/assets/rules/task-flow-owner.md +34 -0
  246. package/assets/rules/task-flow-plan.md +38 -0
  247. package/assets/rules/task-flow.md +22 -300
  248. package/assets/rules/testing.md +32 -273
  249. package/assets/rules/turn-conduct.md +105 -106
  250. package/assets/rules/turn-entry.md +2 -2
  251. package/assets/rules/typescript-conventions.md +41 -147
  252. package/assets/samples/tasks/_template/plan.md +30 -6
  253. package/assets/samples/tasks/_template/progress.md +0 -1
  254. package/assets/skills/agent-kit-extend.md +25 -168
  255. package/assets/skills/agent-kit.md +27 -299
  256. package/assets/skills/write-a-skill.md +20 -106
  257. package/assets/task-flow/flow.js +184 -0
  258. package/assets/task-flow/flow.md +101 -0
  259. package/assets/task-flow/measure/agreement.mjs +24 -0
  260. package/assets/task-flow/measure/ci.mjs +184 -0
  261. package/assets/task-flow/measure/copy.mjs +22 -0
  262. package/assets/task-flow/measure/epic-of.mjs +50 -0
  263. package/assets/task-flow/measure/epic-text.mjs +35 -0
  264. package/assets/task-flow/measure/epic.mjs +114 -0
  265. package/assets/task-flow/measure/folder.mjs +16 -0
  266. package/assets/task-flow/measure/footprint.mjs +28 -0
  267. package/assets/task-flow/measure/grill.mjs +21 -0
  268. package/assets/task-flow/measure/host.mjs +8 -0
  269. package/assets/task-flow/measure/owner.mjs +27 -0
  270. package/assets/task-flow/measure/plan.mjs +27 -0
  271. package/assets/task-flow/measure/pr.mjs +20 -0
  272. package/assets/task-flow/measure/progress.mjs +50 -0
  273. package/assets/task-flow/measure/session.mjs +252 -0
  274. package/assets/task-flow/measure/task.mjs +23 -0
  275. package/assets/task-flow/measure/text.mjs +77 -0
  276. package/assets/task-flow/source/git.mjs +254 -0
  277. package/assets/task-flow/source/host.mjs +277 -0
  278. package/assets/task-flow/source/marks.mjs +56 -0
  279. package/assets/task-flow/source/owner.mjs +94 -0
  280. package/assets/task-flow/source/records.mjs +116 -0
  281. package/assets/task-flow/source/session.mjs +269 -0
  282. package/assets/task-flow/source/steps.mjs +28 -0
  283. package/assets/task-flow/source/tree.mjs +42 -0
  284. package/bin/agent-kit.d.ts.map +1 -1
  285. package/bin/agent-kit.js +30 -0
  286. package/bin/agent-kit.js.map +1 -1
  287. package/lib/agent-checks.d.ts +55 -0
  288. package/lib/agent-checks.d.ts.map +1 -0
  289. package/lib/agent-checks.js +221 -0
  290. package/lib/agent-checks.js.map +1 -0
  291. package/lib/assets.d.ts.map +1 -1
  292. package/lib/assets.js +7 -2
  293. package/lib/assets.js.map +1 -1
  294. package/lib/cargo.d.ts +29 -0
  295. package/lib/cargo.d.ts.map +1 -1
  296. package/lib/cargo.js +27 -1
  297. package/lib/cargo.js.map +1 -1
  298. package/lib/cascade.d.ts.map +1 -1
  299. package/lib/cascade.js +3 -1
  300. package/lib/cascade.js.map +1 -1
  301. package/lib/commands.d.ts.map +1 -1
  302. package/lib/commands.js +78 -2
  303. package/lib/commands.js.map +1 -1
  304. package/lib/config.d.ts +18 -0
  305. package/lib/config.d.ts.map +1 -1
  306. package/lib/config.js +18 -1
  307. package/lib/config.js.map +1 -1
  308. package/lib/epic-window-send.d.ts +74 -0
  309. package/lib/epic-window-send.d.ts.map +1 -0
  310. package/lib/epic-window-send.js +166 -0
  311. package/lib/epic-window-send.js.map +1 -0
  312. package/lib/hooks-map.d.ts +4 -0
  313. package/lib/hooks-map.d.ts.map +1 -1
  314. package/lib/hooks-map.js +2 -2
  315. package/lib/hooks-map.js.map +1 -1
  316. package/lib/integrity.d.ts +3 -0
  317. package/lib/integrity.d.ts.map +1 -1
  318. package/lib/integrity.js +7 -0
  319. package/lib/integrity.js.map +1 -1
  320. package/lib/metric-lines.d.ts +2 -1
  321. package/lib/metric-lines.d.ts.map +1 -1
  322. package/lib/metric-lines.js +49 -1
  323. package/lib/metric-lines.js.map +1 -1
  324. package/lib/metric-send-mark.d.ts +6 -3
  325. package/lib/metric-send-mark.d.ts.map +1 -1
  326. package/lib/metric-send-mark.js +15 -5
  327. package/lib/metric-send-mark.js.map +1 -1
  328. package/lib/metric-send.d.ts +6 -2
  329. package/lib/metric-send.d.ts.map +1 -1
  330. package/lib/metric-send.js +47 -13
  331. package/lib/metric-send.js.map +1 -1
  332. package/lib/metrics.d.ts +17 -0
  333. package/lib/metrics.d.ts.map +1 -1
  334. package/lib/metrics.js +26 -15
  335. package/lib/metrics.js.map +1 -1
  336. package/lib/observations.js +3 -3
  337. package/lib/observations.js.map +1 -1
  338. package/lib/outcomes.d.ts +5 -2
  339. package/lib/outcomes.d.ts.map +1 -1
  340. package/lib/outcomes.js +5 -4
  341. package/lib/outcomes.js.map +1 -1
  342. package/lib/push-gate.d.ts +13 -0
  343. package/lib/push-gate.d.ts.map +1 -1
  344. package/lib/push-gate.js +11 -7
  345. package/lib/push-gate.js.map +1 -1
  346. package/lib/push-set-usefulness.d.ts +78 -0
  347. package/lib/push-set-usefulness.d.ts.map +1 -0
  348. package/lib/push-set-usefulness.js +225 -0
  349. package/lib/push-set-usefulness.js.map +1 -0
  350. package/lib/sync.d.ts +10 -0
  351. package/lib/sync.d.ts.map +1 -1
  352. package/lib/sync.js +14 -1
  353. package/lib/sync.js.map +1 -1
  354. package/lib/work-result.d.ts +43 -0
  355. package/lib/work-result.d.ts.map +1 -0
  356. package/lib/work-result.js +39 -0
  357. package/lib/work-result.js.map +1 -0
  358. package/package.json +1 -1
  359. package/assets/hooks/claim-guard.sh +0 -212
  360. package/assets/hooks/grill-gate-ask.sh +0 -26
  361. package/assets/hooks/grill-gate-bypass.sh +0 -61
  362. package/assets/hooks/grill-gate-options.sh +0 -50
  363. package/assets/hooks/grill-gate.sh +0 -482
  364. package/assets/hooks/postmortem-guard.sh +0 -124
  365. package/assets/hooks/proposal-guard.sh +0 -154
  366. package/assets/hooks/stand-login-guard.sh +0 -107
  367. package/assets/hooks/turn-exit-epic.sh +0 -173
  368. package/assets/hooks/turn-exit-patterns.sh +0 -123
  369. package/assets/hooks/turn-exit-verdict.sh +0 -149
  370. package/assets/hooks/waiting-turn-guard.sh +0 -320
  371. package/assets/hooks/work-start-guard.sh +0 -175
@@ -2,313 +2,35 @@
2
2
  name: task-flow
3
3
  kind: rule
4
4
  law: work-conduct
5
- description: Rule under the work-conduct law — the course of one task from the request to the merge. Load at the start of any work, when editing task folders and product agreements, and on return to an unfinished task. Patterns task-flow-start, -resume, -close, -archive. Epics — epic-flow, turns — turn-conduct.
5
+ description: Rule under the work-conduct law — the work states. Load at the start of any work, on any edit of a task folder and on return to unfinished work. Its parts: task-flow-plan, -owner, -handover. Patterns task-flow-start, -graph.
6
6
  ---
7
7
 
8
- # Work conduct — how it works here
8
+ # Work conduct — the states
9
9
 
10
- Rule under the law `docs/constitution/work-conduct.md`. The law says what must be true about the
11
- course of work; here — what it is called in this tree, where it lives and what is not checked here.
12
- How a series of tasks is held together as one epic — rule `epic-flow` under the same law.
13
-
14
- **Cold part:** `pitfalls.md` next to it — traps and conduct from incident analyses. Loaded on
15
- demand, not with the rule: an ordinary decision does not need it — whoever analyses a miss or argues
16
- with a guard does.
17
-
18
- **Requires:** `hooks/task-flow-guard.sh`, `hooks/task-flow-draft-guard.sh`,
19
- `hooks/task-context-load.sh`, `hooks/grill-gate.sh`, `hooks/window-fill-guard.sh`,
20
- `hooks/turn-exit-guard.sh`, `hooks/work-start-guard.sh`, `hooks/main-run-context.sh`
21
-
22
- ## What it is called here
23
-
24
- | In the law | Here |
25
- | --- | --- |
26
- | the owner's request | what work begins with; grilled by the `/grill-me` command before the first edit |
27
- | understanding written where the work goes | `docs/tasks/<ветка>/grill.md` — the request verbatim, the owner's answers in their words, decisions with reasons |
28
- | the plan | `docs/tasks/<ветка>/plan.md` — the task footprint and stages with readiness signs; not edited after it is written |
29
- | the progress | `docs/tasks/<ветка>/progress.md` — "Where we stand", decisions along the way, session entries; the only place where done work is marked |
30
- | the product agreement written before the code | `docs/specs/<домен>/proposed/<фича>/` — the feature spec; merges into the domain spec before the PR opens |
31
- | the task folder before the task is created | `docs/tasks/_draft-<slug>/` — outside history while there is no number |
32
- | exploration | an `Explore` or `general-purpose` session before the first question to the owner |
33
- | the plan review by roles | `.claude/workflows/plan.js` — need, points, agreement, critique, plan, goal |
34
- | a large edit carried by roles | `.claude/workflows/feature.js` — plan, implementation, check, acceptance, points, goal |
35
-
36
- ## Where it lives
37
-
38
- In this tree — the table in `implementation.md` next to it. Paths live there, not here: the rule
39
- travels between repositories, the layout does not, and a path named in the rule lies in the first
40
- tree that keeps its code differently.
10
+ Rule under the law `docs/constitution/work-conduct.md`. Cold part: `pitfalls.md`, `pitfalls-2.md`.
41
11
 
42
12
  ## Work states
43
13
 
44
- The unit of work is a state, not a step. A state has an entry, a mandatory action and an exit, and
45
- until the action is done the work stays in the same state.
46
-
47
- The state is declared in the "Where we stand" section of the progress by the machine-readable line
48
- ``- **State:** `этап-идёт` `` and is rewritten with it.
49
-
50
- | State | Entry | Mandatory action | Pattern |
14
+ <!-- flow:states -->
15
+ | State | Exit | Mandatory action | Pattern |
51
16
  | --- | --- | --- | --- |
52
- | `просьба-не-разобрана` | the owner's message about new work | exploration over the tree, then questions | `task-flow-start` |
53
- | `эпик-заведён` | the epic card, all its tasks and its plan lie in the queue | take the epic branch from the main branch; with the first task the epic card moves to in progress | `epic-flow-declare` |
54
- | `разбор-закрыт` | the owner's answers lie on disk | a product agreement, or the reason there is none | `task-flow-start` |
55
- | `договорённость-записана` | the draft lies, or the reason is named | create the task, the branch from the epic branch, and the folder | `task-flow-start` |
56
- | `задача-взята` | task in the work column, branch by number, folder | write the plan | `task-flow-start` |
57
- | `замысел-записан` | the plan lies and is not edited after writing | do the first stage | `task-flow-start` |
58
- | `этап-идёт` | a stage is begun | finish the stage and mark it in the progress | `task-flow-resume` |
59
- | `этапы-кончились` | all stages are marked | merge the agreement, bring texts up to date, run the suite | `task-flow-close` |
60
- | `разбор-кончился` | the suite is green, texts are up to date | take the folder apart by the last commit | `task-flow-archive` |
61
- | `папка-разобрана` | no folder in the branch, a record in the archive | the work queue audit, then open the PR: a draft where a run is waited for, ready where the pipeline does not wake | `task-flow-close` |
62
- | `работа-отдана` | the PR is open into the epic branch, with a reviewer | the rules review of the work goes to the background, then take the next task of the epic | `task-flow-archive` |
63
- | `влито` | the PR merged by a person | the epic plan marks the task merged by the next task's branch | `task-flow-resume` |
64
- | `задачи-эпика-кончились` | every task of the epic is merged and its folder taken apart | open the PR of the epic into the main branch | `task-flow-close` |
65
-
66
- No state has a mandatory action that sounds like "wait": waiting for someone else's step is not a
67
- work state, so in `работа-отдана` the mandatory action is the next task, not the open PR. A blocked
68
- task does not count as next: the same waiting under the name of work. The next is taken from the
69
- epic plan; outside an epic the owner names it, and the queue, asked by a command, goes into the
70
- question: "no tasks" is a statement about the tree, backed by output, not by the executor's memory. A filled session window is no state either: the session ends
71
- with a handover, and the work stays where it stood. **An open card says nothing about whether the
72
- work is taken.** A card is closed by the merge, and in a session that opens no PRs the list of open
73
- ones does not shrink. A task is untaken when the tree holds no trace of it: open numbers are checked
74
- against the archive and its history — a record past its expiry stays in `git log -- docs/archive/`.
75
-
76
- What a turn ends with — rule `turn-conduct` under the same law.
77
-
78
- The list is shown to the owner at the start of work, and where we stand is marked on it.
79
-
80
- The last two states cannot be declared on disk: the progress leaves with the folder, and the folder
81
- is taken apart before the PR opens. Their sign is in the branch history — the commit that takes the
82
- folder apart — and a guard reads it, not a line in a file.
83
-
84
- ## Flow
85
-
86
- The course of work from the owner's request to closing: where the grill stands, what the guard
87
- demands and where the task folder goes.
88
-
89
- ```mermaid
90
- flowchart TD
91
- A[The owner's request] --> B[Exploration over the tree — before the first question]
92
- B --> C[Grill: six mandatory questions, the answers land on disk]
93
- C --> D{The edit touches application code}
94
- D -->|Yes| E[A product agreement is written — before the code]
95
- D -->|No| F[The plan states the reason there is none]
96
- E --> Z{The epic of this work exists}
97
- F --> Z
98
- Z -->|No| Y[The epic is declared: a card, all its tasks and a plan — then its branch from the main branch]
99
- Z -->|Yes| G[Task, branch from the epic branch, task folder by branch name; the epic card moves with its first task]
100
- Z -->|The owner's word about work outside an epic| X[Task, branch from the main branch, task folder by branch name]
101
- X --> H
102
- Y --> G
103
- G --> H[A plan with stages; not edited after it is written]
104
- H --> I{Stage done}
105
- I -->|Yes| J[A mark in the progress — the only place where done work is marked]
106
- J --> I
107
- I -->|Stages are over| T[The agreement merges into the domain spec, texts are brought up to what was done, then the suite runs]
108
- T --> N[The task folder is taken apart by the last commit: the grill — to the archive, findings — to the epic plan, the plan — away]
109
- N --> S[Work queue audit]
110
- S --> K[The PR opens; the executor names the number, what it waits for and what comes next]
111
- K --> W[The rules review of the closed work goes to the background, findings land on disk]
112
- W --> L[While the PR waits for review, the next task is taken]
113
- L --> M{Review and run are over}
114
- M -->|Red run or remarks| V[Fixed in the same branch: the plan is gone from disk, the guard takes the sign of work from the branch history]
115
- V --> M
116
- M -->|Green and no remarks| O[The draft, if there was one, is lifted; a person presses merge into the epic branch]
117
- O --> P{Tasks of the epic are left}
118
- P -->|Yes| G
119
- P -->|No| Q[The PR of the epic into the main branch opens: every folder is taken apart]
120
- ```
17
+ | `просьба-не-разобрана` | `measure.grill.written` | explore the tree, then ask the questions | `task-flow-start` |
18
+ | `эпик-заведён` | `measure.epic.declared` | take the epic branch from the main branch; the epic card moves with the first task | `epic-flow-declare` |
19
+ | `разбор-закрыт` | `measure.agreement.named` | write the product agreement, or the reason there is none | `task-flow-start` |
20
+ | `договорённость-записана` | `measure.task.taken` | create the task, the branch from the epic branch, and the folder | `task-flow-start` |
21
+ | `задача-взята` | `measure.plan.approved` | write the plan | `task-flow-start` |
22
+ | `замысел-записан` | `measure.progress.mirrors` | do the first stage | `task-flow-start` |
23
+ | `этап-идёт` | `measure.progress.done` | finish the stage: `step N.M` measures each step and marks it done | `task-flow-resume` |
24
+ | `этапы-кончились` | `measure.footprint.touched` | merge the agreement, bring the texts up to date, run the suite | `task-flow-close` |
25
+ | `разбор-кончился` | `measure.folder.archived` | take the folder apart by the last commit | `task-flow-archive` |
26
+ | `папка-разобрана` | `measure.pr.handed` | the work queue audit, then open the PR | `task-flow-close` |
27
+ | `работа-отдана` | `measure.epic.nextTaken` | send the rules review to the background, then take the next task of the epic | `task-flow-archive` |
28
+ | `влито` | `measure.epic.mergedMarked` | merge the PRs of the chain bottom-up, mark the merged tasks by the branch of the next one | `task-flow-resume` |
29
+ | `задачи-эпика-кончились` | `measure.epic.finished` | open the PR of the epic into the main branch | `task-flow-close` |
30
+ <!-- /flow:states -->
121
31
 
122
32
  ## How the law applies here
123
- - **Editing application code is refused until the work has reached a state in which code is
124
- edited.** The guard demands three things: a task folder by branch name, a plan in it and a
125
- declared state. The agreement has a guard of its own on the same events.
126
- - **The guard judges the declared transition, not the presence of files.** The refusal is lifted
127
- by the declared state — `этап-идёт`,
128
- `этапы-кончились`, `разбор-кончился`, `работа-отдана`. The fifth road is the branch history: a
129
- folder taken apart means handed-in work.
130
- - **A state line moved forward is the same declaration of intent, only machine-readable.** It is
131
- declared by the turn in which its mandatory action is begun by deed.
132
- - **A refusal by state names the mandatory action of that state.** Hearing only "wrong state", the
133
- executor rewrites the state line instead of the step.
134
- - **Only a word from the list counts as a state name.** A word of one's own says nothing about the
135
- entry, the exit or the action.
136
- - **Two requirements — two guards, and one can be lifted without losing the other.** A line about
137
- unchanged behaviour lifts the agreement, not the requirement to reach the code-editing state.
138
- - **A merged agreement does not lock the branch.** After the merge the "proposed" directory is gone
139
- from disk while the plan refers to it to the end: the guard tells merged from never-created by the
140
- branch history.
141
- - **The agreement is required by the edit paths, not by an appraisal of the task.** `apps/**` and
142
- `libs/**` are the sign; rules, texts, tooling and dependencies fall outside it. The bypass is the
143
- line `**Behaviour:** unchanged — <the reason of the owner>` in the plan; an empty reason is not
144
- accepted.
145
- - **What needs the owner's word is taken from a list, not appraised on the spot.** The appraisal
146
- "this is safe" is assigned by whoever finds it convenient.
147
- - **A stop the owner sets on a later step is written down the moment it is said.** It is quoted in
148
- the waiting line: it holds that step and releases the exit guard.
149
- - **A reply to the owner's order begins with the result, not with intent or its justification.** A
150
- justification under someone else's accepted decision reads as its appraisal. One exception:
151
- execution stopped by an obstacle — then the obstacle is named.
152
- - **The last run of the main branch is read first thing in a session and after every known
153
- merge.** A red main branch lives until the owner notices; a red run is fixed before new work is taken.
154
- - **A session does not start work by itself.** The handover, the state from the startup hook and an
155
- assigned epic say what to do, not whether to work: a start needs the owner's word in the same
156
- session. An empty message, one word or one path order no work.
157
- - **A refusal by an external limiter removes the way, not the task.** It names no exit: the way is
158
- taken from the guard that already described this fix, and the task stays the same.
159
- - **A question written by a past session does not become a question to the owner.** It is addressed
160
- to the handover's author, and some are closed by a work step.
161
- - **The owner's instruction holds until they cancel it, and a new fact against it is a line in the
162
- reply about the cost, not a new question.** Re-asked is what the instruction does not cover. A
163
- menu where two options of three offer to cancel the owner's decision is that very cancellation.
164
- - **An answer in the owner's message counts the same as an answer in a document.** A question
165
- already answered in the conversation is not asked again.
166
- - **The owner's word about the design is a task setting, not a decision.** What they named is
167
- usually in the tree under that word — a name on a screen, a spec section, a model field — and is
168
- checked against it before the edit. Diverged — the owner is asked.
169
- - **A tool the owner named is used, and a substitute is named in the same reply.** A command, a
170
- role or a browser named in the request is part of it; the reply says what was used instead and why.
171
- - **A rule of the tree outweighs a standing instruction of the host.** The host describes its own
172
- default; where the two differ, the tree's text is carried out.
173
- - **A task folder is created for any work, no exceptions.** An exception with even one lawful form
174
- is executed as permission. It goes in before the first edit.
175
- - **The task folder goes into the branch by a commit, not lives in one working tree.** Uncommitted,
176
- it passes edits without refusal until the plan is already gone. Outside history one draft without
177
- a number is lawful.
178
- - **The task folder is taken apart by the last commit before the PR opens, not after approval.** A
179
- person merges as soon as they see green, and no room is left for a closing commit.
180
- - **After opening the PR, the executor tells the owner the number, what it waits for and what comes
181
- next.** A draft waits for the run, a PR opened ready waits for the owner's hand, and that is said.
182
- - **A request to merge never comes before the work is checked.** Where the pipeline wakes for this
183
- base: folder taken apart and pushed → PR as a draft → run green → draft lifted → the request to
184
- merge, naming the number. Where it does not wake, the green push gate is the check, and opening
185
- the PR and asking to merge are one turn.
186
- - **A PR that waits for a run opens as a draft, and one that waits for nothing opens ready.** An
187
- open PR reads as an invitation to merge. Which of the two applies is decided by the bases the pipeline wakes for, and that is read from its file.
188
- - **The plan guard is the lower bound of the requirement, not its limit.** It demands a folder only
189
- for an edit of application code; the article above — for any work.
190
- - **An instruction to work by a rule or by the progress is an instruction to do all its steps,
191
- including those that change history.** Marking a stage, a commit, a push and opening a PR are
192
- prescribed by the rule; questions are asked about what the progress lacks.
193
- - **A taken task does not end a turn.** Creating the task, the branch, the column and the folder is
194
- preparation; the turn-exit guard names the first stage in its refusal.
195
- - **The stages of a plan cover its done-sign whole.** Otherwise every stage closes, the run is
196
- green, and half the order is not done. Either the stages are written up to the sign, or the sign
197
- is narrowed to what the stages give.
198
- - **Every rule of the product agreement becomes a step of some stage.** The plan names, per rule,
199
- the stage that writes its code and the check that proves it, and is compared with the agreement
200
- rule by rule before the first stage: a rule with no stage is found at the merge review, when the
201
- code is written.
202
- - **A stage's readiness sign is taken from the output of a command run while the plan is written.**
203
- Written by a guess, it fails at the stage itself.
204
- - **A plan for work that ports a technique from outside is written by a measurement of one's own
205
- code.** Reading the sample says how it is built; what is needed here is said by a count over
206
- one's own files.
207
- - **A count that becomes the measure of the work is bounded by the declaration, not by the file.**
208
- A file holds neighbouring sets too.
209
- - **Waiting for one part of a stage is never a stop of the stage.** The parts independent of what is
210
- awaited are done in the same turn; the owner is told what is done and what is left for their step.
211
- - **A finding made mid-stage is checked against the plan's exit conditions before the first edit.**
212
- A finding named by no exit condition goes to the section on what the work does not do, and is
213
- filed as a task.
214
- - **Done work is marked only in the progress.** "Where we stand" is rewritten by every session, not
215
- appended.
216
- - **The plan names the steps of every stage, and the progress mirrors them with a mark each.** The
217
- plan is not edited after it is written, the marks change every turn; a line nobody can call done
218
- is not a step.
219
- - **The numbers and the names of the steps are copied from the plan, not reworded.** A check matches
220
- the two lists: a reworded name reads as a different step.
221
- - **Exactly one step carries the mark of going on right now, while any step is not done.** Marked on
222
- none, the progress says the work stands; marked on two, it says nothing at all.
223
- - **A word for a new notion is looked up in the tree's glossary.** It goes into the context whole
224
- at session start, so "did not read it" is never a ground.
225
- - **The task folder is created as a draft and gets its number by a command.** Until the grill ends,
226
- how many tasks come out is unknown, so the number never comes first.
227
- - **An abandoned grill is visible.** A draft older than a week is listed by the work queue audit.
228
- - **Work ordered in words becomes a task in the queue in the same turn.** Even if it will not be
229
- done now: a draft folder has no number, and one session knows of it. Postponed work names a
230
- date; postponed silently, it reads as done.
231
- - **The plan names the points: the epic its milestone, the task the change a person will see.** The
232
- role `product-strategist` tries to prove the miss in planning and before the PR. A proved miss is
233
- fixed or named to the owner; no pipeline stops. Every PR body carries the table of points.
234
- - **An improvement of a rule names the metric it should move, and the next report judges it.** A repair
235
- names what was broken instead. An edit that moved nothing is named so. The technique is the
236
- pattern `task-flow-cycle`.
237
- - **Work is judged by the role `goal-critic` against the owner's words.** A plan is no evidence to
238
- it, its reply is not edited, and the PR body carries its table.
239
- - **A mission is set by the owner.** A session only proposes a wording from its analysis and waits
240
- for approval.
241
- - **Building by a sample begins with reading the sample itself, whole, by walking the directories.**
242
- - **Exploration of a tree that holds a code graph begins with the graph.** A tree with a graph names
243
- the trait `graph` in its settings and follows the pattern `task-flow-graph`: in every turn the
244
- graph is checked against the head before the first exploration, and a turn that does not use it
245
- names the reason. Relations are taken from the graph; numbers, behaviour and texts — from the code
246
- and the documents.
247
- - **The path to a sample lies outside the history, the permission to work outside the epic — in
248
- the main branch.** The path names another tree and lives among the records that belong to no
249
- branch; the progress names the sample by a reference to that place. The permission is a row of
250
- the table of assignments, read from the main branch by every branch; it repeats the owner's word,
251
- not replaces it.
252
- - **Closed work is reviewed by the rules in the background, right after the PR, and its findings
253
- wait for the owner.** Only the session that led the work sees what was loaded and what was
254
- missing, and it takes the next task meanwhile. A proposal sent unreviewed becomes the work of
255
- someone who did not order it; only the digest of observations leaves, always. The technique is
256
- the pattern `task-flow-archive`.
257
- - **The cheap closing step goes before the costly one, and the run — after the merge.** A run
258
- before the merge checks what will not reach main.
259
- - **The agreement merges into the domain spec by one of the last commits of the branch, before the
260
- PR opens.** By then the bindings are known, and `proposed/` never appears in main. What is ready
261
- to merge is listed by `npm run check:specs`.
262
- - **The folder of a closed task is taken apart, not moved whole.** What explains a decision goes to
263
- `docs/archive/`; the rest is deleted. One not taken apart is caught by the work queue audit.
264
- - **Opening the PR and lifting the draft are refused while the branch carries its task folder.** A
265
- person presses merge on the host, where there are no guards: a lifted draft reads to them as an
266
- invitation. The branch content is judged, not the working tree.
267
- - **A branch that removed the folder adds a record to the archive.** Removing is cheaper than taking
268
- apart, and the grill leaves first — the only record of the owner's words.
269
- - **The bypass is the line `Task-folder-skip: <reason>` in the PR or in the command itself.** An
270
- empty reason is no bypass, and the bypass lifts the refusal but does not silence the work queue
271
- audit line.
272
-
273
- ## What of the law is not here
274
-
275
- Nothing checks the completeness of the written understanding: the machine sees that a record exists,
276
- not that it closes every gap. The same for a question worth asking and not asked — it leaves no
277
- trace. The owner judges both.
278
-
279
- The guard judges by the edit paths, not by whether the work changes behaviour. A refactoring gets no
280
- sign of its own: the appraisal "behaviour does not change" would be assigned by whoever it hinders.
281
-
282
- Of the grill itself only the menus are checked: the conversation guard refuses a third menu after
283
- the owner took the recommended option twice in a row. The exploration, the six questions and the
284
- answers are checked by nothing.
285
-
286
- The conversation guard judges shared words between the question's topic and the owner's last
287
- message, not meaning; its refusal names the lawful move.
288
-
289
- Nothing watches the plan's immutability: an edit along the way is told from the original record only
290
- by history.
291
-
292
- Nothing checks that the texts match what was done: the machine cannot see what went stale in a rule
293
- or a spec. This is held by the closing step and the task footprint in the plan. A rule and a spec
294
- are edited in the branch, a law is not: its article goes to the owner as text, and the work goes on
295
- without it.
296
-
297
- What went to the archive is not checked: the owner judges it at review.
298
-
299
- The task folder guard judges the executor's call, not the host's button: a person merging from their
300
- side passes it in silence, and there the requirement is held by a section in the PR body.
301
-
302
- A tree may reverse the hand-in order by an override. Which package steps stop being executed then
303
- nothing counts; it is held by reading both texts in a row on every such edit.
304
-
305
- ## Patterns
306
33
 
307
- - `task-flow-start` — exploration, grill, agreement, plan, task and branch.
308
- - `task-flow-resume` — returning to unfinished work in a new session.
309
- - `task-flow-close` — merging the agreement, bringing the texts up to date, opening the PR and
310
- lifting the draft.
311
- - `task-flow-archive` — taking the task folder apart, the move to the archive, review by the rules.
312
- - `task-flow-cycle` — an edit chosen by the report and judged by the next one.
313
- - `task-flow-graph` — where the tree names the trait `graph`: the freshness check, the domain inventory and
314
- what the graph never answers.
34
+ - **A state line never stands ahead of the measured state.**
35
+ - **A refusal by state names the mandatory action of that state.**
36
+ - **Only a word from the list counts as a state name.**