@askrjs/cli 0.0.2

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 (460) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +140 -0
  3. package/dist/add-DqhqRzBQ.js +555 -0
  4. package/dist/add-DqhqRzBQ.js.map +1 -0
  5. package/dist/add.js +3 -0
  6. package/dist/cli.js +91 -0
  7. package/dist/cli.js.map +1 -0
  8. package/dist/create.js +923 -0
  9. package/dist/create.js.map +1 -0
  10. package/dist/is-direct-execution-Cdlr-ZUl.js +20 -0
  11. package/dist/is-direct-execution-Cdlr-ZUl.js.map +1 -0
  12. package/dist/openapi.js +127 -0
  13. package/dist/openapi.js.map +1 -0
  14. package/dist/skills/askr-accessibility/SKILL.md +68 -0
  15. package/dist/skills/askr-accessibility/agents/openai.yaml +4 -0
  16. package/dist/skills/askr-agent-execution/SKILL.md +85 -0
  17. package/dist/skills/askr-agent-execution/agents/openai.yaml +4 -0
  18. package/dist/skills/askr-agent-workflows/SKILL.md +57 -0
  19. package/dist/skills/askr-agent-workflows/agents/openai.yaml +4 -0
  20. package/dist/skills/askr-api-integration/SKILL.md +79 -0
  21. package/dist/skills/askr-api-integration/agents/openai.yaml +4 -0
  22. package/dist/skills/askr-app-builder/SKILL.md +99 -0
  23. package/dist/skills/askr-app-builder/agents/openai.yaml +4 -0
  24. package/dist/skills/askr-auth-access/SKILL.md +74 -0
  25. package/dist/skills/askr-auth-access/agents/openai.yaml +4 -0
  26. package/dist/skills/askr-cli-vite/SKILL.md +76 -0
  27. package/dist/skills/askr-cli-vite/agents/openai.yaml +4 -0
  28. package/dist/skills/askr-dashboard-charts/SKILL.md +82 -0
  29. package/dist/skills/askr-dashboard-charts/agents/openai.yaml +4 -0
  30. package/dist/skills/askr-design-system/SKILL.md +86 -0
  31. package/dist/skills/askr-design-system/agents/openai.yaml +4 -0
  32. package/dist/skills/askr-env-config/SKILL.md +74 -0
  33. package/dist/skills/askr-env-config/agents/openai.yaml +4 -0
  34. package/dist/skills/askr-error-loading-empty/SKILL.md +89 -0
  35. package/dist/skills/askr-error-loading-empty/agents/openai.yaml +4 -0
  36. package/dist/skills/askr-file-upload-artifacts/SKILL.md +77 -0
  37. package/dist/skills/askr-file-upload-artifacts/agents/openai.yaml +4 -0
  38. package/dist/skills/askr-forms-tables-crud/SKILL.md +98 -0
  39. package/dist/skills/askr-forms-tables-crud/agents/openai.yaml +4 -0
  40. package/dist/skills/askr-mental-model/SKILL.md +109 -0
  41. package/dist/skills/askr-mental-model/agents/openai.yaml +4 -0
  42. package/dist/skills/askr-migration-react/SKILL.md +81 -0
  43. package/dist/skills/askr-migration-react/agents/openai.yaml +4 -0
  44. package/dist/skills/askr-observability-debugging/SKILL.md +83 -0
  45. package/dist/skills/askr-observability-debugging/agents/openai.yaml +4 -0
  46. package/dist/skills/askr-project-structure/SKILL.md +79 -0
  47. package/dist/skills/askr-project-structure/agents/openai.yaml +4 -0
  48. package/dist/skills/askr-query-mutation/SKILL.md +115 -0
  49. package/dist/skills/askr-query-mutation/agents/openai.yaml +4 -0
  50. package/dist/skills/askr-realtime-streaming/SKILL.md +76 -0
  51. package/dist/skills/askr-realtime-streaming/agents/openai.yaml +4 -0
  52. package/dist/skills/askr-resources-data/SKILL.md +100 -0
  53. package/dist/skills/askr-resources-data/agents/openai.yaml +4 -0
  54. package/dist/skills/askr-routing-layouts/SKILL.md +107 -0
  55. package/dist/skills/askr-routing-layouts/agents/openai.yaml +4 -0
  56. package/dist/skills/askr-runtime-reactivity/SKILL.md +92 -0
  57. package/dist/skills/askr-runtime-reactivity/agents/openai.yaml +4 -0
  58. package/dist/skills/askr-ssr-ssg/SKILL.md +76 -0
  59. package/dist/skills/askr-ssr-ssg/agents/openai.yaml +4 -0
  60. package/dist/skills/askr-testing-determinism/SKILL.md +75 -0
  61. package/dist/skills/askr-testing-determinism/agents/openai.yaml +4 -0
  62. package/dist/skills/askr-theming/SKILL.md +86 -0
  63. package/dist/skills/askr-theming/agents/openai.yaml +4 -0
  64. package/dist/skills/askr-ui-composition/SKILL.md +92 -0
  65. package/dist/skills/askr-ui-composition/agents/openai.yaml +4 -0
  66. package/dist/skills-Bh0mEhIx.js +682 -0
  67. package/dist/skills-Bh0mEhIx.js.map +1 -0
  68. package/dist/skills.js +3 -0
  69. package/dist/ssg.js +188 -0
  70. package/dist/ssg.js.map +1 -0
  71. package/dist/templates/full-stack/AGENTS.md +12 -0
  72. package/dist/templates/full-stack/README.md +18 -0
  73. package/dist/templates/full-stack/gitignore.template +4 -0
  74. package/dist/templates/full-stack/index.html +14 -0
  75. package/dist/templates/full-stack/package.json +37 -0
  76. package/dist/templates/full-stack/server.ts +13 -0
  77. package/dist/templates/full-stack/src/action-authorizations.ts +10 -0
  78. package/dist/templates/full-stack/src/actions/create-message.ts +10 -0
  79. package/dist/templates/full-stack/src/i18n.ts +8 -0
  80. package/dist/templates/full-stack/src/main.tsx +12 -0
  81. package/dist/templates/full-stack/src/pages/home.tsx +25 -0
  82. package/dist/templates/full-stack/src/pages/layout.tsx +33 -0
  83. package/dist/templates/full-stack/src/pages/not-found.tsx +4 -0
  84. package/dist/templates/full-stack/src/routes.tsx +20 -0
  85. package/dist/templates/full-stack/src/schemas.ts +11 -0
  86. package/dist/templates/full-stack/src/server/action-registry.ts +12 -0
  87. package/dist/templates/full-stack/src/server/actions/create-message.ts +14 -0
  88. package/dist/templates/full-stack/src/server/app.ts +66 -0
  89. package/dist/templates/full-stack/src/server/dependencies.ts +55 -0
  90. package/dist/templates/full-stack/src/server/entry-server.ts +8 -0
  91. package/dist/templates/full-stack/src/telemetry.ts +4 -0
  92. package/dist/templates/full-stack/src/vite-server.d.ts +6 -0
  93. package/dist/templates/full-stack/tests/actions/create-message.test.ts +13 -0
  94. package/dist/templates/full-stack/tsconfig.json +16 -0
  95. package/dist/templates/full-stack/vite.config.ts +11 -0
  96. package/dist/templates/spa/AGENTS.md +60 -0
  97. package/dist/templates/spa/README.md +96 -0
  98. package/dist/templates/spa/gitignore.template +16 -0
  99. package/dist/templates/spa/index.html +13 -0
  100. package/dist/templates/spa/package.json +35 -0
  101. package/dist/templates/spa/src/adapters/operations-client.ts +90 -0
  102. package/dist/templates/spa/src/components/shared/metric-card.tsx +27 -0
  103. package/dist/templates/spa/src/components/shared/status-badge.tsx +24 -0
  104. package/dist/templates/spa/src/features/operations/operations.query.ts +9 -0
  105. package/dist/templates/spa/src/main.tsx +10 -0
  106. package/dist/templates/spa/src/pages/_layout.tsx +9 -0
  107. package/dist/templates/spa/src/pages/_routes.tsx +27 -0
  108. package/dist/templates/spa/src/pages/app/_layout.tsx +94 -0
  109. package/dist/templates/spa/src/pages/app/_routes.tsx +10 -0
  110. package/dist/templates/spa/src/pages/app/admin-home.tsx +152 -0
  111. package/dist/templates/spa/src/pages/app/agent-runs.tsx +93 -0
  112. package/dist/templates/spa/src/pages/app/settings.tsx +91 -0
  113. package/dist/templates/spa/src/pages/auth/_layout.tsx +38 -0
  114. package/dist/templates/spa/src/pages/auth/_routes.tsx +6 -0
  115. package/dist/templates/spa/src/pages/auth/login.tsx +63 -0
  116. package/dist/templates/spa/src/pages/not-found.tsx +22 -0
  117. package/dist/templates/spa/src/pages/public/_layout.tsx +47 -0
  118. package/dist/templates/spa/src/pages/public/_routes.tsx +6 -0
  119. package/dist/templates/spa/src/pages/public/home.tsx +143 -0
  120. package/dist/templates/spa/src/shared/format.ts +12 -0
  121. package/dist/templates/spa/src/shared/navigation.ts +15 -0
  122. package/dist/templates/spa/src/styles/components.css +49 -0
  123. package/dist/templates/spa/src/styles/layout.css +192 -0
  124. package/dist/templates/spa/src/styles/reset.css +44 -0
  125. package/dist/templates/spa/src/styles/theme.css +57 -0
  126. package/dist/templates/spa/src/styles/tokens.css +20 -0
  127. package/dist/templates/spa/src/styles.css +7 -0
  128. package/dist/templates/spa/src/styles.d.ts +1 -0
  129. package/dist/templates/spa/tests/app.test.tsx +37 -0
  130. package/dist/templates/spa/tests/components/shared.test.tsx +12 -0
  131. package/dist/templates/spa/tests/resources.test.ts +22 -0
  132. package/dist/templates/spa/tsconfig.json +20 -0
  133. package/dist/templates/spa/tsconfig.node.json +10 -0
  134. package/dist/templates/spa/vite.config.ts +24 -0
  135. package/dist/templates/spa/vitest.config.ts +17 -0
  136. package/dist/templates/ssg/AGENTS.md +55 -0
  137. package/dist/templates/ssg/README.md +39 -0
  138. package/dist/templates/ssg/gitignore.template +17 -0
  139. package/dist/templates/ssg/index.html +13 -0
  140. package/dist/templates/ssg/package.json +35 -0
  141. package/dist/templates/ssg/src/app.tsx +14 -0
  142. package/dist/templates/ssg/src/components/badge.tsx +3 -0
  143. package/dist/templates/ssg/src/components/counter.tsx +30 -0
  144. package/dist/templates/ssg/src/components/site-shell.tsx +111 -0
  145. package/dist/templates/ssg/src/jsx.d.ts +23 -0
  146. package/dist/templates/ssg/src/main.tsx +8 -0
  147. package/dist/templates/ssg/src/pages/about.tsx +82 -0
  148. package/dist/templates/ssg/src/pages/content.tsx +63 -0
  149. package/dist/templates/ssg/src/pages/example.tsx +97 -0
  150. package/dist/templates/ssg/src/pages/home.tsx +51 -0
  151. package/dist/templates/ssg/src/resources/user.ts +15 -0
  152. package/dist/templates/ssg/src/routes.tsx +15 -0
  153. package/dist/templates/ssg/src/styles.css +89 -0
  154. package/dist/templates/ssg/src/vite-env.d.ts +5 -0
  155. package/dist/templates/ssg/ssg.config.ts +34 -0
  156. package/dist/templates/ssg/tests/app.test.tsx +19 -0
  157. package/dist/templates/ssg/tests/components/counter.test.tsx +18 -0
  158. package/dist/templates/ssg/tests/resources.test.ts +11 -0
  159. package/dist/templates/ssg/tests/ssg-config.test.ts +11 -0
  160. package/dist/templates/ssg/tsconfig.json +20 -0
  161. package/dist/templates/ssg/tsconfig.node.json +10 -0
  162. package/dist/templates/ssg/vite.config.ts +24 -0
  163. package/dist/templates/ssg/vitest.config.ts +17 -0
  164. package/dist/templates/ssr/AGENTS.md +28 -0
  165. package/dist/templates/ssr/README.md +38 -0
  166. package/dist/templates/ssr/gitignore.template +16 -0
  167. package/dist/templates/ssr/index.html +13 -0
  168. package/dist/templates/ssr/package.json +34 -0
  169. package/dist/templates/ssr/server.ts +16 -0
  170. package/dist/templates/ssr/src/app.tsx +21 -0
  171. package/dist/templates/ssr/src/components/counter.tsx +26 -0
  172. package/dist/templates/ssr/src/entry-server.tsx +10 -0
  173. package/dist/templates/ssr/src/main.tsx +11 -0
  174. package/dist/templates/ssr/src/pages/about.tsx +75 -0
  175. package/dist/templates/ssr/src/pages/example.tsx +113 -0
  176. package/dist/templates/ssr/src/pages/home.tsx +56 -0
  177. package/dist/templates/ssr/src/resources/user.ts +15 -0
  178. package/dist/templates/ssr/src/routes.tsx +13 -0
  179. package/dist/templates/ssr/src/styles.css +148 -0
  180. package/dist/templates/ssr/src/vite-server.d.ts +7 -0
  181. package/dist/templates/ssr/tests/app.test.tsx +24 -0
  182. package/dist/templates/ssr/tests/components/counter.test.tsx +13 -0
  183. package/dist/templates/ssr/tests/resources.test.ts +11 -0
  184. package/dist/templates/ssr/tsconfig.json +22 -0
  185. package/dist/templates/ssr/tsconfig.node.json +10 -0
  186. package/dist/templates/ssr/tsconfig.server.json +15 -0
  187. package/dist/templates/ssr/vite.config.ts +25 -0
  188. package/dist/templates/ssr/vitest.config.ts +13 -0
  189. package/dist/templates/startkit/AGENTS.md +77 -0
  190. package/dist/templates/startkit/README.md +192 -0
  191. package/dist/templates/startkit/gitignore.template +16 -0
  192. package/dist/templates/startkit/index.html +13 -0
  193. package/dist/templates/startkit/package.json +35 -0
  194. package/dist/templates/startkit/src/components/app-header.tsx +93 -0
  195. package/dist/templates/startkit/src/components/app-sidebar.tsx +95 -0
  196. package/dist/templates/startkit/src/components/data-table.tsx +80 -0
  197. package/dist/templates/startkit/src/components/empty-state.tsx +13 -0
  198. package/dist/templates/startkit/src/components/page-header.tsx +23 -0
  199. package/dist/templates/startkit/src/components/stat-card.tsx +24 -0
  200. package/dist/templates/startkit/src/features/accounts/account-filters.tsx +61 -0
  201. package/dist/templates/startkit/src/features/accounts/account-table.tsx +79 -0
  202. package/dist/templates/startkit/src/lib/format.ts +31 -0
  203. package/dist/templates/startkit/src/lib/mock-data.ts +441 -0
  204. package/dist/templates/startkit/src/lib/routes.ts +116 -0
  205. package/dist/templates/startkit/src/main.tsx +12 -0
  206. package/dist/templates/startkit/src/pages/_layout.tsx +56 -0
  207. package/dist/templates/startkit/src/pages/auth/_layout.tsx +7 -0
  208. package/dist/templates/startkit/src/pages/auth/login.tsx +129 -0
  209. package/dist/templates/startkit/src/pages/home.tsx +83 -0
  210. package/dist/templates/startkit/src/pages/not-found.tsx +24 -0
  211. package/dist/templates/startkit/src/pages/workspace/_layout.tsx +17 -0
  212. package/dist/templates/startkit/src/pages/workspace/accounts/index.tsx +217 -0
  213. package/dist/templates/startkit/src/pages/workspace/dashboard.tsx +118 -0
  214. package/dist/templates/startkit/src/pages/workspace/settings.tsx +218 -0
  215. package/dist/templates/startkit/src/router.tsx +7 -0
  216. package/dist/templates/startkit/src/routes/auth-config.ts +38 -0
  217. package/dist/templates/startkit/src/routes/auth.ts +8 -0
  218. package/dist/templates/startkit/src/routes/index.ts +28 -0
  219. package/dist/templates/startkit/src/routes/public.ts +8 -0
  220. package/dist/templates/startkit/src/routes/workspace/accounts.ts +8 -0
  221. package/dist/templates/startkit/src/routes/workspace/index.ts +14 -0
  222. package/dist/templates/startkit/src/styles/components.css +396 -0
  223. package/dist/templates/startkit/src/styles/layout.css +192 -0
  224. package/dist/templates/startkit/src/styles/reset.css +38 -0
  225. package/dist/templates/startkit/src/styles/theme.css +76 -0
  226. package/dist/templates/startkit/src/styles/tokens.css +67 -0
  227. package/dist/templates/startkit/src/styles.css +7 -0
  228. package/dist/templates/startkit/src/toast.ts +55 -0
  229. package/dist/templates/startkit/src/utils/join-classes.ts +4 -0
  230. package/dist/templates/startkit/src/vite-env.d.ts +5 -0
  231. package/dist/templates/startkit/tests/app.test.tsx +32 -0
  232. package/dist/templates/startkit/tests/preferences.test.ts +43 -0
  233. package/dist/templates/startkit/tests/resources.test.ts +82 -0
  234. package/dist/templates/startkit/tsconfig.json +20 -0
  235. package/dist/templates/startkit/tsconfig.node.json +10 -0
  236. package/dist/templates/startkit/vite.config.ts +32 -0
  237. package/dist/templates/startkit/vitest.config.ts +13 -0
  238. package/dist/update-DyW1na5V.js +1140 -0
  239. package/dist/update-DyW1na5V.js.map +1 -0
  240. package/dist/update.js +3 -0
  241. package/package.json +84 -0
  242. package/skills/askr-accessibility/SKILL.md +68 -0
  243. package/skills/askr-accessibility/agents/openai.yaml +4 -0
  244. package/skills/askr-agent-execution/SKILL.md +85 -0
  245. package/skills/askr-agent-execution/agents/openai.yaml +4 -0
  246. package/skills/askr-agent-workflows/SKILL.md +57 -0
  247. package/skills/askr-agent-workflows/agents/openai.yaml +4 -0
  248. package/skills/askr-api-integration/SKILL.md +79 -0
  249. package/skills/askr-api-integration/agents/openai.yaml +4 -0
  250. package/skills/askr-app-builder/SKILL.md +99 -0
  251. package/skills/askr-app-builder/agents/openai.yaml +4 -0
  252. package/skills/askr-auth-access/SKILL.md +74 -0
  253. package/skills/askr-auth-access/agents/openai.yaml +4 -0
  254. package/skills/askr-cli-vite/SKILL.md +76 -0
  255. package/skills/askr-cli-vite/agents/openai.yaml +4 -0
  256. package/skills/askr-dashboard-charts/SKILL.md +82 -0
  257. package/skills/askr-dashboard-charts/agents/openai.yaml +4 -0
  258. package/skills/askr-design-system/SKILL.md +86 -0
  259. package/skills/askr-design-system/agents/openai.yaml +4 -0
  260. package/skills/askr-env-config/SKILL.md +74 -0
  261. package/skills/askr-env-config/agents/openai.yaml +4 -0
  262. package/skills/askr-error-loading-empty/SKILL.md +89 -0
  263. package/skills/askr-error-loading-empty/agents/openai.yaml +4 -0
  264. package/skills/askr-file-upload-artifacts/SKILL.md +77 -0
  265. package/skills/askr-file-upload-artifacts/agents/openai.yaml +4 -0
  266. package/skills/askr-forms-tables-crud/SKILL.md +98 -0
  267. package/skills/askr-forms-tables-crud/agents/openai.yaml +4 -0
  268. package/skills/askr-mental-model/SKILL.md +109 -0
  269. package/skills/askr-mental-model/agents/openai.yaml +4 -0
  270. package/skills/askr-migration-react/SKILL.md +81 -0
  271. package/skills/askr-migration-react/agents/openai.yaml +4 -0
  272. package/skills/askr-observability-debugging/SKILL.md +83 -0
  273. package/skills/askr-observability-debugging/agents/openai.yaml +4 -0
  274. package/skills/askr-project-structure/SKILL.md +79 -0
  275. package/skills/askr-project-structure/agents/openai.yaml +4 -0
  276. package/skills/askr-query-mutation/SKILL.md +115 -0
  277. package/skills/askr-query-mutation/agents/openai.yaml +4 -0
  278. package/skills/askr-realtime-streaming/SKILL.md +76 -0
  279. package/skills/askr-realtime-streaming/agents/openai.yaml +4 -0
  280. package/skills/askr-resources-data/SKILL.md +100 -0
  281. package/skills/askr-resources-data/agents/openai.yaml +4 -0
  282. package/skills/askr-routing-layouts/SKILL.md +107 -0
  283. package/skills/askr-routing-layouts/agents/openai.yaml +4 -0
  284. package/skills/askr-runtime-reactivity/SKILL.md +92 -0
  285. package/skills/askr-runtime-reactivity/agents/openai.yaml +4 -0
  286. package/skills/askr-ssr-ssg/SKILL.md +76 -0
  287. package/skills/askr-ssr-ssg/agents/openai.yaml +4 -0
  288. package/skills/askr-testing-determinism/SKILL.md +75 -0
  289. package/skills/askr-testing-determinism/agents/openai.yaml +4 -0
  290. package/skills/askr-theming/SKILL.md +86 -0
  291. package/skills/askr-theming/agents/openai.yaml +4 -0
  292. package/skills/askr-ui-composition/SKILL.md +92 -0
  293. package/skills/askr-ui-composition/agents/openai.yaml +4 -0
  294. package/templates/full-stack/AGENTS.md +12 -0
  295. package/templates/full-stack/README.md +18 -0
  296. package/templates/full-stack/gitignore.template +4 -0
  297. package/templates/full-stack/index.html +14 -0
  298. package/templates/full-stack/package.json +37 -0
  299. package/templates/full-stack/server.ts +13 -0
  300. package/templates/full-stack/src/action-authorizations.ts +10 -0
  301. package/templates/full-stack/src/actions/create-message.ts +10 -0
  302. package/templates/full-stack/src/i18n.ts +8 -0
  303. package/templates/full-stack/src/main.tsx +12 -0
  304. package/templates/full-stack/src/pages/home.tsx +25 -0
  305. package/templates/full-stack/src/pages/layout.tsx +33 -0
  306. package/templates/full-stack/src/pages/not-found.tsx +4 -0
  307. package/templates/full-stack/src/routes.tsx +20 -0
  308. package/templates/full-stack/src/schemas.ts +11 -0
  309. package/templates/full-stack/src/server/action-registry.ts +12 -0
  310. package/templates/full-stack/src/server/actions/create-message.ts +14 -0
  311. package/templates/full-stack/src/server/app.ts +66 -0
  312. package/templates/full-stack/src/server/dependencies.ts +55 -0
  313. package/templates/full-stack/src/server/entry-server.ts +8 -0
  314. package/templates/full-stack/src/telemetry.ts +4 -0
  315. package/templates/full-stack/src/vite-server.d.ts +6 -0
  316. package/templates/full-stack/tests/actions/create-message.test.ts +13 -0
  317. package/templates/full-stack/tsconfig.json +16 -0
  318. package/templates/full-stack/vite.config.ts +11 -0
  319. package/templates/spa/AGENTS.md +60 -0
  320. package/templates/spa/README.md +96 -0
  321. package/templates/spa/gitignore.template +16 -0
  322. package/templates/spa/index.html +13 -0
  323. package/templates/spa/package.json +35 -0
  324. package/templates/spa/src/adapters/operations-client.ts +90 -0
  325. package/templates/spa/src/components/shared/metric-card.tsx +27 -0
  326. package/templates/spa/src/components/shared/status-badge.tsx +24 -0
  327. package/templates/spa/src/features/operations/operations.query.ts +9 -0
  328. package/templates/spa/src/main.tsx +10 -0
  329. package/templates/spa/src/pages/_layout.tsx +9 -0
  330. package/templates/spa/src/pages/_routes.tsx +27 -0
  331. package/templates/spa/src/pages/app/_layout.tsx +94 -0
  332. package/templates/spa/src/pages/app/_routes.tsx +10 -0
  333. package/templates/spa/src/pages/app/admin-home.tsx +152 -0
  334. package/templates/spa/src/pages/app/agent-runs.tsx +93 -0
  335. package/templates/spa/src/pages/app/settings.tsx +91 -0
  336. package/templates/spa/src/pages/auth/_layout.tsx +38 -0
  337. package/templates/spa/src/pages/auth/_routes.tsx +6 -0
  338. package/templates/spa/src/pages/auth/login.tsx +63 -0
  339. package/templates/spa/src/pages/not-found.tsx +22 -0
  340. package/templates/spa/src/pages/public/_layout.tsx +47 -0
  341. package/templates/spa/src/pages/public/_routes.tsx +6 -0
  342. package/templates/spa/src/pages/public/home.tsx +143 -0
  343. package/templates/spa/src/shared/format.ts +12 -0
  344. package/templates/spa/src/shared/navigation.ts +15 -0
  345. package/templates/spa/src/styles/components.css +49 -0
  346. package/templates/spa/src/styles/layout.css +192 -0
  347. package/templates/spa/src/styles/reset.css +44 -0
  348. package/templates/spa/src/styles/theme.css +57 -0
  349. package/templates/spa/src/styles/tokens.css +20 -0
  350. package/templates/spa/src/styles.css +7 -0
  351. package/templates/spa/src/styles.d.ts +1 -0
  352. package/templates/spa/tests/app.test.tsx +37 -0
  353. package/templates/spa/tests/components/shared.test.tsx +12 -0
  354. package/templates/spa/tests/resources.test.ts +22 -0
  355. package/templates/spa/tsconfig.json +20 -0
  356. package/templates/spa/tsconfig.node.json +10 -0
  357. package/templates/spa/vite.config.ts +24 -0
  358. package/templates/spa/vitest.config.ts +17 -0
  359. package/templates/ssg/AGENTS.md +55 -0
  360. package/templates/ssg/README.md +39 -0
  361. package/templates/ssg/gitignore.template +17 -0
  362. package/templates/ssg/index.html +13 -0
  363. package/templates/ssg/package.json +35 -0
  364. package/templates/ssg/src/app.tsx +14 -0
  365. package/templates/ssg/src/components/badge.tsx +3 -0
  366. package/templates/ssg/src/components/counter.tsx +30 -0
  367. package/templates/ssg/src/components/site-shell.tsx +111 -0
  368. package/templates/ssg/src/jsx.d.ts +23 -0
  369. package/templates/ssg/src/main.tsx +8 -0
  370. package/templates/ssg/src/pages/about.tsx +82 -0
  371. package/templates/ssg/src/pages/content.tsx +63 -0
  372. package/templates/ssg/src/pages/example.tsx +97 -0
  373. package/templates/ssg/src/pages/home.tsx +51 -0
  374. package/templates/ssg/src/resources/user.ts +15 -0
  375. package/templates/ssg/src/routes.tsx +15 -0
  376. package/templates/ssg/src/styles.css +89 -0
  377. package/templates/ssg/src/vite-env.d.ts +5 -0
  378. package/templates/ssg/ssg.config.ts +34 -0
  379. package/templates/ssg/tests/app.test.tsx +19 -0
  380. package/templates/ssg/tests/components/counter.test.tsx +18 -0
  381. package/templates/ssg/tests/resources.test.ts +11 -0
  382. package/templates/ssg/tests/ssg-config.test.ts +11 -0
  383. package/templates/ssg/tsconfig.json +20 -0
  384. package/templates/ssg/tsconfig.node.json +10 -0
  385. package/templates/ssg/vite.config.ts +24 -0
  386. package/templates/ssg/vitest.config.ts +17 -0
  387. package/templates/ssr/AGENTS.md +28 -0
  388. package/templates/ssr/README.md +38 -0
  389. package/templates/ssr/gitignore.template +16 -0
  390. package/templates/ssr/index.html +13 -0
  391. package/templates/ssr/package.json +34 -0
  392. package/templates/ssr/server.ts +16 -0
  393. package/templates/ssr/src/app.tsx +21 -0
  394. package/templates/ssr/src/components/counter.tsx +26 -0
  395. package/templates/ssr/src/entry-server.tsx +10 -0
  396. package/templates/ssr/src/main.tsx +11 -0
  397. package/templates/ssr/src/pages/about.tsx +75 -0
  398. package/templates/ssr/src/pages/example.tsx +113 -0
  399. package/templates/ssr/src/pages/home.tsx +56 -0
  400. package/templates/ssr/src/resources/user.ts +15 -0
  401. package/templates/ssr/src/routes.tsx +13 -0
  402. package/templates/ssr/src/styles.css +148 -0
  403. package/templates/ssr/src/vite-server.d.ts +7 -0
  404. package/templates/ssr/tests/app.test.tsx +24 -0
  405. package/templates/ssr/tests/components/counter.test.tsx +13 -0
  406. package/templates/ssr/tests/resources.test.ts +11 -0
  407. package/templates/ssr/tsconfig.json +22 -0
  408. package/templates/ssr/tsconfig.node.json +10 -0
  409. package/templates/ssr/tsconfig.server.json +15 -0
  410. package/templates/ssr/vite.config.ts +25 -0
  411. package/templates/ssr/vitest.config.ts +13 -0
  412. package/templates/startkit/AGENTS.md +77 -0
  413. package/templates/startkit/README.md +192 -0
  414. package/templates/startkit/gitignore.template +16 -0
  415. package/templates/startkit/index.html +13 -0
  416. package/templates/startkit/package.json +35 -0
  417. package/templates/startkit/src/components/app-header.tsx +93 -0
  418. package/templates/startkit/src/components/app-sidebar.tsx +95 -0
  419. package/templates/startkit/src/components/data-table.tsx +80 -0
  420. package/templates/startkit/src/components/empty-state.tsx +13 -0
  421. package/templates/startkit/src/components/page-header.tsx +23 -0
  422. package/templates/startkit/src/components/stat-card.tsx +24 -0
  423. package/templates/startkit/src/features/accounts/account-filters.tsx +61 -0
  424. package/templates/startkit/src/features/accounts/account-table.tsx +79 -0
  425. package/templates/startkit/src/lib/format.ts +31 -0
  426. package/templates/startkit/src/lib/mock-data.ts +441 -0
  427. package/templates/startkit/src/lib/routes.ts +116 -0
  428. package/templates/startkit/src/main.tsx +12 -0
  429. package/templates/startkit/src/pages/_layout.tsx +56 -0
  430. package/templates/startkit/src/pages/auth/_layout.tsx +7 -0
  431. package/templates/startkit/src/pages/auth/login.tsx +129 -0
  432. package/templates/startkit/src/pages/home.tsx +83 -0
  433. package/templates/startkit/src/pages/not-found.tsx +24 -0
  434. package/templates/startkit/src/pages/workspace/_layout.tsx +17 -0
  435. package/templates/startkit/src/pages/workspace/accounts/index.tsx +217 -0
  436. package/templates/startkit/src/pages/workspace/dashboard.tsx +118 -0
  437. package/templates/startkit/src/pages/workspace/settings.tsx +218 -0
  438. package/templates/startkit/src/router.tsx +7 -0
  439. package/templates/startkit/src/routes/auth-config.ts +38 -0
  440. package/templates/startkit/src/routes/auth.ts +8 -0
  441. package/templates/startkit/src/routes/index.ts +28 -0
  442. package/templates/startkit/src/routes/public.ts +8 -0
  443. package/templates/startkit/src/routes/workspace/accounts.ts +8 -0
  444. package/templates/startkit/src/routes/workspace/index.ts +14 -0
  445. package/templates/startkit/src/styles/components.css +396 -0
  446. package/templates/startkit/src/styles/layout.css +192 -0
  447. package/templates/startkit/src/styles/reset.css +38 -0
  448. package/templates/startkit/src/styles/theme.css +76 -0
  449. package/templates/startkit/src/styles/tokens.css +67 -0
  450. package/templates/startkit/src/styles.css +7 -0
  451. package/templates/startkit/src/toast.ts +55 -0
  452. package/templates/startkit/src/utils/join-classes.ts +4 -0
  453. package/templates/startkit/src/vite-env.d.ts +5 -0
  454. package/templates/startkit/tests/app.test.tsx +32 -0
  455. package/templates/startkit/tests/preferences.test.ts +43 -0
  456. package/templates/startkit/tests/resources.test.ts +82 -0
  457. package/templates/startkit/tsconfig.json +20 -0
  458. package/templates/startkit/tsconfig.node.json +10 -0
  459. package/templates/startkit/vite.config.ts +32 -0
  460. package/templates/startkit/vitest.config.ts +13 -0
@@ -0,0 +1,77 @@
1
+ ---
2
+ name: askr-file-upload-artifacts
3
+ description: Use when building Askr file uploads, generated artifacts, progress, previews, validation, storage adapters, downloads, open flows, virus-scan or processing states, and event-sourced artifact readiness.
4
+ ---
5
+
6
+ # Askr File Upload Artifacts
7
+
8
+ Use this for uploads, downloads, previews, and generated files. The goal is one clear upload workflow, explicit processing truth, and no loss of progress or readiness state.
9
+
10
+ ## Use This When
11
+
12
+ - You need file selection, upload, processing, preview, or download flows.
13
+ - Artifacts may be generated asynchronously after upload.
14
+ - You need progress, retry, cancellation, or readiness reconciliation.
15
+ - Validation rules include type, size, count, privacy, or retention.
16
+
17
+ ## Inspect First
18
+
19
+ - Adapter support for upload URLs, multipart uploads, or artifact APIs
20
+ - Feature workflow for create, upload, process, and download
21
+ - File validation rules: type, size, count, privacy, retention
22
+ - Artifact processing states and event stream support
23
+
24
+ ## Choose The Boundary
25
+
26
+ - `src/adapters`: upload transport, signed URL calls, artifact downloads.
27
+ - `src/features/<feature>`: validation, upload workflow, and artifact query or mutation state.
28
+ - `src/components/shared`: reusable file picker, progress list, and preview shell.
29
+ - `src/shared`: size formatting, safe filename helpers, and error normalization.
30
+
31
+ ## Do This In Order
32
+
33
+ 1. Keep file validation explicit before upload starts.
34
+ 2. Model selection, uploading, processing, ready, and failure as separate states.
35
+ 3. Preserve upload ID, artifact ID, processing job ID, and last event ID when readiness is asynchronous.
36
+ 4. Treat upload completion and artifact readiness as separate truths.
37
+ 5. Allow retry or refresh without duplicating uploads where possible.
38
+
39
+ ## Copy This Shape
40
+
41
+ ```ts
42
+ type ArtifactStatus =
43
+ | "selected"
44
+ | "uploading"
45
+ | "processing"
46
+ | "ready"
47
+ | "failed-validation"
48
+ | "failed-upload"
49
+ | "failed-processing";
50
+ ```
51
+
52
+ ## Never Do These
53
+
54
+ - Pretending an artifact is ready immediately after upload when processing is asynchronous.
55
+ - Client-only validation as the only protection.
56
+ - Losing progress and error state on route-local rerenders.
57
+ - Download links without accessible names or file metadata.
58
+
59
+ ## Validate
60
+
61
+ - Validation, upload, processing, ready, and failure states are visible.
62
+ - Upload cancellation or retry behavior is explicit.
63
+ - Large files and unsupported types fail clearly.
64
+ - Artifact readiness is reconciled from server state.
65
+
66
+ ## Done When
67
+
68
+ - Upload completion and artifact readiness are modeled separately.
69
+ - Progress and error state survive the owning workflow.
70
+ - Artifact metadata is preserved for retries and reconciliation.
71
+ - Users can understand whether a file is uploaded, processing, ready, or failed.
72
+
73
+ ## Handoff
74
+
75
+ - Use `askr-api-integration` when signed URLs or artifact APIs are the hard part.
76
+ - Use `askr-error-loading-empty` when the hard part is presenting processing and failure truth.
77
+ - Use `askr-testing-determinism` before closing upload and retry behavior.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Askr File Upload Artifacts"
3
+ short_description: "Handle uploads and artifacts"
4
+ default_prompt: "Use $askr-file-upload-artifacts to build file workflows."
@@ -0,0 +1,98 @@
1
+ ---
2
+ name: askr-forms-tables-crud
3
+ description: Use when building askr CRUD screens, forms, validation, filters, tables, pagination, selection, bulk actions, confirmation dialogs, row actions, resource/query data flow, and feature folder boundaries.
4
+ ---
5
+
6
+ # Askr Forms Tables CRUD
7
+
8
+ Use this for create, read, update, archive, filter, paginate, and edit workflows. The goal is a predictable split between route composition, feature workflow state, and transport boundaries.
9
+
10
+ ## Inspect First
11
+
12
+ - The nearest page that owns a table or form.
13
+ - The nearest feature folder for the same domain.
14
+ - The adapter or service that owns transport.
15
+ - Existing tests that cover filtering, submission, or destructive actions.
16
+
17
+ ## Use This When
18
+
19
+ - You are adding a list, detail, create, edit, archive, or bulk-action flow.
20
+ - You need filters, pagination, selection, or row actions.
21
+ - You need field validation and server validation errors.
22
+ - You need a safe destructive action flow.
23
+
24
+ ## Pick The Owner
25
+
26
+ - The route or page composes the screen.
27
+ - The feature folder owns filters, form state, table columns, queries, and mutations.
28
+ - The adapter owns fetch, update, archive, and DTO mapping.
29
+ - Shared helpers own cross-cutting formatting and validation helpers when reused.
30
+
31
+ ## Copy This Shape
32
+
33
+ ```text
34
+ src/pages/app/users.tsx
35
+ src/features/users/user-table.tsx
36
+ src/features/users/user-filters.tsx
37
+ src/features/users/user-form.tsx
38
+ src/features/users/users.query.ts
39
+ src/features/users/users.mutation.ts
40
+ src/adapters/users-client.ts
41
+ src/shared/format.ts
42
+ ```
43
+
44
+ Routes compose the screen. Features own domain UI and workflow state. Adapters own transport. Shared helpers own cross-cutting formatting or validation utilities.
45
+
46
+ ## Do This In Order
47
+
48
+ 1. Choose the async owner first: `resource()` for route-owned reads, `createQuery()` for shared keyed reads, and `createMutation()` for writes.
49
+ 2. Keep filters, pagination, dialog state, and selected IDs in local `state()` pairs, and read or write each one through its `[getter, setter]` pair.
50
+ 3. Keep field validation and submit handling explicit in the feature layer.
51
+ 4. Confirm destructive actions before archive or delete.
52
+ 5. Refresh or invalidate after create, update, archive, or delete.
53
+
54
+ ## Table Rules
55
+
56
+ - Use stable row keys, never index keys for records.
57
+ - Put feature-specific columns in the feature folder.
58
+ - Use `selector()` for keyed row selection fanout when the table is large or hot.
59
+ - Provide loading, empty, error, and disabled action states.
60
+ - Keep formatting in `src/shared/format.ts` or a domain feature helper.
61
+
62
+ ## Form Rules
63
+
64
+ - Keep form state local unless multiple routes need it.
65
+ - Put validation rules in `src/features/<feature>` when domain-specific, or `src/shared` when cross-cutting.
66
+ - Use `@askrjs/ui` form controls for behavior and accessibility.
67
+ - Disable submit while pending and surface field or form errors explicitly.
68
+
69
+ - API clients in table, form, or generic UI components.
70
+ - Bound live or frequently updating rows so tables and timelines do not churn the whole DOM.
71
+ - Keep filtering, sorting, and pagination state together in the feature workflow instead of scattering it across route files.
72
+ - Business rules in reusable primitives.
73
+ - Hidden destructive actions without confirmation.
74
+ - Duplicated pagination/filter logic across route files.
75
+ - A table component that imports a raw API client and mutates records directly from row actions.
76
+ - A form that shows only a toast on submit failure and never maps field errors back to inputs.
77
+ - Pagination, sorting, and filter state duplicated in multiple route pages.
78
+
79
+ ## Validate
80
+
81
+ - CRUD ownership boundaries are obvious.
82
+ - Every async path has loading, error, retry, or disabled feedback.
83
+ - Selection, bulk actions, and destructive actions are keyboard reachable.
84
+ - Submit handlers preserve pending state and field or form errors.
85
+ - Record rows use stable keys.
86
+
87
+ ## Done When
88
+
89
+ - Form, table, mutation, and adapter ownership are separated.
90
+ - Field errors, form errors, pending state, and success state are all visible.
91
+ - Selection, filters, sorting, and destructive actions are keyboard reachable.
92
+ - Rows keep stable identity and large updates do not force whole-list churn.
93
+
94
+ ## Handoff
95
+
96
+ - Use `askr-query-mutation` when the form or table state becomes shared keyed state across screens.
97
+ - Use `askr-accessibility` when validation, focus, or destructive-action UX is the hard part.
98
+ - Use `askr-testing-determinism` to validate submit, retry, selection, and list identity behavior.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Askr Forms Tables CRUD"
3
+ short_description: "Build CRUD forms and tables"
4
+ default_prompt: "Use $askr-forms-tables-crud to build a CRUD workflow in askr."
@@ -0,0 +1,109 @@
1
+ ---
2
+ name: askr-mental-model
3
+ description: Use when an AI agent or developer needs the canonical Askr mental model, including what Askr is, what it is not, how core primitives fit together, and which React-style assumptions must be rejected.
4
+ ---
5
+
6
+ # Askr Mental Model
7
+
8
+ Use this before building or reviewing Askr code when primitive choice is unclear. This skill exists to keep agents on the native Askr path and off React-shaped defaults.
9
+
10
+ ## Use This When
11
+
12
+ - Primitive choice is unclear.
13
+ - The task looks like React, hooks, or a generic SPA by default.
14
+ - You need to decide who owns local state, async reads, or writes.
15
+ - You need one obvious Askr-native shape before editing.
16
+
17
+ ## Inspect First
18
+
19
+ - `AGENTS.md` when it exists
20
+ - `src/main.tsx`
21
+ - The nearest route file and layout file
22
+ - The nearest existing feature that solves a similar problem
23
+ - Existing tests for the touched surface
24
+
25
+ ## What Askr Expects
26
+
27
+ - Route-first ownership.
28
+ - Synchronous route components.
29
+ - Explicit runtime primitives for state, derived state, lifecycle-owned async work, shared server state, and writes.
30
+ - Honest UI for loading, empty, error, stale, and pending-write states.
31
+
32
+ ## What Askr Is Not
33
+
34
+ - Not a React hooks runtime.
35
+ - Not a place to default to `useEffect` data loading.
36
+ - Not a reason to add React Router, TanStack Query, or a global state library first.
37
+ - Not a place to clone solved `Button`, `Card`, `Sidebar`, `EmptyState`, or shell primitives before checking the existing theme and UI layers.
38
+
39
+ ## Pick The Primitive
40
+
41
+ - Local mutable UI state: use `state()` as a `[getter, setter]` pair.
42
+ - Computed value from reactive reads: use `derive()`.
43
+ - One source fans out to many keyed readers: use `selector()`.
44
+ - One route or container owns an async read lifecycle: use `resource()`.
45
+ - Shared keyed server state used across screens: use `createQuery()`.
46
+ - Writes with pending, error, and reconciliation state: use `createMutation()`.
47
+ - Keyed or dynamic list identity matters: use `For`.
48
+
49
+ ## Copy This Shape
50
+
51
+ ```tsx
52
+ import { derive, selector, state } from "@askrjs/askr";
53
+ import { For } from "@askrjs/askr/control";
54
+
55
+ const [selectedId, setSelectedId] = state<string | null>(null);
56
+ const isSelected = selector(selectedId);
57
+ const items = derive(() => [
58
+ { id: "queued", label: "Queued" },
59
+ { id: "running", label: "Running" },
60
+ { id: "done", label: "Done" },
61
+ ]);
62
+
63
+ export default function RunFilterBar() {
64
+ return (
65
+ <nav aria-label="Run status filters">
66
+ <For each={items()} by={(item) => item.id}>
67
+ {(item) => (
68
+ <button
69
+ type="button"
70
+ aria-pressed={isSelected(item.id)}
71
+ onClick={() => setSelectedId(item.id)}
72
+ >
73
+ {item.label}
74
+ </button>
75
+ )}
76
+ </For>
77
+ </nav>
78
+ );
79
+ }
80
+ ```
81
+
82
+ ## Reject These Shapes
83
+
84
+ - React imports or hook-shaped state as the default solution.
85
+ - Effect-driven loading when the UI depends on the async result.
86
+ - Treating getters like plain values instead of callable reads.
87
+ - Creating runtime helpers conditionally.
88
+ - Defaulting to `.map()` for large or dynamic keyed lists where `For` should own identity.
89
+ - Hiding data transport, mapping, and mutations inside pages or presentational components.
90
+
91
+ ## Validate
92
+
93
+ - Primitive choice is explainable in one sentence.
94
+ - Route components remain synchronous.
95
+ - Keyed UI uses stable IDs.
96
+ - No React runtime imports or hook defaults slipped in.
97
+ - Async state truth is explicit where the user can observe it.
98
+
99
+ ## Done When
100
+
101
+ - The code reads like Askr, not like translated React.
102
+ - No invented primitives or parallel state layers were added.
103
+ - The next narrower skill is obvious from the changed surface.
104
+
105
+ ## Handoff
106
+
107
+ - Use `askr-routing-layouts` when the next step is route ownership or shell structure.
108
+ - Use `askr-resources-data` or `askr-query-mutation` when the next step is async ownership.
109
+ - Use `askr-runtime-reactivity` when the next step is local state or keyed rendering behavior.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Askr Mental Model"
3
+ short_description: "Learn the canonical Askr runtime model"
4
+ default_prompt: "Use $askr-mental-model before building or reviewing Askr application code."
@@ -0,0 +1,81 @@
1
+ ---
2
+ name: askr-migration-react
3
+ description: Use when translating React-shaped code, habits, or component designs into idiomatic Askr, including replacing useState/useEffect patterns, JSX assumptions, data fetching, routing, context, component APIs, and UI primitive choices.
4
+ ---
5
+
6
+ # Askr Migration React
7
+
8
+ Use this only when a task, sample, or codebase slice is React-shaped and must be translated into idiomatic Askr. It is a transition skill, not a default entrypoint for normal Askr feature work.
9
+
10
+ ## Use This When
11
+
12
+ - The input code or prompt uses React hooks, React Router, or React-only UI assumptions.
13
+ - A generated design mirrors React patterns that need translation before implementation.
14
+ - A migration task needs native Askr ownership for state, async work, routing, or primitives.
15
+ - The fastest path is to convert a known React shape instead of designing from scratch.
16
+
17
+ ## Inspect First
18
+
19
+ - The current app's Askr imports and component patterns
20
+ - The route tree and feature boundaries already present in the repo
21
+ - The React-shaped state, async, routing, and primitive assumptions you are replacing
22
+
23
+ ## Choose The Replacement
24
+
25
+ - React `useState` -> Askr `state()` as a `[getter, setter]` pair.
26
+ - React `useMemo` -> Askr `derive()` when a reactive computation is needed.
27
+ - React `useEffect` data loading -> Askr `resource()` or `createQuery()` based on ownership.
28
+ - React Router component routes -> Askr route registration with `group()`, `page()`, `route()`, and `fallback()`.
29
+ - React context -> Askr `defineScope()` and `readScope()`.
30
+ - React keyed list `.map` -> `For` when identity or dynamic list updates matter.
31
+
32
+ ## Do This In Order
33
+
34
+ 1. Identify whether the React-shaped code is really local state, shared data, routing, context, or primitive behavior.
35
+ 2. Remove React imports and hook assumptions before translating line by line.
36
+ 3. Replace state, async, routing, and context with the owning Askr primitives.
37
+ 4. Move feature logic to the correct route, feature, adapter, or shared boundary.
38
+ 5. Replace React-only UI libraries with Askr-compatible primitives when behavior matters.
39
+ 6. Validate call order, async truth, and route registration before closing the migration.
40
+
41
+ ## Copy This Shape
42
+
43
+ ```tsx
44
+ import { state } from "@askrjs/askr";
45
+ import { resource } from "@askrjs/askr/resources";
46
+
47
+ const [open, setOpen] = state(false);
48
+ const user = resource(({ signal }) => loadUser(id, { signal }), [id]);
49
+
50
+ <button onClick={() => setOpen((value) => !value)}>{open() ? "Close" : "Open"}</button>;
51
+ ```
52
+
53
+ ## Never Do These
54
+
55
+ - Importing React hooks or React runtime helpers.
56
+ - Treating state getters like values instead of functions.
57
+ - Porting React Router route components directly.
58
+ - Hiding async work in effects when the UI depends on it.
59
+ - Assuming third-party React component packages are compatible.
60
+
61
+ ## Validate
62
+
63
+ - No React imports remain unless the project intentionally embeds React separately.
64
+ - Runtime helper call order is stable.
65
+ - Async work has cancellation and visible loading or error states.
66
+ - Routing uses Askr route registration.
67
+ - Interactive UI uses Askr-compatible primitives.
68
+
69
+ ## Done When
70
+
71
+ - The translated code reads like Askr instead of line-by-line React porting.
72
+ - State, async work, routing, and context use native Askr ownership.
73
+ - Feature logic sits in the right file boundaries.
74
+ - Remaining UI assumptions are compatible with the app's existing primitives.
75
+
76
+ ## Handoff
77
+
78
+ - Use `askr-mental-model` when primitive choice is still unclear.
79
+ - Use `askr-project-structure` when the migration requires moving files or ownership boundaries.
80
+ - Use `askr-query-mutation` or `askr-resources-data` when async ownership is the real blocker.
81
+ - Use `askr-testing-determinism` before closing migrated behavior.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Askr Migration React"
3
+ short_description: "Translate React habits to askr"
4
+ default_prompt: "Use $askr-migration-react to convert React-shaped code into askr."
@@ -0,0 +1,83 @@
1
+ ---
2
+ name: askr-observability-debugging
3
+ description: Use when adding Askr observability, debugging, structured logs, request IDs, trace IDs, query and mutation diagnostics, event-sourced replay context, agent-run audit trails, and dev-only diagnostics.
4
+ ---
5
+
6
+ # Askr Observability Debugging
7
+
8
+ Use this when failures must be explainable to users, developers, or operators. The goal is preserved correlation data, safe user-facing errors, and diagnosable stale or event-driven failures.
9
+
10
+ ## Use This When
11
+
12
+ - A failure needs request, trace, command, run, or event correlation.
13
+ - You need safe user-visible error copy plus deeper operator diagnostics.
14
+ - The UI depends on stale-state or eventual-consistency diagnostics.
15
+ - An agent workflow, realtime flow, or write path needs audit-friendly tracing.
16
+
17
+ ## Inspect First
18
+
19
+ - Existing error normalization and logging helpers in `src/shared`
20
+ - API request and response metadata available from adapters
21
+ - Query and mutation consistency or error states
22
+ - Agent run IDs, command IDs, event IDs, and audit requirements
23
+
24
+ ## Preserve These IDs
25
+
26
+ - Request ID or trace ID.
27
+ - User, session, or workspace ID where safe.
28
+ - Command ID, idempotency key, aggregate ID, version, event ID, or projection cursor.
29
+ - Query key and invalidation prefix.
30
+ - Run ID, tool call ID, approval ID, and artifact ID for agentic workflows.
31
+
32
+ ## Do This In Order
33
+
34
+ 1. Preserve correlation metadata at the adapter boundary.
35
+ 2. Normalize errors into a user-safe message plus structured diagnostics.
36
+ 3. Show safe copy to users and deeper context only in logs or dev-only panels.
37
+ 4. Preserve stale-state, projection, or replay context when eventual consistency matters.
38
+ 5. Add focused tests for duplicate-event, stale-state, or correlation behavior when the flow depends on it.
39
+
40
+ ## Copy This Shape
41
+
42
+ ```ts
43
+ const normalized = normalizeApiError(error, {
44
+ requestId,
45
+ commandId,
46
+ eventId,
47
+ queryKey: "accounts:list",
48
+ });
49
+
50
+ logError("accounts.refresh.failed", normalized.diagnostics);
51
+ return {
52
+ message: "Unable to refresh accounts.",
53
+ diagnostics: normalized.diagnostics,
54
+ };
55
+ ```
56
+
57
+ ## Never Do These
58
+
59
+ - Swallowing errors in async handlers.
60
+ - Console-only diagnostics for production-critical flows.
61
+ - Showing raw stack traces or transport payloads to users.
62
+ - Losing correlation IDs between adapters, features, and UI errors.
63
+ - Logging private prompts, tokens, or sensitive request bodies to preserve debugging context.
64
+
65
+ ## Validate
66
+
67
+ - Errors include user-safe copy and developer-useful context.
68
+ - Eventual-consistency states are diagnosable.
69
+ - Agent workflows have audit-friendly run and event IDs.
70
+ - Logs do not contain secrets or private prompts.
71
+
72
+ ## Done When
73
+
74
+ - User-facing failures stay safe and intelligible.
75
+ - Operators have enough correlation data to trace the issue.
76
+ - Stale or event-sourced failures are diagnosable separately from command success.
77
+ - No logs or diagnostics leak secrets or private prompts.
78
+
79
+ ## Handoff
80
+
81
+ - Use `askr-api-integration` when metadata is being dropped before it reaches the feature layer.
82
+ - Use `askr-agent-workflows` when run IDs, tool calls, approvals, or artifacts need user-facing traceability.
83
+ - Use `askr-testing-determinism` to prove duplicate-event, stale-state, or error-correlation behavior.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Askr Observability Debugging"
3
+ short_description: "Trace and debug Askr workflows"
4
+ default_prompt: "Use $askr-observability-debugging to add diagnostics."
@@ -0,0 +1,79 @@
1
+ ---
2
+ name: askr-project-structure
3
+ description: Use when deciding where Askr app files belong, naming components, separating route-first pages, layouts, features, shared helpers, adapters, reusable UI, tests, and package-owned responsibilities.
4
+ ---
5
+
6
+ # Askr Project Structure
7
+
8
+ Use this before creating, moving, or splitting files. The goal is one obvious owner per file and no parallel architecture.
9
+
10
+ ## Use This When
11
+
12
+ - You need to add a new file.
13
+ - You are tempted to put logic in a page because it is nearby.
14
+ - The repo already has routes, features, adapters, or shared helpers and you need the right owner.
15
+ - You want to avoid duplicate structures for the same concern.
16
+
17
+ ## Inspect First
18
+
19
+ - The existing route registry and nearest `_layout.tsx` owner.
20
+ - The nearest existing feature folder for the same domain.
21
+ - The nearest adapter, shared helper, and reusable component folder.
22
+ - Existing tests for the same surface.
23
+
24
+ ## Keep The Existing App Shape
25
+
26
+ - If the repo uses `src/pages/**/_routes.tsx`, keep using it.
27
+ - If the repo uses `src/routes/*`, keep using it.
28
+ - If the repo uses `src/shared`, keep shared helpers there.
29
+ - If the repo uses `src/lib` for shared helpers, keep using it.
30
+ - Do not create a second route tree, a second shared layer, or a second feature layout because one file looked easier.
31
+
32
+ ## Pick The Owner
33
+
34
+ - URL reachability: nearest route registry file.
35
+ - Shell chrome or persistent branch UI: matching `_layout.tsx`.
36
+ - Domain workflow, queries, mutations, and feature UI: `src/features/<feature>/`.
37
+ - Reusable display-only pieces: the repo's shared components folder.
38
+ - Cross-cutting helpers such as formatting or parsing: the repo's shared helper folder.
39
+ - Generated clients, raw fetch wrappers, and DTO mapping: `src/adapters/`.
40
+ - Visual styling and tokens: CSS or theme layer, not runtime logic.
41
+
42
+ ## Copy This Shape
43
+
44
+ ```text
45
+ src/pages/app/billing.tsx # route-owned page shell
46
+ src/features/billing/billing-form.tsx
47
+ src/features/billing/billing.query.ts
48
+ src/adapters/billing-client.ts
49
+ src/shared/format-money.ts
50
+ ```
51
+
52
+ ## Reject These Shapes
53
+
54
+ - `src/pages/app/billing.tsx` importing a generated API client directly.
55
+ - `src/components/shared/billing-table.tsx` owning billing mutations and route redirects.
56
+ - `src/shared/billing.tsx` containing JSX and transport code together.
57
+ - API clients in components or UI primitives.
58
+ - Business logic or transport code in `src/pages`.
59
+ - JSX in `src/shared` or `src/adapters`.
60
+ - Duplicate shells across pages.
61
+ - One component that owns routing, fetching, mutation, and styling.
62
+ - Parallel abstractions for a concern Askr already owns.
63
+
64
+ ## Validate
65
+
66
+ - Another agent could predict where the file belongs.
67
+ - No page directly owns raw transport or DTO mapping.
68
+ - No JSX leaked into adapters or shared helper files.
69
+ - New folders match the existing repo shape instead of creating a second one.
70
+
71
+ ## Done When
72
+
73
+ - No duplicate structure was introduced for the same concern.
74
+
75
+ ## Handoff
76
+
77
+ - Use `askr-routing-layouts` when the hard part is URL ownership.
78
+ - Use `askr-resources-data` or `askr-query-mutation` when the hard part is async ownership.
79
+ - Use `askr-testing-determinism` once ownership is settled and you need validation.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Askr Project Structure"
3
+ short_description: "Place Askr files in the right layer"
4
+ default_prompt: "Use $askr-project-structure to decide where Askr app files belong."
@@ -0,0 +1,115 @@
1
+ ---
2
+ name: askr-query-mutation
3
+ description: Use when modeling shared server state in Askr with createQuery, createMutation, invalidate, service boundaries, consistency states, pending writes, cache keys, event-sourced read models, and explicit read/write coordination.
4
+ ---
5
+
6
+ # Askr Query Mutation
7
+
8
+ Use this for shared keyed reads and writes that must coordinate across screens or survive beyond one render. The goal is deliberate keys, narrow invalidation, and truthful write reconciliation.
9
+
10
+ ## Use This When
11
+
12
+ - Multiple screens need the same keyed server state.
13
+ - A write must invalidate or reconcile shared reads.
14
+ - The UI needs pending, error, stale, or pending-write truth after a mutation.
15
+ - Event-sourced or eventually consistent data needs explicit reconciliation.
16
+
17
+ ## Inspect First
18
+
19
+ - Existing query keys and invalidation prefixes.
20
+ - The nearest feature owner for the data.
21
+ - The adapter or service boundary that should receive `signal`.
22
+ - Existing stale, syncing, or pending-write UI on the same surface.
23
+
24
+ ## Pick The Data Owner First
25
+
26
+ - One route or container owns the read and no other screen shares it: use `askr-resources-data`.
27
+ - Shared keyed read that multiple screens can refresh or invalidate: use `createQuery()`.
28
+ - Write with visible pending, error, result, and invalidation behavior: use `createMutation()`.
29
+
30
+ ## Do This In Order
31
+
32
+ 1. Design a stable, prefix-friendly query key.
33
+ 2. Keep fetch and mutation transport in an adapter or service boundary.
34
+ 3. Use `createQuery()` for the shared read and `createMutation()` for the write.
35
+ 4. Invalidate only the affected key or prefix after success.
36
+ 5. Preserve version, event ID, cursor, or command metadata when the UI must reason about projection lag.
37
+
38
+ ## Copy This Shape
39
+
40
+ ```ts
41
+ import { createQuery, invalidate } from "@askrjs/askr/data";
42
+
43
+ const user = createQuery({
44
+ key: `user:${id}`,
45
+ fetch: ({ signal }) => userService.getUser(id, { signal }),
46
+ });
47
+
48
+ await user.refresh();
49
+ invalidate("user:");
50
+ ```
51
+
52
+ ## Mutation Shape
53
+
54
+ ```ts
55
+ import { createMutation } from "@askrjs/askr/data";
56
+
57
+ const saveUser = createMutation({
58
+ action: (input, { signal }) => userService.updateUser(input, { signal }),
59
+ affects: (input) => [`user:${input.id}`, "users:"],
60
+ afterSuccess: "invalidate",
61
+ });
62
+
63
+ await saveUser.execute({ id, name });
64
+ ```
65
+
66
+ - Only use optimistic updates when rollback or refetch behavior is explicit.
67
+ - If the backend is event-sourced, prefer truthful `pending-write` or `syncing` UI over pretending the projection already caught up.
68
+ - Keep optimistic local intent separate from confirmed read-model state.
69
+
70
+ ## Event-Sourced Consistency
71
+
72
+ Use this pattern when writes append events and reads come from projections:
73
+
74
+ - Command success means the write was accepted, not necessarily that every read model is caught up.
75
+ - Include command ID, aggregate ID, expected version, observed version, event ID, or projection cursor in mutation results when the backend exposes them.
76
+ - Use `affects` and `afterSuccess: 'invalidate'` to mark affected queries as `pending-write` and refresh them.
77
+ - Keep the old query data visible while `consistency` is `pending-write`, `refreshing`, or `stale`.
78
+ - On stream reconnect or cursor gaps, invalidate the affected query prefix instead of replaying uncertain local state.
79
+ - Use `isConsistent` to compare returned read data against expected versions or event IDs.
80
+ - Use `reconcile` to retry while a projection is behind, with user-visible stale/syncing feedback.
81
+
82
+ ```ts
83
+ const account = createQuery({
84
+ key: `account:${id}`,
85
+ fetch: ({ signal }) => accountsService.getAccount(id, { signal }),
86
+ isConsistent: (data) => data.version >= expectedVersion(),
87
+ reconcile: () => true,
88
+ });
89
+ ```
90
+
91
+ - Fetching directly in many leaf components.
92
+ - Hiding writes inside presentational UI.
93
+ - Cache keys that cannot be invalidated predictably.
94
+ - Generic query clients or global state abstractions unless the app already owns one.
95
+ - Optimistic updates without rollback or refetch.
96
+ - Treating write acknowledgement as read-model convergence in event-sourced systems.
97
+ - Cache keys that mix route-local UI state with shared server-state identity.
98
+
99
+ ## Validate
100
+
101
+ - Query keys are stable and prefix-friendly.
102
+ - `signal` reaches the service boundary.
103
+ - Mutation pending and error states are visible outside the button that triggered them.
104
+ - Success invalidates only the affected read model.
105
+ - Event or version metadata is preserved when the UI needs to reason about catch-up.
106
+
107
+ ## Done When
108
+
109
+ - The feature did not grow a second cache or state layer.
110
+
111
+ ## Handoff
112
+
113
+ - Use `askr-api-integration` when DTO mapping or transport details are the real blocker.
114
+ - Use `askr-error-loading-empty` when the hard part is presenting stale, syncing, or retry truth.
115
+ - Use `askr-realtime-streaming` when queries must reconcile with live events.