@oyolincc/create 0.0.0-dev-20260513130832 → 0.0.0-dev-20260922064135

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 (418) hide show
  1. package/dist/index.d.mts +2 -2
  2. package/dist/index.mjs +2 -2
  3. package/dist/index.mjs.map +1 -1
  4. package/package.json +31 -16
  5. package/templates/hono-fullstack/.agents/skills/ask-matt/PHASE-BOUNDARIES.md +55 -0
  6. package/templates/hono-fullstack/.agents/skills/ask-matt/SKILL.md +90 -0
  7. package/templates/hono-fullstack/.agents/skills/ask-matt/agents/openai.yaml +5 -0
  8. package/templates/hono-fullstack/.agents/skills/code-review/SKILL.md +87 -0
  9. package/templates/hono-fullstack/.agents/skills/code-review/agents/openai.yaml +3 -0
  10. package/templates/hono-fullstack/.agents/skills/codebase-design/DEEPENING.md +37 -0
  11. package/templates/hono-fullstack/.agents/skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
  12. package/templates/hono-fullstack/.agents/skills/codebase-design/SKILL.md +114 -0
  13. package/templates/hono-fullstack/.agents/skills/codebase-design/agents/openai.yaml +3 -0
  14. package/templates/hono-fullstack/.agents/skills/confirm-requirements/SKILL.md +25 -0
  15. package/templates/hono-fullstack/.agents/skills/diagnosing-bugs/SKILL.md +140 -0
  16. package/templates/hono-fullstack/.agents/skills/diagnosing-bugs/agents/openai.yaml +3 -0
  17. package/templates/hono-fullstack/.agents/skills/diagnosing-bugs/scripts/hitl-loop.template.sh +44 -0
  18. package/templates/hono-fullstack/.agents/skills/domain-modeling/ADR-FORMAT.md +47 -0
  19. package/templates/hono-fullstack/.agents/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
  20. package/templates/hono-fullstack/.agents/skills/domain-modeling/SKILL.md +74 -0
  21. package/templates/hono-fullstack/.agents/skills/domain-modeling/agents/openai.yaml +3 -0
  22. package/templates/hono-fullstack/.agents/skills/grill-me/SKILL.md +7 -0
  23. package/templates/hono-fullstack/.agents/skills/grill-me/agents/openai.yaml +5 -0
  24. package/templates/hono-fullstack/.agents/skills/grilling/SKILL.md +22 -0
  25. package/templates/hono-fullstack/.agents/skills/grilling/agents/openai.yaml +3 -0
  26. package/templates/hono-fullstack/.agents/skills/implement/SKILL.md +15 -0
  27. package/templates/hono-fullstack/.agents/skills/implement/agents/openai.yaml +5 -0
  28. package/templates/hono-fullstack/.agents/skills/improve-codebase-architecture/HTML-REPORT.md +123 -0
  29. package/templates/hono-fullstack/.agents/skills/improve-codebase-architecture/SKILL.md +71 -0
  30. package/templates/hono-fullstack/.agents/skills/improve-codebase-architecture/agents/openai.yaml +5 -0
  31. package/templates/hono-fullstack/.agents/skills/prototype/LOGIC.md +67 -0
  32. package/templates/hono-fullstack/.agents/skills/prototype/SKILL.md +26 -0
  33. package/templates/hono-fullstack/.agents/skills/prototype/UI.md +112 -0
  34. package/templates/hono-fullstack/.agents/skills/prototype/agents/openai.yaml +3 -0
  35. package/templates/hono-fullstack/.agents/skills/research/SKILL.md +12 -0
  36. package/templates/hono-fullstack/.agents/skills/research/agents/openai.yaml +3 -0
  37. package/templates/hono-fullstack/.agents/skills/resolving-merge-conflicts/SKILL.md +14 -0
  38. package/templates/hono-fullstack/.agents/skills/resolving-merge-conflicts/agents/openai.yaml +3 -0
  39. package/templates/hono-fullstack/.agents/skills/scoped-code-review/SKILL.md +113 -0
  40. package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/SKILL.md +116 -0
  41. package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/agents/openai.yaml +5 -0
  42. package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/domain.md +51 -0
  43. package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/issue-tracker-github.md +45 -0
  44. package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +46 -0
  45. package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/issue-tracker-local.md +30 -0
  46. package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/triage-labels.md +15 -0
  47. package/templates/hono-fullstack/.agents/skills/tdd/SKILL.md +38 -0
  48. package/templates/hono-fullstack/.agents/skills/tdd/agents/openai.yaml +3 -0
  49. package/templates/hono-fullstack/.agents/skills/tdd/mocking.md +59 -0
  50. package/templates/hono-fullstack/.agents/skills/tdd/tests.md +77 -0
  51. package/templates/hono-fullstack/.agents/skills/teach/GLOSSARY-FORMAT.md +35 -0
  52. package/templates/hono-fullstack/.agents/skills/teach/LEARNING-RECORD-FORMAT.md +46 -0
  53. package/templates/hono-fullstack/.agents/skills/teach/MISSION-FORMAT.md +31 -0
  54. package/templates/hono-fullstack/.agents/skills/teach/RESOURCES-FORMAT.md +32 -0
  55. package/templates/hono-fullstack/.agents/skills/teach/SKILL.md +140 -0
  56. package/templates/hono-fullstack/.agents/skills/teach/agents/openai.yaml +5 -0
  57. package/templates/hono-fullstack/.agents/skills/to-questionnaire/SKILL.md +53 -0
  58. package/templates/hono-fullstack/.agents/skills/to-questionnaire/agents/openai.yaml +5 -0
  59. package/templates/hono-fullstack/.agents/skills/triage/AGENT-BRIEF.md +207 -0
  60. package/templates/hono-fullstack/.agents/skills/triage/OUT-OF-SCOPE.md +105 -0
  61. package/templates/hono-fullstack/.agents/skills/triage/SKILL.md +112 -0
  62. package/templates/hono-fullstack/.agents/skills/triage/agents/openai.yaml +5 -0
  63. package/templates/hono-fullstack/.agents/skills/wait-what/SKILL.md +7 -0
  64. package/templates/hono-fullstack/.agents/skills/wait-what/agents/openai.yaml +5 -0
  65. package/templates/hono-fullstack/.agents/skills/wayfinder/SKILL.md +128 -0
  66. package/templates/hono-fullstack/.agents/skills/wayfinder/agents/openai.yaml +5 -0
  67. package/templates/hono-fullstack/.agents/skills/wizard/SKILL.md +44 -0
  68. package/templates/hono-fullstack/.agents/skills/wizard/agents/openai.yaml +3 -0
  69. package/templates/hono-fullstack/.agents/skills/wizard/template.sh +204 -0
  70. package/templates/hono-fullstack/.agents/skills/writing-for-agents/SKILL-MECHANICS.md +22 -0
  71. package/templates/hono-fullstack/.agents/skills/writing-for-agents/SKILL.md +81 -0
  72. package/templates/hono-fullstack/.agents/skills/writing-for-agents/agents/openai.yaml +3 -0
  73. package/templates/hono-fullstack/.changeset/README.md +8 -0
  74. package/templates/hono-fullstack/.changeset/config.json +11 -0
  75. package/templates/hono-fullstack/.vscode/extensions.json +5 -0
  76. package/templates/hono-fullstack/.vscode/launch.json +25 -0
  77. package/templates/hono-fullstack/.vscode/settings.json +24 -0
  78. package/templates/hono-fullstack/AGENTS.md +43 -0
  79. package/templates/hono-fullstack/README.md +37 -0
  80. package/templates/hono-fullstack/_gitignore +30 -0
  81. package/templates/hono-fullstack/apps/server/package.json +55 -0
  82. package/templates/hono-fullstack/apps/server/src/adapters/nodejs/bootstrap.ts +64 -0
  83. package/templates/hono-fullstack/apps/server/src/adapters/nodejs/config.ts +53 -0
  84. package/templates/hono-fullstack/apps/server/src/adapters/nodejs/entry.ts +50 -0
  85. package/templates/hono-fullstack/apps/server/src/app.ts +43 -0
  86. package/templates/hono-fullstack/apps/server/src/infra/logger/getter.ts +74 -0
  87. package/templates/hono-fullstack/apps/server/src/infra/logger/pino.ts +122 -0
  88. package/templates/hono-fullstack/apps/server/src/infra/work-runner/constants.ts +23 -0
  89. package/templates/hono-fullstack/apps/server/src/infra/work-runner/errors.ts +40 -0
  90. package/templates/hono-fullstack/apps/server/src/infra/work-runner/example/runner.test.ts +56 -0
  91. package/templates/hono-fullstack/apps/server/src/infra/work-runner/example/runner.ts +185 -0
  92. package/templates/hono-fullstack/apps/server/src/infra/work-runner/example/worker-entry.ts +34 -0
  93. package/templates/hono-fullstack/apps/server/src/infra/work-runner/types.ts +113 -0
  94. package/templates/hono-fullstack/apps/server/src/infra/work-runner/utils/business-error.ts +19 -0
  95. package/templates/hono-fullstack/apps/server/src/infra/work-runner/utils/message.ts +46 -0
  96. package/templates/hono-fullstack/apps/server/src/infra/work-runner/utils/transfer.ts +144 -0
  97. package/templates/hono-fullstack/apps/server/src/middlewares/cors.ts +26 -0
  98. package/templates/hono-fullstack/apps/server/src/modules/example/contracts.ts +9 -0
  99. package/templates/hono-fullstack/apps/server/src/modules/example/routes.ts +75 -0
  100. package/templates/hono-fullstack/apps/server/src/modules/example/work-task/tasks.test.ts +37 -0
  101. package/templates/hono-fullstack/apps/server/src/modules/example/work-task/tasks.ts +35 -0
  102. package/templates/hono-fullstack/apps/server/src/shared/app/types.ts +45 -0
  103. package/templates/hono-fullstack/apps/server/src/shared/errors/constants.ts +152 -0
  104. package/templates/hono-fullstack/apps/server/src/shared/errors/defs/index.ts +15 -0
  105. package/templates/hono-fullstack/apps/server/src/shared/errors/handler.ts +16 -0
  106. package/templates/hono-fullstack/apps/server/src/shared/errors/log.ts +67 -0
  107. package/templates/hono-fullstack/apps/server/src/shared/errors/proto.ts +42 -0
  108. package/templates/hono-fullstack/apps/server/src/shared/errors/types.ts +29 -0
  109. package/templates/hono-fullstack/apps/server/src/shared/network/fetcher.ts +35 -0
  110. package/templates/hono-fullstack/apps/server/src/shared/network/openapi/index.ts +50 -0
  111. package/templates/hono-fullstack/apps/server/src/shared/network/openapi/res-defs.ts +39 -0
  112. package/templates/hono-fullstack/apps/server/src/shared/network/types.ts +3 -0
  113. package/templates/hono-fullstack/apps/server/src/shared/network/utils.ts +36 -0
  114. package/templates/hono-fullstack/apps/server/src/shared/network/validator.ts +28 -0
  115. package/templates/hono-fullstack/apps/server/src/shared/utils/index.ts +30 -0
  116. package/templates/hono-fullstack/apps/server/src/virtual-modules.d.ts +5 -0
  117. package/templates/hono-fullstack/apps/server/tsconfig.json +16 -0
  118. package/templates/hono-fullstack/apps/server/vite.config.ts +79 -0
  119. package/templates/hono-fullstack/apps/stack/frontend/modules/example/api.ts +13 -0
  120. package/templates/hono-fullstack/apps/stack/frontend/modules/example/components/ExamplePage.tsx +59 -0
  121. package/templates/hono-fullstack/apps/stack/frontend/modules/example/hooks/api-hooks.ts +14 -0
  122. package/templates/hono-fullstack/apps/stack/frontend/modules/example/stores/index.ts +3 -0
  123. package/templates/hono-fullstack/apps/stack/frontend/routeTree.gen.ts +56 -0
  124. package/templates/hono-fullstack/apps/stack/frontend/router.tsx +22 -0
  125. package/templates/hono-fullstack/apps/stack/frontend/routes/__root.tsx +61 -0
  126. package/templates/hono-fullstack/apps/stack/frontend/routes/index.tsx +4 -0
  127. package/templates/hono-fullstack/apps/stack/frontend/shared/network/client.ts +19 -0
  128. package/templates/hono-fullstack/apps/stack/frontend/shared/network/constants.ts +1 -0
  129. package/templates/hono-fullstack/apps/stack/frontend/shared/network/errors.ts +33 -0
  130. package/templates/hono-fullstack/apps/stack/frontend/styles.css +23 -0
  131. package/templates/hono-fullstack/apps/stack/frontend/vite-env.d.ts +1 -0
  132. package/templates/hono-fullstack/apps/stack/nitro/handlers/hono.ts +1 -0
  133. package/templates/hono-fullstack/apps/stack/nitro/plugins/hono.ts +9 -0
  134. package/templates/hono-fullstack/apps/stack/package.json +44 -0
  135. package/templates/hono-fullstack/apps/stack/tsconfig.json +12 -0
  136. package/templates/hono-fullstack/apps/stack/tsr.config.json +5 -0
  137. package/templates/hono-fullstack/apps/stack/vite.config.ts +33 -0
  138. package/templates/hono-fullstack/docs/agents/domain.md +41 -0
  139. package/templates/hono-fullstack/docs/agents/issue-tracker.md +30 -0
  140. package/templates/hono-fullstack/docs/agents/triage-labels.md +15 -0
  141. package/templates/hono-fullstack/envs/.env.example.server +12 -0
  142. package/templates/hono-fullstack/envs/.env.example.sqlite +1 -0
  143. package/templates/hono-fullstack/libs/db/drizzle-kit/sqlite.config.ts +22 -0
  144. package/templates/hono-fullstack/libs/db/package.json +40 -0
  145. package/templates/hono-fullstack/libs/db/src/dialects/sqlite/client.ts +35 -0
  146. package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/columns.ts +32 -0
  147. package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/index.ts +7 -0
  148. package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/modules/examples/examples.ts +22 -0
  149. package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/relations.ts +5 -0
  150. package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/tables.ts +5 -0
  151. package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/types.ts +7 -0
  152. package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/vo.ts +1 -0
  153. package/templates/hono-fullstack/libs/db/src/dialects/sqlite/utils.ts +8 -0
  154. package/templates/hono-fullstack/libs/db/src/shared/types.ts +26 -0
  155. package/templates/hono-fullstack/libs/db/tsconfig.json +10 -0
  156. package/templates/hono-fullstack/libs/db/vite.config.ts +21 -0
  157. package/templates/hono-fullstack/libs/definition/package.json +30 -0
  158. package/templates/hono-fullstack/libs/definition/src/backend.ts +2 -0
  159. package/templates/hono-fullstack/libs/definition/src/configs/defs/log.ts +53 -0
  160. package/templates/hono-fullstack/libs/definition/src/configs/defs/middleware.ts +16 -0
  161. package/templates/hono-fullstack/libs/definition/src/configs/defs/runtime.ts +11 -0
  162. package/templates/hono-fullstack/libs/definition/src/configs/defs/sqlite.ts +13 -0
  163. package/templates/hono-fullstack/libs/definition/src/configs/defs/worker.ts +29 -0
  164. package/templates/hono-fullstack/libs/definition/src/configs/index.ts +5 -0
  165. package/templates/hono-fullstack/libs/definition/src/configs/proto.ts +81 -0
  166. package/templates/hono-fullstack/libs/definition/src/configs/schema.ts +23 -0
  167. package/templates/hono-fullstack/libs/definition/src/frontend.ts +1 -0
  168. package/templates/hono-fullstack/libs/definition/src/modules/example/index.ts +16 -0
  169. package/templates/hono-fullstack/libs/definition/src/modules/index.ts +1 -0
  170. package/templates/hono-fullstack/libs/definition/tsconfig.json +5 -0
  171. package/templates/hono-fullstack/libs/definition/vite.config.ts +13 -0
  172. package/templates/hono-fullstack/oyo.config.json +12 -0
  173. package/templates/hono-fullstack/package.json +25 -0
  174. package/templates/hono-fullstack/pnpm-workspace.yaml +82 -0
  175. package/templates/hono-fullstack/tsconfig.json +4 -0
  176. package/templates/hono-fullstack/turbo.json +14 -0
  177. package/templates/hono-fullstack/vite.config.ts +13 -0
  178. package/templates/hono-server/.agents/skills/ask-matt/PHASE-BOUNDARIES.md +55 -0
  179. package/templates/hono-server/.agents/skills/ask-matt/SKILL.md +90 -0
  180. package/templates/hono-server/.agents/skills/ask-matt/agents/openai.yaml +5 -0
  181. package/templates/hono-server/.agents/skills/code-review/SKILL.md +87 -0
  182. package/templates/hono-server/.agents/skills/code-review/agents/openai.yaml +3 -0
  183. package/templates/hono-server/.agents/skills/codebase-design/DEEPENING.md +37 -0
  184. package/templates/hono-server/.agents/skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
  185. package/templates/hono-server/.agents/skills/codebase-design/SKILL.md +114 -0
  186. package/templates/hono-server/.agents/skills/codebase-design/agents/openai.yaml +3 -0
  187. package/templates/hono-server/.agents/skills/confirm-requirements/SKILL.md +25 -0
  188. package/templates/hono-server/.agents/skills/diagnosing-bugs/SKILL.md +140 -0
  189. package/templates/hono-server/.agents/skills/diagnosing-bugs/agents/openai.yaml +3 -0
  190. package/templates/hono-server/.agents/skills/diagnosing-bugs/scripts/hitl-loop.template.sh +44 -0
  191. package/templates/hono-server/.agents/skills/domain-modeling/ADR-FORMAT.md +47 -0
  192. package/templates/hono-server/.agents/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
  193. package/templates/hono-server/.agents/skills/domain-modeling/SKILL.md +74 -0
  194. package/templates/hono-server/.agents/skills/domain-modeling/agents/openai.yaml +3 -0
  195. package/templates/hono-server/.agents/skills/grill-me/SKILL.md +7 -0
  196. package/templates/hono-server/.agents/skills/grill-me/agents/openai.yaml +5 -0
  197. package/templates/hono-server/.agents/skills/grilling/SKILL.md +22 -0
  198. package/templates/hono-server/.agents/skills/grilling/agents/openai.yaml +3 -0
  199. package/templates/hono-server/.agents/skills/implement/SKILL.md +15 -0
  200. package/templates/hono-server/.agents/skills/implement/agents/openai.yaml +5 -0
  201. package/templates/hono-server/.agents/skills/improve-codebase-architecture/HTML-REPORT.md +123 -0
  202. package/templates/hono-server/.agents/skills/improve-codebase-architecture/SKILL.md +71 -0
  203. package/templates/hono-server/.agents/skills/improve-codebase-architecture/agents/openai.yaml +5 -0
  204. package/templates/hono-server/.agents/skills/prototype/LOGIC.md +67 -0
  205. package/templates/hono-server/.agents/skills/prototype/SKILL.md +26 -0
  206. package/templates/hono-server/.agents/skills/prototype/UI.md +112 -0
  207. package/templates/hono-server/.agents/skills/prototype/agents/openai.yaml +3 -0
  208. package/templates/hono-server/.agents/skills/research/SKILL.md +12 -0
  209. package/templates/hono-server/.agents/skills/research/agents/openai.yaml +3 -0
  210. package/templates/hono-server/.agents/skills/resolving-merge-conflicts/SKILL.md +14 -0
  211. package/templates/hono-server/.agents/skills/resolving-merge-conflicts/agents/openai.yaml +3 -0
  212. package/templates/hono-server/.agents/skills/scoped-code-review/SKILL.md +113 -0
  213. package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/SKILL.md +116 -0
  214. package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/agents/openai.yaml +5 -0
  215. package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/domain.md +51 -0
  216. package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/issue-tracker-github.md +45 -0
  217. package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +46 -0
  218. package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/issue-tracker-local.md +30 -0
  219. package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/triage-labels.md +15 -0
  220. package/templates/hono-server/.agents/skills/tdd/SKILL.md +38 -0
  221. package/templates/hono-server/.agents/skills/tdd/agents/openai.yaml +3 -0
  222. package/templates/hono-server/.agents/skills/tdd/mocking.md +59 -0
  223. package/templates/hono-server/.agents/skills/tdd/tests.md +77 -0
  224. package/templates/hono-server/.agents/skills/teach/GLOSSARY-FORMAT.md +35 -0
  225. package/templates/hono-server/.agents/skills/teach/LEARNING-RECORD-FORMAT.md +46 -0
  226. package/templates/hono-server/.agents/skills/teach/MISSION-FORMAT.md +31 -0
  227. package/templates/hono-server/.agents/skills/teach/RESOURCES-FORMAT.md +32 -0
  228. package/templates/hono-server/.agents/skills/teach/SKILL.md +140 -0
  229. package/templates/hono-server/.agents/skills/teach/agents/openai.yaml +5 -0
  230. package/templates/hono-server/.agents/skills/to-questionnaire/SKILL.md +53 -0
  231. package/templates/hono-server/.agents/skills/to-questionnaire/agents/openai.yaml +5 -0
  232. package/templates/hono-server/.agents/skills/triage/AGENT-BRIEF.md +207 -0
  233. package/templates/hono-server/.agents/skills/triage/OUT-OF-SCOPE.md +105 -0
  234. package/templates/hono-server/.agents/skills/triage/SKILL.md +112 -0
  235. package/templates/hono-server/.agents/skills/triage/agents/openai.yaml +5 -0
  236. package/templates/hono-server/.agents/skills/wait-what/SKILL.md +7 -0
  237. package/templates/hono-server/.agents/skills/wait-what/agents/openai.yaml +5 -0
  238. package/templates/hono-server/.agents/skills/wayfinder/SKILL.md +128 -0
  239. package/templates/hono-server/.agents/skills/wayfinder/agents/openai.yaml +5 -0
  240. package/templates/hono-server/.agents/skills/wizard/SKILL.md +44 -0
  241. package/templates/hono-server/.agents/skills/wizard/agents/openai.yaml +3 -0
  242. package/templates/hono-server/.agents/skills/wizard/template.sh +204 -0
  243. package/templates/hono-server/.agents/skills/writing-for-agents/SKILL-MECHANICS.md +22 -0
  244. package/templates/hono-server/.agents/skills/writing-for-agents/SKILL.md +81 -0
  245. package/templates/hono-server/.agents/skills/writing-for-agents/agents/openai.yaml +3 -0
  246. package/templates/hono-server/.changeset/README.md +8 -0
  247. package/templates/hono-server/.changeset/config.json +11 -0
  248. package/templates/hono-server/.editorconfig +31 -0
  249. package/templates/hono-server/.gitattributes +39 -0
  250. package/templates/hono-server/.vscode/extensions.json +5 -0
  251. package/templates/hono-server/.vscode/launch.json +25 -0
  252. package/templates/hono-server/.vscode/settings.json +24 -0
  253. package/templates/hono-server/AGENTS.md +43 -0
  254. package/templates/hono-server/README.md +31 -0
  255. package/templates/hono-server/_gitignore +30 -0
  256. package/templates/hono-server/apps/server/package.json +54 -0
  257. package/templates/hono-server/apps/server/src/adapters/nodejs/bootstrap.ts +61 -0
  258. package/templates/hono-server/apps/server/src/adapters/nodejs/config.ts +53 -0
  259. package/templates/hono-server/apps/server/src/adapters/nodejs/entry.ts +42 -0
  260. package/templates/hono-server/apps/server/src/app.ts +43 -0
  261. package/templates/hono-server/apps/server/src/infra/logger/getter.ts +74 -0
  262. package/templates/hono-server/apps/server/src/infra/logger/pino.ts +122 -0
  263. package/templates/hono-server/apps/server/src/infra/work-runner/constants.ts +23 -0
  264. package/templates/hono-server/apps/server/src/infra/work-runner/errors.ts +40 -0
  265. package/templates/hono-server/apps/server/src/infra/work-runner/example/runner.test.ts +56 -0
  266. package/templates/hono-server/apps/server/src/infra/work-runner/example/runner.ts +185 -0
  267. package/templates/hono-server/apps/server/src/infra/work-runner/example/worker-entry.ts +34 -0
  268. package/templates/hono-server/apps/server/src/infra/work-runner/types.ts +113 -0
  269. package/templates/hono-server/apps/server/src/infra/work-runner/utils/business-error.ts +19 -0
  270. package/templates/hono-server/apps/server/src/infra/work-runner/utils/message.ts +46 -0
  271. package/templates/hono-server/apps/server/src/infra/work-runner/utils/transfer.ts +144 -0
  272. package/templates/hono-server/apps/server/src/middlewares/cors.ts +26 -0
  273. package/templates/hono-server/apps/server/src/modules/example/contracts.ts +5 -0
  274. package/templates/hono-server/apps/server/src/modules/example/routes.ts +46 -0
  275. package/templates/hono-server/apps/server/src/modules/example/work-task/tasks.test.ts +37 -0
  276. package/templates/hono-server/apps/server/src/modules/example/work-task/tasks.ts +35 -0
  277. package/templates/hono-server/apps/server/src/shared/app/types.ts +45 -0
  278. package/templates/hono-server/apps/server/src/shared/errors/constants.ts +152 -0
  279. package/templates/hono-server/apps/server/src/shared/errors/defs/index.ts +15 -0
  280. package/templates/hono-server/apps/server/src/shared/errors/handler.ts +16 -0
  281. package/templates/hono-server/apps/server/src/shared/errors/log.ts +67 -0
  282. package/templates/hono-server/apps/server/src/shared/errors/proto.ts +42 -0
  283. package/templates/hono-server/apps/server/src/shared/errors/types.ts +29 -0
  284. package/templates/hono-server/apps/server/src/shared/network/fetcher.ts +35 -0
  285. package/templates/hono-server/apps/server/src/shared/network/openapi/index.ts +50 -0
  286. package/templates/hono-server/apps/server/src/shared/network/openapi/res-defs.ts +39 -0
  287. package/templates/hono-server/apps/server/src/shared/network/types.ts +3 -0
  288. package/templates/hono-server/apps/server/src/shared/network/utils.ts +36 -0
  289. package/templates/hono-server/apps/server/src/shared/network/validator.ts +28 -0
  290. package/templates/hono-server/apps/server/src/shared/utils/index.ts +30 -0
  291. package/templates/hono-server/apps/server/src/virtual-modules.d.ts +5 -0
  292. package/templates/hono-server/apps/server/tsconfig.json +16 -0
  293. package/templates/hono-server/apps/server/vite.config.ts +79 -0
  294. package/templates/hono-server/docker/.env.example +4 -0
  295. package/templates/hono-server/docker/README.md +5 -0
  296. package/templates/hono-server/docker/local/compose.local.app.yml +21 -0
  297. package/templates/hono-server/docker/local/local-app-deploy.sh +8 -0
  298. package/templates/hono-server/docker/local/local-app-down.sh +8 -0
  299. package/templates/hono-server/docker/prod/.env.example.server +11 -0
  300. package/templates/hono-server/docker/prod/compose.prod.stack.yml +21 -0
  301. package/templates/hono-server/docker/prod/update.sh +7 -0
  302. package/templates/hono-server/docker/server.Dockerfile +40 -0
  303. package/templates/hono-server/docker/server.Dockerfile.dockerignore +23 -0
  304. package/templates/hono-server/docs/agents/domain.md +41 -0
  305. package/templates/hono-server/docs/agents/issue-tracker.md +30 -0
  306. package/templates/hono-server/docs/agents/triage-labels.md +15 -0
  307. package/templates/hono-server/envs/.env.example.server +12 -0
  308. package/templates/hono-server/libs/definition/package.json +29 -0
  309. package/templates/hono-server/libs/definition/src/backend.ts +2 -0
  310. package/templates/hono-server/libs/definition/src/configs/defs/log.ts +53 -0
  311. package/templates/hono-server/libs/definition/src/configs/defs/middleware.ts +16 -0
  312. package/templates/hono-server/libs/definition/src/configs/defs/runtime.ts +11 -0
  313. package/templates/hono-server/libs/definition/src/configs/defs/worker.ts +29 -0
  314. package/templates/hono-server/libs/definition/src/configs/index.ts +4 -0
  315. package/templates/hono-server/libs/definition/src/configs/proto.ts +81 -0
  316. package/templates/hono-server/libs/definition/src/configs/schema.ts +23 -0
  317. package/templates/hono-server/libs/definition/src/modules/example/index.ts +16 -0
  318. package/templates/hono-server/libs/definition/src/modules/index.ts +1 -0
  319. package/templates/hono-server/libs/definition/tsconfig.json +5 -0
  320. package/templates/hono-server/libs/definition/vite.config.ts +12 -0
  321. package/templates/hono-server/oyo.config.json +11 -0
  322. package/templates/hono-server/package.json +26 -0
  323. package/templates/hono-server/pnpm-workspace.yaml +57 -0
  324. package/templates/hono-server/scripts/.env.example.docker +4 -0
  325. package/templates/hono-server/scripts/build-docker-server.sh +13 -0
  326. package/templates/hono-server/scripts/common.sh +20 -0
  327. package/templates/hono-server/tsconfig.json +4 -0
  328. package/templates/hono-server/turbo.json +14 -0
  329. package/templates/hono-server/vite.config.ts +13 -0
  330. package/templates/monorepo/.agents/skills/ask-matt/PHASE-BOUNDARIES.md +55 -0
  331. package/templates/monorepo/.agents/skills/ask-matt/SKILL.md +90 -0
  332. package/templates/monorepo/.agents/skills/ask-matt/agents/openai.yaml +5 -0
  333. package/templates/monorepo/.agents/skills/code-review/SKILL.md +87 -0
  334. package/templates/monorepo/.agents/skills/code-review/agents/openai.yaml +3 -0
  335. package/templates/monorepo/.agents/skills/codebase-design/DEEPENING.md +37 -0
  336. package/templates/monorepo/.agents/skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
  337. package/templates/monorepo/.agents/skills/codebase-design/SKILL.md +114 -0
  338. package/templates/monorepo/.agents/skills/codebase-design/agents/openai.yaml +3 -0
  339. package/templates/monorepo/.agents/skills/confirm-requirements/SKILL.md +25 -0
  340. package/templates/monorepo/.agents/skills/diagnosing-bugs/SKILL.md +140 -0
  341. package/templates/monorepo/.agents/skills/diagnosing-bugs/agents/openai.yaml +3 -0
  342. package/templates/monorepo/.agents/skills/diagnosing-bugs/scripts/hitl-loop.template.sh +44 -0
  343. package/templates/monorepo/.agents/skills/domain-modeling/ADR-FORMAT.md +47 -0
  344. package/templates/monorepo/.agents/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
  345. package/templates/monorepo/.agents/skills/domain-modeling/SKILL.md +74 -0
  346. package/templates/monorepo/.agents/skills/domain-modeling/agents/openai.yaml +3 -0
  347. package/templates/monorepo/.agents/skills/grill-me/SKILL.md +7 -0
  348. package/templates/monorepo/.agents/skills/grill-me/agents/openai.yaml +5 -0
  349. package/templates/monorepo/.agents/skills/grilling/SKILL.md +22 -0
  350. package/templates/monorepo/.agents/skills/grilling/agents/openai.yaml +3 -0
  351. package/templates/monorepo/.agents/skills/implement/SKILL.md +15 -0
  352. package/templates/monorepo/.agents/skills/implement/agents/openai.yaml +5 -0
  353. package/templates/monorepo/.agents/skills/improve-codebase-architecture/HTML-REPORT.md +123 -0
  354. package/templates/monorepo/.agents/skills/improve-codebase-architecture/SKILL.md +71 -0
  355. package/templates/monorepo/.agents/skills/improve-codebase-architecture/agents/openai.yaml +5 -0
  356. package/templates/monorepo/.agents/skills/prototype/LOGIC.md +67 -0
  357. package/templates/monorepo/.agents/skills/prototype/SKILL.md +26 -0
  358. package/templates/monorepo/.agents/skills/prototype/UI.md +112 -0
  359. package/templates/monorepo/.agents/skills/prototype/agents/openai.yaml +3 -0
  360. package/templates/monorepo/.agents/skills/research/SKILL.md +12 -0
  361. package/templates/monorepo/.agents/skills/research/agents/openai.yaml +3 -0
  362. package/templates/monorepo/.agents/skills/resolving-merge-conflicts/SKILL.md +14 -0
  363. package/templates/monorepo/.agents/skills/resolving-merge-conflicts/agents/openai.yaml +3 -0
  364. package/templates/monorepo/.agents/skills/scoped-code-review/SKILL.md +113 -0
  365. package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/SKILL.md +116 -0
  366. package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/agents/openai.yaml +5 -0
  367. package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/domain.md +51 -0
  368. package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/issue-tracker-github.md +45 -0
  369. package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +46 -0
  370. package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/issue-tracker-local.md +30 -0
  371. package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/triage-labels.md +15 -0
  372. package/templates/monorepo/.agents/skills/tdd/SKILL.md +38 -0
  373. package/templates/monorepo/.agents/skills/tdd/agents/openai.yaml +3 -0
  374. package/templates/monorepo/.agents/skills/tdd/mocking.md +59 -0
  375. package/templates/monorepo/.agents/skills/tdd/tests.md +77 -0
  376. package/templates/monorepo/.agents/skills/teach/GLOSSARY-FORMAT.md +35 -0
  377. package/templates/monorepo/.agents/skills/teach/LEARNING-RECORD-FORMAT.md +46 -0
  378. package/templates/monorepo/.agents/skills/teach/MISSION-FORMAT.md +31 -0
  379. package/templates/monorepo/.agents/skills/teach/RESOURCES-FORMAT.md +32 -0
  380. package/templates/monorepo/.agents/skills/teach/SKILL.md +140 -0
  381. package/templates/monorepo/.agents/skills/teach/agents/openai.yaml +5 -0
  382. package/templates/monorepo/.agents/skills/to-questionnaire/SKILL.md +53 -0
  383. package/templates/monorepo/.agents/skills/to-questionnaire/agents/openai.yaml +5 -0
  384. package/templates/monorepo/.agents/skills/triage/AGENT-BRIEF.md +207 -0
  385. package/templates/monorepo/.agents/skills/triage/OUT-OF-SCOPE.md +105 -0
  386. package/templates/monorepo/.agents/skills/triage/SKILL.md +112 -0
  387. package/templates/monorepo/.agents/skills/triage/agents/openai.yaml +5 -0
  388. package/templates/monorepo/.agents/skills/wait-what/SKILL.md +7 -0
  389. package/templates/monorepo/.agents/skills/wait-what/agents/openai.yaml +5 -0
  390. package/templates/monorepo/.agents/skills/wayfinder/SKILL.md +128 -0
  391. package/templates/monorepo/.agents/skills/wayfinder/agents/openai.yaml +5 -0
  392. package/templates/monorepo/.agents/skills/wizard/SKILL.md +44 -0
  393. package/templates/monorepo/.agents/skills/wizard/agents/openai.yaml +3 -0
  394. package/templates/monorepo/.agents/skills/wizard/template.sh +204 -0
  395. package/templates/monorepo/.agents/skills/writing-for-agents/SKILL-MECHANICS.md +22 -0
  396. package/templates/monorepo/.agents/skills/writing-for-agents/SKILL.md +81 -0
  397. package/templates/monorepo/.agents/skills/writing-for-agents/agents/openai.yaml +3 -0
  398. package/templates/monorepo/.editorconfig +31 -0
  399. package/templates/monorepo/.gitattributes +39 -0
  400. package/templates/monorepo/.vscode/extensions.json +5 -0
  401. package/templates/monorepo/.vscode/launch.json +25 -0
  402. package/templates/monorepo/.vscode/settings.json +3 -1
  403. package/templates/monorepo/AGENTS.md +43 -0
  404. package/templates/monorepo/README.md +27 -0
  405. package/templates/monorepo/_gitignore +8 -0
  406. package/templates/monorepo/docs/agents/domain.md +41 -0
  407. package/templates/monorepo/docs/agents/issue-tracker.md +30 -0
  408. package/templates/monorepo/docs/agents/triage-labels.md +15 -0
  409. package/templates/monorepo/envs/.env.example +1 -0
  410. package/templates/monorepo/oyo.config.json +11 -0
  411. package/templates/monorepo/package.json +24 -0
  412. package/templates/monorepo/pnpm-workspace.yaml +32 -0
  413. package/templates/monorepo/tsconfig.json +4 -0
  414. package/templates/monorepo/turbo.json +14 -0
  415. package/templates/monorepo/vite.config.ts +13 -0
  416. package/templates/monorepo/.vite-hooks/pre-commit +0 -1
  417. /package/templates/{monorepo/_editorconfig → hono-fullstack/.editorconfig} +0 -0
  418. /package/templates/{monorepo/_gitattributes → hono-fullstack/.gitattributes} +0 -0
@@ -0,0 +1,59 @@
1
+ import { useAtom } from 'jotai'
2
+ import type { FormEvent } from 'react'
3
+ import { useCreateExample, useExamples, useProcessExample } from '../hooks/api-hooks'
4
+ import { exampleMessageAtom } from '../stores'
5
+
6
+ export function ExamplePage() {
7
+ const [message, setMessage] = useAtom(exampleMessageAtom)
8
+ const examples = useExamples()
9
+ const create = useCreateExample()
10
+ const process = useProcessExample()
11
+
12
+ const submit = async (event: FormEvent) => {
13
+ event.preventDefault()
14
+ await create.mutateAsync({ message })
15
+ setMessage('')
16
+ }
17
+
18
+ return (
19
+ <main className="mx-auto flex min-h-screen max-w-2xl flex-col gap-6 p-8">
20
+ <header>
21
+ <h1 className="text-3xl font-bold">Example workspace</h1>
22
+ <p className="text-zinc-400">Nitro mounts the independent Hono server under /api.</p>
23
+ </header>
24
+ <form className="flex gap-2" onSubmit={submit}>
25
+ <input
26
+ className="min-w-0 flex-1 rounded border border-zinc-700 bg-zinc-900 px-3 py-2"
27
+ value={message}
28
+ onChange={(event) => setMessage(event.target.value)}
29
+ placeholder="Message"
30
+ />
31
+ <button
32
+ className="rounded bg-blue-600 px-4 py-2"
33
+ disabled={!message.trim() || create.isPending}>
34
+ Save
35
+ </button>
36
+ <button
37
+ className="rounded bg-emerald-600 px-4 py-2"
38
+ type="button"
39
+ disabled={!message.trim() || process.isPending}
40
+ onClick={() => process.mutate({ message })}>
41
+ Process
42
+ </button>
43
+ </form>
44
+ {process.data && (
45
+ <pre className="rounded bg-zinc-900 p-4">{JSON.stringify(process.data, null, 2)}</pre>
46
+ )}
47
+ {(create.error || process.error || examples.error) && (
48
+ <p className="text-red-400">{String(create.error || process.error || examples.error)}</p>
49
+ )}
50
+ <ul className="grid gap-2">
51
+ {examples.data?.map((example) => (
52
+ <li className="rounded border border-zinc-800 p-3" key={example.id}>
53
+ {example.message}
54
+ </li>
55
+ ))}
56
+ </ul>
57
+ </main>
58
+ )
59
+ }
@@ -0,0 +1,14 @@
1
+ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
2
+ import { createExample, listExamples, processExample } from '../api'
3
+
4
+ export const exampleQueryKey = ['examples'] as const
5
+
6
+ export const useExamples = () => useQuery({ queryKey: exampleQueryKey, queryFn: listExamples })
7
+ export function useCreateExample() {
8
+ const queryClient = useQueryClient()
9
+ return useMutation({
10
+ mutationFn: createExample,
11
+ onSuccess: () => queryClient.invalidateQueries({ queryKey: exampleQueryKey }),
12
+ })
13
+ }
14
+ export const useProcessExample = () => useMutation({ mutationFn: processExample })
@@ -0,0 +1,3 @@
1
+ import { atom } from 'jotai'
2
+
3
+ export const exampleMessageAtom = atom('')
@@ -0,0 +1,56 @@
1
+ /* eslint-disable */
2
+ // @ts-nocheck
3
+ // This file was automatically generated by TanStack Router.
4
+ import { Route as rootRouteImport } from './routes/__root'
5
+ import { Route as IndexRouteImport } from './routes/index'
6
+
7
+ const IndexRoute = IndexRouteImport.update({
8
+ id: '/',
9
+ path: '/',
10
+ getParentRoute: () => rootRouteImport,
11
+ } as any)
12
+
13
+ export interface FileRoutesByFullPath {
14
+ '/': typeof IndexRoute
15
+ }
16
+ export interface FileRoutesByTo {
17
+ '/': typeof IndexRoute
18
+ }
19
+ export interface FileRoutesById {
20
+ __root__: typeof rootRouteImport
21
+ '/': typeof IndexRoute
22
+ }
23
+ export interface FileRouteTypes {
24
+ fileRoutesByFullPath: FileRoutesByFullPath
25
+ fullPaths: '/'
26
+ fileRoutesByTo: FileRoutesByTo
27
+ to: '/'
28
+ id: '__root__' | '/'
29
+ fileRoutesById: FileRoutesById
30
+ }
31
+ export interface RootRouteChildren {
32
+ IndexRoute: typeof IndexRoute
33
+ }
34
+ declare module '@tanstack/react-router' {
35
+ interface FileRoutesByPath {
36
+ '/': {
37
+ id: '/'
38
+ path: '/'
39
+ fullPath: '/'
40
+ preLoaderRoute: typeof IndexRouteImport
41
+ parentRoute: typeof rootRouteImport
42
+ }
43
+ }
44
+ }
45
+ const rootRouteChildren: RootRouteChildren = { IndexRoute }
46
+ export const routeTree = rootRouteImport
47
+ ._addFileChildren(rootRouteChildren)
48
+ ._addFileTypes<FileRouteTypes>()
49
+
50
+ import type { getRouter } from './router.tsx'
51
+ declare module '@tanstack/react-start' {
52
+ interface Register {
53
+ ssr: true
54
+ router: Awaited<ReturnType<typeof getRouter>>
55
+ }
56
+ }
@@ -0,0 +1,22 @@
1
+ import { QueryClient } from '@tanstack/react-query'
2
+ import { createRouter as createTanStackRouter } from '@tanstack/react-router'
3
+ import { createStore } from 'jotai'
4
+ import { routeTree } from './routeTree.gen'
5
+
6
+ export function getRouter() {
7
+ const queryClient = new QueryClient()
8
+ const store = createStore()
9
+ return createTanStackRouter({
10
+ routeTree,
11
+ context: { queryClient, store },
12
+ scrollRestoration: true,
13
+ defaultPreload: 'intent',
14
+ defaultPreloadStaleTime: 0,
15
+ })
16
+ }
17
+
18
+ declare module '@tanstack/react-router' {
19
+ interface Register {
20
+ router: ReturnType<typeof getRouter>
21
+ }
22
+ }
@@ -0,0 +1,61 @@
1
+ import type { QueryClient } from '@tanstack/react-query'
2
+ import { QueryClientProvider } from '@tanstack/react-query'
3
+ import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
4
+ import {
5
+ HeadContent,
6
+ Navigate,
7
+ Outlet,
8
+ Scripts,
9
+ createRootRouteWithContext,
10
+ } from '@tanstack/react-router'
11
+ import { TanStackRouterDevtools } from '@tanstack/react-router-devtools'
12
+ import { Provider as JotaiProvider, type createStore } from 'jotai'
13
+ import appCss from '../styles.css?url'
14
+
15
+ export const Route = createRootRouteWithContext<{
16
+ queryClient: QueryClient
17
+ store: ReturnType<typeof createStore>
18
+ }>()({
19
+ head: () => ({
20
+ meta: [
21
+ { charSet: 'utf-8' },
22
+ { name: 'viewport', content: 'width=device-width, initial-scale=1' },
23
+ { title: 'Hono fullstack' },
24
+ ],
25
+ links: [{ rel: 'stylesheet', href: appCss }],
26
+ }),
27
+ component: RootComponent,
28
+ notFoundComponent: () => <Navigate to="/" />,
29
+ shellComponent: RootDocument,
30
+ })
31
+
32
+ function RootComponent() {
33
+ const { queryClient, store } = Route.useRouteContext()
34
+ return (
35
+ <QueryClientProvider client={queryClient}>
36
+ <JotaiProvider store={store}>
37
+ <Outlet />
38
+ </JotaiProvider>
39
+ {import.meta.env.DEV && (
40
+ <>
41
+ <ReactQueryDevtools buttonPosition="bottom-left" />
42
+ <TanStackRouterDevtools position="bottom-right" />
43
+ </>
44
+ )}
45
+ </QueryClientProvider>
46
+ )
47
+ }
48
+
49
+ function RootDocument({ children }: { children: React.ReactNode }) {
50
+ return (
51
+ <html lang="en" className="dark">
52
+ <head>
53
+ <HeadContent />
54
+ </head>
55
+ <body>
56
+ {children}
57
+ <Scripts />
58
+ </body>
59
+ </html>
60
+ )
61
+ }
@@ -0,0 +1,4 @@
1
+ import { createFileRoute } from '@tanstack/react-router'
2
+ import { ExamplePage } from '#/modules/example/components/ExamplePage'
3
+
4
+ export const Route = createFileRoute('/')({ component: ExamplePage })
@@ -0,0 +1,19 @@
1
+ import ky, { HTTPError, type Options } from 'ky'
2
+ import { NetworkDefaults } from './constants'
3
+ import { parseApiError } from './errors'
4
+
5
+ const client = ky.create({
6
+ prefix: NetworkDefaults.API_PREFIX,
7
+ timeout: NetworkDefaults.TIMEOUT,
8
+ retry: 0,
9
+ })
10
+
11
+ export async function request<T>(path: string, options?: Options) {
12
+ try {
13
+ const response = await client(path, options).json<{ data: T }>()
14
+ return response.data
15
+ } catch (error) {
16
+ if (error instanceof HTTPError) throw await parseApiError(error)
17
+ throw error
18
+ }
19
+ }
@@ -0,0 +1 @@
1
+ export const NetworkDefaults = Object.freeze({ API_PREFIX: '/api', TIMEOUT: 15_000 })
@@ -0,0 +1,33 @@
1
+ import type { HTTPError } from 'ky'
2
+
3
+ export type ProblemDetails = {
4
+ type?: string
5
+ title?: string
6
+ status?: number
7
+ detail?: string
8
+ message?: string
9
+ extensions?: Record<string, unknown>
10
+ [key: string]: unknown
11
+ }
12
+
13
+ export class ApiError extends Error {
14
+ constructor(
15
+ public readonly problem: ProblemDetails,
16
+ options?: ErrorOptions,
17
+ ) {
18
+ super(problem.detail || problem.message || problem.title || 'Request failed', options)
19
+ this.name = 'ApiError'
20
+ }
21
+ get status() {
22
+ return this.problem.status
23
+ }
24
+ }
25
+
26
+ export const isApiError = (error: unknown, status?: number): error is ApiError =>
27
+ error instanceof ApiError && (status === undefined || error.status === status)
28
+
29
+ export async function parseApiError(error: HTTPError) {
30
+ const fallback = { title: error.response.statusText }
31
+ const problem = await error.response.json<ProblemDetails>().catch(() => fallback)
32
+ return new ApiError({ ...problem, status: error.response.status }, { cause: error })
33
+ }
@@ -0,0 +1,23 @@
1
+ @import 'tailwindcss';
2
+ @custom-variant dark (&:where(.dark, .dark *));
3
+
4
+ html,
5
+ body {
6
+ min-height: 100%;
7
+ margin: 0;
8
+ }
9
+ html.dark {
10
+ color-scheme: dark;
11
+ }
12
+ body {
13
+ background: #18181b;
14
+ color: #e4e4e7;
15
+ font-family: ui-sans-serif, system-ui, sans-serif;
16
+ }
17
+ button {
18
+ cursor: pointer;
19
+ }
20
+ button:disabled {
21
+ cursor: not-allowed;
22
+ opacity: 0.5;
23
+ }
@@ -0,0 +1 @@
1
+ /// <reference types="vite/client" />
@@ -0,0 +1 @@
1
+ export { default } from '@repo/server/node'
@@ -0,0 +1,9 @@
1
+ import { definePlugin } from 'nitro'
2
+ import { exampleWorkRunner, sqliteClient } from '@repo/server/node'
3
+
4
+ export default definePlugin((nitro) => {
5
+ nitro.hooks.hook('close', async () => {
6
+ await exampleWorkRunner.shutdown()
7
+ sqliteClient.close()
8
+ })
9
+ })
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@repo/stack",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "oyo env server -- vp dev",
8
+ "dev:chain": "turbo watch dev --filter=@repo/stack",
9
+ "generate-routes": "tsr generate",
10
+ "build": "vp build",
11
+ "preview": "oyo env server -- vp preview",
12
+ "test": "vp test",
13
+ "check": "vp check"
14
+ },
15
+ "dependencies": {
16
+ "@repo/definition": "workspace:*",
17
+ "@repo/server": "workspace:*",
18
+ "@tanstack/react-query": "catalog:frontend",
19
+ "@tanstack/react-router": "catalog:frontend",
20
+ "@tanstack/react-start": "catalog:frontend",
21
+ "jotai": "catalog:frontend",
22
+ "ky": "catalog:shared",
23
+ "nitro": "catalog:",
24
+ "react": "catalog:frontend",
25
+ "react-dom": "catalog:frontend"
26
+ },
27
+ "devDependencies": {
28
+ "@oyolincc/cli": "catalog:",
29
+ "@oyolincc/dev-config": "catalog:",
30
+ "@rollup/pluginutils": "catalog:",
31
+ "@tailwindcss/vite": "catalog:frontend",
32
+ "@tanstack/react-query-devtools": "catalog:frontend",
33
+ "@tanstack/react-router-devtools": "catalog:frontend",
34
+ "@tanstack/router-cli": "catalog:frontend",
35
+ "@types/node": "catalog:",
36
+ "@types/react": "catalog:frontend",
37
+ "@types/react-dom": "catalog:frontend",
38
+ "@vitejs/plugin-react": "catalog:",
39
+ "fast-glob": "catalog:",
40
+ "tailwindcss": "catalog:frontend",
41
+ "typescript": "catalog:",
42
+ "vite-plus": "catalog:"
43
+ }
44
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "extends": "@oyolincc/dev-config/tsconfig.frontend.json",
3
+ "compilerOptions": {
4
+ "jsx": "react-jsx",
5
+ "paths": {
6
+ "#/*": ["./frontend/*"],
7
+ "@/*": ["./nitro/*"]
8
+ }
9
+ },
10
+ "files": [],
11
+ "include": ["frontend", "nitro", "./*.ts", "./*.mts"]
12
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "target": "react",
3
+ "routesDirectory": "./frontend/routes",
4
+ "generatedRouteTree": "./frontend/routeTree.gen.ts"
5
+ }
@@ -0,0 +1,33 @@
1
+ import { defineConfig } from 'vite-plus'
2
+ import { tanstackStart } from '@tanstack/react-start/plugin/vite'
3
+ import tailwindcss from '@tailwindcss/vite'
4
+ import viteReact from '@vitejs/plugin-react'
5
+ import { nitro } from 'nitro/vite'
6
+
7
+ export default defineConfig({
8
+ server: {
9
+ port: 3000,
10
+ warmup: {
11
+ clientFiles: ['./frontend/router.tsx'],
12
+ ssrFiles: ['./frontend/router.tsx'],
13
+ },
14
+ },
15
+ resolve: { tsconfigPaths: true },
16
+ optimizeDeps: { include: ['@repo/definition/frontend'] },
17
+ plugins: [
18
+ nitro({
19
+ serverDir: './nitro',
20
+ handlers: [
21
+ {
22
+ route: '/api/**',
23
+ handler: './nitro/handlers/hono.ts',
24
+ middleware: false,
25
+ lazy: false,
26
+ },
27
+ ],
28
+ }),
29
+ tanstackStart({ srcDirectory: './frontend' }),
30
+ tailwindcss(),
31
+ viteReact(),
32
+ ],
33
+ })
@@ -0,0 +1,41 @@
1
+ # Domain Docs
2
+
3
+ How the engineering skills should consume this repo's domain documentation when exploring the codebase.
4
+
5
+ ## Before exploring, read these
6
+
7
+ - **`CONTEXT-MAP.md`** at the repo root. It points at the `CONTEXT.md` file for each relevant app or library context; read the entries relevant to the topic.
8
+ - **`docs/adr/`** — read ADRs that touch the area you're about to work in.
9
+ - Context-specific `docs/adr/` directories — check the ADR directory alongside the relevant context when one exists.
10
+
11
+ If any of these files don't exist, **proceed silently**. Don't flag their absence; don't suggest creating them upfront. The `/domain-modeling` skill (reached via `/grill-with-docs` and `/improve-codebase-architecture`) creates them lazily when terms or decisions actually get resolved.
12
+
13
+ ## File structure
14
+
15
+ This repo uses a multi-context layout:
16
+
17
+ ```text
18
+ /
19
+ ├── CONTEXT-MAP.md ← index of all contexts
20
+ ├── docs/adr/ ← system-wide decisions
21
+ ├── apps/
22
+ │ └── <app>/
23
+ │ ├── CONTEXT.md
24
+ │ └── docs/adr/ ← app-specific decisions
25
+ └── libs/
26
+ └── <library>/
27
+ ├── CONTEXT.md
28
+ └── docs/adr/ ← library-specific decisions
29
+ ```
30
+
31
+ ## Use the glossary's vocabulary
32
+
33
+ When your output names a domain concept (in an issue title, a refactor proposal, a hypothesis, a test name), use the term as defined in the relevant context's `CONTEXT.md`. Don't drift to synonyms the glossary explicitly avoids.
34
+
35
+ If the concept you need isn't in the relevant glossary yet, that's a signal — either you're inventing language the project doesn't use (reconsider) or there's a real gap (note it for `/domain-modeling`).
36
+
37
+ ## Flag ADR conflicts
38
+
39
+ If your output contradicts an existing ADR, surface it explicitly rather than silently overriding:
40
+
41
+ > _Contradicts ADR-0007 (event-sourced orders) — but worth reopening because…_
@@ -0,0 +1,30 @@
1
+ # Issue tracker: Local Markdown
2
+
3
+ Issues and specs for this repo live as markdown files in `.scratch/`.
4
+
5
+ ## Conventions
6
+
7
+ - One feature per directory: `.scratch/<feature-slug>/`
8
+ - The spec is `.scratch/<feature-slug>/spec.md`
9
+ - Implementation issues are one file per ticket at `.scratch/<feature-slug>/issues/<NN>-<slug>.md`, numbered from `01` — never a single combined tickets file
10
+ - Triage state is recorded as a `Status:` line near the top of each issue file (see `triage-labels.md` for the role strings)
11
+ - Comments and conversation history append to the bottom of the file under a `## Comments` heading
12
+
13
+ ## When a skill says "publish to the issue tracker"
14
+
15
+ Create a new file under `.scratch/<feature-slug>/` (creating the directory if needed).
16
+
17
+ ## When a skill says "fetch the relevant ticket"
18
+
19
+ Read the file at the referenced path. The user will normally pass the path or the issue number directly.
20
+
21
+ ## Wayfinding operations
22
+
23
+ Used by `/wayfinder`. The **map** is a file with one **child** file per ticket.
24
+
25
+ - **Map**: `.scratch/<effort>/map.md` — the Notes / Decisions-so-far / Fog body.
26
+ - **Child ticket**: `.scratch/<effort>/issues/NN-<slug>.md`, numbered from `01`, with the question in the body. A `Type:` line records the ticket type (`research`/`prototype`/`grilling`/`task`); a `Status:` line records `claimed`/`resolved`.
27
+ - **Blocking**: a `Blocked by: NN, NN` line near the top. A ticket is unblocked when every file it lists is `resolved`.
28
+ - **Frontier**: scan `.scratch/<effort>/issues/` for files that are open, unblocked, and unclaimed; first by number wins.
29
+ - **Claim**: set `Status: claimed` and save before any work.
30
+ - **Resolve**: append the answer under an `## Answer` heading, set `Status: resolved`, then append a context pointer (gist + link) to the map's Decisions-so-far in `map.md`.
@@ -0,0 +1,15 @@
1
+ # Triage Labels
2
+
3
+ The skills speak in terms of five canonical triage roles. This file maps those roles to the actual label strings used in this repo's issue tracker.
4
+
5
+ | Label in mattpocock/skills | Label in our tracker | Meaning |
6
+ | -------------------------- | -------------------- | ---------------------------------------- |
7
+ | `needs-triage` | `needs-triage` | Maintainer needs to evaluate this issue |
8
+ | `needs-info` | `needs-info` | Waiting on reporter for more information |
9
+ | `ready-for-agent` | `ready-for-agent` | Fully specified, ready for an AFK agent |
10
+ | `ready-for-human` | `ready-for-human` | Requires human implementation |
11
+ | `wontfix` | `wontfix` | Will not be actioned |
12
+
13
+ When a skill mentions a role (e.g. "apply the AFK-ready triage label"), use the corresponding label string from this table.
14
+
15
+ Edit the right-hand column to match whatever vocabulary you actually use.
@@ -0,0 +1,12 @@
1
+ NODE_PORT=6464
2
+ SERVER_ENV=local
3
+ LOGGER_DIR=./logs
4
+ LOGGER_FILE_BASE=app
5
+ # LOGGER_LEVEL=debug
6
+ CORS_DOMAINS='*'
7
+ # MIN_THREADS=1
8
+ # MAX_THREADS=4
9
+ # CONCURRENT_TASKS_PER_WORKER=1
10
+ # MAX_QUEUE=12
11
+ # WORKER_TASK_TIMEOUT_MS=30000
12
+
@@ -0,0 +1 @@
1
+ DB_PATH=/absolute/path/to/repo.sqlite
@@ -0,0 +1,22 @@
1
+ import path from 'node:path'
2
+ import { defineConfig } from 'drizzle-kit'
3
+ import { ensureDatabaseDirectory } from '../src/dialects/sqlite/utils'
4
+ import { sqliteSchemaConfig } from '@repo/definition/backend'
5
+
6
+ const configDir = import.meta.dirname
7
+
8
+ const { dbPath } = sqliteSchemaConfig.resolve({
9
+ context: process.env,
10
+ matchContextKey: 'constantCase',
11
+ })
12
+
13
+ ensureDatabaseDirectory(dbPath)
14
+
15
+ export default defineConfig({
16
+ dialect: 'sqlite',
17
+ schema: path.join(configDir, '../src/dialects/sqlite/schema/tables.ts'),
18
+ out: path.join(configDir, '../migrations/sqlite'),
19
+ dbCredentials: {
20
+ url: dbPath,
21
+ },
22
+ })
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@repo/db",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "files": [
6
+ "dist"
7
+ ],
8
+ "type": "module",
9
+ "exports": {
10
+ "./sqlite/schema": "./dist/sqlite/schema.mjs",
11
+ "./sqlite/sqlite": "./dist/sqlite/sqlite.mjs",
12
+ "./package.json": "./package.json"
13
+ },
14
+ "scripts": {
15
+ "build": "vp pack",
16
+ "dev": "vp pack --watch",
17
+ "test": "vp test",
18
+ "check": "vp check",
19
+ "sqlite:export": "oyo env sqlite -- drizzle-kit export --config=drizzle-kit/sqlite.config.ts",
20
+ "dev:sqlite:push": "oyo env sqlite -- drizzle-kit push --config=drizzle-kit/sqlite.config.ts",
21
+ "dev:sqlite:gen": "oyo env sqlite -- drizzle-kit generate --config=drizzle-kit/sqlite.config.ts",
22
+ "dev:sqlite:migrate": "oyo env sqlite -- drizzle-kit migrate --config=drizzle-kit/sqlite.config.ts"
23
+ },
24
+ "dependencies": {
25
+ "@repo/definition": "workspace:*",
26
+ "better-sqlite3": "catalog:drizzle",
27
+ "drizzle-orm": "catalog:drizzle"
28
+ },
29
+ "devDependencies": {
30
+ "@cloudflare/workers-types": "catalog:drizzle",
31
+ "@oyolincc/cli": "catalog:",
32
+ "@oyolincc/dev-config": "catalog:",
33
+ "@types/better-sqlite3": "catalog:drizzle",
34
+ "@types/node": "catalog:",
35
+ "drizzle-kit": "catalog:drizzle",
36
+ "tsx": "catalog:",
37
+ "typescript": "catalog:",
38
+ "vite-plus": "catalog:"
39
+ }
40
+ }
@@ -0,0 +1,35 @@
1
+ import Database from 'better-sqlite3'
2
+ import { drizzle } from 'drizzle-orm/better-sqlite3'
3
+ import { relations, type SqliteDBType } from './schema'
4
+ import { ensureDatabaseDirectory } from './utils'
5
+
6
+ export type SqliteDatabase = SqliteDBType
7
+
8
+ export interface SqliteClient {
9
+ db: SqliteDatabase
10
+ close(): void
11
+ }
12
+
13
+ export function createSqliteClient(databaseFile: string): SqliteClient {
14
+ if (!databaseFile) throw new Error('databaseFile must not be empty')
15
+
16
+ ensureDatabaseDirectory(databaseFile)
17
+
18
+ const client = new Database(databaseFile)
19
+ client.pragma('foreign_keys = ON')
20
+ if (databaseFile !== ':memory:') client.pragma('journal_mode = WAL')
21
+
22
+ const db = drizzle({ client, relations })
23
+
24
+ let closed = false
25
+
26
+ return {
27
+ db,
28
+ close() {
29
+ if (!closed) {
30
+ client.close()
31
+ closed = true
32
+ }
33
+ },
34
+ }
35
+ }
@@ -0,0 +1,32 @@
1
+ import { sql } from 'drizzle-orm'
2
+ import { customType, integer, text } from 'drizzle-orm/sqlite-core'
3
+
4
+ export const idType = customType<{ data: string; driverData: number | bigint }>({
5
+ dataType() {
6
+ return 'integer'
7
+ },
8
+ fromDriver(value) {
9
+ return String(value)
10
+ },
11
+ })
12
+
13
+ export function timestampMsColumn(name: string) {
14
+ return integer(name, { mode: 'timestamp_ms' })
15
+ .notNull()
16
+ .default(sql`(unixepoch('subsec') * 1000)`)
17
+ }
18
+
19
+ export const updatedAtCol = () => timestampMsColumn('updated_at').$onUpdateFn(() => new Date())
20
+
21
+ /**
22
+ * createdAt 和 updatedAt 是数据库行的创建/修改时间,SQLite 保存毫秒时间戳,代码里使用 Date。
23
+ * syncState.updatedTime 是客户端同步版本号,和这两个时间不是一回事,不要混用。
24
+ */
25
+ export const modifiedTimeCols = () => ({
26
+ createdAt: timestampMsColumn('created_at'),
27
+ updatedAt: updatedAtCol(),
28
+ })
29
+
30
+ export function jsonColumn<T>(name: string) {
31
+ return text(name, { mode: 'json' }).$type<T>()
32
+ }