@turri-dev/cli 0.4.3-next.aea3ca1 → 0.4.3-next.fd01774

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 (483) hide show
  1. package/README.md +24 -3
  2. package/dist/banner.js +248 -0
  3. package/dist/capture-cli.js +77 -0
  4. package/dist/capture-view.js +99 -0
  5. package/dist/chat-commands.js +9 -63
  6. package/dist/chat-models.js +17 -15
  7. package/dist/chat-tab-header.js +90 -0
  8. package/dist/chat-tabs.js +100 -0
  9. package/dist/chat-terminal.js +163 -54
  10. package/dist/chat-waiting.js +0 -20
  11. package/dist/cli-options.js +11 -7
  12. package/dist/cli-root.js +101 -0
  13. package/dist/cli.js +48 -36
  14. package/dist/conform-cli.js +4 -6
  15. package/dist/cultivate-cli.js +65 -97
  16. package/dist/doctor-cli.js +99 -0
  17. package/dist/drift-cli.js +2 -7
  18. package/dist/entry-renderers.js +107 -0
  19. package/dist/extension.js +14 -3211
  20. package/dist/init-config-cli.js +209 -0
  21. package/dist/launch-cli.js +55 -91
  22. package/dist/lineage-cli.js +2 -4
  23. package/dist/loop-cli.js +118 -233
  24. package/dist/panel-view.js +409 -0
  25. package/dist/parse-cli.js +5 -2
  26. package/dist/pi-launch.js +43 -13
  27. package/dist/pi-themes.js +21 -0
  28. package/dist/plain-code-blocks.js +56 -0
  29. package/dist/pointer-hover.js +48 -0
  30. package/dist/print-mode.js +20 -0
  31. package/dist/question-dialog.js +26 -3
  32. package/dist/quiet.js +7 -106
  33. package/dist/regenerate/diff-view.js +6 -87
  34. package/dist/regenerate/jobs-tree.js +7 -18
  35. package/dist/regenerate/side-panel.js +158 -22
  36. package/dist/regenerate/spec-map-view.js +25 -70
  37. package/dist/regenerate-cli.js +7 -11
  38. package/dist/reopen.js +80 -0
  39. package/dist/skill-progress.js +25 -0
  40. package/dist/skill-report.js +52 -0
  41. package/dist/terminal-marks.js +21 -0
  42. package/dist/terminal-notifications.js +219 -0
  43. package/dist/terminal-view.js +275 -0
  44. package/dist/turri-versions.js +64 -6
  45. package/docs/README.md +4 -2
  46. package/docs/capture.md +227 -0
  47. package/docs/chats.md +14 -10
  48. package/docs/claude-subscription.md +1 -1
  49. package/docs/config.md +23 -8
  50. package/docs/development.md +30 -61
  51. package/docs/headless.md +3 -1
  52. package/docs/hosting.md +3 -251
  53. package/docs/installation.md +5 -3
  54. package/docs/launch.md +3 -3
  55. package/docs/regenerating.md +1 -1
  56. package/docs/sandbox.md +4 -2
  57. package/docs/sentinel.md +13 -13
  58. package/docs/theming.md +3 -3
  59. package/docs/using.md +13 -5
  60. package/package.json +13 -31
  61. package/dist/ask.d.ts +0 -90
  62. package/dist/ask.js +0 -170
  63. package/dist/background-skills.d.ts +0 -53
  64. package/dist/background-skills.js +0 -121
  65. package/dist/bedrock-region.d.ts +0 -66
  66. package/dist/bedrock-region.js +0 -144
  67. package/dist/brand.d.ts +0 -13
  68. package/dist/btw.d.ts +0 -69
  69. package/dist/btw.js +0 -174
  70. package/dist/chat-commands.d.ts +0 -25
  71. package/dist/chat-idle.d.ts +0 -7
  72. package/dist/chat-idle.js +0 -20
  73. package/dist/chat-models.d.ts +0 -22
  74. package/dist/chat-records.d.ts +0 -50
  75. package/dist/chat-records.js +0 -107
  76. package/dist/chat-scope.d.ts +0 -14
  77. package/dist/chat-scope.js +0 -15
  78. package/dist/chat-skills.d.ts +0 -17
  79. package/dist/chat-skills.js +0 -18
  80. package/dist/chat-terminal.d.ts +0 -24
  81. package/dist/chat-ui.d.ts +0 -33
  82. package/dist/chat-waiting.d.ts +0 -67
  83. package/dist/chats.d.ts +0 -338
  84. package/dist/chats.js +0 -996
  85. package/dist/cli-options.d.ts +0 -24
  86. package/dist/cli.d.ts +0 -9
  87. package/dist/config-edit.d.ts +0 -83
  88. package/dist/config-edit.js +0 -390
  89. package/dist/config.d.ts +0 -415
  90. package/dist/config.js +0 -757
  91. package/dist/conform-cli.d.ts +0 -1
  92. package/dist/conformance-switch.d.ts +0 -25
  93. package/dist/conformance-switch.js +0 -86
  94. package/dist/cultivate-cli.d.ts +0 -1
  95. package/dist/doctor-tool.d.ts +0 -11
  96. package/dist/doctor-tool.js +0 -33
  97. package/dist/drift-cli.d.ts +0 -1
  98. package/dist/environment.d.ts +0 -37
  99. package/dist/environment.js +0 -109
  100. package/dist/extension.d.ts +0 -208
  101. package/dist/genome.d.ts +0 -77
  102. package/dist/genome.js +0 -288
  103. package/dist/graph.d.ts +0 -52
  104. package/dist/graph.js +0 -247
  105. package/dist/host-session.d.ts +0 -112
  106. package/dist/host-session.js +0 -103
  107. package/dist/host.d.ts +0 -40
  108. package/dist/host.js +0 -54
  109. package/dist/identity.d.ts +0 -7
  110. package/dist/identity.js +0 -74
  111. package/dist/init-config.d.ts +0 -169
  112. package/dist/init-config.js +0 -840
  113. package/dist/installed-providers.d.ts +0 -40
  114. package/dist/installed-providers.js +0 -98
  115. package/dist/jellyfish.d.ts +0 -40
  116. package/dist/judge.d.ts +0 -25
  117. package/dist/judge.js +0 -62
  118. package/dist/launch-agent.d.ts +0 -62
  119. package/dist/launch-agent.js +0 -339
  120. package/dist/launch-cli.d.ts +0 -1
  121. package/dist/launch-session.d.ts +0 -68
  122. package/dist/launch-session.js +0 -225
  123. package/dist/launch-tools.d.ts +0 -28
  124. package/dist/launch-tools.js +0 -72
  125. package/dist/launch-track.d.ts +0 -175
  126. package/dist/launch-track.js +0 -497
  127. package/dist/lineage-cli.d.ts +0 -1
  128. package/dist/loop-cli.d.ts +0 -35
  129. package/dist/loop-tools.d.ts +0 -103
  130. package/dist/loop-tools.js +0 -357
  131. package/dist/model-check.d.ts +0 -72
  132. package/dist/model-check.js +0 -162
  133. package/dist/module-report.d.ts +0 -9
  134. package/dist/new-project.d.ts +0 -5
  135. package/dist/new-project.js +0 -31
  136. package/dist/notice.d.ts +0 -115
  137. package/dist/notice.js +0 -61
  138. package/dist/parse-cli.d.ts +0 -1
  139. package/dist/parse-tool.d.ts +0 -9
  140. package/dist/parse-tool.js +0 -33
  141. package/dist/pi-launch.d.ts +0 -1
  142. package/dist/pi-settings.d.ts +0 -4
  143. package/dist/pi.d.ts +0 -248
  144. package/dist/pi.js +0 -889
  145. package/dist/picture-row.d.ts +0 -10
  146. package/dist/plain/check.d.ts +0 -63
  147. package/dist/plain/check.js +0 -236
  148. package/dist/plain/concepts.d.ts +0 -37
  149. package/dist/plain/concepts.js +0 -283
  150. package/dist/plain/cycles.d.ts +0 -21
  151. package/dist/plain/cycles.js +0 -190
  152. package/dist/plain/errors.d.ts +0 -26
  153. package/dist/plain/errors.js +0 -50
  154. package/dist/plain/files.d.ts +0 -47
  155. package/dist/plain/files.js +0 -161
  156. package/dist/plain/graph.d.ts +0 -107
  157. package/dist/plain/graph.js +0 -194
  158. package/dist/plain/highlight.d.ts +0 -43
  159. package/dist/plain/highlight.js +0 -196
  160. package/dist/plain/index.d.ts +0 -18
  161. package/dist/plain/index.js +0 -18
  162. package/dist/plain/liquid.d.ts +0 -22
  163. package/dist/plain/liquid.js +0 -124
  164. package/dist/plain/markdown.d.ts +0 -103
  165. package/dist/plain/markdown.js +0 -330
  166. package/dist/plain/module-concepts.d.ts +0 -32
  167. package/dist/plain/module-concepts.js +0 -80
  168. package/dist/plain/parser.d.ts +0 -163
  169. package/dist/plain/parser.js +0 -930
  170. package/dist/plain/plain.tmLanguage.json +0 -150
  171. package/dist/plain/project.d.ts +0 -48
  172. package/dist/plain/project.js +0 -155
  173. package/dist/plain/spec.d.ts +0 -152
  174. package/dist/plain/spec.js +0 -265
  175. package/dist/plain/stdlib.d.ts +0 -16
  176. package/dist/plain/stdlib.js +0 -48
  177. package/dist/plain/test-plain-file.d.ts +0 -59
  178. package/dist/plain/test-plain-file.js +0 -232
  179. package/dist/plain-files.d.ts +0 -21
  180. package/dist/plain-files.js +0 -156
  181. package/dist/question-dialog.d.ts +0 -55
  182. package/dist/questioning.d.ts +0 -55
  183. package/dist/questioning.js +0 -109
  184. package/dist/quiet.d.ts +0 -34
  185. package/dist/regenerate/activity.d.ts +0 -227
  186. package/dist/regenerate/activity.js +0 -250
  187. package/dist/regenerate/agent-env.d.ts +0 -51
  188. package/dist/regenerate/agent-env.js +0 -311
  189. package/dist/regenerate/agent-shell.d.ts +0 -54
  190. package/dist/regenerate/agent-shell.js +0 -121
  191. package/dist/regenerate/arbiter.d.ts +0 -68
  192. package/dist/regenerate/arbiter.js +0 -133
  193. package/dist/regenerate/audit.d.ts +0 -69
  194. package/dist/regenerate/audit.js +0 -212
  195. package/dist/regenerate/base-folder.d.ts +0 -70
  196. package/dist/regenerate/base-folder.js +0 -186
  197. package/dist/regenerate/cases.d.ts +0 -12
  198. package/dist/regenerate/cases.js +0 -149
  199. package/dist/regenerate/change-view.d.ts +0 -23
  200. package/dist/regenerate/change-view.js +0 -153
  201. package/dist/regenerate/chunk-plan.d.ts +0 -217
  202. package/dist/regenerate/chunk-plan.js +0 -937
  203. package/dist/regenerate/codebase.d.ts +0 -21
  204. package/dist/regenerate/codebase.js +0 -75
  205. package/dist/regenerate/command-check.d.ts +0 -66
  206. package/dist/regenerate/command-check.js +0 -508
  207. package/dist/regenerate/compaction.d.ts +0 -13
  208. package/dist/regenerate/compaction.js +0 -20
  209. package/dist/regenerate/confine.d.ts +0 -69
  210. package/dist/regenerate/confine.js +0 -311
  211. package/dist/regenerate/conform.d.ts +0 -66
  212. package/dist/regenerate/conform.js +0 -132
  213. package/dist/regenerate/conformance-agents.d.ts +0 -388
  214. package/dist/regenerate/conformance-agents.js +0 -1162
  215. package/dist/regenerate/conformance.d.ts +0 -191
  216. package/dist/regenerate/conformance.js +0 -1035
  217. package/dist/regenerate/conversation-writes.d.ts +0 -10
  218. package/dist/regenerate/conversation-writes.js +0 -100
  219. package/dist/regenerate/credentials.d.ts +0 -18
  220. package/dist/regenerate/credentials.js +0 -88
  221. package/dist/regenerate/debug-log.d.ts +0 -56
  222. package/dist/regenerate/debug-log.js +0 -236
  223. package/dist/regenerate/debugger.d.ts +0 -36
  224. package/dist/regenerate/debugger.js +0 -133
  225. package/dist/regenerate/delivery.d.ts +0 -2
  226. package/dist/regenerate/diagnose-job.d.ts +0 -2
  227. package/dist/regenerate/diagnose-job.js +0 -40
  228. package/dist/regenerate/diagnose.d.ts +0 -46
  229. package/dist/regenerate/diagnose.js +0 -92
  230. package/dist/regenerate/diff-view.d.ts +0 -64
  231. package/dist/regenerate/drift.d.ts +0 -120
  232. package/dist/regenerate/drift.js +0 -285
  233. package/dist/regenerate/environment-error.d.ts +0 -167
  234. package/dist/regenerate/environment-error.js +0 -342
  235. package/dist/regenerate/failure-reports.d.ts +0 -28
  236. package/dist/regenerate/failure-reports.js +0 -79
  237. package/dist/regenerate/job-log.d.ts +0 -30
  238. package/dist/regenerate/job-log.js +0 -105
  239. package/dist/regenerate/job-panel.d.ts +0 -122
  240. package/dist/regenerate/job-panel.js +0 -339
  241. package/dist/regenerate/jobs-tree.d.ts +0 -75
  242. package/dist/regenerate/jobs.d.ts +0 -231
  243. package/dist/regenerate/jobs.js +0 -522
  244. package/dist/regenerate/lanes.d.ts +0 -16
  245. package/dist/regenerate/lanes.js +0 -32
  246. package/dist/regenerate/launch.d.ts +0 -256
  247. package/dist/regenerate/launch.js +0 -689
  248. package/dist/regenerate/ledger-view.d.ts +0 -87
  249. package/dist/regenerate/ledger-view.js +0 -325
  250. package/dist/regenerate/ledger.d.ts +0 -368
  251. package/dist/regenerate/ledger.js +0 -357
  252. package/dist/regenerate/lineage.d.ts +0 -105
  253. package/dist/regenerate/lineage.js +0 -485
  254. package/dist/regenerate/list-arguments.d.ts +0 -21
  255. package/dist/regenerate/list-arguments.js +0 -121
  256. package/dist/regenerate/loop.d.ts +0 -423
  257. package/dist/regenerate/loop.js +0 -2079
  258. package/dist/regenerate/masking.d.ts +0 -19
  259. package/dist/regenerate/masking.js +0 -95
  260. package/dist/regenerate/model-names.d.ts +0 -33
  261. package/dist/regenerate/model-names.js +0 -92
  262. package/dist/regenerate/notes.d.ts +0 -159
  263. package/dist/regenerate/notes.js +0 -446
  264. package/dist/regenerate/os-sandbox.d.ts +0 -93
  265. package/dist/regenerate/os-sandbox.js +0 -283
  266. package/dist/regenerate/panel-dock.d.ts +0 -23
  267. package/dist/regenerate/paths.d.ts +0 -110
  268. package/dist/regenerate/paths.js +0 -190
  269. package/dist/regenerate/plain-palette.d.ts +0 -34
  270. package/dist/regenerate/prompt.d.ts +0 -230
  271. package/dist/regenerate/prompt.js +0 -741
  272. package/dist/regenerate/pulse-files.d.ts +0 -14
  273. package/dist/regenerate/pulse-files.js +0 -63
  274. package/dist/regenerate/records.d.ts +0 -132
  275. package/dist/regenerate/records.js +0 -327
  276. package/dist/regenerate/regenerate.d.ts +0 -106
  277. package/dist/regenerate/regenerate.js +0 -660
  278. package/dist/regenerate/regression.d.ts +0 -58
  279. package/dist/regenerate/regression.js +0 -188
  280. package/dist/regenerate/renames.d.ts +0 -42
  281. package/dist/regenerate/renames.js +0 -185
  282. package/dist/regenerate/requires.d.ts +0 -117
  283. package/dist/regenerate/requires.js +0 -377
  284. package/dist/regenerate/resources.d.ts +0 -57
  285. package/dist/regenerate/resources.js +0 -162
  286. package/dist/regenerate/scripts-being-written.d.ts +0 -19
  287. package/dist/regenerate/scripts-being-written.js +0 -30
  288. package/dist/regenerate/self-check.d.ts +0 -29
  289. package/dist/regenerate/self-check.js +0 -119
  290. package/dist/regenerate/services.d.ts +0 -28
  291. package/dist/regenerate/services.js +0 -158
  292. package/dist/regenerate/shell.d.ts +0 -91
  293. package/dist/regenerate/shell.js +0 -320
  294. package/dist/regenerate/side-panel.d.ts +0 -59
  295. package/dist/regenerate/spec-map-view.d.ts +0 -139
  296. package/dist/regenerate/spec-map.d.ts +0 -160
  297. package/dist/regenerate/spec-map.js +0 -596
  298. package/dist/regenerate/spec-steps.d.ts +0 -180
  299. package/dist/regenerate/spec-steps.js +0 -729
  300. package/dist/regenerate/standing.d.ts +0 -28
  301. package/dist/regenerate/standing.js +0 -30
  302. package/dist/regenerate/state.d.ts +0 -21
  303. package/dist/regenerate/state.js +0 -10
  304. package/dist/regenerate/steering.d.ts +0 -56
  305. package/dist/regenerate/steering.js +0 -119
  306. package/dist/regenerate/stop-report.d.ts +0 -43
  307. package/dist/regenerate/stop-report.js +0 -160
  308. package/dist/regenerate/submit-work.d.ts +0 -44
  309. package/dist/regenerate/submit-work.js +0 -76
  310. package/dist/regenerate/test-kinds.d.ts +0 -85
  311. package/dist/regenerate/test-kinds.js +0 -171
  312. package/dist/regenerate/test-scripts.d.ts +0 -235
  313. package/dist/regenerate/test-scripts.js +0 -843
  314. package/dist/regenerate/testing-steps.d.ts +0 -52
  315. package/dist/regenerate/testing-steps.js +0 -129
  316. package/dist/regenerate/testing.d.ts +0 -150
  317. package/dist/regenerate/testing.js +0 -438
  318. package/dist/regenerate/transcript-view.d.ts +0 -21
  319. package/dist/regenerate/unit-gate.d.ts +0 -27
  320. package/dist/regenerate/unit-gate.js +0 -20
  321. package/dist/regenerate/unit-review.d.ts +0 -152
  322. package/dist/regenerate/unit-review.js +0 -361
  323. package/dist/regenerate/web.d.ts +0 -61
  324. package/dist/regenerate/web.js +0 -256
  325. package/dist/regenerate/workspace.d.ts +0 -12
  326. package/dist/regenerate/workspace.js +0 -99
  327. package/dist/regenerate-cli.d.ts +0 -1
  328. package/dist/resume-line.d.ts +0 -5
  329. package/dist/review/live.d.ts +0 -72
  330. package/dist/review/live.js +0 -166
  331. package/dist/rules.d.ts +0 -20
  332. package/dist/rules.js +0 -47
  333. package/dist/run-report.d.ts +0 -88
  334. package/dist/run-report.js +0 -338
  335. package/dist/screen-padding.d.ts +0 -28
  336. package/dist/self-invocation.d.ts +0 -36
  337. package/dist/self-invocation.js +0 -137
  338. package/dist/sentinel-chat.d.ts +0 -19
  339. package/dist/sentinel-chat.js +0 -221
  340. package/dist/sentinel-check.d.ts +0 -36
  341. package/dist/sentinel-check.js +0 -78
  342. package/dist/sentinel.d.ts +0 -107
  343. package/dist/sentinel.js +0 -599
  344. package/dist/settings.d.ts +0 -45
  345. package/dist/settings.js +0 -378
  346. package/dist/setup.d.ts +0 -97
  347. package/dist/setup.js +0 -428
  348. package/dist/skill-progress.d.ts +0 -46
  349. package/dist/skill.d.ts +0 -102
  350. package/dist/skill.js +0 -147
  351. package/dist/skills.d.ts +0 -54
  352. package/dist/skills.js +0 -111
  353. package/dist/spawn-async.d.ts +0 -18
  354. package/dist/spawn-async.js +0 -35
  355. package/dist/stack.d.ts +0 -80
  356. package/dist/stack.js +0 -206
  357. package/dist/stdlib.d.ts +0 -43
  358. package/dist/stdlib.js +0 -118
  359. package/dist/surface.d.ts +0 -5
  360. package/dist/surface.js +0 -18
  361. package/dist/terminal-images.d.ts +0 -2
  362. package/dist/test-plain-files.d.ts +0 -41
  363. package/dist/test-plain-files.js +0 -172
  364. package/dist/tools.d.ts +0 -101
  365. package/dist/tools.js +0 -242
  366. package/dist/turri-versions.d.ts +0 -71
  367. package/genome/rules/bullet-continuation.md +0 -61
  368. package/genome/rules/concise-specs-examples.md +0 -460
  369. package/genome/rules/concise-specs-integration-examples.md +0 -281
  370. package/genome/rules/concise-specs.md +0 -80
  371. package/genome/rules/definitions.md +0 -107
  372. package/genome/rules/examples/integration-embedded-testing/run_conformance_tests_java.sh +0 -161
  373. package/genome/rules/examples/integration-embedded-testing/run_unittests_java.sh +0 -50
  374. package/genome/rules/exported-concepts.md +0 -39
  375. package/genome/rules/func-specs.md +0 -164
  376. package/genome/rules/impl-reqs.md +0 -68
  377. package/genome/rules/import-modules.md +0 -49
  378. package/genome/rules/integration-embedded-testing.md +0 -273
  379. package/genome/rules/integration-embedded.md +0 -171
  380. package/genome/rules/integration-standalone.md +0 -135
  381. package/genome/rules/integrations.md +0 -136
  382. package/genome/rules/linked-resources.md +0 -76
  383. package/genome/rules/module-structure.md +0 -112
  384. package/genome/rules/project-model.md +0 -69
  385. package/genome/rules/required-concepts.md +0 -44
  386. package/genome/rules/requires-modules.md +0 -81
  387. package/genome/rules/semantic-ids.md +0 -49
  388. package/genome/rules/stdlib.md +0 -37
  389. package/genome/rules/test-plain-files.md +0 -138
  390. package/genome/rules/test-reqs.md +0 -57
  391. package/genome/rules/turri-regeneration.md +0 -66
  392. package/genome/skills/analyze-2-func-specs/SKILL.md +0 -116
  393. package/genome/skills/analyze-func-specs/SKILL.md +0 -137
  394. package/genome/skills/break-down-func-spec/SKILL.md +0 -229
  395. package/genome/skills/consolidate-concepts/SKILL.md +0 -192
  396. package/genome/skills/convert-old-syntax/SKILL.md +0 -68
  397. package/genome/skills/convert-old-syntax/references/rubric.md +0 -11
  398. package/genome/skills/debug-specs/SKILL.md +0 -194
  399. package/genome/skills/implement-conformance-testing-script/SKILL.md +0 -247
  400. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_cypress.ps1 +0 -337
  401. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_golang.ps1 +0 -111
  402. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_java.sh +0 -151
  403. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_python.ps1 +0 -103
  404. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_python.sh +0 -146
  405. package/genome/skills/implement-unit-testing-script/SKILL.md +0 -171
  406. package/genome/skills/implement-unit-testing-script/assets/run_unittests_flutter.ps1 +0 -87
  407. package/genome/skills/implement-unit-testing-script/assets/run_unittests_golang.ps1 +0 -73
  408. package/genome/skills/implement-unit-testing-script/assets/run_unittests_java.sh +0 -82
  409. package/genome/skills/implement-unit-testing-script/assets/run_unittests_python.ps1 +0 -81
  410. package/genome/skills/implement-unit-testing-script/assets/run_unittests_python.sh +0 -102
  411. package/genome/skills/implement-unit-testing-script/assets/run_unittests_react.ps1 +0 -87
  412. package/genome/skills/refactor-module/SKILL.md +0 -218
  413. package/genome/skills/resolve-section-ownership/SKILL.md +0 -64
  414. package/genome/skills/resolve-spec-conflict/SKILL.md +0 -102
  415. package/stdlib/backend/common.plain +0 -25
  416. package/stdlib/backend/conformance/common.plain +0 -12
  417. package/stdlib/backend/conformance/go-gin.plain +0 -9
  418. package/stdlib/backend/conformance/go-nethttp.plain +0 -9
  419. package/stdlib/backend/conformance/java-springboot.plain +0 -9
  420. package/stdlib/backend/conformance/python-django.plain +0 -9
  421. package/stdlib/backend/conformance/python-fastapi.plain +0 -9
  422. package/stdlib/backend/conformance/python-flask.plain +0 -9
  423. package/stdlib/backend/conformance/rust-axum.plain +0 -9
  424. package/stdlib/backend/conformance/typescript-express.plain +0 -9
  425. package/stdlib/backend/conformance/typescript-fastify.plain +0 -9
  426. package/stdlib/backend/conformance/typescript-nestjs.plain +0 -9
  427. package/stdlib/backend/go-gin.plain +0 -18
  428. package/stdlib/backend/go-nethttp.plain +0 -18
  429. package/stdlib/backend/java-springboot.plain +0 -19
  430. package/stdlib/backend/python-django.plain +0 -19
  431. package/stdlib/backend/python-fastapi.plain +0 -23
  432. package/stdlib/backend/python-flask.plain +0 -23
  433. package/stdlib/backend/rust-axum.plain +0 -17
  434. package/stdlib/backend/typescript-express.plain +0 -19
  435. package/stdlib/backend/typescript-fastify.plain +0 -19
  436. package/stdlib/backend/typescript-nestjs.plain +0 -19
  437. package/stdlib/cli/common.plain +0 -17
  438. package/stdlib/cli/conformance/common.plain +0 -11
  439. package/stdlib/cli/conformance/go-cobra.plain +0 -9
  440. package/stdlib/cli/conformance/go-flag.plain +0 -9
  441. package/stdlib/cli/conformance/java-picocli.plain +0 -9
  442. package/stdlib/cli/conformance/python-argparse.plain +0 -9
  443. package/stdlib/cli/conformance/python-click.plain +0 -9
  444. package/stdlib/cli/conformance/python-typer.plain +0 -9
  445. package/stdlib/cli/conformance/rust-clap.plain +0 -9
  446. package/stdlib/cli/conformance/typescript-commander.plain +0 -9
  447. package/stdlib/cli/go-cobra.plain +0 -14
  448. package/stdlib/cli/go-flag.plain +0 -14
  449. package/stdlib/cli/java-picocli.plain +0 -15
  450. package/stdlib/cli/python-argparse.plain +0 -18
  451. package/stdlib/cli/python-click.plain +0 -16
  452. package/stdlib/cli/python-typer.plain +0 -16
  453. package/stdlib/cli/rust-clap.plain +0 -14
  454. package/stdlib/cli/typescript-commander.plain +0 -17
  455. package/stdlib/frontend/angular.plain +0 -17
  456. package/stdlib/frontend/common.plain +0 -17
  457. package/stdlib/frontend/conformance/angular.plain +0 -5
  458. package/stdlib/frontend/conformance/common.plain +0 -11
  459. package/stdlib/frontend/conformance/react-vite.plain +0 -5
  460. package/stdlib/frontend/conformance/sveltekit-spa.plain +0 -5
  461. package/stdlib/frontend/conformance/vue-vite.plain +0 -5
  462. package/stdlib/frontend/react-vite.plain +0 -16
  463. package/stdlib/frontend/sveltekit-spa.plain +0 -16
  464. package/stdlib/frontend/vue-vite.plain +0 -16
  465. package/stdlib/lang/go.plain +0 -13
  466. package/stdlib/lang/java.plain +0 -12
  467. package/stdlib/lang/python.plain +0 -18
  468. package/stdlib/lang/rust.plain +0 -12
  469. package/stdlib/lang/typescript.plain +0 -13
  470. package/stdlib/library/common.plain +0 -15
  471. package/stdlib/library/conformance/common.plain +0 -9
  472. package/stdlib/library/conformance/go.plain +0 -9
  473. package/stdlib/library/conformance/java-gradle.plain +0 -9
  474. package/stdlib/library/conformance/java-maven.plain +0 -9
  475. package/stdlib/library/conformance/python.plain +0 -9
  476. package/stdlib/library/conformance/rust.plain +0 -9
  477. package/stdlib/library/conformance/typescript.plain +0 -9
  478. package/stdlib/library/go.plain +0 -12
  479. package/stdlib/library/java-gradle.plain +0 -13
  480. package/stdlib/library/java-maven.plain +0 -13
  481. package/stdlib/library/python.plain +0 -13
  482. package/stdlib/library/rust.plain +0 -12
  483. package/stdlib/library/typescript.plain +0 -15
@@ -1,82 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- # Java 21 or newer, and Maven: JAVA_HOME's java when it is set, else the one on the PATH - the same on macOS, Linux
4
- # and Windows (Git Bash). Not macOS's /usr/libexec/java_home, which no other OS has.
5
- JAVA="java"
6
- [ -n "${JAVA_HOME:-}" ] && JAVA="$JAVA_HOME/bin/java"
7
- if ! "$JAVA" -version >/dev/null 2>&1; then
8
- echo "Error: Java is not installed (no $JAVA)."
9
- exit 69
10
- fi
11
- JAVA_VERSION="$("$JAVA" -version 2>&1 | sed -n 's/.*version "\([0-9]*\).*/\1/p' | head -n 1)"
12
- if [ -z "$JAVA_VERSION" ] || [ "$JAVA_VERSION" -lt 21 ]; then
13
- echo "Error: Java 21 or newer is needed; $JAVA is Java ${JAVA_VERSION:-of a version it does not say}."
14
- exit 69
15
- fi
16
- if ! command -v mvn >/dev/null 2>&1; then
17
- echo "Error: Maven (mvn) is not installed."
18
- exit 69
19
- fi
20
- "$JAVA" -version
21
- mvn --version
22
-
23
- # Check if subfolder name is provided
24
- if [ -z "$1" ]; then
25
- echo "Error: No subfolder name provided."
26
- echo "Usage: $0 <subfolder_name>"
27
- exit 1
28
- fi
29
-
30
- # Working folder lives in the system temp directory. $1 may be an absolute
31
- # path, so only its basename is used to build the working folder name.
32
- WORKING_FOLDER="/tmp/java_$(basename "$1")"
33
-
34
- trap 'rm -rf "$WORKING_FOLDER"' EXIT
35
-
36
- # Check if the java subfolder exists
37
- if [ -d "$WORKING_FOLDER" ]; then
38
- # delete everything in the subfolder
39
- rm -rf "$WORKING_FOLDER"/*
40
- else
41
- echo "Subfolder '$WORKING_FOLDER' does not exist. Creating it now..."
42
- mkdir -p "$WORKING_FOLDER"
43
- fi
44
-
45
-
46
- # copy all folders and files from the build folder to the subfolder
47
- cp -R "$1"/* "$WORKING_FOLDER"
48
- printf "Copied from $1 to $WORKING_FOLDER...\n"
49
- # Move to the subfolder
50
- if ! cd "$WORKING_FOLDER" 2>/dev/null; then
51
- echo "Error: cannot enter the working folder '$WORKING_FOLDER'."
52
- exit 2
53
- fi
54
- printf "Moved to $WORKING_FOLDER...\n"
55
-
56
- # Static checks: the code compiled with every javac lint warning an error - the flags pinned here, not in the pom.
57
- # A formatter runs only when the implementation reqs name one (mvn spotless:check, say). Every check runs, and the
58
- # tests run whatever they said.
59
- STATIC_CHECKS_FAILED=80
60
- echo "Running the static checks in $(pwd)..."
61
- echo "+ mvn -Dmaven.repo.local=./.m2 -Dmaven.compiler.showWarnings=true -Dmaven.compiler.failOnWarning=true -Dmaven.compiler.compilerArgument=-Xlint:all test-compile"
62
- mvn -Dmaven.repo.local=./.m2 -Dmaven.compiler.showWarnings=true -Dmaven.compiler.failOnWarning=true \
63
- -Dmaven.compiler.compilerArgument=-Xlint:all test-compile
64
- CHECKS=$?
65
- [ "$CHECKS" -eq 0 ] && echo "Static checks: passed" || echo "Static checks: FAILED - the findings are above"
66
-
67
- # Execute all Java unittests in the subfolder
68
- echo "Running Java unittests in $(pwd)..."
69
- echo "+ mvn -Dmaven.repo.local=./.m2 test"
70
- mvn -Dmaven.repo.local=./.m2 test
71
- TESTS=$?
72
-
73
- # The tests' own exit code when they failed; 80 when only the static checks did; 0 when both pass.
74
- if [ "$TESTS" -ne 0 ]; then
75
- STATUS=$TESTS
76
- elif [ "$CHECKS" -ne 0 ]; then
77
- STATUS=$STATIC_CHECKS_FAILED
78
- else
79
- STATUS=0
80
- fi
81
- echo "static checks: exit $CHECKS; unit tests: exit $TESTS; exit $STATUS (working folder $WORKING_FOLDER)"
82
- exit "$STATUS"
@@ -1,81 +0,0 @@
1
- #!/usr/bin/env pwsh
2
-
3
- $ErrorActionPreference = 'Stop'
4
-
5
- $UNRECOVERABLE_ERROR_EXIT_CODE = 69
6
-
7
- # Check if subfolder name is provided
8
- if (-not $args[0]) {
9
- Write-Host "Error: No subfolder name provided."
10
- Write-Host "Usage: $($MyInvocation.MyCommand.Name) <subfolder_name>"
11
- exit $UNRECOVERABLE_ERROR_EXIT_CODE
12
- }
13
-
14
- $BuildFolder = $args[0]
15
-
16
- # Try to find Python interpreter (python3 first, then python)
17
- if (Get-Command python3 -ErrorAction SilentlyContinue) {
18
- $PYTHON_CMD = "python3"
19
- } elseif (Get-Command python -ErrorAction SilentlyContinue) {
20
- $PYTHON_CMD = "python"
21
- } else {
22
- Write-Host "Error: Python interpreter not found. Please install Python."
23
- exit $UNRECOVERABLE_ERROR_EXIT_CODE
24
- }
25
-
26
- # Working folder lives in the system temp directory. $BuildFolder may be an
27
- # absolute path, so only its leaf name is used to build the working folder name.
28
- $PYTHON_BUILD_SUBFOLDER = Join-Path ([System.IO.Path]::GetTempPath()) "python_$(Split-Path $BuildFolder -Leaf)"
29
-
30
- if ($env:VERBOSE -eq "1") {
31
- Write-Host "Preparing Python build subfolder: $PYTHON_BUILD_SUBFOLDER"
32
- }
33
-
34
- # Check if the Python build subfolder exists
35
- if (Test-Path $PYTHON_BUILD_SUBFOLDER) {
36
- # Delete all files and folders inside
37
- Get-ChildItem -Path $PYTHON_BUILD_SUBFOLDER -Force | Remove-Item -Recurse -Force
38
-
39
- if ($env:VERBOSE -eq "1") {
40
- Write-Host "Cleanup completed."
41
- }
42
- } else {
43
- if ($env:VERBOSE -eq "1") {
44
- Write-Host "Subfolder does not exist. Creating it..."
45
- }
46
-
47
- New-Item -ItemType Directory -Path $PYTHON_BUILD_SUBFOLDER -Force | Out-Null
48
- }
49
-
50
- Copy-Item -Path "$BuildFolder/*" -Destination $PYTHON_BUILD_SUBFOLDER -Recurse -Force
51
-
52
- # Move to the subfolder
53
- if (-not (Test-Path $PYTHON_BUILD_SUBFOLDER)) {
54
- Write-Host "Error: Python build folder '$PYTHON_BUILD_SUBFOLDER' does not exist."
55
- exit $UNRECOVERABLE_ERROR_EXIT_CODE
56
- }
57
-
58
- Push-Location $PYTHON_BUILD_SUBFOLDER
59
-
60
- try {
61
- # Execute all Python unittests in the subfolder
62
- Write-Host "Running Python unittests in $PYTHON_BUILD_SUBFOLDER..."
63
-
64
- # Temporarily allow stderr output without throwing (Python unittest writes progress to stderr)
65
- # ForEach-Object converts ErrorRecord objects (from stderr) to plain strings to avoid verbose error formatting
66
- $ErrorActionPreference = 'Continue'
67
- $output = & $PYTHON_CMD -m unittest discover -b 2>&1 | ForEach-Object { if ($_ -is [System.Management.Automation.ErrorRecord]) { $_.Exception.Message } else { $_ } } | Out-String
68
- $exit_code = $LASTEXITCODE
69
- $ErrorActionPreference = 'Stop'
70
-
71
- # Echo the original output
72
- Write-Host $output
73
-
74
- # Return the exit code of the unittest command
75
- exit $exit_code
76
- } finally {
77
- Pop-Location
78
- if (Test-Path $PYTHON_BUILD_SUBFOLDER) {
79
- Remove-Item -Path $PYTHON_BUILD_SUBFOLDER -Recurse -Force -ErrorAction SilentlyContinue
80
- }
81
- }
@@ -1,102 +0,0 @@
1
- #!/usr/bin/env bash
2
- # The unit tests of a Python build, with its static checks: ruff's formatter in check mode, ruff's linter and mypy,
3
- # each from the project's own `dev` dependency group, then pytest - as stdlib/lang/python asks for them.
4
- #
5
- # run_unittests_python.sh <build folder>
6
- #
7
- # The build folder is read only: the build is staged in a working folder in /tmp and everything runs there.
8
- # Every check runs, and the tests run whatever the checks said, so one run reports both.
9
- # Exit codes: 0 all pass; 1 bad usage; 2 a filesystem problem; 69 a toolchain missing on this machine;
10
- # 80 the tests passed and only the static checks did not; any other, the failing install or test tool's own.
11
-
12
- set -u
13
- STATIC_CHECKS_FAILED=80
14
-
15
- echo "===== [1/8] Toolchain check ====="
16
- if ! command -v uv >/dev/null 2>&1; then
17
- echo "Error: uv is not installed on this machine (https://docs.astral.sh/uv/)."
18
- exit 69
19
- fi
20
- echo "uv: $(command -v uv) - $(uv --version)"
21
- PYTHON="$(uv python find --system --no-python-downloads 3.12 2>/dev/null)" || {
22
- echo "Error: Python 3.12 is not installed on this machine; no runtime is downloaded."
23
- exit 69
24
- }
25
- echo "Python: $PYTHON - $("$PYTHON" --version 2>&1)"
26
-
27
- echo "===== [2/8] Argument validation ====="
28
- if [ -z "${1:-}" ]; then
29
- echo "Usage: $0 <build folder>"
30
- exit 1
31
- fi
32
- SOURCE="$(cd "$1" 2>/dev/null && pwd)" || { echo "Error: the build folder '$1' does not exist."; exit 2; }
33
- echo "Build folder (read only): $SOURCE"
34
-
35
- echo "===== [3/8] Working folder ====="
36
- # A folder of its own each run: runs side by side never share one.
37
- WORKING_FOLDER="$(mktemp -d "/tmp/python_$(basename "$SOURCE").XXXXXX")" || { echo "Error: could not create a working folder in /tmp."; exit 2; }
38
- trap 'rm -rf "$WORKING_FOLDER"' EXIT
39
- echo "Working folder: $WORKING_FOLDER"
40
-
41
- echo "===== [4/8] Copy the build ====="
42
- EXCLUDES=(--exclude=.venv --exclude=venv --exclude=__pycache__ --exclude=.mypy_cache --exclude=.ruff_cache --exclude=.pytest_cache --exclude=.git)
43
- echo "+ tar -C $SOURCE ${EXCLUDES[*]} -cf - . | tar -C $WORKING_FOLDER -xf -"
44
- tar -C "$SOURCE" "${EXCLUDES[@]}" -cf - . | tar -C "$WORKING_FOLDER" -xf - || { echo "Error: could not copy the build folder."; exit 2; }
45
-
46
- echo "===== [5/8] Enter the working folder ====="
47
- cd "$WORKING_FOLDER" 2>/dev/null || { echo "Error: cannot enter $WORKING_FOLDER."; exit 2; }
48
- echo "Now in: $(pwd)"
49
-
50
- echo "===== [6/8] Dependencies ====="
51
- if [ ! -f pyproject.toml ]; then
52
- echo "Error: there is no pyproject.toml - the project's dependencies, pytest, ruff and mypy among them, go in it."
53
- exit 1
54
- fi
55
- # Relative to the working folder, where the script now is: a path a native Windows uv reads as it is, from Git Bash too.
56
- export UV_PROJECT_ENVIRONMENT=".venv" UV_PYTHON="$PYTHON" UV_PYTHON_DOWNLOADS=never
57
- export UV_CACHE_DIR="${UV_CACHE_DIR:-.uv-cache}" PYTHONDONTWRITEBYTECODE=1
58
- unset PYTHONPATH PYTHONHOME
59
- echo "+ uv sync (the project and its dev dependency group into $WORKING_FOLDER/.venv)"
60
- uv sync || exit $?
61
- # The venv's own tools: in bin/ on macOS and Linux, in Scripts/ on Windows.
62
- if [ -d .venv/Scripts ]; then VENV_BIN=.venv/Scripts; else VENV_BIN=.venv/bin; fi
63
-
64
- echo "===== [7/8] Static checks ====="
65
- CHECKS=0
66
- for tool in ruff mypy; do
67
- if [ ! -x "$VENV_BIN/$tool" ]; then
68
- echo "pyproject.toml:1:1: $tool is not in the dev dependency group - add it with \`uv add --dev $tool\`"
69
- CHECKS=1
70
- fi
71
- done
72
- if [ -x "$VENV_BIN/ruff" ]; then
73
- # Not uv's cache, kept in the working folder when the person has none of their own: its files are not the build's.
74
- echo "+ ruff format --check --output-format concise --extend-exclude .uv-cache ."
75
- "$VENV_BIN/ruff" format --check --output-format concise --extend-exclude .uv-cache . || CHECKS=1
76
- echo "+ ruff check --output-format concise --no-fix --extend-exclude .uv-cache ."
77
- "$VENV_BIN/ruff" check --output-format concise --no-fix --extend-exclude .uv-cache . || CHECKS=1
78
- fi
79
- if [ -x "$VENV_BIN/mypy" ]; then
80
- # `files` in [tool.mypy] says what to check; without it, the whole build.
81
- if grep -Eq '^[[:space:]]*files[[:space:]]*=' pyproject.toml; then TARGETS=(); else TARGETS=(.); fi
82
- echo "+ mypy --no-color-output --show-column-numbers ${TARGETS[*]:-}"
83
- "$VENV_BIN/mypy" --no-color-output --show-column-numbers ${TARGETS[@]+"${TARGETS[@]}"} || CHECKS=1
84
- fi
85
- [ "$CHECKS" -eq 0 ] && echo "Static checks: passed" || echo "Static checks: FAILED - the findings are above"
86
-
87
- echo "===== [8/8] Unit tests ====="
88
- echo "+ uv run --no-sync pytest"
89
- uv run --no-sync pytest
90
- TESTS=$?
91
-
92
- echo "===== Summary ====="
93
- if [ "$TESTS" -ne 0 ]; then
94
- STATUS=$TESTS
95
- elif [ "$CHECKS" -ne 0 ]; then
96
- STATUS=$STATIC_CHECKS_FAILED
97
- else
98
- STATUS=0
99
- fi
100
- echo "static checks: $([ "$CHECKS" -eq 0 ] && echo passed || echo failed); unit tests: exit $TESTS"
101
- echo "Exit: $STATUS; build: $SOURCE; working folder: $WORKING_FOLDER"
102
- exit "$STATUS"
@@ -1,87 +0,0 @@
1
- #!/usr/bin/env pwsh
2
-
3
- $ErrorActionPreference = 'Stop'
4
-
5
- $UNRECOVERABLE_ERROR_EXIT_CODE = 69
6
-
7
- # ANSI escape code pattern to remove color codes and formatting from output
8
- $ANSI_ESCAPE_PATTERN = '\x1b\[[0-9;]*[mK]'
9
-
10
- # Check if subfolder name is provided
11
- if (-not $args[0]) {
12
- Write-Host "Error: No subfolder name provided."
13
- Write-Host "Usage: $($MyInvocation.MyCommand.Name) <subfolder_name>"
14
- exit $UNRECOVERABLE_ERROR_EXIT_CODE
15
- }
16
-
17
- $BuildFolder = $args[0]
18
-
19
- # Define the path to the subfolder. It lives in the system temp directory;
20
- # $BuildFolder may be an absolute path, so only its leaf name is used.
21
- $NODE_SUBFOLDER = Join-Path ([System.IO.Path]::GetTempPath()) "node_$(Split-Path $BuildFolder -Leaf)"
22
-
23
- if ($env:VERBOSE -eq "1") {
24
- Write-Host "Preparing Node subfolder: $NODE_SUBFOLDER"
25
- }
26
-
27
- # Check if the node subfolder exists
28
- if (Test-Path $NODE_SUBFOLDER) {
29
- # Delete all files and folders except "node_modules", "build", and "package-lock.json"
30
- Get-ChildItem -Path $NODE_SUBFOLDER -Force |
31
- Where-Object {
32
- $_.Name -ne "node_modules" -and
33
- $_.Name -ne "build" -and
34
- $_.Name -ne "package-lock.json"
35
- } | Remove-Item -Recurse -Force
36
-
37
- if ($env:VERBOSE -eq "1") {
38
- Write-Host "Cleanup completed, keeping 'node_modules' and 'package-lock.json'."
39
- }
40
- } else {
41
- if ($env:VERBOSE -eq "1") {
42
- Write-Host "Subfolder does not exist. Creating it..."
43
- }
44
-
45
- New-Item -ItemType Directory -Path $NODE_SUBFOLDER -Force | Out-Null
46
- }
47
-
48
- Copy-Item -Path "$BuildFolder/*" -Destination $NODE_SUBFOLDER -Recurse -Force
49
-
50
- # Move to the subfolder
51
- if (-not (Test-Path $NODE_SUBFOLDER)) {
52
- Write-Host "Error: Subfolder '$BuildFolder' does not exist."
53
- exit $UNRECOVERABLE_ERROR_EXIT_CODE
54
- }
55
-
56
- Push-Location $NODE_SUBFOLDER
57
-
58
- try {
59
- # Install libraries
60
- npm install
61
-
62
- # Execute all React unittests in the subfolder
63
- Write-Host "Running React unittests in $BuildFolder..."
64
- # Temporarily allow stderr output without throwing (npm/jest may write to stderr)
65
- # ForEach-Object converts ErrorRecord objects (from stderr) to plain strings to avoid verbose error formatting
66
- $ErrorActionPreference = 'Continue'
67
- $output = npm test -- --runInBand --silent --detectOpenHandles 2>&1 | ForEach-Object { if ($_ -is [System.Management.Automation.ErrorRecord]) { $_.Exception.Message } else { $_ } } | Out-String
68
- $TEST_EXIT_CODE = $LASTEXITCODE
69
- $ErrorActionPreference = 'Stop'
70
-
71
- # Strip ANSI escape codes
72
- $output = $output -replace $ANSI_ESCAPE_PATTERN, ''
73
- Write-Host $output
74
-
75
- # Check if tests failed
76
- if ($TEST_EXIT_CODE -ne 0) {
77
- Write-Host "Error: Tests failed with exit code $TEST_EXIT_CODE"
78
- exit $TEST_EXIT_CODE
79
- }
80
-
81
- exit $TEST_EXIT_CODE
82
- } finally {
83
- Pop-Location
84
- if (Test-Path $NODE_SUBFOLDER) {
85
- Remove-Item -Path $NODE_SUBFOLDER -Recurse -Force -ErrorAction SilentlyContinue
86
- }
87
- }
@@ -1,218 +0,0 @@
1
- ---
2
- name: refactor-module
3
- description: >-
4
- Split a large ***plain module into smaller modules grouped by logical domain.
5
- The resulting modules are connected via a requires chain so that their behaviour
6
- is 100% preserved. Use when a module has become too large and its functional
7
- functional specs span multiple distinct concerns that would be clearer as separate modules.
8
- allowed-tools: [read, write, edit, bash, ls, grep, find]
9
- ---
10
-
11
- # Refactor Module
12
-
13
- ## When to Use
14
-
15
- - A module has many functional specs spanning multiple distinct domains or feature areas.
16
- - The module is hard to reason about because unrelated concerns are interleaved.
17
- - New features are difficult to add because the module's scope is too broad.
18
- - The user explicitly asks to split or reorganize a module.
19
-
20
- ## Guiding Principle
21
-
22
- The refactoring is purely structural. The **combined behavior** of the resulting modules must be **identical** to the original module. No functional spec is added, removed, or weakened. The split is semantic — grouping related functional specs together — not behavioral.
23
-
24
- The ***plain is structural; the code is not. Once modules are split and functional specs move between them, the code already built no longer matches the module layout: functional specs move into modules the code was never built on, and no change to that code brings them in. **After a refactor, the whole requires chain is regenerated from scratch** — the existing code and conformance tests are taken out (their lineage keeps them) and every module is built again from the base of the chain upward. Say so up front: it is part of what the user agrees to (Phase 2e), and it is the last step of the skill (Phase 5).
25
-
26
- ## Input
27
-
28
- The `.plain` file to refactor, plus guidance from the user on the desired grouping (or ask the user to confirm your proposed grouping).
29
-
30
- ## Phase 1 — Analyze the Current Module
31
-
32
- 1. **Read the entire `.plain` file** — frontmatter, definitions, implementation reqs, test reqs, and all functional specs. Also read any `import` and `requires` chains to understand the full context.
33
- 2. **Inventory the functional specs.** List each functional spec by its func-id and note which `:Concepts:` it references. Build a dependency map: which functional specs depend on earlier functional specs (by referencing behavior or state they introduced)?
34
- 3. **Inventory the definitions.** For each concept, note which functional specs reference it. Identify concepts that are used across multiple logical groups vs. concepts used only within one group.
35
- 4. **Identify logical groups.** Look for natural seams — clusters of functional specs that share concepts, represent a cohesive domain, or describe a single feature area. Common groupings:
36
- - Data model setup and CRUD operations
37
- - Business logic and processing rules
38
- - UI screens and navigation
39
- - Integrations and external interfaces
40
- - Statistics, reporting, and analytics
41
- 5. **Verify group independence.** Each group's functional specs should form a contiguous or near-contiguous block in chronological order. If a group's functional specs are scattered and interleaved with other groups, the split boundary may need adjustment.
42
-
43
- ## Phase 2 — Plan the Split
44
-
45
- Present the proposed split to the user and get explicit confirmation before making any changes.
46
-
47
- ### 2a. Define the module chain
48
-
49
- The modules form a `requires` chain that preserves the original chronological ordering of functional specs. The first module in the chain contains the earliest functional specs; each subsequent module `requires` the previous one and adds the next logical group.
50
-
51
- ```
52
- original-module
53
- ↓ splits into
54
- module-group-a (no requires — this is the new base)
55
- module-group-b (requires: module-group-a)
56
- module-group-c (requires: module-group-b)
57
- ```
58
-
59
- If the original module already had `requires` or `import` dependencies, the first new module inherits them.
60
-
61
- ### 2b. Assign functional specs to modules
62
-
63
- Place each functional spec in exactly one module. The placement must respect chronological ordering:
64
- - Within each module, the functional specs appear in the same relative order as in the original.
65
- - Across the chain, the ordering is preserved: all functional specs in module A come before all functional specs in module B, which come before all functional specs in module C.
66
- - A functional spec **cannot** move to an earlier module than a functional spec it depends on.
67
-
68
- ### 2c. Assign definitions to modules
69
-
70
- For each concept, determine where it belongs:
71
-
72
- | Concept usage | Placement |
73
- |---------------|-----------|
74
- | Used only within one module's functional specs | Define in that module |
75
- | Used across multiple modules in the chain | Define in the first module that uses it, and add to that module's `exported_concepts` |
76
- | Already defined in an import template | Leave in the import — no change needed |
77
-
78
- If many concepts are shared across all modules, consider creating a new import module (template) to hold them. This avoids long `exported_concepts` lists and keeps definitions centralized. Write it following `import-modules.md`.
79
-
80
- ### 2d. Assign implementation reqs and test reqs
81
-
82
- - Reqs that apply to all modules should live in a shared import template. If one already exists, keep them there.
83
- - Reqs specific to a single module's domain move to that module.
84
- - When in doubt, keep reqs in the shared template — duplication across modules is worse than a slightly broad template.
85
-
86
- ### 2e. Present the plan
87
-
88
- Summarize for the user:
89
- - Number of resulting modules and their names
90
- - Which functional specs go in each module (listed by func-id)
91
- - The `requires` chain order
92
- - Any new import module being created
93
- - Which concepts are exported from each module
94
- - Confirmation that all original functional specs are accounted for (none lost)
95
- - That the whole chain will be **regenerated from scratch** once the split is done: the code and conformance tests built so far are taken out (kept in the lineage) and everything is built again from the base module up — this takes as long and costs as much as building the original module did
96
-
97
- Get explicit user confirmation before proceeding — of the split and of regenerating from scratch.
98
-
99
- ## Phase 3 — Execute the Split
100
-
101
- Create the new modules in order, from the base of the chain upward.
102
-
103
- ### 3a. Create or update the import template (if needed)
104
-
105
- If shared definitions or reqs are being moved to a new import template, create it first, following `import-modules.md`.
106
-
107
- ### 3b. Create the base module
108
-
109
- Create the first module in the chain:
110
- 1. Set the YAML frontmatter — inherit the original module's `import` references. Add `exported_concepts` for any concepts that downstream modules need.
111
- 2. Add the `***definitions***` section with concepts used by this module's functional specs and concepts that need to be exported.
112
- 3. Add `***implementation reqs***` and `***test reqs***` specific to this module (if not fully covered by the import template).
113
- 4. Add the `***functional specs***` assigned to this module, preserving their original order and exact wording.
114
- 5. Move the test plain files of the moved functional specs into this module's folder, `tests/<module>/`, with `module:` set to the new module's name; func-ids and scenario text stay as they are.
115
-
116
- ### 3c. Create subsequent modules
117
-
118
- For each subsequent module in the chain:
119
- 1. Set `requires` to point to the previous module in the chain. Set `import` if it uses shared templates.
120
- 2. Add `exported_concepts` for any concepts that later modules in the chain need.
121
- 3. Add `***definitions***` for concepts local to this module. Do **not** redefine concepts already available via `requires` (exported) or `import`.
122
- 4. Add `***implementation reqs***` and `***test reqs***` specific to this module.
123
- 5. Add the `***functional specs***` assigned to this module, preserving their original order and exact wording.
124
- 6. Move the test plain files of the moved functional specs the same way.
125
-
126
- ### 3d. Handle the original module file
127
-
128
- After all new modules are created:
129
- - If the original module is being fully replaced (all functional specs moved out), delete it or rename it to avoid confusion.
130
- - If the original module was required by other modules, update those modules to `require` the last module in the new chain instead — its accumulated code and previous functional specs cover the whole chain. Exported concepts are **not** transitive, though: if a downstream module references a concept now exported by an earlier module in the new chain, it must list that earlier module in its `requires` as well.
131
-
132
- ## Phase 4 — Verify
133
-
134
- ### 4a. Completeness check
135
-
136
- This is the most critical verification. Walk through every functional spec from the original module and confirm it appears in exactly one of the new modules. Nothing may be lost, weakened, modified, or left implicit.
137
-
138
- Checklist:
139
- - [ ] The functional specs across all new modules are as many as the original's
140
- - [ ] Each functional spec's text is identical to the original (no rewording) and keeps its func-id
141
- - [ ] Each functional spec's test plain file moved with it, with `module:` updated and scenarios intact
142
-
143
- ### 4b. Chronological ordering check
144
-
145
- Verify that the chronological order of all functional specs — when read across the requires chain from base to leaf — matches the original ordering exactly. A functional spec must not appear before a functional spec it depends on.
146
-
147
- ### 4c. Concept availability check
148
-
149
- For each module, verify:
150
- - [ ] Every `:Concept:` referenced in its functional specs is either defined locally, available via `import`, or available via `exported_concepts` from a module listed in `requires`
151
- - [ ] `exported_concepts` includes every concept that downstream modules need
152
- - [ ] No concept name collisions between modules
153
-
154
- ### 4d. Structural validation per module
155
-
156
- For each new module:
157
- - [ ] Has at least one functional spec and one implementation req
158
- - [ ] YAML frontmatter is correctly formatted
159
- - [ ] `requires` and `import` paths are correct
160
- - [ ] Module file is at the repository root (not in `template/`)
161
- - [ ] Functional specs are language-agnostic
162
- - [ ] All external interfaces remain explicit
163
-
164
- ### 4e. Read all new modules
165
-
166
- Read each new `.plain` file in full and present the final structure to the user for approval. If the user requests changes, apply them and re-verify.
167
-
168
- Parse each new module with `turri parse <module>.plain` (or the `parse` tool) before going on: a module that does not parse cannot be regenerated.
169
-
170
- ## Phase 5 — Regenerate the Chain from Scratch
171
-
172
- The split moves functional specs between modules, so the code built from the original module cannot be patched into the new layout: the chain is regenerated from scratch. Do not try to keep or reuse the existing code, and do not regenerate only what looks changed — modules have moved, and a codebase built without a module it now requires has to be started over anyway.
173
-
174
- 1. **Remind the user** what regenerating from scratch does — the code and conformance tests built so far are taken out, committed so the lineage keeps them, and the whole chain is built again from the base up — and that they already agreed to it in Phase 2e. Proceed only on that agreement.
175
- 2. **Regenerate the tip of the chain from scratch, with its whole chain** — the last module, the one everything else is required by. From scratch for the tip alone is not enough: the modules below keep their code, and the tip starts from a copy of it, laid out for the old modules. With the whole chain, every module's code is taken out, the base's included, and the chain is built again from the bottom:
176
- - in the chat: the `regenerate` tool on the tip's `.plain` file with `from_scratch: "chain"`, or `/regenerate <tip> from scratch, the whole chain`;
177
- - on the command line: `turri regenerate <tip>.plain --from-scratch-chain`.
178
- 3. **Modules that require the chain** (updated in 3d) are regenerated after it, from scratch too (`from_scratch: "module"`): the modules they require are not the ones their code was built on. When the tip's whole chain is regenerated, a module built on top of it is a chain of its own — regenerating it from scratch with its whole chain instead covers the tip's chain too, in one go.
179
- 4. **The original module's codebase** (`plain_modules/<original-module>/`), when the original module was deleted or renamed, is no longer built from anything. Tell the user it is there; it is theirs to delete. Do not delete it unasked.
180
-
181
- ## Common Pitfalls
182
-
183
- ### Splitting too aggressively
184
- Creating many tiny modules with 1–2 functional specs each adds overhead without clarity. Aim for modules with 3–10 functional specs each, grouped around a cohesive theme.
185
-
186
- ### Breaking chronological order
187
- Functional specs that set up foundational behavior (entry point, database init, core CRUD) must stay in the base module even if they touch concepts from multiple domains. Only split when functional specs are cleanly separable.
188
-
189
- ### Forgetting exported_concepts
190
- If a concept defined in module A is referenced by a functional spec in module B (which requires A), the concept must be in A's `exported_concepts`. Missing exports cause regeneration failures.
191
-
192
- ### Modifying the ***plain during the split
193
- This is a refactoring, not a rewrite. Functional specs must be copied verbatim. If one needs rewording to work in its new module context, that is a sign the split boundary is wrong — adjust the grouping instead.
194
-
195
- ### Losing test plain files
196
- A test plain file binds to its functional spec by `module:` and `func_id:`, and lives in its module's folder. When a functional spec moves to a new module, its test plain file moves to `tests/<new module>/` with `module:` changed; otherwise `turri parse` reports a file bound to no functional spec, and a functional spec with no test plain file.
197
-
198
- ### Regenerating only what changed
199
- After a split the existing code was built for a module layout that no longer exists. Regenerating incrementally either stops at a codebase that has to be started over or builds on code laid out for the old modules. Regenerate the whole chain from scratch.
200
-
201
- ## Validation Checklist
202
-
203
- - [ ] User confirmed the split plan before execution, including regenerating the whole chain from scratch
204
- - [ ] All original functional specs are present in exactly one new module — none lost
205
- - [ ] Every functional spec's text is identical to the original — no rewording
206
- - [ ] Test plain files moved with their functional specs and bound to the new module
207
- - [ ] Chronological order preserved across the requires chain
208
- - [ ] Every referenced `:Concept:` is available in each module (local, import, or exported)
209
- - [ ] `exported_concepts` are correctly set on each module
210
- - [ ] No concept name collisions
211
- - [ ] Each module has at least one functional spec and one implementation req
212
- - [ ] `requires` chain is correctly ordered (base → leaf)
213
- - [ ] Original module removed or updated
214
- - [ ] Downstream modules (if any) updated to require the chain tip, plus any earlier chain modules whose exported concepts they reference
215
- - [ ] User approved the final result
216
- - [ ] Every new module parses
217
- - [ ] The tip of the chain regenerated from scratch with its whole chain, then any module that requires it
218
- - [ ] User told about the original module's leftover codebase, if there is one
@@ -1,64 +0,0 @@
1
- ---
2
- name: resolve-section-ownership
3
- description: >-
4
- Route every fact in a .plain bullet, section, or file to the section that owns it — splitting a bullet that carries several kinds of fact, and moving a misplaced one to where turri will read it. Use when a bullet answers more than one of what it is / what it does / how it is built / how it is tested, when a requirement looks like it is in the wrong section, or when auditing a file for section ownership. Not for a functional spec that is merely too large (use break-down-func-spec) or for two that contradict each other (use resolve-spec-conflict).
5
- allowed-tools: [read, write, edit, ls, grep, find]
6
- ---
7
-
8
- # Resolve Section Ownership
9
-
10
- This is the ownership counterpart to `break-down-func-spec`. That skill splits one functional spec into several because it is **too large**; this one moves facts between sections because they are in the **wrong place**. The two are unrelated: a correctly placed functional spec can be too large, and a one-line bullet can be misplaced.
11
-
12
- ## When to Use
13
-
14
- - A bullet answers more than one of *what is it*, *what does it do*, *how is it built*, *how is it tested*.
15
- - A requirement states a mechanism (retry, cache, token refresh, connection handling) but sits in `***functional specs***`.
16
- - A `:UnitTests:` fact sits in `***test reqs***`, or a `:ConformanceTests:` fact sits in `***implementation reqs***` — the coding agent and the conformance agent each read only their own section, so the fact is silently ignored today.
17
- - A functional spec describes an external system rather than the software being built.
18
- - A whole file is being audited for placement.
19
-
20
- ## When Not to Use
21
-
22
- - The functional spec is correctly placed but too large → `break-down-func-spec`.
23
- - Two functional specs contradict each other → `analyze-func-specs`, then `resolve-spec-conflict`.
24
- - The wording is merely verbose → trim per `concise-specs.md`; no fact changes section.
25
-
26
- ## Input
27
-
28
- The bullet, section, or `.plain` file to resolve.
29
-
30
- ## Workflow
31
-
32
- 1. **Read the full `.plain` file** — every section, plus its `import` and `requires` chains, so an existing home for a fact is visible before a new one is written.
33
- 2. **Identify the target** — one bullet, one section, or the whole file.
34
- 3. **Decompose each bullet into atomic facts.** A clause joined by *and*, *which*, *so that*, or a comma often carries a second fact. Keep each fact in the author's own words for now; rewording comes at step 6.
35
- 4. **Route each fact** by the *Section ownership* table in `module-structure.md`. Where a fact resists the table, apply the question it encodes: **would a caller of the finished software observe this?** Yes → `***functional specs***`. No, it is how the result is reached → `***implementation reqs***`. It says what a term means → `***definitions***`. It shapes `:ConformanceTests:` → `***test reqs***`.
36
- 5. **Split a fact that carries both a mechanism and its consequence.** The consequence is observable and becomes the functional spec; the mechanism becomes the implementation req. *"Sends the same idempotency key on every retry, so a retried write creates at most one record"* is two facts, not one.
37
- 6. **Give each moved fact a subject that exists in the built system.** A fact leaving a functional spec often loses its subject: name the component that owns the behavior, and add it to `***definitions***` if it is not defined yet. `:Implementation:` is the whole codebase — use it only for a fact that holds everywhere.
38
- 7. **Write each fact into its owning section** by that section's rule — `definitions.md`, `impl-reqs.md`, `test-reqs.md`, and for a test scenario its functional spec's test plain file, by *Writing scenarios* in `test-plain-files.md`. A fact moving *into* `***functional specs***` goes through `func-specs.md` (*Adding a functional spec*): its complexity and conflict checks run before it is written in.
39
- 8. **Remove each fact from where it no longer belongs.** If a bullet is left stating nothing observable, delete the bullet; do not leave a stub. Deleting the last bullet of a section deletes the section.
40
- 9. **Verify nothing was lost and nothing was duplicated.** Walk every fact from the original text and confirm it appears in exactly one section. A fact that now reads as obvious in its new home is still a cut decision — make it deliberately, per `concise-specs.md`.
41
- 10. **Run `parse`** on the module. Moving facts changes what is regenerated; do not finish while it reports errors.
42
- 11. **Read the file again** to confirm canonical section order (`***definitions***` → `***implementation reqs***` → `***test reqs***` → `***functional specs***`), correct syntax, and that every referenced concept is still defined before use.
43
-
44
- ## Error Handling
45
-
46
- - **The complexity check finds the moved fact too complex** → the fact was a whole functional spec in disguise; run `break-down-func-spec` on it, then place the resulting functional specs.
47
- - **The conflict check reports a conflict** → resolve it with `resolve-spec-conflict` **before** removing the fact from its old section, so no version of it is lost in between.
48
- - **A fact appears to belong to two sections** → it is two facts; split it per step 5. If it still resists, it is a mechanism whose consequence has not been written down — write the consequence, and the split follows.
49
- - **The owning section does not exist in the file** → create it in canonical order. An import module carries no `***functional specs***` at all (see `import-modules.md`), so an observable fact found there belongs on the root module that imports it.
50
- - **The move empties a functional spec** → delete the functional spec rather than leaving a placeholder, and delete its test plain file with it, moving any scenario that still fits to the functional spec it now tests (*Keeping test plain files in step* in `test-plain-files.md`).
51
-
52
- ## Worked examples
53
-
54
- `concise-specs-examples.md` (*Split one crowded bullet across its owning sections*) shows one bullet carrying four kinds of fact. `concise-specs-integration-examples.md` works through the mechanism-versus-result cases — retry policy, idempotency, auth — which are where this comes up most.
55
-
56
- ## Validation Checklist
57
-
58
- - [ ] Every fact from the original text appears in exactly one section, or was deliberately cut
59
- - [ ] No fact was reworded into a different meaning while being moved
60
- - [ ] Each moved fact names a subject that exists in the built system
61
- - [ ] Every fact moved into `***functional specs***` passed the complexity and conflict checks of `func-specs.md`
62
- - [ ] No `:UnitTests:` fact outside `***implementation reqs***`, no `:ConformanceTests:` fact outside `***test reqs***`
63
- - [ ] Sections are in canonical order and every referenced concept is defined before use
64
- - [ ] Emptied bullets and sections were removed, not left as stubs