@rt-tools/agent-kit 0.23.0 → 0.26.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 (288) hide show
  1. package/README.md +8 -2
  2. package/assets/agents/business-analyst.md +51 -50
  3. package/assets/agents/conscience.md +37 -35
  4. package/assets/agents/project-manager.md +49 -48
  5. package/assets/agents/prose-editor.md +31 -29
  6. package/assets/agents/qa-engineer.md +50 -48
  7. package/assets/agents/rules-reviewer.md +63 -58
  8. package/assets/agents/skill-curator.md +83 -78
  9. package/assets/agents/spec-critic.md +34 -29
  10. package/assets/agents/spec-writer.md +35 -32
  11. package/assets/agents/strict-teacher.md +39 -37
  12. package/assets/checks/archive-age.mjs +48 -28
  13. package/assets/checks/archive-prune.mjs +16 -14
  14. package/assets/checks/board-epics.github.mjs +75 -41
  15. package/assets/checks/board-folders.mjs +61 -0
  16. package/assets/checks/board-gh.github.mjs +35 -26
  17. package/assets/checks/board-long-work.github.mjs +24 -24
  18. package/assets/checks/board-paths.github.mjs +21 -16
  19. package/assets/checks/board-runs.github.mjs +45 -43
  20. package/assets/checks/board-titles.github.mjs +19 -17
  21. package/assets/checks/board.github.mjs +150 -128
  22. package/assets/checks/check-archive-age.mjs +23 -19
  23. package/assets/checks/check-board.github.mjs +179 -157
  24. package/assets/checks/check-descriptions.mjs +30 -29
  25. package/assets/checks/check-doc-paths.mjs +104 -82
  26. package/assets/checks/check-dupes.mjs +84 -80
  27. package/assets/checks/check-file-size.mjs +79 -70
  28. package/assets/checks/check-glossary.mjs +47 -37
  29. package/assets/checks/check-hook-scope.mjs +30 -27
  30. package/assets/checks/check-lib-layers.mjs +22 -21
  31. package/assets/checks/check-profile-drift.mjs +48 -43
  32. package/assets/checks/check-prose-style.mjs +125 -33
  33. package/assets/checks/check-push-gate.mjs +53 -50
  34. package/assets/checks/check-reuse.mjs +50 -40
  35. package/assets/checks/check-schema-drift.mjs +87 -83
  36. package/assets/checks/check-specs.mjs +155 -134
  37. package/assets/checks/check-state-next.mjs +66 -52
  38. package/assets/checks/check-states.mjs +32 -30
  39. package/assets/checks/check-styles.mjs +52 -51
  40. package/assets/checks/check-turn-map.mjs +54 -46
  41. package/assets/checks/lib-boundaries.mjs +32 -30
  42. package/assets/checks/lib-common.mjs +30 -29
  43. package/assets/checks/lib-domains.mjs +34 -34
  44. package/assets/checks/lib-manifests.mjs +17 -15
  45. package/assets/checks/lib-reexports.mjs +18 -18
  46. package/assets/checks/rt-kit-checks.config.mjs +174 -142
  47. package/assets/checks/signals.mjs +43 -39
  48. package/assets/checks/spec-anchors.mjs +114 -87
  49. package/assets/checks/spec-common.mjs +128 -84
  50. package/assets/checks/spec-contract.mjs +30 -30
  51. package/assets/checks/spec-proposed.mjs +27 -24
  52. package/assets/checks/spec-scenarios.mjs +51 -28
  53. package/assets/checks/task-new.github.mjs +85 -56
  54. package/assets/commands/feedback.md +65 -59
  55. package/assets/commands/next-session.md +64 -57
  56. package/assets/commands/skill-curator.md +83 -79
  57. package/assets/defaults/gate-map.sh +115 -91
  58. package/assets/defaults/project.sh +228 -178
  59. package/assets/defaults/shell.sh +85 -65
  60. package/assets/defaults/turn-map.md +45 -44
  61. package/assets/docs/GLOSSARY.md +142 -65
  62. package/assets/hooks/browser-device-id.sh +12 -12
  63. package/assets/hooks/browser-guard-device-id.sh +46 -14
  64. package/assets/hooks/browser-guard-no-asking.sh +5 -4
  65. package/assets/hooks/browser-guard-no-listing.sh +12 -11
  66. package/assets/hooks/browser-guard-no-other-drivers.sh +48 -42
  67. package/assets/hooks/browser-guard-require-select.sh +34 -23
  68. package/assets/hooks/claim-guard.sh +62 -56
  69. package/assets/hooks/commit-msg.sh +11 -10
  70. package/assets/hooks/conscience-guard.sh +91 -45
  71. package/assets/hooks/constitution-index.sh +16 -16
  72. package/assets/hooks/deny-tail.sh +28 -26
  73. package/assets/hooks/dev-server-guard.sh +46 -43
  74. package/assets/hooks/dispatch.sh +84 -39
  75. package/assets/hooks/docs-guard.sh +105 -86
  76. package/assets/hooks/exam-guard.sh +146 -84
  77. package/assets/hooks/git-guard-delivery-conflict.sh +38 -36
  78. package/assets/hooks/git-guard-delivery-draft.sh +85 -0
  79. package/assets/hooks/git-guard-delivery-folder.sh +50 -43
  80. package/assets/hooks/git-guard-delivery-signature.sh +88 -52
  81. package/assets/hooks/git-guard-delivery.sh +207 -253
  82. package/assets/hooks/git-guard-main.sh +65 -26
  83. package/assets/hooks/git-guard-push-tests.sh +133 -75
  84. package/assets/hooks/glossary-load.sh +23 -22
  85. package/assets/hooks/grill-gate-ask.sh +12 -11
  86. package/assets/hooks/grill-gate.sh +94 -87
  87. package/assets/hooks/guard-note.sh +20 -19
  88. package/assets/hooks/handoff-entry-guard.sh +26 -24
  89. package/assets/hooks/handoff-write.sh +74 -67
  90. package/assets/hooks/hook-input.sh +70 -50
  91. package/assets/hooks/lint-after-edit.sh +95 -61
  92. package/assets/hooks/observe.sh +28 -26
  93. package/assets/hooks/override-write-guard.sh +23 -21
  94. package/assets/hooks/postmortem-guard.sh +42 -39
  95. package/assets/hooks/profile-check.sh +22 -20
  96. package/assets/hooks/proposal-guard.sh +57 -49
  97. package/assets/hooks/prose-style-guard.sh +19 -17
  98. package/assets/hooks/qa-dataid-guard.sh +52 -49
  99. package/assets/hooks/rerun-guard.sh +31 -30
  100. package/assets/hooks/reuse-first-guard.sh +108 -87
  101. package/assets/hooks/roles.sh +14 -14
  102. package/assets/hooks/rule-article.sh +36 -34
  103. package/assets/hooks/rule-source-guard.sh +52 -36
  104. package/assets/hooks/skill-gate-layers.sh +59 -57
  105. package/assets/hooks/skill-gate-rearm.sh +15 -8
  106. package/assets/hooks/skill-gate.sh +89 -81
  107. package/assets/hooks/skill-loaded.sh +6 -6
  108. package/assets/hooks/sql-guard-parse.sh +68 -66
  109. package/assets/hooks/sql-guard-request.sh +48 -46
  110. package/assets/hooks/sql-guard-target.sh +57 -51
  111. package/assets/hooks/sql-guard-write.sh +84 -79
  112. package/assets/hooks/sql-guard.sh +52 -47
  113. package/assets/hooks/stand-login-guard.sh +104 -0
  114. package/assets/hooks/task-context-load.sh +60 -55
  115. package/assets/hooks/task-flow-context.sh +87 -69
  116. package/assets/hooks/task-flow-draft-guard.sh +55 -48
  117. package/assets/hooks/task-flow-guard.sh +67 -64
  118. package/assets/hooks/turn-entry-load.sh +39 -32
  119. package/assets/hooks/turn-exit-guard.sh +256 -204
  120. package/assets/hooks/turn-exit-patterns.sh +53 -0
  121. package/assets/hooks/utf8.sh +11 -11
  122. package/assets/hooks/waiting-turn-guard.sh +94 -94
  123. package/assets/hooks/window-fill-guard.sh +70 -62
  124. package/assets/hooks/work-start-guard.sh +52 -49
  125. package/assets/hooks/write-targets.sh +115 -30
  126. package/assets/laws/autonomous-work.md +29 -27
  127. package/assets/laws/code-structure.md +31 -30
  128. package/assets/laws/delivery.md +148 -137
  129. package/assets/laws/entity-editing.md +52 -50
  130. package/assets/laws/entity-models.md +14 -13
  131. package/assets/laws/frontend-application.md +39 -38
  132. package/assets/laws/lib-imports.md +27 -27
  133. package/assets/laws/lists.md +31 -29
  134. package/assets/laws/navigation.md +37 -37
  135. package/assets/laws/observability.md +41 -40
  136. package/assets/laws/project-documentation.md +106 -99
  137. package/assets/laws/reuse-first.md +31 -29
  138. package/assets/laws/shared-code.md +27 -27
  139. package/assets/laws/verifiability.md +131 -114
  140. package/assets/laws/work-conduct.md +250 -250
  141. package/assets/patterns/admin-lists-screen.md +72 -69
  142. package/assets/patterns/admin-nav-item.md +51 -46
  143. package/assets/patterns/angular-patterns-state.md +32 -31
  144. package/assets/patterns/api-layer-pair.md +33 -31
  145. package/assets/patterns/autonomous-work-run.md +50 -49
  146. package/assets/patterns/browser-verification-measure.md +143 -67
  147. package/assets/patterns/browser-verification-stand.md +181 -128
  148. package/assets/patterns/component-structure-new.md +51 -42
  149. package/assets/patterns/dependencies-upgrade.md +55 -39
  150. package/assets/patterns/doc-style-human.md +93 -0
  151. package/assets/patterns/doc-style-sweep.md +82 -79
  152. package/assets/patterns/doc-style-trace.md +87 -81
  153. package/assets/patterns/doc-style-write.md +130 -122
  154. package/assets/patterns/entity-aside.md +77 -63
  155. package/assets/patterns/entity-models-new.md +37 -37
  156. package/assets/patterns/entity-store.md +33 -33
  157. package/assets/patterns/git-workflow-commit.azure.md +94 -75
  158. package/assets/patterns/git-workflow-commit.github.md +153 -129
  159. package/assets/patterns/git-workflow-commit.gitlab.md +96 -78
  160. package/assets/patterns/git-workflow-docker.md +165 -147
  161. package/assets/patterns/git-workflow-freshness.md +45 -45
  162. package/assets/patterns/git-workflow-merge.md +99 -86
  163. package/assets/patterns/git-workflow-migration.md +54 -52
  164. package/assets/patterns/git-workflow-pr-ready.md +57 -56
  165. package/assets/patterns/git-workflow-pr.azure.md +126 -121
  166. package/assets/patterns/git-workflow-pr.github.md +179 -175
  167. package/assets/patterns/git-workflow-pr.gitlab.md +138 -131
  168. package/assets/patterns/git-workflow-restart.md +35 -31
  169. package/assets/patterns/git-workflow-secrets.md +80 -73
  170. package/assets/patterns/git-workflow-stack.md +131 -106
  171. package/assets/patterns/lib-layers-move.md +62 -53
  172. package/assets/patterns/lib-layers-new.md +59 -45
  173. package/assets/patterns/observability-record.md +72 -67
  174. package/assets/patterns/platform-access-di.md +31 -29
  175. package/assets/patterns/reuse-first-extend.md +66 -61
  176. package/assets/patterns/shared-code-new.md +39 -38
  177. package/assets/patterns/spec-driven-domain.md +161 -151
  178. package/assets/patterns/spec-driven-rule.md +179 -168
  179. package/assets/patterns/spec-driven-sweep.md +41 -39
  180. package/assets/patterns/status-report-table.github.md +37 -36
  181. package/assets/patterns/styling-bem-component.md +42 -42
  182. package/assets/patterns/styling-bem-layout.md +39 -34
  183. package/assets/patterns/styling-bem-sheet.md +59 -58
  184. package/assets/patterns/task-flow-archive.md +222 -215
  185. package/assets/patterns/task-flow-close.md +215 -203
  186. package/assets/patterns/task-flow-handoff.md +154 -145
  187. package/assets/patterns/task-flow-resume.md +138 -133
  188. package/assets/patterns/task-flow-start.md +204 -192
  189. package/assets/patterns/testing-e2e.md +103 -92
  190. package/assets/patterns/testing-unit.md +77 -70
  191. package/assets/patterns/ts-procedure.md +32 -29
  192. package/assets/patterns/turn-entry-map.md +50 -48
  193. package/assets/pitfalls/agent-kit.md +152 -141
  194. package/assets/pitfalls/doc-style.md +96 -91
  195. package/assets/pitfalls/git-workflow.azure.md +49 -46
  196. package/assets/pitfalls/git-workflow.github.md +264 -234
  197. package/assets/pitfalls/git-workflow.gitlab.md +49 -45
  198. package/assets/pitfalls/spec-driven.md +73 -71
  199. package/assets/pitfalls/styling-bem.md +46 -40
  200. package/assets/pitfalls/task-flow.md +262 -246
  201. package/assets/pitfalls/testing.md +99 -92
  202. package/assets/pitfalls/turn-conduct.md +96 -81
  203. package/assets/rules/angular-patterns.md +81 -80
  204. package/assets/rules/api-layer.md +77 -74
  205. package/assets/rules/autonomous-work.md +75 -74
  206. package/assets/rules/browser-verification.md +223 -188
  207. package/assets/rules/component-structure.md +72 -69
  208. package/assets/rules/dependencies.md +74 -67
  209. package/assets/rules/deploy-flow.azure.md +118 -108
  210. package/assets/rules/deploy-flow.github.md +145 -135
  211. package/assets/rules/deploy-flow.gitlab.md +120 -110
  212. package/assets/rules/doc-style.md +209 -148
  213. package/assets/rules/entity-conventions.needs-admin.md +81 -79
  214. package/assets/rules/entity-models.md +73 -70
  215. package/assets/rules/git-workflow.azure.md +224 -228
  216. package/assets/rules/git-workflow.github.md +250 -242
  217. package/assets/rules/git-workflow.gitlab.md +218 -217
  218. package/assets/rules/lib-layers.md +85 -86
  219. package/assets/rules/lists.md +101 -97
  220. package/assets/rules/navigation.md +78 -78
  221. package/assets/rules/observability.needs-app.md +165 -153
  222. package/assets/rules/platform-access.md +76 -75
  223. package/assets/rules/reuse-first.md +153 -137
  224. package/assets/rules/shared-code.md +82 -79
  225. package/assets/rules/spec-driven.md +272 -260
  226. package/assets/rules/status-report.md +55 -58
  227. package/assets/rules/styling-bem.md +83 -72
  228. package/assets/rules/task-flow.md +282 -270
  229. package/assets/rules/testing.md +224 -188
  230. package/assets/rules/turn-conduct.md +255 -258
  231. package/assets/rules/turn-entry.md +92 -87
  232. package/assets/rules/typescript-conventions.md +94 -88
  233. package/assets/samples/specs/_template/spec.md +47 -47
  234. package/assets/samples/tasks/_template/grill.md +20 -20
  235. package/assets/samples/tasks/_template/plan.md +32 -30
  236. package/assets/samples/tasks/_template/progress.md +16 -16
  237. package/assets/skills/agent-kit-extend.md +129 -113
  238. package/assets/skills/agent-kit.md +236 -222
  239. package/assets/skills/write-a-skill.md +76 -71
  240. package/assets/templates/findings.md +19 -19
  241. package/assets/templates/gate-map.sh +16 -14
  242. package/assets/templates/implementation.md +28 -27
  243. package/assets/templates/pattern.md +17 -17
  244. package/assets/templates/pitfalls.md +6 -6
  245. package/assets/templates/postmortem.md +24 -23
  246. package/assets/templates/project.sh +24 -24
  247. package/assets/templates/proposal.md +62 -60
  248. package/assets/templates/rule.md +38 -38
  249. package/assets/workflows/feature.js +46 -46
  250. package/assets/workflows/plan.js +54 -54
  251. package/lib/catalog.d.ts +2 -0
  252. package/lib/catalog.d.ts.map +1 -1
  253. package/lib/catalog.js +4 -3
  254. package/lib/catalog.js.map +1 -1
  255. package/lib/commands.d.ts.map +1 -1
  256. package/lib/commands.js +68 -4
  257. package/lib/commands.js.map +1 -1
  258. package/lib/companion.js +3 -2
  259. package/lib/companion.js.map +1 -1
  260. package/lib/enroll.d.ts +7 -1
  261. package/lib/enroll.d.ts.map +1 -1
  262. package/lib/enroll.js +13 -4
  263. package/lib/enroll.js.map +1 -1
  264. package/lib/observations.d.ts +10 -1
  265. package/lib/observations.d.ts.map +1 -1
  266. package/lib/observations.js +1 -0
  267. package/lib/observations.js.map +1 -1
  268. package/lib/override-marks.d.ts +24 -0
  269. package/lib/override-marks.d.ts.map +1 -0
  270. package/lib/override-marks.js +98 -0
  271. package/lib/override-marks.js.map +1 -0
  272. package/lib/plan.d.ts +11 -0
  273. package/lib/plan.d.ts.map +1 -1
  274. package/lib/plan.js +10 -1
  275. package/lib/plan.js.map +1 -1
  276. package/lib/ship.d.ts +0 -7
  277. package/lib/ship.d.ts.map +1 -1
  278. package/lib/ship.js +10 -2
  279. package/lib/ship.js.map +1 -1
  280. package/lib/shipment.d.ts.map +1 -1
  281. package/lib/shipment.js +7 -3
  282. package/lib/shipment.js.map +1 -1
  283. package/lib/sync.d.ts.map +1 -1
  284. package/lib/sync.js +45 -11
  285. package/lib/sync.js.map +1 -1
  286. package/package.json +1 -1
  287. package/rt-tools-agent-kit-0.26.0.tgz +0 -0
  288. package/rt-tools-agent-kit-0.23.0.tgz +0 -0
@@ -1,32 +1,33 @@
1
1
  #!/usr/bin/env bash
2
- # Карта «что правится — какое правило». Умолчание пакета: настоящие пути, а не образцы.
2
+ # Map "what is edited — which rule". The package default: real paths, not samples.
3
3
  #
4
- # Деревья этой мастерской устроены одинаково — Nx, `apps/` и `libs/`, те же расширения и те же
5
- # имена каталогов, — поэтому карту везёт пакет, а не пишет каждый проект заново. Пятнадцать её
6
- # редакций расходились бы молча, и заметить расхождение можно было бы только по тому, что гейт
7
- # перестал требовать правило там, где оно есть.
4
+ # The trees of this workshop are built alike — Nx, `apps/` and `libs/`, the same extensions and the
5
+ # same directory names — so the package carries the map instead of every project writing it anew.
6
+ # Fifteen editions of it would drift apart silently, and the drift could be noticed only by the gate
7
+ # no longer demanding a rule where there is one.
8
8
  #
9
- # Своё дерево дописывает надстройкой — `.claude/rt-kit/gate-map.sh`. Она грузится второй,
10
- # объявляет `skill_for` заново и зовёт отсюда `skill_for_default` для всего, чего не назвала.
9
+ # A tree adds its own by an override — `.claude/rt-kit/gate-map.sh`. It loads second, declares
10
+ # `skill_for` anew and calls `skill_for_default` from here for everything it did not name.
11
11
  #
12
- # Функция печатает ИМЯ ПРАВИЛА или молчит. Молчание — «правила на это нет», и гейт пропускает.
13
- # Имён может быть несколько, по одному в строке: первое — доменное правило файла, следующие —
14
- # те, что действуют вторым слоем. Гейт потребует первое незагруженное.
12
+ # The function prints the RULE NAME or stays silent. Silence means "there is no rule for this", and
13
+ # the gate lets it through. There may be several names, one per line: the first is the file's domain
14
+ # rule, the following ones act as the second layer. The gate demands the first one not loaded.
15
15
  #
16
- # Порядок веток решает: первое совпадение выигрывает, поэтому частное идёт раньше общего.
16
+ # The order of branches decides: the first match wins, so the specific goes before the general.
17
17
 
18
- # Правила, вступающие не от рода файла, а от того, что в него пишут, здесь не выбираются:
19
- # они приходят слоем поверх доменного — `hooks/skill-gate-layers.sh`. Карта судит путь, слой
20
- # судит текст, и оба зовутся из гейта в одной оболочке.
18
+ # Rules that apply not by the kind of file but by what is written into it are not chosen here: they
19
+ # come as a layer over the domain one — `hooks/skill-gate-layers.sh`. The map judges the path, the
20
+ # layer judges the text, and both are called from the gate in one shell.
21
21
 
22
- # Команда считается ВЫЗОВОМ, только когда стоит в начале строки или сразу за разделителем.
23
- # Совпадение по подстроке ловит любое УПОМИНАНИЕ: строка о коммите в теле самого коммита и поиск
24
- # по истории отбивались как настоящий коммит.
22
+ # A command counts as a CALL only when it stands at the start of a line or right after a separator.
23
+ # A substring match catches any MENTION: a line about a commit in the body of the commit itself and
24
+ # a search through history were refused as a real commit.
25
25
  #
26
- # `([A-Za-z_]…=…[[:space:]]+)*` — переменные окружения перед вызовом: адрес хранилища ставят
27
- # приставкой самой команды, и без этого куска вызов не опознавался вовсе. `(npx…)?` — запуск
28
- # через раннер пакетов, `([^[:space:]]*/)?` — путь до исполняемого файла. Многострочную команду
29
- # поиск разбирает построчно, поэтому начало строки — начало каждой.
26
+ # `([A-Za-z_]…=…[[:space:]]+)*` — environment variables before the call: the storage address is put
27
+ # as a prefix of the command itself, and without this piece the call was not recognised at all.
28
+ # `(npx…)?` — a launch through the package runner, `([^[:space:]]*/)?` — the path to the executable.
29
+ # The search parses a multi-line command line by line, so the start of the line is the start of each
30
+ # one.
30
31
  rt_gate_invokes() {
31
32
  printf '%s\n' "$1" \
32
33
  | grep -qE "(^|[;&|(])[[:space:]]*([A-Za-z_][A-Za-z0-9_]*=[^[:space:]]*[[:space:]]+)*((npx|pnpm|yarn|bun|npm)([[:space:]]+(exec|run|dlx))?[[:space:]]+)?([^[:space:]]*/)?$2([[:space:]]|$)"
@@ -40,53 +41,55 @@ skill_for_default() {
40
41
  case "$kind" in
41
42
  edit)
42
43
  case "$target" in
43
- # Собранное дерево кодом не бывает, и правкой его никто не занимается: путь к
44
- # артефакту приходит из команды, которая его ЗАПУСКАЕТ. Под артефактом лежат те
45
- # же имена каталогов, что и под исходником, поэтому ветка стоит первой — любая
46
- # ниже совпала бы с ним и потребовала правило, которое работе ничего не даёт.
44
+ # A built tree is never code, and nobody edits it: the path to the artifact comes
45
+ # from the command that RUNS it. Under the artifact lie the same directory names as
46
+ # under the source, so the branch stands first — any branch below would match it and
47
+ # demand a rule that gives the work nothing.
47
48
  */node_modules/* | */dist/* | */build/* | */.nx/* | */coverage/*) return 0 ;;
48
49
 
49
- # Надстройка над разложенным текстом — правка того же текста: путь другой, а
50
- # предмет тот же. Ветка стоит первой, потому что путь надстройки кончается тем
51
- # же именем файла, что и разложенная копия, и ветки ниже разобрали бы её по
52
- # расширению — то есть правилом формулировок вместо правила устройства.
50
+ # An override over a laid-out text is an edit of the same text: the path differs,
51
+ # the subject is the same. The branch stands first because the override path ends
52
+ # with the same file name as the laid-out copy, and the branches below would sort it
53
+ # by extension — that is, by the wording rule instead of the structure rule.
53
54
  */.claude/rt-kit/overrides/laws/* | */.claude/rt-kit/overrides/rules/* | */.claude/rt-kit/overrides/patterns/*)
54
55
  printf '%s\n' 'spec-driven' ;;
55
56
 
56
- # Правило и паттерн — такая же договорённость, как спек: обязательные разделы,
57
- # утверждение с привязкой, граница между статьёй закона и утверждением правила.
58
- # Ветка стоит раньше общего исключения и раньше `*.md`: под исключением текст
59
- # правила переписывался без единого требования, а `*.md` увёл бы его в правило
60
- # формулировок — оно про слова, не про устройство.
57
+ # A rule and a pattern are the same kind of agreement as a spec: mandatory sections,
58
+ # a statement with a binding, the border between an article of the law and a
59
+ # statement of the rule. The branch stands before the general exception and before
60
+ # `*.md`: under the exception the rule text was rewritten without a single
61
+ # requirement, and `*.md` would send it to the wording rule — it is about words, not
62
+ # structure.
61
63
  */.claude/skills/*.md) printf '%s\n' 'spec-driven' ;;
62
64
 
63
- # Остальные файлы самого агента правятся без правила: правило на них — это оно
64
- # само.
65
+ # The rest of the agent's own files are edited without a rule: the rule for them is
66
+ # the file itself.
65
67
  */.claude/skills/* | */.claude/agents/* | */.claude/commands/* | */.claude/workflows/*) return 0 ;;
66
68
 
67
- # Тексты проекта. Спек держит устройство домена, закон — договорённость,
68
- # и оба правятся не так, как правится код.
69
+ # The project's texts. A spec holds the structure of a domain, a law holds the
70
+ # agreement, and both are edited differently from code.
69
71
  */docs/specs/*) printf '%s\n' 'spec-driven' ;;
70
72
  */docs/tasks/*) printf '%s\n' 'task-flow' ;;
71
73
  */docs/constitution/*) printf '%s\n' 'spec-driven' ;;
72
74
  *.md) printf '%s\n' 'doc-style' ;;
73
75
 
74
- # Конфиги линтеров — то же самое, только запреты в них исполняемые: они и есть
75
- # исполнение правил про типы и про оформление, а комментарии в них пересказывают
76
- # эти правила поимённо. Правились без единого правила под рукой.
76
+ # Linter configs are the same thing, only the bans in them are executable: they are
77
+ # the enforcement of the rules about types and about styling, and the comments in
78
+ # them retell those rules by name. They were edited without a single rule at hand.
77
79
  */eslint.config.mjs | */eslint.config.js) printf '%s\n' 'typescript-conventions' ;;
78
80
  */stylelint.config.js | */stylelint.config.mjs) printf '%s\n' 'styling-bem' ;;
79
81
 
80
- # Проверка повторов исполняет утверждения правила об общем коде и требуется
81
- # только им: правило о раскладке либ говорит про неё одной строкой с отсылкой,
82
- # а привязки её признаков стоят при общем коде. Два отказа подряд на правку двух
83
- # строк комментария стоят захода, а второе прочитанное правило не пригождается.
82
+ # The duplicates check enforces the statements of the shared-code rule and is
83
+ # required only by it: the lib layout rule speaks of it in one line with a
84
+ # reference, and the bindings of its signs stand with the shared-code rule. Two
85
+ # refusals in a row on an edit of two comment lines cost a session, and the second
86
+ # rule read is never of use.
84
87
  */tools/check-dupes.mjs | */tools/dupes-allowlist.json) printf '%s\n' 'shared-code' ;;
85
88
 
86
- # Остальные проверки — то же самое: проверка исполняет утверждения своего
87
- # правила, и признаки, по которым она судит, объявлены у него в привязке. Правя
88
- # признак в проверке, второе место открывают рядом — иначе они расходятся молча,
89
- # и проверка числит отказом то, что правило разрешает.
89
+ # The other checks are the same: a check enforces the statements of its rule, and
90
+ # the signs it judges by are declared in the rule's binding. Editing a sign in a
91
+ # check, one opens the second place next to it — otherwise they drift apart
92
+ # silently, and the check counts as a refusal what the rule allows.
90
93
  */check-specs.mjs) printf '%s\n' 'spec-driven' ;;
91
94
  */check-doc-paths.mjs | */doc-paths-allowlist.json | */check-file-size.mjs)
92
95
  printf '%s\n' 'doc-style' ;;
@@ -96,42 +99,46 @@ skill_for_default() {
96
99
  */check-reuse.mjs | */reuse-allowlist.json) printf '%s\n' 'reuse-first' ;;
97
100
  */check-board.mjs | */board.mjs | */task-new.mjs | */check-schema-drift.mjs)
98
101
  printf '%s\n' 'git-workflow' ;;
99
- # Своё правило линтера кода пишется по тем же соглашениям, что и код под ним.
102
+ # A tree's own code linter rule is written by the same conventions as the code under
103
+ # it.
100
104
  */eslint-rules/*) printf '%s\n' 'typescript-conventions' ;;
101
105
 
102
- # Схема хранилища, её миграции и настройка клиента: порядок каталогов
103
- # лексикографический, а метку времени ставит инструмент в момент заведения —
104
- # цепочка ломается молча и падает только накатом с нуля, то есть уже после
105
- # слияния. Настройка клиента стоит здесь же: её читает тот же накат, а правилась
106
- # она без правила под рукой. Правило живёт при поставке.
106
+ # The storage schema, its migrations and the client setup: the directory order is
107
+ # lexicographic, and the timestamp is set by the tool at creation. The chain breaks
108
+ # silently and fails only on an apply from scratch, that is, after the merge. The
109
+ # client setup stands here too: the same apply reads it, and it was edited without a
110
+ # rule at hand. The rule lives with the delivery.
107
111
  */schema.prisma | */prisma/migrations/* | */prisma.config.ts)
108
112
  printf '%s\n' 'git-workflow' ;;
109
- # Конвейер и образ: проверки решают, что вообще гоняется до слияния, а образ —
110
- # что приезжает на прод. И то и другое правилось без единого правила поставки.
113
+ # The pipeline and the image: the checks decide what runs before the merge at all,
114
+ # and the image decides what arrives on production. Both were edited without a
115
+ # single delivery rule.
111
116
  */.github/workflows/*.yml | */.gitlab-ci.yml | */azure-pipelines*.yml)
112
117
  printf '%s\n' 'git-workflow' ;;
113
118
  */Dockerfile | */*.Dockerfile | */docker-compose*.yml | */docker-compose*.yaml)
114
119
  printf '%s\n' 'git-workflow' ;;
115
120
 
116
- # Сквозная спека проверяет поднятое приложение, а не класс: по имени файла она от
117
- # обычного модуля не отличается, и без этой ветки уходила бы в соглашения языка.
121
+ # An end-to-end spec checks a running application, not a class: by file name it is
122
+ # no different from an ordinary module, and without this branch it would go to the
123
+ # language conventions.
118
124
  *-e2e/*) printf '%s\n' 'testing' ;;
119
125
 
120
- # Поставка: состав зависимостей — это то, что приезжает на прод. Правка
121
- # скриптов зависимостью не является, и правило про версии на неё не вступает.
122
- # Оговорка: удаление зависимости приходит правкой без номера версии и сюда не
123
- # попадает — его ловит снимок дерева, который правится тем же коммитом.
124
- # Своя редакция зависимостью не является: строка `"version"` в собственном
125
- # манифесте говорит о выпуске этого пакета, а не о чужой версии, которую он
126
- # тянет. Признак номера её ловил наравне с зависимостью, и подъём своей версии
127
- # вёл исполнителя в правило о чужих версиях — не туда, где сказано, как выпускают.
126
+ # Delivery: the set of dependencies is what arrives on production. An edit of
127
+ # scripts is not a dependency, and the rule about versions does not apply to it. A
128
+ # caveat: removing a dependency comes as an edit without a version number and does
129
+ # not land here — it is caught by the tree snapshot, which is edited by the same
130
+ # commit. Its own edition is not a dependency: the `"version"` line in the package's
131
+ # own manifest speaks of this package's release, not of someone else's version it
132
+ # pulls. The number sign caught it on a par with a dependency, and bumping its own
133
+ # version led the executor to the rule about others' versions — not to where it says
134
+ # how releases are made.
128
135
  */package.json)
129
136
  printf '%s' "$written" | grep -v '"version"[[:space:]]*:' \
130
137
  | grep -qE '"(dependencies|devDependencies|peerDependencies|optionalDependencies|overrides|resolutions|packageManager)"|"[^"]+"[[:space:]]*:[[:space:]]*"[~^]?[0-9]+\.[0-9]+' \
131
138
  && printf '%s\n' 'dependencies' ;;
132
139
  */pnpm-lock.yaml | */pnpm-workspace.yaml | */package-lock.json) printf '%s\n' 'dependencies' ;;
133
140
 
134
- # Границы между либами: манифест, алиасы, барель.
141
+ # Borders between libs: the manifest, the aliases, the barrel.
135
142
  */project.json | */tsconfig.base.json | */eslint/boundaries/* | */src/index.ts | */public-api.ts | */ng-package.json)
136
143
  printf '%s\n' 'lib-layers' ;;
137
144
 
@@ -139,8 +146,8 @@ skill_for_default() {
139
146
  *.component.ts | *.component.html) printf '%s\n' 'component-structure' ;;
140
147
  *.scss) printf '%s\n' 'styling-bem' ;;
141
148
 
142
- # Классы каркаса: состояние, потоки и место подписки. Бэкенд сюда не идёт —
143
- # ни компонентов, ни подписок в шаблоне у него нет.
149
+ # Framework classes: state, streams and where a subscription lives. The backend does
150
+ # not go here — it has neither components nor subscriptions in a template.
144
151
  */libs/api/* | */apps/api/*) printf '%s\n' 'typescript-conventions' ;;
145
152
  *.store.ts | *.service.ts | *.directive.ts | *.pipe.ts | *.guard.ts | *.interceptor.ts) printf '%s\n' 'angular-patterns' ;;
146
153
 
@@ -148,8 +155,8 @@ skill_for_default() {
148
155
  esac
149
156
  ;;
150
157
  bash)
151
- # Ветки идут проверкой на вызов, а не совпадением по подстроке: упоминание команды
152
- # командой не является, и гейт отбивал собственный текст о коммите.
158
+ # The branches go by a call check, not by a substring match: a mention of a command is
159
+ # not a command, and the gate refused its own text about a commit.
153
160
  if rt_gate_invokes "$target" "git[[:space:]]+(commit|push|merge|rebase|cherry-pick)" \
154
161
  || rt_gate_invokes "$target" "git[[:space:]]+worktree[[:space:]]+(add|remove)" \
155
162
  || rt_gate_invokes "$target" "git[[:space:]]+checkout[[:space:]]+-b" \
@@ -159,47 +166,64 @@ skill_for_default() {
159
166
  || rt_gate_invokes "$target" "[^[:space:]]*task:new" \
160
167
  || rt_gate_invokes "$target" "prisma[[:space:]]+(migrate|db)"; then
161
168
  printf '%s\n' 'git-workflow'
162
- # Правка тела PR через клиент хостинга ловится двумя признаками сразу — вызовом
163
- # клиента И адресом запроса: одного слова о заявке мало, оно попадает в строку любой
164
- # команды, которая о ней пишет. Тело PR не читает ни одна проверка, и утверждение
165
- # о дереве стареет в нём молча.
169
+ # An edit of the PR body through the hosting client is caught by two signs at once — the
170
+ # client call AND the request address. One word about the PR is not enough: it lands in
171
+ # the line of any command that writes about it. No check reads the PR body, and a
172
+ # statement about the tree goes stale in it silently.
166
173
  elif rt_gate_invokes "$target" "(gh|glab)[[:space:]]+api" \
167
174
  && printf '%s' "$target" | grep -qE '(-X|--method)[[:space:]]+(PATCH|PUT).*(pulls|merge_requests)/[0-9]+'; then
168
175
  printf '%s\n' 'git-workflow'
169
- # Образы и реестр на машине владельца: там же лежат его собственные стенды и работы
170
- # других его веток. Снятие и чистка важнее сборки — они уносят чужое безвозвратно.
171
- # Команды чтения остаются вне гейта: ими нехватку места и разбирают, и требовать на
172
- # них правило значило бы отбивать сам приём. Поэтому общая чистка ловится с `prune`.
176
+ # Images and the registry on the owner's machine: the owner's own stands and the work of
177
+ # their other branches lie there too. Removal and cleanup matter more than the build —
178
+ # they carry away someone else's for good. Read commands stay outside the gate: they are
179
+ # what a shortage of space is investigated with, and demanding a rule for them would
180
+ # refuse the very technique. So the general cleanup is caught with `prune`.
173
181
  elif rt_gate_invokes "$target" "docker[[:space:]]+(build|buildx|pull|push|run|compose|login|rm|rmi|stop|start|restart|image|volume|builder|network)" \
174
182
  || rt_gate_invokes "$target" "docker[[:space:]]+system[[:space:]]+prune"; then
175
183
  printf '%s\n' 'git-workflow'
176
184
  fi
177
185
 
178
- # Слияние PR — последний момент, когда папку закрытой задачи ещё можно разобрать
179
- # тем же PR: после слияния сверка очереди её видит, а отвечать за неё уже
180
- # некому. Требуется ВТОРЫМ слоем, дополнительно к правилу поставки.
186
+ # The task body and the PR body are published by a client call and never become a file
187
+ # of the tree: the gate checked the extension of the edited file and stayed silent on
188
+ # such a command. A person reads this text, and more often than any file of the tree:
189
+ # the owner read seven of their tasks and two PRs and called the language in them
190
+ # unreadable, and not one check reported it. Two signs at once: the client call and the
191
+ # body in the arguments — one word about the PR is not enough, it is in the line of any
192
+ # command that writes about it.
193
+ if { rt_gate_invokes "$target" "(gh|glab)[[:space:]]+(pr|mr|issue)[[:space:]]+(create|edit)" \
194
+ || rt_gate_invokes "$target" "[^[:space:]]*task:new"; } \
195
+ && printf '%s' "$target" | grep -qE '(--body|--body-file|--description|-F[[:space:]]*body)'; then
196
+ printf '%s\n' 'doc-style'
197
+ printf '%s\n' 'doc-style-human'
198
+ fi
199
+
200
+ # The PR merge is the last moment when the folder of a closed task can still be taken
201
+ # apart by the same PR: after the merge the queue audit sees it, and there is nobody
202
+ # left to answer for it. Required as the SECOND layer, on top of the delivery rule.
181
203
  rt_gate_invokes "$target" "(gh[[:space:]]+pr|glab[[:space:]]+mr)[[:space:]]+merge" \
182
204
  && printf '%s\n' 'task-flow'
183
205
 
184
- # Обращение к поднятому приложению: врёт здесь не код, а то, что отвечает на порту.
185
- # Ответ сборки прошлого захода неотличим от ответа живой ветки. Нужны оба признака —
186
- # вызов клиента И адрес: одного адреса мало, он попадает в строку любой команды,
187
- # которая о нём пишет, и гейт отбивал проверку самого гейта. Порт не перечисляется:
188
- # свой разовый стенд поднимается на любом свободном.
206
+ # A request to a running application: what lies here is not the code but what answers on
207
+ # the port. The reply of the previous session's build is indistinguishable from the
208
+ # reply of the live branch. Both signs are needed — the client call AND the address: the
209
+ # address alone is not enough, it lands in the line of any command that writes about it,
210
+ # and the gate refused the check of the gate itself. The port is not listed: a one-off
211
+ # stand of one's own is raised on any free one.
189
212
  if printf '%s' "$target" | grep -qE '(localhost|127\.0\.0\.1):[0-9]{4,5}' \
190
213
  && { rt_gate_invokes "$target" curl || rt_gate_invokes "$target" wget; }; then
191
214
  printf '%s\n' 'browser-verification'
192
215
  fi
193
216
  ;;
194
- # Проверка через браузер — единственная область, где правило нужно не под правку файла, а
195
- # под инструмент: врут там не файлы, а стенд и координаты.
217
+ # The check through the browser is the only area where the rule is needed not for a file
218
+ # edit but for a tool: what lies there is not the files but the stand and the coordinates.
196
219
  browser) printf '%s\n' 'browser-verification' ;;
197
220
  esac
198
221
 
199
222
  return 0
200
223
  }
201
224
 
202
- # Без надстройки проекта карта — это умолчание. С надстройкой она объявит `skill_for` заново.
225
+ # Without a project override the map is the default. With an override it will declare `skill_for`
226
+ # anew.
203
227
  skill_for() {
204
228
  skill_for_default "$@"
205
229
  }