@turri-dev/cli 0.0.0-stage → 0.1.2-next.48dacfc

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 (315) hide show
  1. package/.pi/themes/turri-dark.json +80 -0
  2. package/.pi/themes/turri-light.json +82 -0
  3. package/LICENSE +21 -0
  4. package/README.md +272 -2
  5. package/assets/jellyfish/dark-00.png +0 -0
  6. package/assets/jellyfish/dark-01.png +0 -0
  7. package/assets/jellyfish/dark-02.png +0 -0
  8. package/assets/jellyfish/dark-03.png +0 -0
  9. package/assets/jellyfish/dark-04.png +0 -0
  10. package/assets/jellyfish/dark-05.png +0 -0
  11. package/assets/jellyfish/dark-06.png +0 -0
  12. package/assets/jellyfish/dark-07.png +0 -0
  13. package/assets/jellyfish/dark-08.png +0 -0
  14. package/assets/jellyfish/dark-09.png +0 -0
  15. package/assets/jellyfish/dark-10.png +0 -0
  16. package/assets/jellyfish/dark-11.png +0 -0
  17. package/assets/jellyfish/dark-12.png +0 -0
  18. package/assets/jellyfish/dark-13.png +0 -0
  19. package/assets/jellyfish/dark-14.png +0 -0
  20. package/assets/jellyfish/fallback.txt +252 -0
  21. package/assets/jellyfish/light-00.png +0 -0
  22. package/assets/jellyfish/light-01.png +0 -0
  23. package/assets/jellyfish/light-02.png +0 -0
  24. package/assets/jellyfish/light-03.png +0 -0
  25. package/assets/jellyfish/light-04.png +0 -0
  26. package/assets/jellyfish/light-05.png +0 -0
  27. package/assets/jellyfish/light-06.png +0 -0
  28. package/assets/jellyfish/light-07.png +0 -0
  29. package/assets/jellyfish/light-08.png +0 -0
  30. package/assets/jellyfish/light-09.png +0 -0
  31. package/assets/jellyfish/light-10.png +0 -0
  32. package/assets/jellyfish/light-11.png +0 -0
  33. package/assets/jellyfish/light-12.png +0 -0
  34. package/assets/jellyfish/light-13.png +0 -0
  35. package/assets/jellyfish/light-14.png +0 -0
  36. package/bin/turri.mjs +29 -0
  37. package/dist/ask.js +149 -0
  38. package/dist/brand.js +50 -0
  39. package/dist/btw.js +174 -0
  40. package/dist/chat-models.js +37 -0
  41. package/dist/chat-skills.js +18 -0
  42. package/dist/cli.js +178 -0
  43. package/dist/config-command.js +197 -0
  44. package/dist/config-edit.js +367 -0
  45. package/dist/config.js +489 -0
  46. package/dist/conform-cli.js +29 -0
  47. package/dist/cultivate-cli.js +110 -0
  48. package/dist/drift-cli.js +25 -0
  49. package/dist/environment.js +70 -0
  50. package/dist/extension.js +2372 -0
  51. package/dist/genome.js +301 -0
  52. package/dist/graph.js +246 -0
  53. package/dist/identity.js +35 -0
  54. package/dist/init-config.js +511 -0
  55. package/dist/judge.js +62 -0
  56. package/dist/lineage-cli.js +13 -0
  57. package/dist/loop-cli.js +132 -0
  58. package/dist/loop-tools.js +225 -0
  59. package/dist/mature-tools.js +193 -0
  60. package/dist/model-check.js +117 -0
  61. package/dist/module-report.js +9 -0
  62. package/dist/pi-launch.js +31 -0
  63. package/dist/pi.js +813 -0
  64. package/dist/plain/check.js +76 -0
  65. package/dist/plain/concepts.js +213 -0
  66. package/dist/plain/errors.js +43 -0
  67. package/dist/plain/files.js +57 -0
  68. package/dist/plain/highlight.js +195 -0
  69. package/dist/plain/index.js +15 -0
  70. package/dist/plain/liquid.js +129 -0
  71. package/dist/plain/markdown.js +208 -0
  72. package/dist/plain/parser.js +752 -0
  73. package/dist/plain/plain.tmLanguage.json +124 -0
  74. package/dist/plain/spec.js +291 -0
  75. package/dist/plain/stdlib.js +44 -0
  76. package/dist/question-dialog.js +125 -0
  77. package/dist/questioning.js +109 -0
  78. package/dist/quiet.js +125 -0
  79. package/dist/regenerate/activity.js +187 -0
  80. package/dist/regenerate/agent-env.js +190 -0
  81. package/dist/regenerate/agent-shell.js +114 -0
  82. package/dist/regenerate/arbiter.js +133 -0
  83. package/dist/regenerate/audit.js +203 -0
  84. package/dist/regenerate/cases.js +83 -0
  85. package/dist/regenerate/change-view.js +102 -0
  86. package/dist/regenerate/choose-conformance.js +117 -0
  87. package/dist/regenerate/chunk-plan.js +625 -0
  88. package/dist/regenerate/codebase.js +75 -0
  89. package/dist/regenerate/command-check.js +312 -0
  90. package/dist/regenerate/compaction.js +20 -0
  91. package/dist/regenerate/confine.js +310 -0
  92. package/dist/regenerate/conform.js +133 -0
  93. package/dist/regenerate/conformance-agents.js +955 -0
  94. package/dist/regenerate/conformance.js +936 -0
  95. package/dist/regenerate/conversation-writes.js +100 -0
  96. package/dist/regenerate/credentials.js +88 -0
  97. package/dist/regenerate/debug-log.js +228 -0
  98. package/dist/regenerate/debugger.js +90 -0
  99. package/dist/regenerate/delivery.js +19 -0
  100. package/dist/regenerate/diagnose-job.js +40 -0
  101. package/dist/regenerate/diagnose.js +81 -0
  102. package/dist/regenerate/diff-view.js +240 -0
  103. package/dist/regenerate/drift.js +194 -0
  104. package/dist/regenerate/engine.js +118 -0
  105. package/dist/regenerate/environment-error.js +220 -0
  106. package/dist/regenerate/job-log.js +102 -0
  107. package/dist/regenerate/job-panel.js +336 -0
  108. package/dist/regenerate/jobs-tree.js +300 -0
  109. package/dist/regenerate/jobs.js +427 -0
  110. package/dist/regenerate/lanes.js +32 -0
  111. package/dist/regenerate/lineage.js +384 -0
  112. package/dist/regenerate/loop.js +1435 -0
  113. package/dist/regenerate/masking.js +95 -0
  114. package/dist/regenerate/notes.js +397 -0
  115. package/dist/regenerate/os-sandbox.js +243 -0
  116. package/dist/regenerate/paths.js +165 -0
  117. package/dist/regenerate/plain-palette.js +83 -0
  118. package/dist/regenerate/prompt.js +704 -0
  119. package/dist/regenerate/records.js +294 -0
  120. package/dist/regenerate/regenerate.js +598 -0
  121. package/dist/regenerate/regression.js +181 -0
  122. package/dist/regenerate/release.js +262 -0
  123. package/dist/regenerate/requires.js +241 -0
  124. package/dist/regenerate/resources.js +164 -0
  125. package/dist/regenerate/self-check.js +111 -0
  126. package/dist/regenerate/services.js +155 -0
  127. package/dist/regenerate/shell.js +320 -0
  128. package/dist/regenerate/side-panel.js +278 -0
  129. package/dist/regenerate/spec-map-view.js +574 -0
  130. package/dist/regenerate/spec-map.js +561 -0
  131. package/dist/regenerate/spec-steps.js +527 -0
  132. package/dist/regenerate/state.js +10 -0
  133. package/dist/regenerate/steer.js +91 -0
  134. package/dist/regenerate/steering.js +119 -0
  135. package/dist/regenerate/stop-report.js +161 -0
  136. package/dist/regenerate/submit-work.js +71 -0
  137. package/dist/regenerate/test-kinds.js +124 -0
  138. package/dist/regenerate/test-scripts.js +695 -0
  139. package/dist/regenerate/testing.js +406 -0
  140. package/dist/regenerate/transcript-view.js +1 -0
  141. package/dist/regenerate/unit-gate.js +20 -0
  142. package/dist/regenerate/unit-review.js +347 -0
  143. package/dist/regenerate/web.js +256 -0
  144. package/dist/regenerate/workspace.js +99 -0
  145. package/dist/regenerate-cli.js +68 -0
  146. package/dist/release-agent.js +114 -0
  147. package/dist/release-cli.js +131 -0
  148. package/dist/release-tools.js +148 -0
  149. package/dist/review/live.js +165 -0
  150. package/dist/rules.js +47 -0
  151. package/dist/self-invocation.js +110 -0
  152. package/dist/setup.js +245 -0
  153. package/dist/skill-progress.js +78 -0
  154. package/dist/skill.js +149 -0
  155. package/dist/skills.js +74 -0
  156. package/dist/spec-diff-cli.js +37 -0
  157. package/dist/spec-tools.js +155 -0
  158. package/dist/stack.js +158 -0
  159. package/dist/stacks.js +97 -0
  160. package/dist/stdlib.js +100 -0
  161. package/dist/terminal-images.js +46 -0
  162. package/dist/tools.js +242 -0
  163. package/dist/validate-cli.js +52 -0
  164. package/docs/README.md +58 -0
  165. package/docs/authoring-plain.md +245 -0
  166. package/docs/config.md +353 -0
  167. package/docs/deploy.md +109 -0
  168. package/docs/development.md +88 -0
  169. package/docs/headless.md +148 -0
  170. package/docs/images/how-turri-works.svg +50 -0
  171. package/docs/images/turri-banner.png +0 -0
  172. package/docs/installation.md +119 -0
  173. package/docs/parser.md +108 -0
  174. package/docs/regenerating.md +1116 -0
  175. package/docs/sandbox.md +233 -0
  176. package/docs/skills-and-gates.md +254 -0
  177. package/docs/theming.md +76 -0
  178. package/docs/using.md +454 -0
  179. package/genome/rules/bullet-continuation.md +69 -0
  180. package/genome/rules/concise-specs-examples.md +431 -0
  181. package/genome/rules/concise-specs-integration-examples.md +270 -0
  182. package/genome/rules/concise-specs.md +80 -0
  183. package/genome/rules/definitions.md +107 -0
  184. package/genome/rules/examples/integration-embedded-testing/run_conformance_tests_java.sh +163 -0
  185. package/genome/rules/examples/integration-embedded-testing/run_unittests_java.sh +51 -0
  186. package/genome/rules/exported-concepts.md +39 -0
  187. package/genome/rules/func-specs.md +129 -0
  188. package/genome/rules/impl-reqs.md +68 -0
  189. package/genome/rules/import-modules.md +48 -0
  190. package/genome/rules/integration-embedded-testing.md +276 -0
  191. package/genome/rules/integration-embedded.md +171 -0
  192. package/genome/rules/integration-standalone.md +135 -0
  193. package/genome/rules/integrations.md +137 -0
  194. package/genome/rules/linked-resources.md +69 -0
  195. package/genome/rules/module-structure.md +105 -0
  196. package/genome/rules/project-model.md +88 -0
  197. package/genome/rules/required-concepts.md +44 -0
  198. package/genome/rules/requires-modules.md +80 -0
  199. package/genome/rules/stdlib.md +73 -0
  200. package/genome/rules/test-reqs.md +57 -0
  201. package/genome/skills/add-acceptance-test/SKILL.md +100 -0
  202. package/genome/skills/add-concept/SKILL.md +71 -0
  203. package/genome/skills/add-functional-spec/SKILL.md +84 -0
  204. package/genome/skills/add-functional-specs/SKILL.md +118 -0
  205. package/genome/skills/add-implementation-requirement/SKILL.md +86 -0
  206. package/genome/skills/add-resource/SKILL.md +105 -0
  207. package/genome/skills/add-template/SKILL.md +64 -0
  208. package/genome/skills/add-test-requirement/SKILL.md +73 -0
  209. package/genome/skills/analyze-2-func-specs/SKILL.md +101 -0
  210. package/genome/skills/analyze-func-specs/SKILL.md +123 -0
  211. package/genome/skills/analyze-if-func-spec-too-complex/SKILL.md +211 -0
  212. package/genome/skills/break-down-func-spec/SKILL.md +205 -0
  213. package/genome/skills/brood/SKILL.md +229 -0
  214. package/genome/skills/brood/references/intent.md +35 -0
  215. package/genome/skills/brood/references/product.md +101 -0
  216. package/genome/skills/brood/references/stack.md +61 -0
  217. package/genome/skills/brood/references/testing.md +56 -0
  218. package/genome/skills/bud/SKILL.md +148 -0
  219. package/genome/skills/bud/references/checklist.md +44 -0
  220. package/genome/skills/bud/references/intent.md +30 -0
  221. package/genome/skills/check-plain-env/SKILL.md +285 -0
  222. package/genome/skills/consolidate-concepts/SKILL.md +192 -0
  223. package/genome/skills/create-import-module/SKILL.md +104 -0
  224. package/genome/skills/create-requires-module/SKILL.md +109 -0
  225. package/genome/skills/debug-specs/SKILL.md +188 -0
  226. package/genome/skills/implement-conformance-testing-script/SKILL.md +238 -0
  227. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_cypress.ps1 +337 -0
  228. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_golang.ps1 +111 -0
  229. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_java.sh +136 -0
  230. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_python.ps1 +103 -0
  231. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_python.sh +150 -0
  232. package/genome/skills/implement-unit-testing-script/SKILL.md +160 -0
  233. package/genome/skills/implement-unit-testing-script/assets/run_unittests_flutter.ps1 +87 -0
  234. package/genome/skills/implement-unit-testing-script/assets/run_unittests_golang.ps1 +73 -0
  235. package/genome/skills/implement-unit-testing-script/assets/run_unittests_java.sh +72 -0
  236. package/genome/skills/implement-unit-testing-script/assets/run_unittests_python.ps1 +81 -0
  237. package/genome/skills/implement-unit-testing-script/assets/run_unittests_python.sh +98 -0
  238. package/genome/skills/implement-unit-testing-script/assets/run_unittests_react.ps1 +87 -0
  239. package/genome/skills/init-plain-project/SKILL.md +117 -0
  240. package/genome/skills/init-plain-project/references/checklist.md +30 -0
  241. package/genome/skills/mature/SKILL.md +126 -0
  242. package/genome/skills/refactor-module/SKILL.md +196 -0
  243. package/genome/skills/resolve-section-ownership/SKILL.md +64 -0
  244. package/genome/skills/resolve-spec-conflict/SKILL.md +96 -0
  245. package/genome/skills/spawn/SKILL.md +163 -0
  246. package/package.json +68 -4
  247. package/stdlib/backend/common.plain +25 -0
  248. package/stdlib/backend/conformance/common.plain +12 -0
  249. package/stdlib/backend/conformance/go-gin.plain +9 -0
  250. package/stdlib/backend/conformance/go-nethttp.plain +9 -0
  251. package/stdlib/backend/conformance/java-springboot.plain +9 -0
  252. package/stdlib/backend/conformance/python-django.plain +9 -0
  253. package/stdlib/backend/conformance/python-fastapi.plain +9 -0
  254. package/stdlib/backend/conformance/python-flask.plain +9 -0
  255. package/stdlib/backend/conformance/rust-axum.plain +9 -0
  256. package/stdlib/backend/conformance/typescript-express.plain +9 -0
  257. package/stdlib/backend/conformance/typescript-fastify.plain +9 -0
  258. package/stdlib/backend/conformance/typescript-nestjs.plain +9 -0
  259. package/stdlib/backend/go-gin.plain +18 -0
  260. package/stdlib/backend/go-nethttp.plain +18 -0
  261. package/stdlib/backend/java-springboot.plain +19 -0
  262. package/stdlib/backend/python-django.plain +19 -0
  263. package/stdlib/backend/python-fastapi.plain +23 -0
  264. package/stdlib/backend/python-flask.plain +23 -0
  265. package/stdlib/backend/rust-axum.plain +17 -0
  266. package/stdlib/backend/typescript-express.plain +19 -0
  267. package/stdlib/backend/typescript-fastify.plain +19 -0
  268. package/stdlib/backend/typescript-nestjs.plain +19 -0
  269. package/stdlib/cli/common.plain +17 -0
  270. package/stdlib/cli/conformance/common.plain +11 -0
  271. package/stdlib/cli/conformance/go-cobra.plain +9 -0
  272. package/stdlib/cli/conformance/go-flag.plain +9 -0
  273. package/stdlib/cli/conformance/java-picocli.plain +9 -0
  274. package/stdlib/cli/conformance/python-argparse.plain +9 -0
  275. package/stdlib/cli/conformance/python-click.plain +9 -0
  276. package/stdlib/cli/conformance/python-typer.plain +9 -0
  277. package/stdlib/cli/conformance/rust-clap.plain +9 -0
  278. package/stdlib/cli/conformance/typescript-commander.plain +9 -0
  279. package/stdlib/cli/go-cobra.plain +14 -0
  280. package/stdlib/cli/go-flag.plain +14 -0
  281. package/stdlib/cli/java-picocli.plain +15 -0
  282. package/stdlib/cli/python-argparse.plain +18 -0
  283. package/stdlib/cli/python-click.plain +16 -0
  284. package/stdlib/cli/python-typer.plain +16 -0
  285. package/stdlib/cli/rust-clap.plain +14 -0
  286. package/stdlib/cli/typescript-commander.plain +17 -0
  287. package/stdlib/frontend/angular.plain +17 -0
  288. package/stdlib/frontend/common.plain +17 -0
  289. package/stdlib/frontend/conformance/angular.plain +5 -0
  290. package/stdlib/frontend/conformance/common.plain +11 -0
  291. package/stdlib/frontend/conformance/react-vite.plain +5 -0
  292. package/stdlib/frontend/conformance/sveltekit-spa.plain +5 -0
  293. package/stdlib/frontend/conformance/vue-vite.plain +5 -0
  294. package/stdlib/frontend/react-vite.plain +16 -0
  295. package/stdlib/frontend/sveltekit-spa.plain +16 -0
  296. package/stdlib/frontend/vue-vite.plain +16 -0
  297. package/stdlib/lang/go.plain +13 -0
  298. package/stdlib/lang/java.plain +12 -0
  299. package/stdlib/lang/python.plain +18 -0
  300. package/stdlib/lang/rust.plain +12 -0
  301. package/stdlib/lang/typescript.plain +13 -0
  302. package/stdlib/library/common.plain +15 -0
  303. package/stdlib/library/conformance/common.plain +9 -0
  304. package/stdlib/library/conformance/go.plain +9 -0
  305. package/stdlib/library/conformance/java-gradle.plain +9 -0
  306. package/stdlib/library/conformance/java-maven.plain +9 -0
  307. package/stdlib/library/conformance/python.plain +9 -0
  308. package/stdlib/library/conformance/rust.plain +9 -0
  309. package/stdlib/library/conformance/typescript.plain +9 -0
  310. package/stdlib/library/go.plain +12 -0
  311. package/stdlib/library/java-gradle.plain +13 -0
  312. package/stdlib/library/java-maven.plain +13 -0
  313. package/stdlib/library/python.plain +13 -0
  314. package/stdlib/library/rust.plain +12 -0
  315. package/stdlib/library/typescript.plain +15 -0
@@ -0,0 +1,23 @@
1
+ ---
2
+ import:
3
+ - stdlib/lang/python
4
+ - stdlib/backend/common
5
+ description: A backend in Python 3.12 with FastAPI, Pydantic v2, Uvicorn and structlog.
6
+ ---
7
+
8
+ ***implementation reqs***
9
+
10
+ - :Implementation: uses FastAPI with Pydantic v2 and pydantic-settings, served by Uvicorn.
11
+ - :Implementation: keeps its code in the package `app/`.
12
+ - `app/main.py` builds the application in `create_app(settings)` and exposes `app = create_app(Settings())`.
13
+ - `app/config.py` holds `Settings`, a pydantic-settings class.
14
+ - `app/api/` holds one `APIRouter` per resource, `app/services/` the services, `app/repositories/` the repositories, and `app/errors.py` the domain errors and their handlers.
15
+ - It starts with `uv run uvicorn app.main:app --host 0.0.0.0 --port $PORT`.
16
+ - :Implementation: declares every request and response body as a Pydantic model, and reaches services and settings in a handler through `Depends`.
17
+ - :Implementation: registers one exception handler for the domain errors' base class, one for `RequestValidationError` answering `validation_error` with its `details`, one for Starlette's `HTTPException`, and one for `Exception`.
18
+ - :Implementation: logs as JSON with structlog, set up once in `app/logging.py`, with the standard `logging` module routed through it and Uvicorn's access log off.
19
+ - A middleware binds the request id with `structlog.contextvars` and logs the request line.
20
+ - :UnitTests: use FastAPI's `TestClient` on an application of their own from `create_app(test_settings)`, never the module-level `app`, with its dependencies replaced through that application's `dependency_overrides`.
21
+ - They name it anything but `app`, which is the package: `application = create_app(test_settings)`.
22
+ - :UnitTests: that use a database use SQLite in memory, one database a test, kept on one connection for the whole test - with SQLAlchemy, `poolclass=StaticPool` and `check_same_thread=False` - since every new connection to an in-memory SQLite database opens an empty one of its own.
23
+ - The tables are created on that engine before the first request, and the application under test is given that same engine through `dependency_overrides`.
@@ -0,0 +1,23 @@
1
+ ---
2
+ import:
3
+ - stdlib/lang/python
4
+ - stdlib/backend/common
5
+ description: A backend in Python 3.12 with Flask 3, Pydantic v2, Gunicorn and structlog.
6
+ ---
7
+
8
+ ***implementation reqs***
9
+
10
+ - :Implementation: uses Flask 3, with Pydantic v2 for request and response bodies, served by Gunicorn with 2 workers.
11
+ - :Implementation: keeps its code in the package `app/`.
12
+ - `app/__init__.py` holds the application factory `create_app(settings=None)`, which reads `Settings` from the environment when none is given.
13
+ - `app/config.py` holds `Settings`, a frozen dataclass.
14
+ - `app/api/` holds one Blueprint per resource, `app/services/` the services, `app/repositories/` the repositories, and `app/errors.py` the domain errors and their handlers.
15
+ - It starts with `uv run gunicorn --bind 0.0.0.0:$PORT --workers 2 'app:create_app()'`.
16
+ - :Implementation: validates every request body with a Pydantic model, and answers a `ValidationError` as `validation_error` with its `details`.
17
+ - :Implementation: registers error handlers for the domain errors' base class, for Werkzeug's `HTTPException` - its status, and its name in snake case as the code - and for `Exception`.
18
+ - :Implementation: logs as JSON with structlog, set up once in `app/logging.py`, with the standard `logging` module routed through it.
19
+ - A `before_request` hook binds the request id with `structlog.contextvars`, and an `after_request` hook logs the request line and sends back `X-Request-ID`.
20
+ - :UnitTests: use an application from `create_app` with test settings, and its `test_client()`.
21
+ - They name it anything but `app`, which is the package: `application = create_app(test_settings)`.
22
+ - :UnitTests: that use a database use SQLite in memory, one database a test, kept on one connection for the whole test - with SQLAlchemy, `poolclass=StaticPool` and `check_same_thread=False` - since every new connection to an in-memory SQLite database opens an empty one of its own.
23
+ - The tables are created on that engine before the first request, and the application under test is given that same engine through its settings.
@@ -0,0 +1,17 @@
1
+ ---
2
+ import:
3
+ - stdlib/lang/rust
4
+ - stdlib/backend/common
5
+ description: A backend in Rust with axum 0.8 on tokio, serde, validator and tracing JSON logs.
6
+ ---
7
+
8
+ ***implementation reqs***
9
+
10
+ - :Implementation: uses axum 0.8 on tokio, with serde for JSON and validator for request bodies.
11
+ - :Implementation: keeps its code in one Cargo package: `src/main.rs` starts the server, `src/app.rs` builds the `Router` in `app(state)`, `src/config.rs` reads the environment, `src/routes/` holds one module per resource, `src/service/` the services, `src/store/` the repositories, and `src/error.rs` the error type.
12
+ - It builds with `cargo build --release`.
13
+ - :Implementation: has handlers return `Result<_, AppError>`, where `AppError` is an enum of the domain errors that implements `IntoResponse` and writes the error body.
14
+ - :Implementation: answers a body that does not parse or validate as `validation_error` with its `details`, through an extractor of its own.
15
+ - :Implementation: logs with `tracing-subscriber`'s JSON formatter on standard output, with tower-http's `SetRequestIdLayer`, `PropagateRequestIdLayer` and `TraceLayer` putting the request id on every event and logging the request line.
16
+ - :Implementation: stops through axum's `serve` with `with_graceful_shutdown`, on SIGTERM or Ctrl-C.
17
+ - :UnitTests: call the `Router` with `oneshot` from tower's `ServiceExt`.
@@ -0,0 +1,19 @@
1
+ ---
2
+ import:
3
+ - stdlib/lang/typescript
4
+ - stdlib/backend/common
5
+ description: A backend in TypeScript on Node.js 24 with Express 5, zod and pino.
6
+ ---
7
+
8
+ ***implementation reqs***
9
+
10
+ - :Implementation: runs on Node.js 24, with Express 5, zod for validation, and pino with pino-http for logs.
11
+ - :Implementation: is an ES module package: `"type": "module"` in `package.json`, `module` and `moduleResolution` `NodeNext` in `tsconfig.json`, and every relative import ending in `.js` - `import { x } from "./x.js"` - as Node.js needs to run what `tsc` emits.
12
+ - :Implementation: keeps its code in `src/`.
13
+ - `src/app.ts` builds the application in `createApp(deps)`, and `src/server.ts` starts it and stops it on a signal.
14
+ - `src/config.ts` parses the environment with a zod schema, `src/routes/` holds one `Router` per resource, `src/services/` the services, `src/repositories/` the repositories, and `src/errors.ts` the domain errors.
15
+ - It builds with `npm run build` - `tsc` into `dist/` - and starts with `npm start`, which runs `node dist/server.js`.
16
+ - :Implementation: validates every request body, query and path parameter with a zod schema, and answers a `ZodError` as `validation_error` with its `details`.
17
+ - :Implementation: turns errors into responses in one error-handling middleware, registered last, which every rejected handler reaches.
18
+ - :Implementation: logs through one pino logger from `src/logger.ts`, with pino-http taking the request id from `X-Request-ID` and logging the request line.
19
+ - :UnitTests: use Vitest and supertest against `createApp` with stand-in dependencies, next to the code as `<file>.test.ts`, and run with `npx vitest run`.
@@ -0,0 +1,19 @@
1
+ ---
2
+ import:
3
+ - stdlib/lang/typescript
4
+ - stdlib/backend/common
5
+ description: A backend in TypeScript on Node.js 24 with Fastify 5, TypeBox and its built-in pino logs.
6
+ ---
7
+
8
+ ***implementation reqs***
9
+
10
+ - :Implementation: runs on Node.js 24, with Fastify 5, and TypeBox schemas through `@fastify/type-provider-typebox` for validation.
11
+ - :Implementation: is an ES module package: `"type": "module"` in `package.json`, `module` and `moduleResolution` `NodeNext` in `tsconfig.json`, and every relative import ending in `.js` - `import { x } from "./x.js"` - as Node.js needs to run what `tsc` emits.
12
+ - :Implementation: keeps its code in `src/`.
13
+ - `src/app.ts` builds the application in `buildApp(deps)`, and `src/server.ts` starts it and closes it on a signal.
14
+ - `src/config.ts` reads the environment against a TypeBox schema, `src/routes/` holds one plugin per resource, `src/services/` the services, `src/repositories/` the repositories, and `src/errors.ts` the domain errors.
15
+ - It builds with `npm run build` - `tsc` into `dist/` - and starts with `npm start`, which runs `node dist/server.js`.
16
+ - :Implementation: declares a schema for every route's body, query, params and response.
17
+ - :Implementation: turns errors into responses in one `setErrorHandler`, schema validation failures into `validation_error` with their `details`, and unknown routes in `setNotFoundHandler`.
18
+ - :Implementation: logs with Fastify's own pino logger, with `requestIdHeader` set to `x-request-id`, a UUID v4 from `genReqId` when it is missing, and `requestIdLogLabel` set to `request_id`.
19
+ - :UnitTests: use Vitest and `app.inject()` on `buildApp` with stand-in dependencies, next to the code as `<file>.test.ts`, and run with `npx vitest run`.
@@ -0,0 +1,19 @@
1
+ ---
2
+ import:
3
+ - stdlib/lang/typescript
4
+ - stdlib/backend/common
5
+ description: A backend in TypeScript on Node.js 24 with NestJS 11, class-validator and nestjs-pino.
6
+ ---
7
+
8
+ ***implementation reqs***
9
+
10
+ - :Implementation: runs on Node.js 24, with NestJS 11 on its Express platform.
11
+ - :Implementation: compiles to CommonJS, as the Nest CLI sets a project up - the one stdlib TypeScript stack that is not ES modules - so Nest's decorators and Jest with ts-jest work without further setup.
12
+ - :Implementation: keeps one Nest module per resource in `src/<resource>/`, with its controller, its service, and its repository as a provider.
13
+ - `src/main.ts` starts the application with `enableShutdownHooks()`, and `src/app.module.ts` imports the modules.
14
+ - It builds with `npm run build` - `nest build` into `dist/` - and starts with `npm start`, which runs `node dist/main.js`.
15
+ - :Implementation: reads its configuration with `@nestjs/config`, validated at start by a schema.
16
+ - :Implementation: validates every request body, query and path parameter as a DTO class with class-validator, through a global `ValidationPipe` with `whitelist` and `transform` on, whose failures are `validation_error` with their `details`.
17
+ - :Implementation: turns errors into responses in one global exception filter, for the domain errors, Nest's `HttpException` and anything else.
18
+ - :Implementation: logs with nestjs-pino, with the request id from `X-Request-ID` as `request_id`.
19
+ - :UnitTests: use Jest with ts-jest and `@nestjs/testing`, controllers through supertest, next to the code as `<file>.spec.ts`, and run with `npx jest`.
@@ -0,0 +1,17 @@
1
+ ---
2
+ description: What every stdlib command-line tool shares - arguments in, results out, its errors, exit codes and logs.
3
+ ---
4
+
5
+ ***implementation reqs***
6
+
7
+ - :Implementation: is a command-line tool: it reads its arguments, standard input and environment variables, and writes its results to standard output.
8
+ - :Implementation: takes each setting from its flag, else from the environment variable `<TOOL>_<SETTING>`, else from its default.
9
+ - :Implementation: keeps parsing the command line apart from the work: a command parses its arguments, calls the work, and prints what it returns.
10
+ - :Implementation: reports a failure of the work by raising one of its own errors, which the command layer turns, in one place, into its message and exit code.
11
+ - It writes the message to standard error as one line, `Error: <message>`.
12
+ - It exits 0 on success, 1 on a failure of the work, 2 on a usage error, and 130 when interrupted with Ctrl-C.
13
+ - It shows a stack trace only with `--debug`.
14
+ - :Implementation: logs to standard error only, never standard output: warnings by default, `INFO` with `--verbose`, `DEBUG` with `--debug`.
15
+ - :Implementation: prints its usage with `--help` and its version with `--version`.
16
+ - :UnitTests: call the work directly, and each command through its framework's in-process runner.
17
+ - :UnitTests: replace the network with stand-ins, and use a temporary directory for files.
@@ -0,0 +1,11 @@
1
+ ---
2
+ description: How every stdlib command-line tool's conformance tests run - the built tool as a separate process.
3
+ ---
4
+
5
+ ***test reqs***
6
+
7
+ - :ConformanceTests: run the built tool as a separate process, and check its standard output, standard error and exit code.
8
+ - :ConformanceTests: run each case in a temporary directory of its own, with only the environment variables the case sets.
9
+ - The tool is run by its absolute path in the built code - the built binary, jar or script - never a path relative to the working directory, which is the case's temporary directory.
10
+ - :ConformanceTests: check a failure by its exit code and that its message starts with `Error: `, never by the rest of the message.
11
+ - :ConformanceTests: pass the formatter, the linter and the type checker of their language as the conformance testing script runs them, and are typed throughout where their language allows it.
@@ -0,0 +1,9 @@
1
+ ---
2
+ import:
3
+ - stdlib/cli/conformance/common
4
+ description: Conformance tests for stdlib/cli/go-cobra as a Go module with os/exec.
5
+ ---
6
+
7
+ ***test reqs***
8
+
9
+ - :ConformanceTests: are a Go module of their own, using the `testing` package and `os/exec`, run with `go test ./...`.
@@ -0,0 +1,9 @@
1
+ ---
2
+ import:
3
+ - stdlib/cli/conformance/common
4
+ description: Conformance tests for stdlib/cli/go-flag as a Go module with os/exec.
5
+ ---
6
+
7
+ ***test reqs***
8
+
9
+ - :ConformanceTests: are a Go module of their own, using the `testing` package and `os/exec`, run with `go test ./...`.
@@ -0,0 +1,9 @@
1
+ ---
2
+ import:
3
+ - stdlib/cli/conformance/common
4
+ description: Conformance tests for stdlib/cli/java-picocli as a Maven project running the jar.
5
+ ---
6
+
7
+ ***test reqs***
8
+
9
+ - :ConformanceTests: are a Maven project of their own, using JUnit 5 and `ProcessBuilder` to run the built jar, run with `mvn test`.
@@ -0,0 +1,9 @@
1
+ ---
2
+ import:
3
+ - stdlib/cli/conformance/common
4
+ description: Conformance tests for stdlib/cli/python-argparse in pytest with subprocess.
5
+ ---
6
+
7
+ ***test reqs***
8
+
9
+ - :ConformanceTests: use pytest and `subprocess`, run the tool as `uv run --project <the built code> <tool>` - `--project`, because the working directory is the case's temporary directory - and run with `pytest`.
@@ -0,0 +1,9 @@
1
+ ---
2
+ import:
3
+ - stdlib/cli/conformance/common
4
+ description: Conformance tests for stdlib/cli/python-click in pytest with subprocess.
5
+ ---
6
+
7
+ ***test reqs***
8
+
9
+ - :ConformanceTests: use pytest and `subprocess`, run the tool as `uv run --project <the built code> <tool>` - `--project`, because the working directory is the case's temporary directory - and run with `pytest`.
@@ -0,0 +1,9 @@
1
+ ---
2
+ import:
3
+ - stdlib/cli/conformance/common
4
+ description: Conformance tests for stdlib/cli/python-typer in pytest with subprocess.
5
+ ---
6
+
7
+ ***test reqs***
8
+
9
+ - :ConformanceTests: use pytest and `subprocess`, run the tool as `uv run --project <the built code> <tool>` - `--project`, because the working directory is the case's temporary directory - and run with `pytest`.
@@ -0,0 +1,9 @@
1
+ ---
2
+ import:
3
+ - stdlib/cli/conformance/common
4
+ description: Conformance tests for stdlib/cli/rust-clap as a Cargo package with assert_cmd.
5
+ ---
6
+
7
+ ***test reqs***
8
+
9
+ - :ConformanceTests: are a Cargo package of their own, using `assert_cmd` and `predicates`, run with `cargo test`.
@@ -0,0 +1,9 @@
1
+ ---
2
+ import:
3
+ - stdlib/cli/conformance/common
4
+ description: Conformance tests for stdlib/cli/typescript-commander in Vitest with child_process.
5
+ ---
6
+
7
+ ***test reqs***
8
+
9
+ - :ConformanceTests: use Vitest and `node:child_process`, run the tool as `node dist/cli.js`, and run with `npx vitest run`.
@@ -0,0 +1,14 @@
1
+ ---
2
+ import:
3
+ - stdlib/lang/go
4
+ - stdlib/cli/common
5
+ description: A command-line tool in Go 1.25 with Cobra.
6
+ ---
7
+
8
+ ***implementation reqs***
9
+
10
+ - :Implementation: uses Cobra, with `main` in `cmd/<tool>/`, one file per command in `internal/cli/`, the work in packages under `internal/`, and the tool's errors under `internal/errs`.
11
+ - Every command uses `RunE`, and the root command sets `SilenceUsage` and `SilenceErrors`, so `main` alone writes the error and chooses the exit code.
12
+ - It builds with `go build -o bin/<tool> ./cmd/<tool>`.
13
+ - :Implementation: logs with a `slog.TextHandler` on standard error, at the level `--verbose` or `--debug` gives.
14
+ - :UnitTests: run commands through the root command with `SetArgs`, `SetOut` and `SetErr`.
@@ -0,0 +1,14 @@
1
+ ---
2
+ import:
3
+ - stdlib/lang/go
4
+ - stdlib/cli/common
5
+ description: A command-line tool in Go 1.25 with the standard library's flag package and no dependencies.
6
+ ---
7
+
8
+ ***implementation reqs***
9
+
10
+ - :Implementation: uses the standard library only: `flag`, with one `flag.FlagSet` per command, and no third-party dependency.
11
+ - :Implementation: keeps `main` in `cmd/<tool>/`, which calls `run(args, stdout, stderr) int` and exits with what it returns, the commands in `internal/cli/`, the work in packages under `internal/`, and the tool's errors under `internal/errs`.
12
+ - It builds with `go build -o bin/<tool> ./cmd/<tool>`.
13
+ - :Implementation: logs with a `slog.TextHandler` on standard error, at the level `--verbose` or `--debug` gives.
14
+ - :UnitTests: call `run` with arguments and buffers for its output.
@@ -0,0 +1,15 @@
1
+ ---
2
+ import:
3
+ - stdlib/lang/java
4
+ - stdlib/cli/common
5
+ description: A command-line tool in Java 21 with picocli 4 and Maven.
6
+ ---
7
+
8
+ ***implementation reqs***
9
+
10
+ - :Implementation: uses picocli 4, built with Maven through the Maven wrapper into one executable jar with its dependencies, run with `java -jar target/<tool>.jar`.
11
+ - The jar is made by maven-shade-plugin, with a `ManifestResourceTransformer` naming the main class, and `<finalName><tool></finalName>`, so it is `target/<tool>.jar` and runs on its own.
12
+ - :Implementation: keeps the main class with the top command in the base package, one `@Command` class per subcommand in `cli`, the work in `core`, and the tool's exceptions in `error`.
13
+ - An `IExecutionExceptionHandler` turns the tool's exceptions into the message and exit code, and an `IParameterExceptionHandler` usage errors.
14
+ - :Implementation: logs through SLF4J with slf4j-simple on standard error, at the level `--verbose` or `--debug` gives.
15
+ - :UnitTests: run commands through `CommandLine.execute` with captured output, run with `./mvnw test`.
@@ -0,0 +1,18 @@
1
+ ---
2
+ import:
3
+ - stdlib/lang/python
4
+ - stdlib/cli/common
5
+ description: A command-line tool in Python 3.12 with the standard library's argparse and no dependencies.
6
+ ---
7
+
8
+ ***implementation reqs***
9
+
10
+ - :Implementation: uses the standard library only: `argparse`, with one subparser per command, and no third-party dependency at run time.
11
+ - :Implementation: keeps its code in the package `app/`.
12
+ - `app/cli.py` holds `main(argv=None) -> int`, which builds the parser, runs the command, and turns a `ToolError` into its message and exit code.
13
+ - One module per command in `app/commands/`, each with `add_parser(subparsers)` and `run(args) -> int`.
14
+ - The work lives in `app/core/`, and the tool's errors in `app/errors.py`, under one base class `ToolError`.
15
+ - `[project.scripts]` names the tool, `<tool> = "app.cli:main"`.
16
+ - `pyproject.toml` declares a build system - hatchling, with `[tool.hatch.build.targets.wheel]` `packages = ["app"]` - so `uv sync` installs the package and the `<tool>` command: without one, uv installs no `[project.scripts]` at all.
17
+ - :Implementation: sets up the standard `logging` module to write to standard error with the level `--verbose` or `--debug` gives.
18
+ - :UnitTests: call `main` with a list of arguments, and read what it printed with `capsys`.
@@ -0,0 +1,16 @@
1
+ ---
2
+ import:
3
+ - stdlib/lang/python
4
+ - stdlib/cli/common
5
+ description: A command-line tool in Python 3.12 with Click 8.
6
+ ---
7
+
8
+ ***implementation reqs***
9
+
10
+ - :Implementation: uses Click 8, in the package `app/`.
11
+ - `app/cli.py` holds the `@click.group()` with `--verbose`, `--debug` and `--version`, which sets up logging, and one module per command in `app/commands/`.
12
+ - The work lives in `app/core/`, and the tool's errors in `app/errors.py`, under one base class `ToolError`, a subclass of `click.ClickException` whose `exit_code` is 1.
13
+ - `[project.scripts]` names the tool, `<tool> = "app.cli:cli"`.
14
+ - `pyproject.toml` declares a build system - hatchling, with `[tool.hatch.build.targets.wheel]` `packages = ["app"]` - so `uv sync` installs the package and the `<tool>` command: without one, uv installs no `[project.scripts]` at all.
15
+ - :Implementation: sets up the standard `logging` module to write to standard error with the level `--verbose` or `--debug` gives.
16
+ - :UnitTests: run commands with Click's `CliRunner`.
@@ -0,0 +1,16 @@
1
+ ---
2
+ import:
3
+ - stdlib/lang/python
4
+ - stdlib/cli/common
5
+ description: A command-line tool in Python 3.12 with Typer.
6
+ ---
7
+
8
+ ***implementation reqs***
9
+
10
+ - :Implementation: uses Typer, with its pretty exceptions off, in the package `app/`.
11
+ - `app/cli.py` holds the Typer app, with a callback for `--verbose`, `--debug` and `--version` that sets up logging, and one module per command in `app/commands/`.
12
+ - The work lives in `app/core/`, and the tool's errors in `app/errors.py`, under one base class `ToolError`.
13
+ - `[project.scripts]` names the tool, `<tool> = "app.cli:main"`, where `main()` runs the Typer app and turns a `ToolError` into its message and exit code.
14
+ - `pyproject.toml` declares a build system - hatchling, with `[tool.hatch.build.targets.wheel]` `packages = ["app"]` - so `uv sync` installs the package and the `<tool>` command: without one, uv installs no `[project.scripts]` at all.
15
+ - :Implementation: sets up the standard `logging` module to write to standard error with the level `--verbose` or `--debug` gives.
16
+ - :UnitTests: run commands with Typer's `CliRunner`.
@@ -0,0 +1,14 @@
1
+ ---
2
+ import:
3
+ - stdlib/lang/rust
4
+ - stdlib/cli/common
5
+ description: A command-line tool in Rust with clap 4.
6
+ ---
7
+
8
+ ***implementation reqs***
9
+
10
+ - :Implementation: uses clap 4's derive API, as one Cargo package: `src/main.rs` parses the arguments and runs the command, one module per command in `src/commands/`, the work in `src/lib.rs` and its modules, and the tool's error type in `src/error.rs`.
11
+ - `main` returns an `ExitCode`, writing the error and choosing the code itself.
12
+ - It builds with `cargo build --release`.
13
+ - :Implementation: logs with `tracing-subscriber` on standard error, at the level `--verbose` or `--debug` gives.
14
+ - :UnitTests: call the work directly, and parse arguments with `Cli::try_parse_from`.
@@ -0,0 +1,17 @@
1
+ ---
2
+ import:
3
+ - stdlib/lang/typescript
4
+ - stdlib/cli/common
5
+ description: A command-line tool in TypeScript on Node.js 24 with Commander.
6
+ ---
7
+
8
+ ***implementation reqs***
9
+
10
+ - :Implementation: runs on Node.js 24, with Commander.
11
+ - :Implementation: is an ES module package: `"type": "module"` in `package.json`, `module` and `moduleResolution` `NodeNext` in `tsconfig.json`, and every relative import ending in `.js` - `import { x } from "./x.js"` - as Node.js needs to run what `tsc` emits.
12
+ - :Implementation: keeps its code in `src/`: `src/cli.ts` builds the program with `exitOverride()` and runs it, one module per command in `src/commands/`, the work in `src/core/`, and the tool's errors in `src/errors.ts` under one base class `ToolError`.
13
+ - `bin` in `package.json` names the tool, pointing at `dist/cli.js`.
14
+ - It builds with `npm run build` - `tsc` into `dist/` - and runs with `node dist/cli.js`.
15
+ - :Implementation: turns a `ToolError` or a Commander error into its message and exit code in `src/cli.ts`, around `program.parseAsync`.
16
+ - :Implementation: logs through a small logger in `src/logger.ts` that writes to standard error, with the level `--verbose` or `--debug` gives.
17
+ - :UnitTests: use Vitest, running commands through `program.parseAsync` with `exitOverride()` and captured output, next to the code as `<file>.test.ts`, and run with `npx vitest run`.
@@ -0,0 +1,17 @@
1
+ ---
2
+ import:
3
+ - stdlib/lang/typescript
4
+ - stdlib/frontend/common
5
+ description: A frontend in Angular 20 and TypeScript with standalone components, signals and HttpClient.
6
+ ---
7
+
8
+ ***implementation reqs***
9
+
10
+ - :Implementation: uses Angular 20 with standalone components, signals for state, and the Angular CLI, building into `dist/`, with `npm run preview` serving the build.
11
+ - :Implementation: takes the backend's base URL from `src/environments/environment.ts`, set at build time.
12
+ - :Implementation: keeps pages in `src/app/pages/`, shared components in `src/app/components/`, services in `src/app/services/`, the API layer in `src/app/api/`, and the logger in `src/app/logger.ts`.
13
+ - :Implementation: makes backend calls with `HttpClient`, with one interceptor that turns an error into an `ApiError`.
14
+ - :Implementation: routes with the Angular Router, one lazy-loaded route per page in `src/app/app.routes.ts`.
15
+ - :Implementation: catches any other failure in its own `ErrorHandler`, and shows the page that says something went wrong.
16
+ - :Implementation: styles each component in its own stylesheet.
17
+ - :UnitTests: use `TestBed` and `HttpTestingController`, with Vitest through the Angular CLI's unit-test builder, next to the code as `<file>.spec.ts`, and run with `npx ng test --watch=false`.
@@ -0,0 +1,17 @@
1
+ ---
2
+ description: What every stdlib frontend shares - a single-page app, its API layer, errors, logs and test ids.
3
+ ---
4
+
5
+ ***implementation reqs***
6
+
7
+ - :Implementation: is a single-page web app, built by `npm run build` into `dist/`, whose build `npm run preview -- --port $PORT` serves.
8
+ - :Implementation: calls its backend at the base URL it is built with, `/api` when none is given.
9
+ - :Implementation: makes every backend call through its API layer: one typed function per call, and no call to `fetch` anywhere else.
10
+ - A response that is not 2xx becomes an `ApiError` with its `status`, and the `code` and `message` of the backend's error body `{"error": {"code", "message"}}`.
11
+ - A request that gets no response becomes an `ApiError` with the code `network_error`.
12
+ - :Implementation: shows an `ApiError` from a page's own calls on that page, in place of what failed, with its message.
13
+ - :Implementation: catches any other failure at the root of the app, and shows a page saying something went wrong, with a button that reloads it.
14
+ - :Implementation: logs through its own logger module only, with `debug`, `info`, `warn` and `error`, which writes to the browser console, `debug` only in a development build; no `console` call is anywhere else.
15
+ - :Implementation: gives every element a person acts on an accessible role and name, or a `data-testid` when it has none.
16
+ - :UnitTests: use Vitest with jsdom, next to the code as `<file>.test.ts` or `<file>.test.tsx`, and run with `npx vitest run`.
17
+ - :UnitTests: replace the API layer with a stand-in, never the network.
@@ -0,0 +1,5 @@
1
+ ---
2
+ import:
3
+ - stdlib/frontend/conformance/common
4
+ description: Conformance tests for stdlib/frontend/angular in Playwright, as for every stdlib frontend.
5
+ ---
@@ -0,0 +1,11 @@
1
+ ---
2
+ description: How every stdlib frontend's conformance tests run - in Chromium through Playwright, against the served build, with the backend stood in.
3
+ ---
4
+
5
+ ***test reqs***
6
+
7
+ - :ConformanceTests: use Playwright with Chromium, and run with `npx playwright test`.
8
+ - :ConformanceTests: build the app, serve the build on a free port given in `PORT`, and drive it through the browser only.
9
+ - :ConformanceTests: answer every backend call with Playwright's `page.route`, never a real backend, and answer an error with the body `{"error": {"code", "message"}}`.
10
+ - :ConformanceTests: find elements by role, label or text, else by `data-testid`, and never by a CSS class.
11
+ - :ConformanceTests: pass the formatter, the linter and the type checker of their language as the conformance testing script runs them, and are typed throughout where their language allows it.
@@ -0,0 +1,5 @@
1
+ ---
2
+ import:
3
+ - stdlib/frontend/conformance/common
4
+ description: Conformance tests for stdlib/frontend/react-vite in Playwright, as for every stdlib frontend.
5
+ ---
@@ -0,0 +1,5 @@
1
+ ---
2
+ import:
3
+ - stdlib/frontend/conformance/common
4
+ description: Conformance tests for stdlib/frontend/sveltekit-spa in Playwright, as for every stdlib frontend.
5
+ ---
@@ -0,0 +1,5 @@
1
+ ---
2
+ import:
3
+ - stdlib/frontend/conformance/common
4
+ description: Conformance tests for stdlib/frontend/vue-vite in Playwright, as for every stdlib frontend.
5
+ ---
@@ -0,0 +1,16 @@
1
+ ---
2
+ import:
3
+ - stdlib/lang/typescript
4
+ - stdlib/frontend/common
5
+ description: A frontend in React 19 and TypeScript with Vite, React Router, TanStack Query and react-hook-form.
6
+ ---
7
+
8
+ ***implementation reqs***
9
+
10
+ - :Implementation: uses React 19 with function components and hooks only, built with Vite, and takes the backend's base URL from `VITE_API_URL`.
11
+ - :Implementation: routes with React Router 7, with one route per page in `src/routes.tsx`, and the root route's `errorElement` as the page that catches any other failure.
12
+ - :Implementation: keeps pages in `src/pages/`, shared components in `src/components/`, one component per `.tsx` file, hooks in `src/hooks/`, the API layer in `src/api/`, and the logger in `src/lib/logger.ts`.
13
+ - :Implementation: loads and changes backend data with TanStack Query, one hook per call in `src/hooks/`, and holds no copy of it in component state.
14
+ - :Implementation: builds forms with react-hook-form and a zod schema per form, showing each field's error beside it.
15
+ - :Implementation: styles components with CSS Modules, one `<Component>.module.css` beside each component.
16
+ - :UnitTests: render components with React Testing Library, drive them with `@testing-library/user-event`, and wrap them in a fresh `QueryClient` per test.
@@ -0,0 +1,16 @@
1
+ ---
2
+ import:
3
+ - stdlib/lang/typescript
4
+ - stdlib/frontend/common
5
+ description: A frontend in Svelte 5 and TypeScript with SvelteKit as a single-page app on adapter-static.
6
+ ---
7
+
8
+ ***implementation reqs***
9
+
10
+ - :Implementation: uses Svelte 5 with runes, in SvelteKit with `adapter-static` writing to `dist/` with the fallback `index.html`, and `ssr` off in the root layout, and takes the backend's base URL from `PUBLIC_API_URL`.
11
+ - :Implementation: keeps pages in `src/routes/`, shared components in `src/lib/components/`, the API layer in `src/lib/api/`, and the logger in `src/lib/logger.ts`.
12
+ - :Implementation: loads a page's data in its `+page.ts` `load` function, and holds state that several pages share in `.svelte.ts` modules with `$state`.
13
+ - :Implementation: shows the page that says something went wrong from `src/routes/+error.svelte`, and catches any other failure in `handleError` in `src/hooks.client.ts`.
14
+ - :Implementation: styles components in their own `<style>` block.
15
+ - :UnitTests: render components with `@testing-library/svelte`.
16
+ - Vitest's config sets `resolve.conditions` to `["browser"]` for the tests, so Svelte 5 mounts components as in the browser rather than as on a server.
@@ -0,0 +1,16 @@
1
+ ---
2
+ import:
3
+ - stdlib/lang/typescript
4
+ - stdlib/frontend/common
5
+ description: A frontend in Vue 3 and TypeScript with Vite, Vue Router and Pinia.
6
+ ---
7
+
8
+ ***implementation reqs***
9
+
10
+ - :Implementation: uses Vue 3 with single-file components and `<script setup lang="ts">`, built with Vite, and takes the backend's base URL from `VITE_API_URL`.
11
+ - :Implementation: routes with Vue Router 4, one route per page in `src/router.ts`.
12
+ - :Implementation: keeps pages in `src/views/`, shared components in `src/components/`, composables in `src/composables/`, stores in `src/stores/`, the API layer in `src/api/`, and the logger in `src/lib/logger.ts`.
13
+ - :Implementation: holds state that several pages share in Pinia setup stores, and loads a page's own data in a composable that returns its data, its loading flag and its error.
14
+ - :Implementation: catches any other failure in `app.config.errorHandler` and the router's `onError`, and shows the page that says something went wrong.
15
+ - :Implementation: styles components in their own `<style scoped>` block.
16
+ - :UnitTests: mount components with Vue Test Utils, with a fresh Pinia per test from `createTestingPinia`.
@@ -0,0 +1,13 @@
1
+ ---
2
+ description: Go 1.25 with slog and go test - what every stdlib Go stack shares.
3
+ ---
4
+
5
+ ***implementation reqs***
6
+
7
+ - :Implementation: is written in Go 1.25, as one Go module with `go.mod` and `go.sum` committed.
8
+ - :Implementation: returns an error as the last result for every failure, and never panics on one it can expect.
9
+ - It wraps an error with `fmt.Errorf("<what failed>: %w", err)`.
10
+ - It declares the errors a caller checks as sentinel values or error types, which callers compare with `errors.Is` and `errors.As`.
11
+ - :Implementation: logs with `log/slog`, and never with `fmt.Print` or the `log` package.
12
+ - :Implementation: is formatted with gofmt and passes `go vet`.
13
+ - :UnitTests: use the `testing` package, table-driven where a function has several cases, next to the code as `<file>_test.go`, and run with `go test ./...`.
@@ -0,0 +1,12 @@
1
+ ---
2
+ description: Java 21 with SLF4J, JUnit 5 and AssertJ - what every stdlib Java stack shares.
3
+ ---
4
+
5
+ ***implementation reqs***
6
+
7
+ - :Implementation: is written in Java 21, with records for data carriers and `Optional` only as a return type.
8
+ - :Implementation: reports a failure by throwing an unchecked exception of its own, all of them subclasses of one base exception.
9
+ - It catches `Exception` only at its outermost boundary, and wraps a caught exception with it as the cause.
10
+ - :Implementation: logs through SLF4J, with one `private static final Logger` per class, and never with `System.out` or `System.err`.
11
+ - :Implementation: uses constructor injection only, with every field it can make `final` made so.
12
+ - :UnitTests: use JUnit 5 and AssertJ, with Mockito for stand-ins, in `src/test/java` mirroring the main packages, named `<Class>Test`.
@@ -0,0 +1,18 @@
1
+ ---
2
+ description: Python 3.12 with uv, ruff and pytest - what every stdlib Python stack shares.
3
+ ---
4
+
5
+ ***implementation reqs***
6
+
7
+ - :Implementation: is written in Python 3.12, with type hints on every function signature.
8
+ - :Implementation: manages dependencies with uv in `pyproject.toml`, with `uv.lock` committed, and keeps development dependencies in the `dev` dependency group.
9
+ - :Implementation: is formatted and linted with ruff, configured in `pyproject.toml` with a line length of 100.
10
+ - :Implementation: is type checked with mypy, configured in `pyproject.toml` under `[tool.mypy]` with `disallow_untyped_defs = true` and `files` naming the package and its tests.
11
+ - A library that ships no type information gets its stubs package (`types-...`) in the `dev` group; only one with none is listed under `ignore_missing_imports`, by its module.
12
+ - :Implementation: keeps ruff and mypy in the `dev` dependency group.
13
+ - :Implementation: reports a failure by raising an exception, never by returning `None` or an error code.
14
+ - It catches an exception only where it handles it, or to raise one of its own with `raise ... from`, keeping the cause.
15
+ - :Implementation: logs through the standard `logging` module, with one logger per module from `logging.getLogger(__name__)`, and never with `print`.
16
+ - :UnitTests: use pytest, in `tests/` mirroring the package layout, named `test_<module>.py`, and run with `uv run pytest`.
17
+ - `pyproject.toml` sets `[tool.pytest.ini_options]` with `testpaths = ["tests"]` and `pythonpath` naming the folder the package is in - `["."]` for a package at the project root, `["src"]` for one under `src/` - so `uv run pytest` imports it whether or not uv installs the project: without a build system it never does.
18
+ - :UnitTests: use fixtures and `monkeypatch` for stand-ins, and `tmp_path` for files.
@@ -0,0 +1,12 @@
1
+ ---
2
+ description: Stable Rust with Cargo, thiserror and tracing - what every stdlib Rust stack shares.
3
+ ---
4
+
5
+ ***implementation reqs***
6
+
7
+ - :Implementation: is written in stable Rust, edition 2021, as Cargo packages.
8
+ - :Implementation: returns a `Result` for every failure, with error types of its own defined with `thiserror`.
9
+ - It never calls `unwrap` or `expect` outside tests.
10
+ - :Implementation: logs with the `tracing` crate.
11
+ - :Implementation: is formatted with rustfmt and passes `cargo clippy` with no warnings.
12
+ - :UnitTests: are `#[cfg(test)] mod tests` modules next to the code, run with `cargo test`.
@@ -0,0 +1,13 @@
1
+ ---
2
+ description: TypeScript 5 in strict mode with npm - what every stdlib TypeScript stack shares.
3
+ ---
4
+
5
+ ***implementation reqs***
6
+
7
+ - :Implementation: is written in TypeScript 5 with `strict` and `noUncheckedIndexedAccess` on, as ES modules.
8
+ - :Implementation: manages dependencies with npm, with `package-lock.json` committed.
9
+ - :Implementation: is formatted with Prettier and linted with ESLint's recommended TypeScript rules.
10
+ - :Implementation: type checks with no errors under `tsc --noEmit` - `vue-tsc --noEmit` where it has Vue components, `tsc --build` where its `tsconfig.json` is made of project references.
11
+ - :Implementation: keeps `typescript`, `prettier`, `eslint` and `typescript-eslint` in `devDependencies`, and `package.json` has the scripts `typecheck`, `lint` and `format` that run them.
12
+ - :Implementation: never uses `any`: data from outside - a request, a response, a file, the environment - is `unknown` until it is validated.
13
+ - :Implementation: reports a failure by throwing an `Error` subclass of its own, with `cause` set when it wraps another error, and never throws a string or a plain object.