@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
@@ -5,316 +5,43 @@ law: project-documentation
5
5
  description: Rule under the project-documentation law. Load when editing specs, laws and any skill. Names the three layers — law, rule, pattern — the mandatory sections, the binding to code and the link between scenarios and tests. Patterns spec-driven-domain, spec-driven-rule.
6
6
  ---
7
7
 
8
- # Project documentation — how it works here
8
+ # Project documentation
9
9
 
10
- Rule under the law `docs/constitution/project-documentation.md`. The law says what must be true
11
- about texts; here — which layers they are built from in this tree and what the machine checks.
12
- Wording is the rule `doc-style` under the same law.
13
-
14
- **Cold part:** `pitfalls.md` next to it — traps already stepped on. Loaded on demand, not together
15
- with the rule.
16
-
17
- ## What it is called here
18
-
19
- ```
20
- LAW docs/constitution/<law>.md — true for any application of this class
21
- docs/constitution/application/<law>.md — an application law: payments, locales, access
22
- knows nothing of the project: no paths, no file names, no bindings
23
-
24
- ├─ RULE .claude/skills/<rule>/SKILL.md (kind: rule, law: <law>)
25
- │ binds the law to this project; several rules per law
26
- │ .claude/skills/<rule>/implementation.md — binding to code
27
- │ .claude/skills/<rule>/pitfalls.md — cold part: loaded on demand
28
- │
29
- │ └─ PATTERN .claude/skills/<rule>-<what>/SKILL.md (kind: pattern, rule: <rule>)
30
- │ ready-made code and concrete techniques; at least one per rule
31
- │
32
- └─ DOMAIN SPEC docs/specs/<domain>/
33
- how the domain works; declares the laws it applies
34
-
35
- SKILL WITHOUT A LAW .claude/skills/<name>/SKILL.md (neither kind: rule nor kind: pattern)
36
- stands next to the ladder, not in it: not about what must be true
37
- in the product, but about how work is done here
38
- ```
39
-
40
- Links go only upward: a law refers neither to a rule, nor to a spec, nor to a file.
41
-
42
- A skill without a law is the third case, and it is legitimate. The showcase, a generator, work with
43
- a third-party service, creating the skill itself: there is no statement about the product above such
44
- a thing, so there is no law either. Inventing a law for it to fit the ladder is not allowed — a law
45
- with one rule and not a single article about the product drifts from the rest at the first edit. How
46
- such a skill is created — skill `write-a-skill`.
47
-
48
- | In the law | Here |
49
- | --------------------------------- | ---------------------------------------------------------------------------------------------------- |
50
- | set of sections | `REQUIRED_HEADINGS` for a spec, "Articles" for a law |
51
- | a statement of a document | an item of `## Rules` in a spec, `## Articles` in a law, `## How the law applies here` in a rule |
52
- | the place where it is carried out | a line in `implementation.md` next to it: `` `file:symbol` `` |
53
- | promised behaviour | scenario `SC-<PREFIX>-<NUMBER>` in `docs/specs/<domain>/scenarios.md` |
54
- | open question | `Q-<law letters>-<number>` in a law's "Open questions", `Q-<number>` in a spec's; tasks and commits refer to it, and the number is not reused after closing |
55
- | laws a domain applies | the `**Laws:**` line in the spec header, names in backticks; `**Законы:**` is the former form |
56
-
57
- ## Where it lives
58
-
59
- In this tree — the table in `implementation.md` next to it. Paths live there, not here: the rule
60
- travels between repositories, the layout does not, and a path named in the rule lies in the first
61
- tree that keeps its code differently.
62
-
63
- ## Flow
64
-
65
- The flow of creating a text: which layer is written, how a statement is bound to code and how a
66
- scenario keeps its number.
67
-
68
- ```mermaid
69
- flowchart TD
70
- A[A text about the product or the work is written] --> B{What it is about}
71
- B -->|What must be true, without names| C[Law: the articles section is mandatory, no paths in it]
72
- B -->|By which technique it is kept here| D[Rule: declares its law, names in the companion next to it]
73
- B -->|Ready-made code and technique| E[Pattern: declares its rule]
74
- B -->|How a domain works| F[Domain spec: declares the laws it applies]
75
- D --> G{The statement has a place in code}
76
- F --> G
77
- G -->|Yes| H[A binding line is placed; the link is checked both ways]
78
- G -->|No| I[A rule article: a verdict line, held by nobody — a law question; a spec rule: the spec's open questions]
79
- H --> J{A scenario is created}
80
- J -->|Yes| K[The number is issued new and never reused; the test title is edited by the same change]
81
- J -->|No| L[Done]
82
- C --> L
83
- E --> L
84
- K --> L
85
- I --> L
86
- ```
10
+ Rule under the law `docs/constitution/project-documentation.md`. Cold part: `pitfalls.md`,
11
+ `pitfalls-2.md`.
87
12
 
88
13
  ## How the law applies here
89
14
 
90
- - **The set of spec sections is fixed in advance, and a missing section is a refusal.** "Not
91
- applicable" is a legitimate answer, a missing section is not: cross-cutting requirements get
92
- remembered after the fact exactly when no place was made for them.
93
- - **Every statement is bound to a place in code, and the link is checked both ways.** The key of the
94
- link is the statement text itself, so it cannot be reworded with the binding forgotten.
95
- - **The first column of the companion is the article text copied, not retold.** The key of the link
96
- is the text itself: a line written by meaning breaks the link while looking filled in. The check
97
- counts articles without an address and knows nothing of an article with a wrong address.
98
- - **A binding does not lead into code nobody calls, and a test is not a call.** A function written
99
- test-first, before the first call from the application, is an intention: the test calls it
100
- itself, and by that call a live symbol cannot be told from a forgotten one. The exception is a
101
- symbol declared in the suite harness itself or published outward by a package — there the caller
102
- is the test or the consumer by the very purpose of the file.
103
- - **A verdict is put by substance, not by the form of the address.** To the check two reasons for
104
- a verdict look alike, and to the reader of the companion they do not: the first says "nothing
105
- here holds the requirement", the second "it holds, but there is nothing to write it with". The
106
- second verdict names the form itself as the reason and lives
107
- until the form is fixed; the article under it stays carried out and is not removed.
108
- - **A "not carried out" binding moves together with its article.** Otherwise the companion line
109
- keeps in the hot part an article with nothing behind it: removed alone, it leaves the binding
110
- without an item, and the audit turns red. Both sides move at once.
111
- - **The procedure table is checked against the decorators both ways, the permission together with
112
- the name.** Otherwise a procedure the domain serves but forgot to describe is visible only in the
113
- decorator, and a permission that drifted from the spec — nowhere.
114
- - **A refusal code is accepted only if the domain throws it.** Codes were written out from the
115
- design, and on one path nobody threw the promised refusal.
116
- - **A spec has one scenario prefix, and across the whole tree it is taken by that spec alone.** A
117
- second prefix inside a spec means the subject is described twice; a prefix taken by another means
118
- the number does not show whose scenario it is. A product agreement is numbered together with the
119
- spec it will merge into, and the prefix does not become taken by it.
120
- - **A scenario number is issued once and never reused.** A new one takes the next free number; it is
121
- not inserted in the middle and does not take a deleted one — the deleted number's place stays
122
- empty. The number ties the scenario to its test, and issued a second time it leaves the old
123
- reference right on the surface; renumbering in sequence is deceptively cheap — the tests are green
124
- both before and after. The free number is asked of the tree's command before the scenario heading
125
- is written, and the companion names that command: the main branch alone does not show numbers
126
- neighbouring work holds on disk.
127
- - **A scenario and the title of its test are edited by one change.** The promise changed — the
128
- number stays, and the test title is edited by the same commit; the scenario deleted — the test is
129
- deleted too. Having drifted apart, they leave the run green while it checks something else.
130
- - **A subdomain is asked the same as a domain.** The same mandatory sections, the same companion
131
- next to it, the same link between scenarios and tests. A domain with half its subdomains described
132
- and half created as empty directories is never green.
133
- - **A law has a mandatory "Articles" section, and beyond it holds only open questions.** A law
134
- carries no history of edits and no arguments for an option chosen once: version control holds the
135
- history, and an argument with a rejected alternative is a trait of the work, and its place is the
136
- rule's cold part, `pitfalls.md`. A closed question leaves the law, and an empty section kept for its heading
137
- passed the check anyway.
138
- - **A proposed law requires no rule.** An agreement written down before the code has nothing to bind
139
- to, and demanding a rule would force creating one with anchors into places that do not exist. The
140
- sign stands as a status line in the law itself, not in an exceptions list next to the check.
141
- - **A law that names a project file is a refusal.** Paths and bindings belong in a rule; otherwise
142
- the law can neither be read without knowing the tree nor applied to another application.
143
- - **A rule description is no longer than three hundred characters and answers one question — load
144
- this rule or not.** The description goes whole into the system prompt of every session, and the
145
- session pays for it whatever it works on: that is what tells it from the rule body, which the
146
- executor reads by itself. It grows on its own — it is written after the rule and retells its
147
- content — and the retelling arrives a second time together with the rule itself. The descriptions
148
- check counts the length; what is left longer than the limit is named in the accepted-debt list by
149
- name, with a reason.
150
-
151
- - **A rule declares the law it is written under.** A rule without a law is a set of techniques that
152
- does not show what exactly must be true.
153
- - **There are two layers of laws, and a law name is one for both.** The shared one lies in the
154
- constitution root, an application law in `application/`; neither `law:` nor `**Laws:**` names
155
- the layer, so law names are unique across the whole constitution tree.
156
- - **A divergence between a rule and its companion is resolved in favour of the rule.** The companion
157
- names the tree's names and the bindings of the articles; it does not cancel them: read above the
158
- rule, it becomes the place where a requirement is lifted silently and without review. Concreteness
159
- is no argument here — the companion is always more concrete, that is what it is for. A divergence
160
- found is named to the owner and fixed in the text that fell behind, and until then the work goes
161
- by the rule.
162
- - **A companion's statement about the state of an external service is checked by the command the
163
- companion itself names.** A neighbour's limit is lifted together with someone else's setting,
164
- while the text about it stays in the present tense and looks right after the lifting: only a call
165
- tells the current from the lifted. So the companion writes the way to ask, not a snapshot of the
166
- answer — and it has no right to order, on such a snapshot, the opposite of what the rule says.
167
- - **A rule may have a third file, and what is not read when deciding goes there.** Pitfalls and
168
- behaviour from incident analyses are needed not by whoever makes an ordinary decision but by
169
- whoever reviews a miss or argues with a guard — yet they load with the rule every time and grow
170
- faster than the articles. Such text leaves for `pitfalls.md` next to it, the rule names it with a
171
- line in its header, and it loads on demand. The gate refusal is silent about the cold part: it
172
- calls the rule, and the rule itself speaks of the third file.
173
-
174
- - **A spec declares the laws it applies, and the link is checked both ways.** A law named in the
175
- spec text must stand in the header: otherwise the law gives no way to learn which domains stand on
176
- it.
177
- - **Portable text speaks of a neighbouring resource conditionally and names it by name.** What is
178
- laid out in the tree and what is not is known to the layout list, not to the resource text. Said
179
- unconditionally — "a guard refuses a code edit before that" — it enters the context of every
180
- session and lies about a tree where that guard was not laid out; the tree has no way to fix that
181
- if the resource has no override. A resource's requirement of a resource is declared by a line in
182
- the header, not derived from such a phrase.
183
- - **An article of a rule speaks of its own applicability itself, by a sign line at its side.** A
184
- gate refusal calls the whole rule, while one of its articles covers the specific edit: paying the
185
- rule's full price for a decision means teaching to skip reading, that is to work worse than what
186
- was explored. The sign stands at the article, not in the gate map: the map knows the path and the
187
- rule, not which of two dozen articles is about that path.
188
-
189
- ```markdown
190
- - **Article title.** Article text, as usual.
191
- <!-- rt-when: *.scss *.css -->
192
- ```
193
-
194
- The globs are separated by a space and matched against the edit path as shell globs, not by
195
- word search: a word search names the wrong article and stays silent about it. A glob without
196
- a directory is also matched against the file name, and the comment is invisible in the
197
- assembled markup.
198
-
199
- - **An article without a sign is legitimate, and so is a rule without a single sign.** A sign is
200
- given to the articles whose rule refuses on a file edit; the rest are marked as their refusals
201
- reach the digest. A missing sign means "this article is not selected by the edit path", not a
202
- miss: demanding it from all would mean marking at random.
203
-
204
- - **A pattern is found by the `rule:` field, not by the name prefix.** Not every pattern carries the
205
- name prefix, and a search by rule name does not see those: the audit finds them by the field, a
206
- person by the rule's own "Patterns" section. A count of patterns gathered by prefixes comes out
207
- below the true one, and the number then goes into splitting the work.
208
- - **A decision from a spec goes to the layer, not to the archive.** What a spec is checked against
209
- the machine knows; where an accepted decision goes it does not know and will not: only whoever
210
- asks "will this still be true tomorrow" can tell a current requirement from an account of what
211
- happened. Where the pattern `task-flow-archive` is laid out, its step holds this, with the
212
- selection sign written there in advance.
213
- - **A name in an anchor is written as declared in code.** A private class field stands with a hash,
214
- and the name written without it names the wrong symbol: the check stays green, and the reader
215
- cannot tell from the binding line whether this is the private method or the ordinary one next to
216
- it. The former form stays legitimate — the name without the hash is remembered alongside the name
217
- itself.
218
- - **An anchor is checked against the raw text of the file, and a comment counts the same as code.**
219
- The check looks for the symbol's existence by word across the whole file without stripping
220
- comments, and counts liveness only for what is declared in code. A name standing in an explanation
221
- alone slips past both sides: the statement's anchor turns out to be a word from a comment, while
222
- the declaration next to it is called differently.
223
-
224
- - **A check nailed to a resource name breaks when the resource is split, and this has to be known
225
- before the edit.** A rule name and a pattern name stand not only in texts but in the tree's
226
- checks, in the probes of their suites and in the state tables. So a split starts with a search for
227
- the name across the whole tree: otherwise red arrives one check per run — that is how splitting
228
- one rule took down three.
229
-
230
- - **The spec speaking of a resource is found by a command, not by walking the subdomains.** A domain
231
- grows into dozens of subdomains, and the one needed is told from the rest only by reading: whoever
232
- takes apart a complaint about a file pays the whole window for that and therefore judges by memory.
233
- The command reads the bindings of the companions — the very ones the audit keeps fresh — and,
234
- called without a name, names the resources no spec speaks of. It knows only what the package
235
- lays out; for an application file it answers that the package carries no such name, and the
236
- product spec is found by the file path in the bindings of the domain specs.
15
+ - **Spec sections are fixed; a missing one is a refusal.**
16
+ - **Every statement is bound to code, checked both ways.**
17
+ - **A companion's first column copies the article text verbatim.**
18
+ - **A binding never leads into uncalled code; a test is not a call.** Except harness or published symbols.
19
+ - **A verdict follows substance, not the address form.**
20
+ - **A "not carried out" binding moves with its article.** A codeless spec rule: its open questions.
21
+ - **Procedure table and decorators match both ways, with permissions.**
22
+ - **A refusal code counts only if the domain throws it.**
23
+ - **A spec has one scenario prefix, taken by no other spec.** Its agreement shares it.
24
+ - **A scenario number is issued once and never reused.** Free number: companion's command; deleted stay empty.
25
+ - **A scenario and its test title change together.** Deleted, it takes its test.
26
+ - **A subdomain is asked the same as a domain.**
27
+ - **A law holds "Articles" and only open questions.**
28
+ - **A proposed law requires no rule.**
29
+ - **A law that names a project file is a refusal.**
30
+ - **A rule description: at most 300 characters, answering only: load it or not.** Longer: debt list, reasoned.
31
+ - **A rule declares its law.**
32
+ - **A law name is unique across both layers.**
33
+ - **Where a rule and its companion diverge, the rule wins.** Named to the owner; the laggard is fixed.
34
+ - **A companion checks an outside service by its named command.**
35
+ - **What is not read when deciding goes to the cold part.**
36
+ - **A compressed article keeps its statement, boundary, exception and sign.** Room: lines and bytes measured first, freed in the same edit; an argument folds to a line or goes whole to the cold part; retelling judges it; a loss returns to the article.
37
+ - **A spec names the laws it applies, checked both ways.**
38
+ - **Portable text names a neighbour by name, conditionally.**
39
+ - **An article marks its own applicability by a sign line.**
40
+ - **An unsigned article or rule is legitimate.**
41
+ - **A pattern is found by its `rule:` field, not its name prefix.**
42
+ - **A spec's decision goes to the layer, not the archive.**
43
+ - **An anchor name is written as declared in code.**
44
+ - **An anchor matches the raw file, comments included.**
45
+ - **Before a split, a resource's name is searched in the tree's checks.**
46
+ - **A resource's spec is found by command, not by walking subdomains.**
237
47
  <!-- rt-when: *.md -->
238
-
239
- ## The shape of a compressed article
240
-
241
- A rule loads whole into a session and pays for it every session, whatever the session works on. A
242
- one-off measurement named where the weight was: 289 440 characters in twenty-nine rules, the articles
243
- section is 45% of them, and inside the section statements take 19%, their arguments 81%. So the
244
- argument is cut, not the statement: a removed statement changes the rule, a removed argument only
245
- its price. Room is measured before an article is added, not after the commit is refused: the size
246
- check judges lines and characters apart, and a rule near either limit is compressed in the same
247
- edit. The measurement is two numbers from `wc -lc` against the limits the check prints.
248
-
249
- A paragraph at an article has three outcomes, chosen by one question: **what is this text needed for
250
- — to make a decision, to keep it from being reversed, or to review a miss?**
251
-
252
- | The text is needed to… | Outcome |
253
- | --------------------------------------------------------------- | ------------------------------ |
254
- | decide on the edit: what counts as right, where the boundary is | stays at the article verbatim |
255
- | not reverse the decision in a month: why exactly so | folds to one line |
256
- | review a miss or argue with a guard | leaves for the cold part whole |
257
-
258
- - **What stays at the article is the statement and what it reads wrong without.** The boundary, the
259
- exception, the applicability sign, the name of whoever guards it. Tested by subtraction: a removed
260
- piece changes the answer to "do it this way or not" — then it is not surplus.
261
- - **An argument folds to one line: the price of the miss, not its history.** "Otherwise the run is
262
- green while it checks something else" is an argument. When it happened, how many times in a row
263
- and in which branch is history, and its place is the cold part.
264
- - **An incident analysis leaves for the cold part whole, with its numbers and rejected options.**
265
- The cold part loads on demand and grows freely: one session in a hundred pays for it.
266
- - **The cold part holds explanation, not requirement.** A statement absent from the rule never lives
267
- there: a rule whose requirement lives in the cold part promises what the session loading it will
268
- not see. Tested by the same question reversed — no decision can be made by the cold part that
269
- cannot be made by the rule.
270
- - **Compression is judged by retelling, not in the source.** An article compressed right is retold
271
- by the same decision: whoever read only it edits the same way as whoever read the former one. They
272
- diverged — surplus was removed, and it comes back at the article, not to the cold part.
273
- - **A rule without a cold part is legitimate, and the first paragraph that leaves creates one.** An
274
- empty `pitfalls.md` next to it is a promise, not a mechanism.
275
-
276
- ## What of the law is not here
277
-
278
- A law no spec applies does not count as a refusal: the laws on code structure, delivery and
279
- verifiability do not touch domains at all. The order "description first, code second" is held by
280
- agreement: the project-documentation law carries no such requirement, and no open question for it is
281
- opened there.
282
-
283
- Screen state tables are checked by nothing. `check:specs` knows scenarios against test titles, rules
284
- against anchors, procedures against decorators and refusal codes against throws — a state table row
285
- is bound to nothing and passes green even when the code never reaches the named state. The state
286
- "the check did not load" stood in the tables of two domains before the code learned to reach it, and
287
- all that time read as a description of something working.
288
-
289
- The meaning of a scenario is checked against its neighbour by nothing: the check judges the number.
290
- Two scenarios promising the same thing in different words are different to it, and the second counts
291
- as unverifiable for as long as it lives.
292
-
293
- The completeness of marking articles with an applicability sign is counted by nothing. A rule with a
294
- sign on none of its articles refuses with the old text — and differs from a marked one only in that
295
- the executor reads it whole; no check says so. The observations digest judges it: the rule that
296
- refuses on a file edit more often than the others is the first to be marked.
297
-
298
- Section completeness of the law, the rule and the pattern themselves is checked by nothing here. The
299
- articles saying that a text is judged no more leniently than its copy, that an unchosen edition is
300
- judged the same as the chosen one, that the set of sections is declared apart from the sample and
301
- that a requirement nobody formulated stays silent are carried out where these texts are written — in the suite of the package that ships them. A consumer
302
- tree holds laid-out copies, and its check must not turn red on someone else's miss. Agreement of two
303
- texts is looked for by reading.
304
-
305
- The shape of a compressed article is checked by nothing, and there will be no check for it: the
306
- machine sees the character count, not whether the compressed article still yields the former
307
- decision. An argument cut out together with the statement's boundary is shorter than the right one
308
- and passes any character count. One thing guards this — the text length limit: it says the rule has
309
- outgrown, and is silent about what to cut. Compression is judged by retelling — by whoever edits by
310
- the compressed article next.
311
-
312
- The share of argument in a rule is counted by nothing. The measurement the shape stands on was made
313
- in a one-off pass and did not go into the tree: it answers "where the weight is", not "does it add
314
- up".
315
-
316
- ## Patterns
317
-
318
- - `spec-driven-domain` — creating and editing a domain spec, scenarios, binding.
319
- - `spec-driven-rule` — creating a law, a rule and a pattern.
320
- - `spec-driven-sweep` — a full review of a domain's binding, passes and their review.
@@ -7,124 +7,27 @@ description: Rule under the frontend-application law. Load when editing any *.sc
7
7
 
8
8
  # Styling — how it works here
9
9
 
10
- Rule under the law `docs/constitution/frontend-application.md`. The law says what must be true;
11
- here — what it is called in this tree and where it lives. The layout of a component file —
12
- `component-structure`, state — `angular-patterns`, the browser environment — `platform-access`,
13
- the layer of calls to the server — `api-layer`. All five under one law.
14
-
15
- **Cold part:** `pitfalls.md` next to it — traps already stepped on. Loaded on demand, not
16
- together with the rule.
17
-
18
- ## What it is called here
19
-
20
- | In the law | Here |
21
- | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
22
- | the shared set of styling values | the kit scales `--rt-*`; one's own on top of them — `--<prefix>-*` in the application's `styles.scss` |
23
- | a class in the markup | the `rtBlock` and `rtElem` directives from `@rt-tools`, not a string in an attribute |
24
- | a style rule | an `&__<element>` declaration in `.scss` — its own or in the application's shared layer |
25
- | the shared layout layer | `apps/<app>/src/styles/`: `<prefix>-page`, `<prefix>-form`, `<prefix>-panel`, `<prefix>-window` in the admin, `<prefix>-site-page` on the site |
26
-
27
- ## Where it lives
28
-
29
- In this tree — the table in `implementation.md` next to it. Paths live there, not here: the rule
30
- travels between repositories, the layout does not, and a path named in the rule lies in the
31
- first tree that keeps its code differently.
32
-
33
- ## Flow
34
-
35
- The flow of a styling edit: where a value comes from, where the layout lives and what opens an
36
- overlay.
37
-
38
- ```mermaid
39
- flowchart TD
40
- A[Styling is edited] --> B{What is being set}
41
- B -->|Colour, spacing, font size| C[Taken as a styling token, not written as a value in place]
42
- B -->|Screen layout| D[Declared in the application's shared layer, not in the screen's styles]
43
- B -->|A layer above the page| E[Opened by the kit service; the layer number is taken from the scale]
44
- C --> F[The class is set by a directive, and every element class has its own rule]
45
- D --> F
46
- E --> F
47
- F --> G{The size of a control}
48
- G -->|Chosen by the pointer sign, not by the screen width| H[The styles file stays within the length limit]
49
- H --> I[The stylelint run: a warning fails it the same as an error]
50
- ```
10
+ Rule under the law `docs/constitution/frontend-application.md`. Cold part: `pitfalls.md` — traps
11
+ already stepped on; `pitfalls-2.md` — the whole text, every article with its reasons.
51
12
 
52
13
  ## How the law applies here
53
14
 
54
- - **Styling is taken as a `--rt-*` token, not written as a value in place.** Composite values —
55
- `box-shadow`, `text-shadow` — are taken as a ready-made token whole, not assembled from parts.
56
- <!-- rt-when: *.scss *.css -->
57
-
58
- - **Every element class has its own style rule.** A class without a rule looks working and
59
- silently does nothing.
60
- <!-- rt-when: *.scss *.css -->
61
-
62
- - **A class is set by a directive, not by a string in an attribute.** `rtElem` gets the block name
63
- by injection from the nearest ancestor with `rtBlock`, and there is nothing to repeat that
64
- resolution by the text of the template.
65
- <!-- rt-when: *.html *.scss -->
66
-
67
- - **The layout is declared in the application's shared layer, not in the screen's styles.** A
68
- screen component outside the kit has an empty styles file by default.
69
- <!-- rt-when: *.scss *.css -->
70
-
71
- - **One thing is called by one name in every place it occurs.** A layout that keeps three
72
- vocabularies for the page, the edit panel and the window, with shared names in different
73
- meanings, does not count as a shared layer: the place of declaration matches, the meaning of the
74
- name does not. Choosing a name, the executor lands in a foreign vocabulary and brings a foreign
75
- spacing, and the checks do not see it. Where an element stands is set by the kind of block, not
76
- by a second set of names.
77
- <!-- rt-when: *.scss *.css *.html -->
78
-
79
- - **The sheet and the window are opened by the kit service, not by a layer number.** The scale's
80
- numbers compare only between neighbours in the markup; the service moves the markup outside, to
81
- `<body>`, and there is nothing left to compare it with.
82
- <!-- rt-when: *.ts *.scss -->
83
-
15
+ - **Styling is taken as a `--rt-*` token, not written as a value in place.**
16
+ - **Every element class has its own style rule.**
17
+ - **A class is set by a directive, not by a string in an attribute.**
18
+ - **The layout is declared in the application's shared layer, not in the screen's styles.**
19
+ - **One thing is called by one name in every place it occurs.**
20
+ - **The sheet and the window are opened by the kit service, not by a layer number.**
84
21
  - **The layer number is taken from the scale, not written as a number in the component file.**
85
- The scale is the only place where the layers are visible side by side: a number written in place
86
- does not land in it, and the next node takes the same number without learning of it.
87
- <!-- rt-when: *.scss *.css -->
88
-
89
- - **A width limit is declared together with the fate of what did not fit.** A limit and a place in
90
- a row hide or wrap nothing by themselves: a node that may receive a value longer than its place
91
- has either ellipsis truncation or wrapping. Without that the text silently runs past the border
92
- and lies over its neighbour, and allowing an element to shrink does not replace truncation.
93
- <!-- rt-when: *.scss *.css -->
94
-
95
- - **Truncation goes in a pair with a tooltip.** A truncated text without a tooltip reads as the
96
- whole value: a person has no way to learn where the text actually ends. The whole value they see
97
- either in the place itself or on hover — and a tooltip given a width limit of its own obeys the
98
- article above the same as a cell.
99
- <!-- rt-when: *.scss *.css -->
100
-
101
- - **The size of a control is chosen by the pointer sign, not by the screen width.** A tablet in
102
- landscape is wider than the narrow-viewport threshold, yet it is tapped with a finger:
103
- `pointer: coarse` answers about the way of pressing, the width — about the room for the layout.
104
- The steps are taken from the kit, not assigned in pixels.
105
- <!-- rt-when: *.scss *.css -->
106
-
107
- - **A styles file is no longer than 500 lines.** The limit is shared with code and texts, but
108
- stylelint does not judge length at all — a check of the tree holds it. A grown screen file is
109
- split by blocks, and shared layout leaves for its own layer.
110
- <!-- rt-when: *.scss *.css -->
111
-
112
- - **A stylelint warning fails the run the same as an error.** `!important` is declared a warning,
113
- and the run goes with `--max-warnings 0`: otherwise the ban reads as a wish — two such warnings
114
- lay in the tree while `npm run stylelint` returned zero and was no gate.
115
- <!-- rt-when: *.scss *.css -->
116
-
117
- ## What of the law is not here
118
-
119
- The "class without a rule" check counts a match by element name, not by the pair "block —
120
- element": a class that has a rule, but under a foreign block, it lets through. The reverse
121
- direction — removing the rule of a live class — is not checked at all and is caught by reading
122
- the template.
123
-
124
- ## Patterns
125
-
126
- - `styling-bem-layout` — a screen on the shared layout layer, the application's blocks.
127
- - `styling-bem-component` — styles of a kit component, `:host`, modifiers, the site's styling
128
- language.
129
- - `styling-bem-sheet` — the sheet and the window above the page: what opens them, the backdrop,
130
- the measurement.
22
+ - **A width limit is declared together with the fate of what did not fit.**
23
+ - **Truncation goes in a pair with a tooltip.**
24
+ - **The size of a control is chosen by the pointer sign, not by the screen width.**
25
+ - **A styles file is no longer than 500 lines.**
26
+ - **A stylelint warning fails the run the same as an error.**
27
+
28
+ ## Names and techniques
29
+
30
+ - Composite values (`box-shadow`, `text-shadow`) take a ready token whole.
31
+ - Own tokens are `--<prefix>-*` in the app's `styles.scss`, built on `--rt-*`.
32
+ - No `!important`: it is a warning, and warnings fail the run.
33
+ - Control sizes take kit steps, not pixels.
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: task-flow-handover
3
+ kind: rule
4
+ law: work-conduct
5
+ description: Rule under the work-conduct law — closing a task: the folder taken apart, the PR opened and readied, the merge. Load before a PR opens, leaves draft or merges. Patterns task-flow-close, -archive.
6
+ ---
7
+
8
+ # Work conduct — closing a task
9
+
10
+ Rule under the law `docs/constitution/work-conduct.md`. Cold part: `pitfalls.md`; every article whole — `pitfalls-2.md` of `task-flow`.
11
+
12
+ ## How the law applies here
13
+
14
+ - **The task folder is taken apart by the last commit before the PR opens, not after approval.** The grill goes to the archive, findings to the epic plan, the plan away.
15
+ - **After opening the PR, the executor tells the owner the number, what it waits for and what comes next.** A draft waits for the run, a ready PR for the owner's hand.
16
+ - **A request to merge never comes before the work is checked.** Where the pipeline wakes for the base: pushed → draft → run green → draft lifted → the request, naming the number. Where it does not wake, the green push gate is the check, and opening the PR and asking to merge are one turn.
17
+ - **A PR that waits for a run opens as a draft, and one that waits for nothing opens ready.** The bases the pipeline wakes for are read from its file.
18
+ - **Closed work is reviewed by the rules in the background, right after the PR, and its findings wait for the owner.** The next task is taken meanwhile.
19
+ - **The cheap closing step goes before the costly one, and the run — after the merge.** The merge is the agreement's into the spec: it, then the texts, then the suite, all before the PR; a run before it checks what will not reach main.
20
+ - **The agreement merges into the domain spec by one of the last commits of the branch, before the PR opens.**
21
+ - **The folder of a closed task is taken apart, not moved whole.** What explains a decision goes to `docs/archive/`; the rest is deleted.
22
+ - **Opening the PR and lifting the draft are refused while the branch carries its task folder.**
23
+ - **A branch that removed the folder adds a record to the archive.** The grill goes first — the only record of the owner's words.
24
+ - **The bypass is the line `Task-folder-skip: <reason>` in the PR or in the command itself.** An empty reason is no bypass; the work queue audit still names the folder.
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: task-flow-owner
3
+ kind: rule
4
+ law: work-conduct
5
+ description: Rule under the work-conduct law — the owner's word and the session. Load before asking the owner, when replying to an order and at the start of a session. Pattern task-flow-cycle.
6
+ ---
7
+
8
+ # Work conduct — the owner's word and the session
9
+
10
+ Rule under the law `docs/constitution/work-conduct.md`. Cold part: `pitfalls.md`.
11
+
12
+ ## How the law applies here
13
+
14
+ - **What needs the owner's word is taken from a list, not appraised on the spot.**
15
+ - **A stop the owner sets on a later step is written down the moment it is said.**
16
+ - **A reply to the owner's order begins with the result, not with intent or its justification.**
17
+ - **The last run of the main branch is read first thing in a session and after every known merge.**
18
+ - **A session does not start work by itself.** An empty message, a word or a path orders nothing.
19
+ - **A refusal by an external limiter removes the way, not the task.** A guard that names the fix gives the way.
20
+ - **A question written by a past session does not become a question to the owner.** It goes to the handover's author; a work step closes some.
21
+ - **The owner's instruction holds until they cancel it, and a new fact against it is a line in the reply about the cost, not a new question.**
22
+ - **An answer in the owner's message counts the same as an answer in a document.**
23
+ - **The owner's word about the design is a task setting, not a decision.** Checked against the tree first; a mismatch goes to the owner.
24
+ - **A tool the owner named is used, and a substitute is named in the same reply.** With the reason.
25
+ - **A rule of the tree outweighs a standing instruction of the host.**
26
+ - **An instruction to work by a rule or by the progress is an instruction to do all its steps, including those that change history.**
27
+ - **A word for a new notion is looked up in the tree's glossary.**
28
+ - **Work ordered in words becomes a task in the queue in the same turn.** Postponed work names a date.
29
+ - **An improvement of a rule names the metric it should move, and the next report judges it.**
30
+ - **Work is judged by the role `goal-critic` against the owner's words.**
31
+ - **A mission is set by the owner.** A session proposes a wording and waits for approval.
32
+ - **Building by a sample begins with reading the sample itself, whole, by walking the directories.**
33
+ - **Exploration of a tree that holds a code graph begins with the graph.**
34
+ - **The path to a sample lies outside the history, the permission to work outside the epic — in the main branch.**
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: task-flow-plan
3
+ kind: rule
4
+ law: work-conduct
5
+ description: Rule under the work-conduct law — the task folder, the plan, its steps and the progress. Load on any edit of a task folder and on a plan refusal. Pattern task-flow-resume.
6
+ ---
7
+
8
+ # Work conduct — the folder, the plan and the progress
9
+
10
+ Rule under the law `docs/constitution/work-conduct.md`. Cold part: `pitfalls.md`; articles whole — `task-flow`, `pitfalls-2.md`.
11
+
12
+ **Requires:** `hooks/task-flow-guard.sh`, `hooks/task-flow-draft-guard.sh`, `hooks/task-context-load.sh`, `hooks/window-fill-guard.sh`, `hooks/turn-exit-guard.sh`, `hooks/turn-judge.md`, `hooks/ask-judge.md`, `hooks/main-run-context.sh`
13
+
14
+ ## How the law applies here
15
+
16
+ - **Editing application code is refused until the work has reached a state in which code is edited.**
17
+ - **The guard judges the declared transition, not the presence of files.** Lifted by `этап-идёт`, `этапы-кончились`, `разбор-кончился`, `работа-отдана`, or a taken-apart folder in history.
18
+ - **Two requirements — two guards, and one can be lifted without losing the other.** The behaviour line lifts only the agreement.
19
+ - **A merged agreement does not lock the branch.**
20
+ - **The agreement is required by the edit paths, not by an appraisal of the task.** `apps/**`, `libs/**`; bypass: `**Behaviour:** unchanged — <the owner's reason>` in the plan.
21
+ - **A task folder is created for any work, no exceptions.**
22
+ - **The task folder goes into the branch by a commit, not lives in one working tree.**
23
+ - **The plan guard is the lower bound of the requirement, not its limit.**
24
+ - **A taken task does not end a turn.**
25
+ - **The stages of a plan cover its done-sign whole.**
26
+ - **Every rule of the product agreement becomes a step of some stage.**
27
+ - **Every step of the plan carries a check whose expected output is taken from a run while the plan is written.**
28
+ - **A plan for work that ports a technique from outside is written by a measurement of one's own code.**
29
+ - **A count that becomes the measure of the work is bounded by the declaration, not by the file.**
30
+ - **Waiting for one part of a stage is never a stop of the stage.**
31
+ - **A finding made mid-stage is checked against the plan's exit conditions before the first edit.** Outside them: to what the work does not do, filed as a task.
32
+ - **Done work is marked only in the progress.**
33
+ - **The plan names the steps of every stage, and the progress mirrors them with a mark each.**
34
+ - **The numbers and the names of the steps are copied from the plan, not reworded.**
35
+ - **Exactly one step carries the mark of going on right now, while any step is not done.**
36
+ - **The task folder is created as a draft and gets its number by a command.**
37
+ - **An abandoned grill is visible.**
38
+ - **The plan names the points: the epic its milestone, the task the change a person will see.**