nemonix-cli 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (281) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +186 -0
  3. package/dist/cli.js +6870 -0
  4. package/package.json +48 -0
  5. package/src/config/claude-code-config/.claude/commands/setup-tmux.md +0 -0
  6. package/src/config/claude-code-config/CHANGELOG.md +261 -0
  7. package/src/config/claude-code-config/README.md +1 -0
  8. package/src/config/claude-code-config/agents/action.md +36 -0
  9. package/src/config/claude-code-config/agents/clean-code-runner.md +61 -0
  10. package/src/config/claude-code-config/agents/code-reviewer.md +172 -0
  11. package/src/config/claude-code-config/agents/code-simplifier.md +49 -0
  12. package/src/config/claude-code-config/agents/explore-codebase.md +65 -0
  13. package/src/config/claude-code-config/agents/explore-docs.md +65 -0
  14. package/src/config/claude-code-config/agents/explore-fast.md +22 -0
  15. package/src/config/claude-code-config/agents/implementer.md +181 -0
  16. package/src/config/claude-code-config/agents/snipper.md +36 -0
  17. package/src/config/claude-code-config/agents/websearch.md +42 -0
  18. package/src/config/claude-code-config/commands/prompts/create-vitejs-app.md +272 -0
  19. package/src/config/claude-code-config/commands/prompts/nextjs-add-prisma-db.md +136 -0
  20. package/src/config/claude-code-config/commands/prompts/nextjs-setup-better-auth.md +173 -0
  21. package/src/config/claude-code-config/commands/prompts/nextjs-setup-project.md +200 -0
  22. package/src/config/claude-code-config/commands/prompts/prompt.md +55 -0
  23. package/src/config/claude-code-config/commands/prompts/saas-challenge-idea.md +135 -0
  24. package/src/config/claude-code-config/commands/prompts/saas-create-architecture.md +242 -0
  25. package/src/config/claude-code-config/commands/prompts/saas-create-headline.md +132 -0
  26. package/src/config/claude-code-config/commands/prompts/saas-create-landing-copywritting.md +267 -0
  27. package/src/config/claude-code-config/commands/prompts/saas-create-legals-docs.md +176 -0
  28. package/src/config/claude-code-config/commands/prompts/saas-create-logos.md +240 -0
  29. package/src/config/claude-code-config/commands/prompts/saas-create-prd.md +195 -0
  30. package/src/config/claude-code-config/commands/prompts/saas-create-tasks.md +240 -0
  31. package/src/config/claude-code-config/commands/prompts/saas-define-pricing.md +293 -0
  32. package/src/config/claude-code-config/commands/prompts/saas-find-domain-name.md +190 -0
  33. package/src/config/claude-code-config/commands/prompts/saas-implement-landing-page.md +257 -0
  34. package/src/config/claude-code-config/commands/prompts/setup-tmux.md +160 -0
  35. package/src/config/claude-code-config/commands/prompts/tools.md +148 -0
  36. package/src/config/claude-code-config/hooks/hook-post-file.ts +162 -0
  37. package/src/config/claude-code-config/scripts/.claude/skills/fix-on-my-computer/SKILL.md +81 -0
  38. package/src/config/claude-code-config/scripts/CLAUDE.md +50 -0
  39. package/src/config/claude-code-config/scripts/auto-rename-session/CLAUDE.md +59 -0
  40. package/src/config/claude-code-config/scripts/auto-rename-session/__tests__/shared.test.ts +185 -0
  41. package/src/config/claude-code-config/scripts/auto-rename-session/__tests__/title-generation.test.ts +44 -0
  42. package/src/config/claude-code-config/scripts/auto-rename-session/fixtures/sample-transcript.jsonl +3 -0
  43. package/src/config/claude-code-config/scripts/auto-rename-session/fixtures/transcript-short-message.jsonl +2 -0
  44. package/src/config/claude-code-config/scripts/auto-rename-session/fixtures/transcript-with-title.jsonl +3 -0
  45. package/src/config/claude-code-config/scripts/auto-rename-session/src/index.ts +113 -0
  46. package/src/config/claude-code-config/scripts/auto-rename-session/src/rename-all.ts +148 -0
  47. package/src/config/claude-code-config/scripts/auto-rename-session/src/shared.ts +157 -0
  48. package/src/config/claude-code-config/scripts/auto-rename-session/src/worker.ts +58 -0
  49. package/src/config/claude-code-config/scripts/biome.json +37 -0
  50. package/src/config/claude-code-config/scripts/claude-code-ai/CLAUDE.md +84 -0
  51. package/src/config/claude-code-config/scripts/claude-code-ai/__tests__/claude.test.ts +19 -0
  52. package/src/config/claude-code-config/scripts/claude-code-ai/__tests__/paths.test.ts +68 -0
  53. package/src/config/claude-code-config/scripts/claude-code-ai/claude.ts +56 -0
  54. package/src/config/claude-code-config/scripts/claude-code-ai/cli.ts +46 -0
  55. package/src/config/claude-code-config/scripts/claude-code-ai/helper/credentials.ts +76 -0
  56. package/src/config/claude-code-config/scripts/claude-code-ai/helper/index.ts +9 -0
  57. package/src/config/claude-code-config/scripts/claude-code-ai/helper/paths.ts +51 -0
  58. package/src/config/claude-code-config/scripts/command-validator/CLAUDE.md +112 -0
  59. package/src/config/claude-code-config/scripts/command-validator/README.md +147 -0
  60. package/src/config/claude-code-config/scripts/command-validator/src/__tests__/validator.test.ts +99 -0
  61. package/src/config/claude-code-config/scripts/command-validator/src/cli.ts +121 -0
  62. package/src/config/claude-code-config/scripts/command-validator/src/lib/security-rules.ts +174 -0
  63. package/src/config/claude-code-config/scripts/command-validator/src/lib/types.ts +34 -0
  64. package/src/config/claude-code-config/scripts/command-validator/src/lib/validator.ts +90 -0
  65. package/src/config/claude-code-config/scripts/package.json +43 -0
  66. package/src/config/claude-code-config/scripts/statusline/CLAUDE.md +205 -0
  67. package/src/config/claude-code-config/scripts/statusline/README.md +193 -0
  68. package/src/config/claude-code-config/scripts/statusline/__tests__/context.test.ts +229 -0
  69. package/src/config/claude-code-config/scripts/statusline/__tests__/formatters.test.ts +108 -0
  70. package/src/config/claude-code-config/scripts/statusline/__tests__/statusline.test.ts +309 -0
  71. package/src/config/claude-code-config/scripts/statusline/data/.gitkeep +0 -0
  72. package/src/config/claude-code-config/scripts/statusline/defaults.json +82 -0
  73. package/src/config/claude-code-config/scripts/statusline/docs/ARCHITECTURE.md +166 -0
  74. package/src/config/claude-code-config/scripts/statusline/fixtures/mock-transcript.jsonl +4 -0
  75. package/src/config/claude-code-config/scripts/statusline/fixtures/test-input.json +35 -0
  76. package/src/config/claude-code-config/scripts/statusline/src/analyze-daily-usage.ts +151 -0
  77. package/src/config/claude-code-config/scripts/statusline/src/commands/interactive-config.ts +515 -0
  78. package/src/config/claude-code-config/scripts/statusline/src/debug-payloads.ts +195 -0
  79. package/src/config/claude-code-config/scripts/statusline/src/index.ts +224 -0
  80. package/src/config/claude-code-config/scripts/statusline/src/lib/config-types.ts +110 -0
  81. package/src/config/claude-code-config/scripts/statusline/src/lib/config.ts +21 -0
  82. package/src/config/claude-code-config/scripts/statusline/src/lib/context.ts +103 -0
  83. package/src/config/claude-code-config/scripts/statusline/src/lib/features/limits/commands/weekly-analysis.ts +108 -0
  84. package/src/config/claude-code-config/scripts/statusline/src/lib/features/limits/index.ts +111 -0
  85. package/src/config/claude-code-config/scripts/statusline/src/lib/features/limits/types.ts +15 -0
  86. package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/commands/migrate-to-sqlite.ts +136 -0
  87. package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/commands/spend-day.ts +79 -0
  88. package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/commands/spend-month.ts +66 -0
  89. package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/commands/spend-project.ts +85 -0
  90. package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/database.ts +395 -0
  91. package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/index.ts +178 -0
  92. package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/payload-logger.ts +161 -0
  93. package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/types.ts +37 -0
  94. package/src/config/claude-code-config/scripts/statusline/src/lib/formatters.ts +426 -0
  95. package/src/config/claude-code-config/scripts/statusline/src/lib/git.ts +100 -0
  96. package/src/config/claude-code-config/scripts/statusline/src/lib/menu-factories.ts +224 -0
  97. package/src/config/claude-code-config/scripts/statusline/src/lib/presets.ts +177 -0
  98. package/src/config/claude-code-config/scripts/statusline/src/lib/render-pure.ts +516 -0
  99. package/src/config/claude-code-config/scripts/statusline/src/lib/types.ts +36 -0
  100. package/src/config/claude-code-config/scripts/statusline/src/lib/utils.ts +15 -0
  101. package/src/config/claude-code-config/scripts/statusline/src/stats.ts +119 -0
  102. package/src/config/claude-code-config/scripts/statusline/src/tests/spend-v2.test.ts +377 -0
  103. package/src/config/claude-code-config/scripts/statusline/src/tools/fixed-cost-calc.ts +317 -0
  104. package/src/config/claude-code-config/scripts/statusline/statusline.config.free.json +79 -0
  105. package/src/config/claude-code-config/scripts/statusline/statusline.config.json +100 -0
  106. package/src/config/claude-code-config/scripts/statusline/test-with-fixtures.ts +37 -0
  107. package/src/config/claude-code-config/scripts/statusline/test.ts +20 -0
  108. package/src/config/claude-code-config/scripts/statusline/tsconfig.json +27 -0
  109. package/src/config/claude-code-config/scripts/tsconfig.json +27 -0
  110. package/src/config/claude-code-config/settings.json +92 -0
  111. package/src/config/claude-code-config/skills/aibuilder-create-saas/SKILL.md +176 -0
  112. package/src/config/claude-code-config/skills/aibuilder-create-saas/references/architecture-template.md +436 -0
  113. package/src/config/claude-code-config/skills/aibuilder-create-saas/references/challenge-framework.md +289 -0
  114. package/src/config/claude-code-config/skills/aibuilder-create-saas/references/discovery-framework.md +338 -0
  115. package/src/config/claude-code-config/skills/aibuilder-create-saas/references/prd-template.md +452 -0
  116. package/src/config/claude-code-config/skills/aibuilder-create-saas/references/task-template.md +263 -0
  117. package/src/config/claude-code-config/skills/aibuilder-create-saas/references/tools.md +132 -0
  118. package/src/config/claude-code-config/skills/aibuilder-create-saas/scripts/rename-project.sh +42 -0
  119. package/src/config/claude-code-config/skills/aibuilder-create-saas/scripts/setup.sh +104 -0
  120. package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-00-init.md +174 -0
  121. package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-01-discovery.md +342 -0
  122. package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-02-brainstorm.md +230 -0
  123. package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-03-validate.md +372 -0
  124. package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-04-prd.md +364 -0
  125. package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-05-architecture.md +904 -0
  126. package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-06-tasks.md +446 -0
  127. package/src/config/claude-code-config/skills/explore/SKILL.md +119 -0
  128. package/src/config/claude-code-config/skills/frontend-design/LICENSE.txt +177 -0
  129. package/src/config/claude-code-config/skills/frontend-design/SKILL.md +42 -0
  130. package/src/config/claude-code-config/skills/git-commit/SKILL.md +42 -0
  131. package/src/config/claude-code-config/skills/git-create-pr/SKILL.md +53 -0
  132. package/src/config/claude-code-config/skills/git-fix-pr-comments/SKILL.md +51 -0
  133. package/src/config/claude-code-config/skills/git-merge/SKILL.md +68 -0
  134. package/src/config/claude-code-config/skills/marketing-copywriting/SKILL.md +72 -0
  135. package/src/config/claude-code-config/skills/meta-claude-memory/SKILL.md +694 -0
  136. package/src/config/claude-code-config/skills/meta-claude-memory/references/comprehensive-example.md +175 -0
  137. package/src/config/claude-code-config/skills/meta-claude-memory/references/project-patterns.md +334 -0
  138. package/src/config/claude-code-config/skills/meta-claude-memory/references/prompting-techniques.md +411 -0
  139. package/src/config/claude-code-config/skills/meta-claude-memory/references/rules-directory-guide.md +298 -0
  140. package/src/config/claude-code-config/skills/meta-claude-memory/references/section-templates.md +347 -0
  141. package/src/config/claude-code-config/skills/meta-hooks-creator/SKILL.md +357 -0
  142. package/src/config/claude-code-config/skills/meta-hooks-creator/references/command-vs-prompt.md +287 -0
  143. package/src/config/claude-code-config/skills/meta-hooks-creator/references/examples.md +689 -0
  144. package/src/config/claude-code-config/skills/meta-hooks-creator/references/hook-types.md +495 -0
  145. package/src/config/claude-code-config/skills/meta-hooks-creator/references/input-output-schemas.md +503 -0
  146. package/src/config/claude-code-config/skills/meta-hooks-creator/references/matchers.md +517 -0
  147. package/src/config/claude-code-config/skills/meta-hooks-creator/references/troubleshooting.md +653 -0
  148. package/src/config/claude-code-config/skills/meta-prompt-creator/SKILL.md +285 -0
  149. package/src/config/claude-code-config/skills/meta-prompt-creator/references/anthropic-best-practices.md +126 -0
  150. package/src/config/claude-code-config/skills/meta-prompt-creator/references/anti-patterns.md +57 -0
  151. package/src/config/claude-code-config/skills/meta-prompt-creator/references/clarity-principles.md +54 -0
  152. package/src/config/claude-code-config/skills/meta-prompt-creator/references/context-management.md +389 -0
  153. package/src/config/claude-code-config/skills/meta-prompt-creator/references/few-shot-patterns.md +47 -0
  154. package/src/config/claude-code-config/skills/meta-prompt-creator/references/openai-best-practices.md +50 -0
  155. package/src/config/claude-code-config/skills/meta-prompt-creator/references/prompt-templates.md +110 -0
  156. package/src/config/claude-code-config/skills/meta-prompt-creator/references/reasoning-techniques.md +52 -0
  157. package/src/config/claude-code-config/skills/meta-prompt-creator/references/system-prompt-patterns.md +48 -0
  158. package/src/config/claude-code-config/skills/meta-prompt-creator/references/xml-structure.md +36 -0
  159. package/src/config/claude-code-config/skills/meta-skill-creator/LICENSE.txt +202 -0
  160. package/src/config/claude-code-config/skills/meta-skill-creator/SKILL.md +421 -0
  161. package/src/config/claude-code-config/skills/meta-skill-creator/package.json +5 -0
  162. package/src/config/claude-code-config/skills/meta-skill-creator/references/output-patterns.md +82 -0
  163. package/src/config/claude-code-config/skills/meta-skill-creator/references/progressive-disclosure-patterns.md +374 -0
  164. package/src/config/claude-code-config/skills/meta-skill-creator/references/prompting-integration.md +363 -0
  165. package/src/config/claude-code-config/skills/meta-skill-creator/references/real-world-examples.md +513 -0
  166. package/src/config/claude-code-config/skills/meta-skill-creator/references/script-patterns.md +385 -0
  167. package/src/config/claude-code-config/skills/meta-skill-creator/references/workflows.md +28 -0
  168. package/src/config/claude-code-config/skills/meta-skill-creator/references/xml-tag-guide.md +606 -0
  169. package/src/config/claude-code-config/skills/meta-skill-creator/scripts/init-skill.ts +214 -0
  170. package/src/config/claude-code-config/skills/meta-skill-creator/scripts/package-skill.ts +146 -0
  171. package/src/config/claude-code-config/skills/meta-skill-creator/scripts/validate.ts +138 -0
  172. package/src/config/claude-code-config/skills/meta-skill-workflow-creator/SKILL.md +390 -0
  173. package/src/config/claude-code-config/skills/meta-skill-workflow-creator/references/ask-patterns.md +225 -0
  174. package/src/config/claude-code-config/skills/meta-skill-workflow-creator/references/prompt-engineering.md +377 -0
  175. package/src/config/claude-code-config/skills/meta-skill-workflow-creator/references/state-management.md +275 -0
  176. package/src/config/claude-code-config/skills/meta-skill-workflow-creator/references/step-template.md +334 -0
  177. package/src/config/claude-code-config/skills/meta-skill-workflow-creator/references/workflow-patterns.md +300 -0
  178. package/src/config/claude-code-config/skills/meta-subagent-creator/SKILL.md +451 -0
  179. package/src/config/claude-code-config/skills/meta-subagent-creator/references/context-management.md +567 -0
  180. package/src/config/claude-code-config/skills/meta-subagent-creator/references/debugging-agents.md +714 -0
  181. package/src/config/claude-code-config/skills/meta-subagent-creator/references/error-handling-and-recovery.md +502 -0
  182. package/src/config/claude-code-config/skills/meta-subagent-creator/references/evaluation-and-testing.md +374 -0
  183. package/src/config/claude-code-config/skills/meta-subagent-creator/references/orchestration-patterns.md +591 -0
  184. package/src/config/claude-code-config/skills/meta-subagent-creator/references/subagents.md +599 -0
  185. package/src/config/claude-code-config/skills/meta-subagent-creator/references/writing-subagent-prompts.md +513 -0
  186. package/src/config/claude-code-config/skills/ralph-loop/SKILL.md +117 -0
  187. package/src/config/claude-code-config/skills/ralph-loop/scripts/setup.sh +278 -0
  188. package/src/config/claude-code-config/skills/ralph-loop/steps/step-00-init.md +215 -0
  189. package/src/config/claude-code-config/skills/ralph-loop/steps/step-01-interactive-prd.md +366 -0
  190. package/src/config/claude-code-config/skills/ralph-loop/steps/step-02-create-stories.md +273 -0
  191. package/src/config/claude-code-config/skills/ralph-loop/steps/step-03-finish.md +245 -0
  192. package/src/config/claude-code-config/skills/ralph-tasks/SKILL.md +88 -0
  193. package/src/config/claude-code-config/skills/ralph-tasks/scripts/add-task.sh +36 -0
  194. package/src/config/claude-code-config/skills/ralph-tasks/scripts/list-tasks.sh +66 -0
  195. package/src/config/claude-code-config/skills/ralph-tasks/scripts/remove-task.sh +47 -0
  196. package/src/config/claude-code-config/skills/ralph-tasks/scripts/setup.sh +201 -0
  197. package/src/config/claude-code-config/skills/ralph-tasks/steps/action-add-search.md +131 -0
  198. package/src/config/claude-code-config/skills/ralph-tasks/steps/action-add.md +46 -0
  199. package/src/config/claude-code-config/skills/ralph-tasks/steps/action-init.md +123 -0
  200. package/src/config/claude-code-config/skills/ralph-tasks/steps/action-list.md +58 -0
  201. package/src/config/claude-code-config/skills/ralph-tasks/steps/action-remove.md +48 -0
  202. package/src/config/claude-code-config/skills/ralph-tasks/steps/action-setup.md +46 -0
  203. package/src/config/claude-code-config/skills/ralph-tasks/steps/action-wake-up.md +62 -0
  204. package/src/config/claude-code-config/skills/utils-fix-errors/SKILL.md +61 -0
  205. package/src/config/claude-code-config/skills/utils-fix-grammar/SKILL.md +59 -0
  206. package/src/config/claude-code-config/skills/utils-oneshot/SKILL.md +56 -0
  207. package/src/config/claude-code-config/skills/utils-refactor/SKILL.md +89 -0
  208. package/src/config/claude-code-config/skills/utils-save-docs/SKILL.md +74 -0
  209. package/src/config/claude-code-config/skills/utils-ultrathink/SKILL.md +42 -0
  210. package/src/config/claude-code-config/skills/workflow-apex/SKILL.md +116 -0
  211. package/src/config/claude-code-config/skills/workflow-apex/scripts/setup-templates.sh +144 -0
  212. package/src/config/claude-code-config/skills/workflow-apex/scripts/update-progress.sh +80 -0
  213. package/src/config/claude-code-config/skills/workflow-apex/steps/step-00-init.md +273 -0
  214. package/src/config/claude-code-config/skills/workflow-apex/steps/step-00b-branch.md +126 -0
  215. package/src/config/claude-code-config/skills/workflow-apex/steps/step-00b-economy.md +244 -0
  216. package/src/config/claude-code-config/skills/workflow-apex/steps/step-00b-interactive.md +165 -0
  217. package/src/config/claude-code-config/skills/workflow-apex/steps/step-00b-save.md +123 -0
  218. package/src/config/claude-code-config/skills/workflow-apex/steps/step-01-analyze.md +361 -0
  219. package/src/config/claude-code-config/skills/workflow-apex/steps/step-02-plan.md +422 -0
  220. package/src/config/claude-code-config/skills/workflow-apex/steps/step-02b-tasks.md +301 -0
  221. package/src/config/claude-code-config/skills/workflow-apex/steps/step-03-execute-teams.md +297 -0
  222. package/src/config/claude-code-config/skills/workflow-apex/steps/step-03-execute.md +239 -0
  223. package/src/config/claude-code-config/skills/workflow-apex/steps/step-04-validate.md +264 -0
  224. package/src/config/claude-code-config/skills/workflow-apex/steps/step-05-examine.md +294 -0
  225. package/src/config/claude-code-config/skills/workflow-apex/steps/step-06-resolve.md +237 -0
  226. package/src/config/claude-code-config/skills/workflow-apex/steps/step-07-tests.md +250 -0
  227. package/src/config/claude-code-config/skills/workflow-apex/steps/step-08-run-tests.md +308 -0
  228. package/src/config/claude-code-config/skills/workflow-apex/steps/step-09-finish.md +193 -0
  229. package/src/config/claude-code-config/skills/workflow-apex/templates/00-context.md +53 -0
  230. package/src/config/claude-code-config/skills/workflow-apex/templates/01-analyze.md +10 -0
  231. package/src/config/claude-code-config/skills/workflow-apex/templates/02-plan.md +10 -0
  232. package/src/config/claude-code-config/skills/workflow-apex/templates/03-execute.md +10 -0
  233. package/src/config/claude-code-config/skills/workflow-apex/templates/04-validate.md +10 -0
  234. package/src/config/claude-code-config/skills/workflow-apex/templates/05-examine.md +10 -0
  235. package/src/config/claude-code-config/skills/workflow-apex/templates/06-resolve.md +10 -0
  236. package/src/config/claude-code-config/skills/workflow-apex/templates/07-tests.md +10 -0
  237. package/src/config/claude-code-config/skills/workflow-apex/templates/08-run-tests.md +10 -0
  238. package/src/config/claude-code-config/skills/workflow-apex/templates/09-finish.md +10 -0
  239. package/src/config/claude-code-config/skills/workflow-apex/templates/README.md +195 -0
  240. package/src/config/claude-code-config/skills/workflow-apex/templates/step-complete.md +7 -0
  241. package/src/config/claude-code-config/skills/workflow-brainstorm/SKILL.md +127 -0
  242. package/src/config/claude-code-config/skills/workflow-brainstorm/steps/step-01-explore.md +230 -0
  243. package/src/config/claude-code-config/skills/workflow-brainstorm/steps/step-02-challenge.md +238 -0
  244. package/src/config/claude-code-config/skills/workflow-brainstorm/steps/step-03-synthesize.md +337 -0
  245. package/src/config/claude-code-config/skills/workflow-brainstorm/steps/step-04-action.md +285 -0
  246. package/src/config/claude-code-config/skills/workflow-ci-fixer/SKILL.md +150 -0
  247. package/src/config/claude-code-config/skills/workflow-ci-fixer/references/cli-commands.md +122 -0
  248. package/src/config/claude-code-config/skills/workflow-ci-fixer/references/github-cli.md +243 -0
  249. package/src/config/claude-code-config/skills/workflow-ci-fixer/references/troubleshooting.md +362 -0
  250. package/src/config/claude-code-config/skills/workflow-ci-fixer/references/vercel-cli.md +192 -0
  251. package/src/config/claude-code-config/skills/workflow-ci-fixer/steps/step-00-init.md +157 -0
  252. package/src/config/claude-code-config/skills/workflow-ci-fixer/steps/step-01-watch-ci.md +192 -0
  253. package/src/config/claude-code-config/skills/workflow-ci-fixer/steps/step-02-analyze-errors.md +263 -0
  254. package/src/config/claude-code-config/skills/workflow-ci-fixer/steps/step-03-fix-locally.md +312 -0
  255. package/src/config/claude-code-config/skills/workflow-ci-fixer/steps/step-04-commit-push.md +206 -0
  256. package/src/config/claude-code-config/skills/workflow-ci-fixer/steps/step-05-cleanup.md +196 -0
  257. package/src/config/claude-code-config/skills/workflow-clean-code/SKILL.md +129 -0
  258. package/src/config/claude-code-config/skills/workflow-clean-code/references/general-clean-code.md +347 -0
  259. package/src/config/claude-code-config/skills/workflow-clean-code/references/nextjs-clean-code.md +458 -0
  260. package/src/config/claude-code-config/skills/workflow-clean-code/references/react-clean-code.md +406 -0
  261. package/src/config/claude-code-config/skills/workflow-clean-code/references/tanstack-query-best-practices.md +516 -0
  262. package/src/config/claude-code-config/skills/workflow-clean-code/references/zustand-best-practices.md +491 -0
  263. package/src/config/claude-code-config/skills/workflow-clean-code/steps/step-01-scan.md +137 -0
  264. package/src/config/claude-code-config/skills/workflow-clean-code/steps/step-02-apply.md +152 -0
  265. package/src/config/claude-code-config/skills/workflow-clean-code/steps/step-03-verify.md +143 -0
  266. package/src/config/claude-code-config/skills/workflow-debug/SKILL.md +126 -0
  267. package/src/config/claude-code-config/skills/workflow-debug/references/log-technique.md +285 -0
  268. package/src/config/claude-code-config/skills/workflow-debug/steps/step-00-init.md +94 -0
  269. package/src/config/claude-code-config/skills/workflow-debug/steps/step-01-analyze.md +180 -0
  270. package/src/config/claude-code-config/skills/workflow-debug/steps/step-01b-log-instrumentation.md +271 -0
  271. package/src/config/claude-code-config/skills/workflow-debug/steps/step-02-find-solutions.md +141 -0
  272. package/src/config/claude-code-config/skills/workflow-debug/steps/step-03-propose.md +142 -0
  273. package/src/config/claude-code-config/skills/workflow-debug/steps/step-04-fix.md +176 -0
  274. package/src/config/claude-code-config/skills/workflow-debug/steps/step-05-verify.md +279 -0
  275. package/src/config/claude-code-config/skills/workflow-review-code/SKILL.md +219 -0
  276. package/src/config/claude-code-config/skills/workflow-review-code/references/clean-code-principles.md +140 -0
  277. package/src/config/claude-code-config/skills/workflow-review-code/references/code-quality-metrics.md +174 -0
  278. package/src/config/claude-code-config/skills/workflow-review-code/references/feedback-patterns.md +149 -0
  279. package/src/config/claude-code-config/skills/workflow-review-code/references/security-checklist.md +127 -0
  280. package/src/config/claude-code-config/song/finish.mp3 +0 -0
  281. package/src/config/claude-code-config/song/need-human.mp3 +0 -0
@@ -0,0 +1,904 @@
1
+ ---
2
+ name: step-05-architecture
3
+ description: Design technical architecture based on PRD and nowts base stack
4
+ prev_step: steps/step-04-prd.md
5
+ next_step: steps/step-06-tasks.md
6
+ ---
7
+
8
+ # Step 5: Technical Architecture
9
+
10
+ ## MANDATORY EXECUTION RULES (READ FIRST):
11
+
12
+ - 🛑 NEVER recommend tools not in the approved stack without justification
13
+ - ✅ ALWAYS base decisions on PRD requirements
14
+ - ✅ ALWAYS respond in `{user_language}`
15
+ - 📋 YOU ARE A solutions architect, making practical decisions
16
+ - 💬 FOCUS on what the PRD requires, not hypothetical future needs
17
+ - 🚫 FORBIDDEN to over-engineer - keep it simple for solo dev
18
+
19
+ ## EXECUTION PROTOCOLS:
20
+
21
+ - 🎯 Read PRD first, then map features to technical needs
22
+ - 💾 Reference nowts project and tools.md for stack decisions
23
+ - 📖 Every tool choice needs "Why" and "Trade-off"
24
+ - 🚫 FORBIDDEN to load step-06 until architecture is validated
25
+
26
+ ## CONTEXT BOUNDARIES:
27
+
28
+ - Variables from previous steps: `{validated_idea}`, `{prd_content}`, `{user_language}`, `{output_dir}`, `{save_mode}`
29
+ - Base project: NOW.TS boilerplate (user provides path in step-07)
30
+
31
+ ## REFERENCE:
32
+
33
+ Load `../references/tools.md` for:
34
+ - Recommended tech stack
35
+ - Tool decision matrix
36
+ - Cost estimation templates
37
+
38
+ Load `../references/architecture-template.md` for:
39
+ - Architecture document structure
40
+ - Common patterns
41
+ - Folder structure
42
+
43
+ ## YOUR TASK:
44
+
45
+ Design the technical architecture that implements the PRD, using the nowts stack as a foundation.
46
+
47
+ ---
48
+
49
+ ## PHASE 0: RESEARCH & UNDERSTANDING
50
+
51
+ **Before making any technical decisions, research the available tools:**
52
+
53
+ ### Research NOW.TS Features
54
+
55
+ NOW.TS is a complete Next.js boilerplate that provides **everything needed for a SaaS**. It saves approximately 12 days of development time by providing:
56
+
57
+ **✅ What's Already Built-In (FREE):**
58
+
59
+ **Authentication (Better Auth):**
60
+ - Password reset functionality
61
+ - Email change management
62
+ - User registration and login
63
+ - Multi-tenant support with organization invitations
64
+ - Permission and role management
65
+ - GDPR-compliant data deletion
66
+
67
+ **Payment Integration (Stripe):**
68
+ - Pre-configured webhooks
69
+ - One-time purchase support
70
+ - Subscription models (monthly/yearly)
71
+ - Usage-based billing capabilities
72
+ - Payment metadata tracking
73
+ - "Configure subscriptions in less than 3 minutes"
74
+
75
+ **Organization & Multi-Tenancy:**
76
+ - Organization creation and management
77
+ - User invitation system
78
+ - Permission and access control
79
+ - Role-based management
80
+ - Member management interface
81
+
82
+ **Admin Dashboard:**
83
+ - User management
84
+ - Payment tracking
85
+ - Subscription monitoring
86
+ - Organization oversight
87
+ - Member administration
88
+
89
+ **Developer Experience:**
90
+ - 10+ VSCode snippets for rapid component creation
91
+ - AI-optimized Cursor rules and Claude Code integration
92
+ - Automated CI/CD pipeline with GitHub
93
+ - Unit, integration, and TypeScript tests
94
+ - ESLint validation
95
+ - Vercel deployment ready
96
+
97
+ **Email System:**
98
+ - Resend integration
99
+ - Email templates with React Email
100
+ - Notification system
101
+
102
+ **Analytics:**
103
+ - PostHog integration for product analytics
104
+
105
+ **AI Features:**
106
+ - AI SDK integration ready
107
+ - Easy to add AI capabilities
108
+
109
+ **Additional:**
110
+ - Internationalization (i18n) support
111
+ - Documentation system
112
+ - Markdown support
113
+
114
+ **Tech Stack:**
115
+ - Next.js 16 with Server Components, Server Actions, App Router
116
+ - TypeScript (strict mode)
117
+ - PostgreSQL with Prisma ORM
118
+ - Tailwind CSS + shadcn/ui
119
+ - Better-Auth for authentication
120
+ - Stripe for payments
121
+ - Resend for email
122
+
123
+ **🚨 IMPORTANT: If the PRD requires auth, payments, organizations, or multi-tenant features, you DON'T need to build them - they're already in NOW.TS!**
124
+
125
+ ### Research Upstash Suite (For Real-Time & Background Jobs)
126
+
127
+ If PRD requires real-time features, background jobs, or messaging, consider the Upstash suite:
128
+
129
+ **Upstash Realtime (for real-time chat, notifications, etc.):**
130
+ - 100% HTTP-based with Server-Sent Events (SSE)
131
+ - Built-in message histories
132
+ - Automatic connection management with delivery guarantee
133
+ - Type-safe with Zod schemas
134
+ - 2.6kB gzipped, zero dependencies
135
+ - Perfect for Next.js serverless
136
+ - **Use Case**: Real-time chat, live notifications, collaborative features
137
+
138
+ **Upstash QStash (for background jobs, scheduling, messaging):**
139
+ - Serverless messaging and scheduling
140
+ - Automatic retries on failure
141
+ - CRON-based scheduling
142
+ - Message delays up to 90 days
143
+ - Dead Letter Queue (DLQ) for failed messages
144
+ - Deduplication
145
+ - Rate limiting and parallelism control
146
+ - Fan-out to multiple endpoints
147
+ - **Use Cases**: Background jobs, scheduled tasks, webhooks, async processing, email queues, LLM workflows
148
+
149
+ **Upstash Redis (for caching, rate limiting):**
150
+ - Serverless Redis
151
+ - Global low latency
152
+ - Perfect for caching, sessions, rate limiting
153
+
154
+ **Upstash Vector (for AI/semantic search):**
155
+ - Vector database for embeddings
156
+ - Semantic search capabilities
157
+ - LLM integration
158
+
159
+ **When to use Upstash:**
160
+ - ✅ Real-time chat or live updates → Upstash Realtime
161
+ - ✅ Background jobs, scheduled tasks → QStash
162
+ - ✅ Rate limiting, caching → Redis
163
+ - ✅ AI semantic search → Vector
164
+
165
+ ---
166
+
167
+ ## BASE STACK (from NOW.TS):
168
+
169
+ **Core Framework:**
170
+ - Next.js 16 with App Router, Server Components, Server Actions
171
+ - TypeScript (strict mode)
172
+ - Tailwind CSS + shadcn/ui components
173
+
174
+ **UI & Frontend:**
175
+ - shadcn/ui components (pre-installed)
176
+ - TanStack Query for data fetching
177
+ - Zustand for client state (if needed)
178
+ - nuqs for URL state
179
+ - 10+ VSCode snippets for rapid development
180
+
181
+ **Backend:**
182
+ - Prisma ORM
183
+ - PostgreSQL (Neon recommended)
184
+ - Better Auth for authentication (fully configured)
185
+ - Next Safe Action for server actions
186
+ - Zod v4 for validation
187
+
188
+ **Authentication (Already Built-In):**
189
+ - Email + Password
190
+ - Password reset
191
+ - Email verification
192
+ - Multi-tenant organizations
193
+ - Role-based permissions
194
+ - GDPR data deletion
195
+
196
+ **Payments (Already Built-In):**
197
+ - Stripe integration with webhooks
198
+ - Subscription management
199
+ - One-time payments
200
+ - Usage-based billing
201
+
202
+ **Email (Already Built-In):**
203
+ - Resend + React Email
204
+ - Email templates
205
+ - Notification system
206
+
207
+ **Real-Time (Add if needed):**
208
+ - Upstash Realtime for SSE-based real-time features
209
+ - 2.6kB, type-safe, automatic reconnection
210
+
211
+ **Background Jobs (Add if needed):**
212
+ - Upstash QStash for scheduling, retries, async tasks
213
+
214
+ **Infrastructure:**
215
+ - Vercel deployment (ready)
216
+ - CI/CD with GitHub (configured)
217
+ - PostHog analytics (integrated)
218
+
219
+ ---
220
+
221
+ ## ARCHITECTURE PROCESS:
222
+
223
+ ### Phase 1: PRD to Technical Requirements
224
+
225
+ **FIRST: Check what NOW.TS already provides:**
226
+
227
+ Go through the PRD feature list and mark what's already built:
228
+
229
+ | PRD Feature | NOW.TS Status | Additional Work Needed? |
230
+ |-------------|---------------|------------------------|
231
+ | User authentication | ✅ Built-in | Just configure auth methods |
232
+ | Payment/subscriptions | ✅ Built-in | Configure Stripe products |
233
+ | Organizations/teams | ✅ Built-in | Customize if needed |
234
+ | Email notifications | ✅ Built-in | Create email templates |
235
+ | {custom feature} | ❌ Need to build | {technical approach} |
236
+
237
+ **🎯 CRITICAL: If a feature is built-in to NOW.TS, don't plan to rebuild it! Just plan to configure it.**
238
+
239
+ **SECOND: Map remaining features to technical needs:**
240
+
241
+ | PRD Feature | Technical Requirement |
242
+ |-------------|----------------------|
243
+ | {feature 1} | {what's needed technically} |
244
+ | {feature 2} | {what's needed technically} |
245
+ | {feature 3} | {what's needed technically} |
246
+
247
+ **THIRD: Identify special needs beyond NOW.TS:**
248
+
249
+ - **Real-time features?** → Consider Upstash Realtime (SSE)
250
+ - Chat, live notifications, collaborative editing
251
+ - Example: Real-time chat widget, live dashboard updates
252
+
253
+ - **Background jobs?** → Consider Upstash QStash
254
+ - Scheduled tasks, async processing, retries
255
+ - Example: Daily reports, email queues, webhook processing
256
+
257
+ - **File uploads?** → Need storage solution
258
+ - Consider Vercel Blob Storage or S3
259
+
260
+ - **AI features?** → NOW.TS has AI SDK ready
261
+ - Easy to integrate OpenAI, Anthropic, etc.
262
+
263
+ - **Heavy computation?** → May need background processing
264
+ - Use QStash for async jobs
265
+
266
+ ### Phase 2: Stack Decisions
267
+
268
+ **For each technical decision, ask:**
269
+ 1. Is this already in NOW.TS? → Use it!
270
+ 2. Does PRD require this?
271
+ 3. What's the simplest solution?
272
+ 4. What's the trade-off?
273
+
274
+ **🚨 IMPORTANT: Only ask about features NOT already in NOW.TS!**
275
+
276
+ **Authentication** - ✅ Already in NOW.TS with Better Auth
277
+ - Just configure which methods to enable (email/password, OAuth, magic link)
278
+ - Don't ask about auth provider - it's Better Auth
279
+
280
+ **Payments** - ✅ Already in NOW.TS with Stripe
281
+ - Just configure Stripe products and pricing
282
+ - Don't ask about payment provider - it's Stripe
283
+
284
+ **Organizations/Multi-tenant** - ✅ Already in NOW.TS
285
+ - Just customize if needed
286
+ - Don't rebuild this!
287
+
288
+ **Real-Time Features** - ❌ Need to decide
289
+
290
+ If PRD requires real-time (chat, live updates, notifications):
291
+
292
+ ```yaml
293
+ questions:
294
+ - header: "Real-time"
295
+ question: "You need real-time features. Which approach?"
296
+ options:
297
+ - label: "Upstash Realtime (Recommended)"
298
+ description: "SSE-based, 2.6kB, type-safe, perfect for Next.js serverless"
299
+ - label: "Polling"
300
+ description: "Simple but higher latency and server load"
301
+ - label: "WebSockets (Custom)"
302
+ description: "More complex, need separate server"
303
+ multiSelect: false
304
+ ```
305
+
306
+ **Background Jobs** - ❌ Need to decide
307
+
308
+ If PRD requires scheduled tasks, async processing, or retries:
309
+
310
+ ```yaml
311
+ questions:
312
+ - header: "Background Jobs"
313
+ question: "You need background job processing. Which approach?"
314
+ options:
315
+ - label: "Upstash QStash (Recommended)"
316
+ description: "Serverless, auto-retry, scheduling, perfect for Vercel"
317
+ - label: "Vercel Cron"
318
+ description: "Simple scheduled tasks only, no retries"
319
+ - label: "BullMQ / Redis Queue"
320
+ description: "Full-featured but need Redis server"
321
+ multiSelect: false
322
+ ```
323
+
324
+ **File Storage** - ❌ Need to decide
325
+
326
+ If PRD requires file uploads:
327
+
328
+ ```yaml
329
+ questions:
330
+ - header: "Storage"
331
+ question: "Where to store uploaded files?"
332
+ options:
333
+ - label: "Vercel Blob (Recommended)"
334
+ description: "Integrated with Vercel, simple API"
335
+ - label: "AWS S3"
336
+ description: "Most flexible, requires AWS setup"
337
+ - label: "Cloudinary"
338
+ description: "Great for images, auto-optimization"
339
+ multiSelect: false
340
+ ```
341
+
342
+ **Database** - Usually Neon + Prisma (already in NOW.TS)
343
+
344
+ Only ask if PRD has special requirements:
345
+
346
+ ```yaml
347
+ questions:
348
+ - header: "Database"
349
+ question: "Special database needs detected. Which approach?"
350
+ options:
351
+ - label: "Neon + Prisma (Recommended)"
352
+ description: "Standard PostgreSQL, already in NOW.TS"
353
+ - label: "Supabase"
354
+ description: "PostgreSQL + real-time + storage built-in"
355
+ multiSelect: false
356
+ ```
357
+
358
+ ### Phase 3: Generate Architecture Document
359
+
360
+ **Create `{output_dir}/archi.md`:**
361
+
362
+ ```markdown
363
+ ---
364
+ project_id: {project_id}
365
+ created: {timestamp}
366
+ status: complete
367
+ stepsCompleted: [0, 1, 2, 3, 4, 5]
368
+ ---
369
+
370
+ # Technical Architecture: {Product Name}
371
+
372
+ ## Architecture Overview
373
+
374
+ **Philosophy**: Keep it simple. Use the nowts stack as foundation, only add what PRD requires.
375
+
376
+ **Tech Stack Summary**:
377
+ - **Framework**: Next.js 15 with App Router
378
+ - **Deployment**: Vercel
379
+ - **Database**: {choice} with {ORM}
380
+ - **Authentication**: Better Auth with {method}
381
+ - **Payments**: {choice or "Not needed for MVP"}
382
+
383
+ ## Frontend Architecture
384
+
385
+ ### Core Stack
386
+ | Tool | Purpose | Why |
387
+ |------|---------|-----|
388
+ | Next.js 15 | Framework | App Router, RSC, great DX |
389
+ | TypeScript | Type safety | Catch errors early |
390
+ | Tailwind CSS | Styling | Fast, consistent |
391
+ | shadcn/ui | Components | Customizable, accessible |
392
+
393
+ ### State Management
394
+ | Type | Solution | When to use |
395
+ |------|----------|-------------|
396
+ | Server state | TanStack Query | API data, caching |
397
+ | URL state | nuqs | Filters, pagination |
398
+ | Client state | Zustand | UI state (if needed) |
399
+ | Form state | React Hook Form + Zod | Form validation |
400
+
401
+ ### Data Fetching Strategy
402
+ - **Default**: Server Components for initial data
403
+ - **Client**: TanStack Query for dynamic/user-specific data
404
+ - **Mutations**: Server Actions via next-safe-action
405
+
406
+ ## Backend Architecture
407
+
408
+ ### API Layer
409
+ | Concern | Solution |
410
+ |---------|----------|
411
+ | API Routes | next-zod-route |
412
+ | Server Actions | next-safe-action |
413
+ | Validation | Zod v4 |
414
+ | Rate Limiting | {approach} |
415
+
416
+ ### Authentication
417
+ - **Provider**: Better Auth
418
+ - **Method**: {chosen method}
419
+ - **Session**: Database sessions
420
+ - **Permissions**: {RBAC if needed, otherwise simple}
421
+
422
+ ### Database & ORM
423
+ - **Database**: {Neon PostgreSQL / Supabase}
424
+ - **ORM**: Prisma
425
+ - **Migrations**: Prisma Migrate
426
+
427
+ **Schema Overview:**
428
+ ```prisma
429
+ // Core models for {Product Name}
430
+
431
+ model User {
432
+ id String @id @default(cuid())
433
+ email String @unique
434
+ name String?
435
+ createdAt DateTime @default(now())
436
+ // relations...
437
+ }
438
+
439
+ // Add other models based on PRD features
440
+ {additional models}
441
+ ```
442
+
443
+ ## Infrastructure
444
+
445
+ ### Deployment
446
+ - **Platform**: Vercel
447
+ - **Region**: {region recommendation}
448
+ - **Environment**: development, preview, production
449
+
450
+ ### External Services
451
+
452
+ **Built-in to NOW.TS:**
453
+ | Service | Purpose | Status |
454
+ |---------|---------|--------|
455
+ | Better Auth | Authentication | ✅ Pre-configured |
456
+ | Stripe | Payments | ✅ Pre-configured |
457
+ | Resend | Email | ✅ Pre-configured |
458
+ | PostHog | Analytics | ✅ Pre-configured |
459
+
460
+ **Add if PRD requires:**
461
+ | Service | Purpose | When to add |
462
+ |---------|---------|-------------|
463
+ | Upstash Realtime | Real-time features | Chat, live updates, notifications |
464
+ | Upstash QStash | Background jobs | Scheduled tasks, async processing, retries |
465
+ | Upstash Redis | Caching, rate limiting | High-traffic apps, session storage |
466
+ | Upstash Vector | AI semantic search | Vector embeddings, AI features |
467
+ | Vercel Blob | File storage | File uploads, images, documents |
468
+ | Sentry | Error tracking | Production monitoring |
469
+
470
+ ## Folder Structure
471
+
472
+ ```
473
+ /
474
+ ├── app/
475
+ │ ├── (auth)/ # Auth pages
476
+ │ │ ├── login/
477
+ │ │ └── signup/
478
+ │ ├── (dashboard)/ # Protected pages
479
+ │ │ └── dashboard/
480
+ │ ├── api/ # API routes
481
+ │ └── page.tsx # Landing
482
+ ├── src/
483
+ │ ├── components/ # UI components
484
+ │ │ ├── ui/ # shadcn components
485
+ │ │ └── {feature}/ # Feature components
486
+ │ ├── lib/ # Utilities
487
+ │ ├── actions/ # Server actions
488
+ │ └── hooks/ # Custom hooks
489
+ ├── prisma/
490
+ │ └── schema.prisma
491
+ └── emails/ # React Email templates
492
+ ```
493
+
494
+ ## Feature → Implementation Map
495
+
496
+ | PRD Feature | Implementation |
497
+ |-------------|---------------|
498
+ | {Feature 1} | {How to build it} |
499
+ | {Feature 2} | {How to build it} |
500
+ | {Feature 3} | {How to build it} |
501
+
502
+ ## Architecture Decision Records
503
+
504
+ ### ADR-001: {Key Decision}
505
+ - **Context**: {Why decision was needed}
506
+ - **Decision**: {What was decided}
507
+ - **Alternatives**: {What else was considered}
508
+ - **Rationale**: {Why this choice}
509
+ - **Consequences**: {Trade-offs}
510
+
511
+ ## Cost Estimation
512
+
513
+ ### Monthly at 1,000 users
514
+ | Service | Cost | Notes |
515
+ |---------|------|-------|
516
+ | NOW.TS License | €200 one-time | Lifetime, unlimited projects |
517
+ | Vercel | $0 (hobby) / $20 (pro) | $20 for team features |
518
+ | Neon | $0 (free tier) / $19 | 10GB free, then $19 |
519
+ | Resend | $0 (3k/month free) | 3k emails free, then pay-as-you-go |
520
+ | Stripe | 2.9% + $0.30/txn | Standard processing fees |
521
+ | **Base Total** | ~$0-40/month | Without optional services |
522
+
523
+ ### Optional Services (if PRD requires):
524
+ | Service | Cost | Free Tier |
525
+ |---------|------|-----------|
526
+ | Upstash Realtime | $0 - $10 | 10k events/day free |
527
+ | Upstash QStash | $0 - $20 | 500 messages/day free |
528
+ | Upstash Redis | $0 - $10 | 10k commands/day free |
529
+ | Vercel Blob | $0 - $10 | 500MB free |
530
+
531
+ ### Free Tier Limits
532
+ - **Vercel**: 100GB bandwidth, unlimited serverless calls (hobby)
533
+ - **Neon**: 10GB storage, 191.9 compute hours/month
534
+ - **Resend**: 3,000 emails/month, 100 emails/day
535
+ - **Upstash Realtime**: 10,000 events/day
536
+ - **Upstash QStash**: 500 messages/day
537
+ - **Upstash Redis**: 10,000 commands/day, 256MB storage
538
+ - **Vercel Blob**: 500MB storage
539
+
540
+ ### Estimated Total Cost
541
+ - **Month 1 (development)**: €200 NOW.TS + $0 hosting = €200
542
+ - **Month 2+ (< 1000 users)**: $0-20/month (free tiers)
543
+ - **At 1000+ users**: $40-80/month
544
+
545
+ ## Implementation Order
546
+
547
+ **🚀 WITH NOW.TS: Most foundation work is DONE!**
548
+
549
+ ### Phase 1: Setup (Hour 1-2)
550
+ 1. ✅ Clone NOW.TS boilerplate (5 minutes)
551
+ 2. ✅ Database already configured (Prisma + Neon)
552
+ 3. ✅ Auth already working (Better Auth)
553
+ 4. ✅ Payments already integrated (Stripe)
554
+ 5. ✅ Email already setup (Resend)
555
+ 6. Configure your branding and colors
556
+ 7. Setup environment variables
557
+
558
+ **Time saved: ~10-12 days!**
559
+
560
+ ### Phase 2: Core Custom Features (Day 1-2)
561
+ Focus ONLY on features unique to your SaaS:
562
+ 1. {Core feature implementation}
563
+ 2. {Feature-specific database schema}
564
+ 3. {Feature-specific UI components}
565
+
566
+ **If using Upstash Realtime:**
567
+ - Install `@upstash/realtime`
568
+ - Setup event schemas with Zod
569
+ - Create route handler for SSE
570
+ - Implement useRealtime hook in components
571
+
572
+ **If using Upstash QStash:**
573
+ - Install `@upstash/qstash`
574
+ - Create API endpoints for jobs
575
+ - Setup scheduled tasks
576
+ - Configure retry logic
577
+
578
+ ### Phase 3: Integration & Polish (Day 3-4)
579
+ 1. Connect custom features to NOW.TS auth/payments
580
+ 2. Create email templates for your features
581
+ 3. Landing page customization
582
+ 4. Test payment flows
583
+
584
+ ### Phase 4: Launch (Day 5-7)
585
+ 1. Configure Stripe products/pricing
586
+ 2. Setup production environment
587
+ 3. Deploy to Vercel (one-click)
588
+ 4. Monitor with PostHog (already integrated)
589
+ ```
590
+
591
+ ---
592
+
593
+ ## IMPLEMENTATION EXAMPLES
594
+
595
+ ### Upstash Realtime Implementation
596
+
597
+ **When to use:** Real-time chat, live notifications, collaborative features
598
+
599
+ **Setup (5 minutes):**
600
+
601
+ ```typescript
602
+ // 1. Install
603
+ npm install @upstash/realtime
604
+
605
+ // 2. Define events (lib/realtime.ts)
606
+ import { Realtime } from "@upstash/realtime";
607
+ import { z } from "zod";
608
+
609
+ export const events = {
610
+ "message.created": z.object({
611
+ id: z.string(),
612
+ content: z.string(),
613
+ senderId: z.string(),
614
+ conversationId: z.string(),
615
+ timestamp: z.number(),
616
+ }),
617
+ "user.typing": z.object({
618
+ userId: z.string(),
619
+ conversationId: z.string(),
620
+ }),
621
+ };
622
+
623
+ export const realtime = new Realtime(events, {
624
+ token: process.env.UPSTASH_REALTIME_TOKEN!,
625
+ });
626
+
627
+ // 3. Route handler (app/api/realtime/route.ts)
628
+ import { realtime } from "@/lib/realtime";
629
+
630
+ export async function GET() {
631
+ return realtime.handle();
632
+ }
633
+
634
+ // 4. Publish from Server Action (actions/messages.ts)
635
+ "use server";
636
+
637
+ import { realtime } from "@/lib/realtime";
638
+
639
+ export async function sendMessage(content: string, conversationId: string) {
640
+ // Save to DB
641
+ const message = await prisma.message.create({...});
642
+
643
+ // Publish real-time event
644
+ await realtime.publish("message.created", {
645
+ id: message.id,
646
+ content: message.content,
647
+ senderId: message.senderId,
648
+ conversationId,
649
+ timestamp: Date.now(),
650
+ });
651
+
652
+ return message;
653
+ }
654
+
655
+ // 5. Subscribe from Client (components/chat.tsx)
656
+ "use client";
657
+
658
+ import { useRealtime } from "@upstash/realtime/react";
659
+
660
+ export function Chat({ conversationId }: { conversationId: string }) {
661
+ const { data: newMessage } = useRealtime("message.created", {
662
+ filter: (msg) => msg.conversationId === conversationId,
663
+ });
664
+
665
+ useEffect(() => {
666
+ if (newMessage) {
667
+ // Add message to UI
668
+ setMessages((prev) => [...prev, newMessage]);
669
+ }
670
+ }, [newMessage]);
671
+
672
+ return <div>{/* Chat UI */}</div>;
673
+ }
674
+ ```
675
+
676
+ **Benefits:**
677
+ - ✅ SSE (Server-Sent Events) - no WebSocket needed
678
+ - ✅ Type-safe with Zod
679
+ - ✅ Automatic reconnection
680
+ - ✅ 2.6kB bundle size
681
+ - ✅ Works perfectly on Vercel serverless
682
+
683
+ ---
684
+
685
+ ### Upstash QStash Implementation
686
+
687
+ **When to use:** Background jobs, scheduled tasks, async processing, retries
688
+
689
+ **Setup (5 minutes):**
690
+
691
+ ```typescript
692
+ // 1. Install
693
+ npm install @upstash/qstash
694
+
695
+ // 2. Create client (lib/qstash.ts)
696
+ import { Client } from "@upstash/qstash";
697
+
698
+ export const qstash = new Client({
699
+ token: process.env.QSTASH_TOKEN!,
700
+ });
701
+
702
+ // 3. API endpoint for job processing (app/api/jobs/send-welcome-email/route.ts)
703
+ import { qstash } from "@/lib/qstash";
704
+ import { sendEmail } from "@/lib/email";
705
+
706
+ export async function POST(req: Request) {
707
+ // Verify request is from QStash
708
+ const signature = req.headers.get("upstash-signature");
709
+ const isValid = await qstash.verify({ signature, body: await req.text() });
710
+
711
+ if (!isValid) {
712
+ return new Response("Unauthorized", { status: 401 });
713
+ }
714
+
715
+ const { userId, email } = await req.json();
716
+
717
+ // Process job
718
+ await sendEmail({
719
+ to: email,
720
+ subject: "Welcome!",
721
+ template: "welcome",
722
+ });
723
+
724
+ return new Response("OK");
725
+ }
726
+
727
+ // 4. Publish job from Server Action (actions/users.ts)
728
+ "use server";
729
+
730
+ import { qstash } from "@/lib/qstash";
731
+
732
+ export async function createUser(email: string) {
733
+ const user = await prisma.user.create({ data: { email } });
734
+
735
+ // Send welcome email asynchronously with retry
736
+ await qstash.publishJSON({
737
+ url: `${process.env.NEXT_PUBLIC_URL}/api/jobs/send-welcome-email`,
738
+ body: {
739
+ userId: user.id,
740
+ email: user.email,
741
+ },
742
+ retries: 3, // Retry 3 times on failure
743
+ });
744
+
745
+ return user;
746
+ }
747
+
748
+ // 5. Schedule recurring job (scripts/schedule-daily-report.ts)
749
+ import { qstash } from "@/lib/qstash";
750
+
751
+ await qstash.schedules.create({
752
+ destination: `${process.env.NEXT_PUBLIC_URL}/api/jobs/daily-report`,
753
+ cron: "0 9 * * *", // Every day at 9 AM
754
+ body: { type: "daily-report" },
755
+ });
756
+
757
+ // 6. Delayed job (actions/trial-reminder.ts)
758
+ "use server";
759
+
760
+ import { qstash } from "@/lib/qstash";
761
+
762
+ export async function startTrial(userId: string) {
763
+ // Send reminder in 7 days
764
+ await qstash.publishJSON({
765
+ url: `${process.env.NEXT_PUBLIC_URL}/api/jobs/trial-reminder`,
766
+ body: { userId },
767
+ delay: 60 * 60 * 24 * 7, // 7 days in seconds
768
+ });
769
+ }
770
+ ```
771
+
772
+ **Benefits:**
773
+ - ✅ Automatic retries with exponential backoff
774
+ - ✅ Dead Letter Queue (DLQ) for failed jobs
775
+ - ✅ CRON scheduling
776
+ - ✅ Delayed execution (up to 90 days)
777
+ - ✅ No infrastructure to manage
778
+ - ✅ Perfect for Vercel serverless
779
+
780
+ **Use Cases:**
781
+ - Welcome emails after signup
782
+ - Daily/weekly reports
783
+ - Trial expiration reminders
784
+ - Webhook processing
785
+ - Data exports
786
+ - LLM API calls (with retry logic)
787
+
788
+ ---
789
+
790
+ ### Phase 4: Present Summary
791
+
792
+ **Display in `{user_language}`:**
793
+ ```
794
+ 🏗️ Architecture Summary for {Product Name}
795
+
796
+ 🚀 Foundation (NOW.TS):
797
+ - ✅ Next.js 16 + Tailwind + shadcn/ui (pre-configured)
798
+ - ✅ Better Auth + Stripe + Email (ready to use)
799
+ - ✅ Organizations, payments, admin dashboard (built-in)
800
+ - ✅ PostgreSQL (Neon) + Prisma
801
+ - ✅ CI/CD, analytics, monitoring (configured)
802
+
803
+ ⚡ Additional Stack:
804
+ - {Real-time}: {Upstash Realtime / Not needed}
805
+ - {Background Jobs}: {Upstash QStash / Not needed}
806
+ - {File Storage}: {Vercel Blob / Not needed}
807
+ - {Other}: {Custom requirements}
808
+
809
+ Key decisions:
810
+ 1. {decision 1} - {why}
811
+ 2. {decision 2} - {why}
812
+ 3. {decision 3} - {why}
813
+
814
+ Implementation order:
815
+ 1. Setup (Hour 1-2): Clone NOW.TS, configure env
816
+ 2. Custom features (Day 1-2): {core feature}
817
+ 3. Integration (Day 3-4): Connect to auth/payments
818
+ 4. Launch (Day 5-7): Deploy, monitor
819
+
820
+ Time saved with NOW.TS: ~10-12 days
821
+ Estimated cost: €200 one-time + $0-40/month
822
+ ```
823
+
824
+ ### Phase 5: User Validation
825
+
826
+ Use AskUserQuestion:
827
+ ```yaml
828
+ questions:
829
+ - header: "Approve"
830
+ question: "Does this architecture look good for your project?"
831
+ options:
832
+ - label: "Yes, let's create tasks (Recommended)"
833
+ description: "Architecture approved, create implementation tasks"
834
+ - label: "I have questions"
835
+ description: "I want to discuss some decisions"
836
+ - label: "Need changes"
837
+ description: "Some decisions need to be different"
838
+ multiSelect: false
839
+ ```
840
+
841
+ ---
842
+
843
+ ## SUCCESS METRICS:
844
+
845
+ ✅ All PRD features mapped to technical implementation
846
+ ✅ Stack decisions justified with "Why" and trade-offs
847
+ ✅ Folder structure defined
848
+ ✅ Cost estimation included
849
+ ✅ Implementation order defined
850
+ ✅ Architecture saved to archi.md (if save_mode)
851
+ ✅ User explicitly approved architecture
852
+
853
+ ## FAILURE MODES:
854
+
855
+ ❌ Over-engineering beyond PRD requirements
856
+ ❌ Using tools not in approved stack without justification
857
+ ❌ Missing cost estimation
858
+ ❌ No implementation order
859
+ ❌ **CRITICAL**: Not using AskUserQuestion for approval
860
+ ❌ **CRITICAL**: Not responding in user's detected language
861
+
862
+ ## ARCHITECTURE PROTOCOLS:
863
+
864
+ - Start with nowts stack, only add what's needed
865
+ - Every tool choice needs justification
866
+ - Simple is better than clever
867
+ - Cost matters for solo devs
868
+ - Implementation order helps with planning
869
+
870
+ ---
871
+
872
+ ## NEXT STEP:
873
+
874
+ After user approves architecture via AskUserQuestion, load `./step-06-tasks.md`
875
+
876
+ <critical>
877
+ 🚀 NOW.TS ADVANTAGE:
878
+ - Auth, payments, organizations, email, analytics = ALREADY BUILT
879
+ - Don't plan to rebuild what's already there
880
+ - Focus architecture on UNIQUE features only
881
+ - Timeline is much shorter because foundation is done!
882
+
883
+ Remember:
884
+ - The goal is to define HOW to build what the PRD specifies
885
+ - Check NOW.TS first before adding any service
886
+ - Upstash Realtime for real-time → SSE-based, perfect for serverless
887
+ - Upstash QStash for background jobs → auto-retry, scheduling, async
888
+ - Solo dev + NOW.TS = 2-7 day timeline is realistic!
889
+ </critical>
890
+
891
+ ---
892
+
893
+ ## Sources
894
+
895
+ **NOW.TS Documentation:**
896
+ - [NOW.TS Official](https://nowts.app/)
897
+ - [NOW.TS on Product Hunt](https://www.producthunt.com/products/now-ts)
898
+ - [NOW.TS Demo](https://demo.nowts.app/)
899
+
900
+ **Upstash Documentation:**
901
+ - [Upstash Realtime Quickstart](https://upstash.com/docs/realtime/overall/quickstart)
902
+ - [Upstash Realtime Blog](https://upstash.com/blog/about-upstash-realtime)
903
+ - [QStash Getting Started](https://upstash.com/docs/qstash/overall/getstarted)
904
+ - [QStash Announcement](https://upstash.com/blog/qstash-announcement)