deepmodebot 0.0.0-stage → 0.9.1

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 (313) hide show
  1. package/.claude-plugin/marketplace.json +26 -0
  2. package/.omp-plugin/marketplace.json +26 -0
  3. package/LICENSE +24 -0
  4. package/README.md +377 -2
  5. package/bin/deepmodebot.mjs +247 -0
  6. package/lib/autoupdate.mjs +47 -0
  7. package/lib/clients.mjs +139 -0
  8. package/lib/run.mjs +32 -0
  9. package/lib/state.mjs +52 -0
  10. package/lib/tree.mjs +48 -0
  11. package/lib/version.mjs +26 -0
  12. package/package.json +44 -4
  13. package/plugins/deepmodebot/.antigravity-plugin/plugin.json +35 -0
  14. package/plugins/deepmodebot/.antigravity-plugin/skills/deep/SKILL.md +13 -0
  15. package/plugins/deepmodebot/.antigravity-plugin/skills/land-pr/SKILL.md +23 -0
  16. package/plugins/deepmodebot/.antigravity-plugin/skills/pr-thread/SKILL.md +17 -0
  17. package/plugins/deepmodebot/.antigravity-plugin/skills/review-pr/SKILL.md +16 -0
  18. package/plugins/deepmodebot/.antigravity-plugin/skills/tournament/SKILL.md +14 -0
  19. package/plugins/deepmodebot/.claude-plugin/plugin.json +27 -0
  20. package/plugins/deepmodebot/agents/reviewer/agent.md +33 -0
  21. package/plugins/deepmodebot/agents/scout/agent.md +34 -0
  22. package/plugins/deepmodebot/agents/security-reviewer/agent.md +30 -0
  23. package/plugins/deepmodebot/assets/logo.svg +8 -0
  24. package/plugins/deepmodebot/commands/contribute.md +8 -0
  25. package/plugins/deepmodebot/commands/deep.md +11 -0
  26. package/plugins/deepmodebot/commands/land-pr.md +12 -0
  27. package/plugins/deepmodebot/commands/pr-thread.md +14 -0
  28. package/plugins/deepmodebot/commands/project-brief.md +8 -0
  29. package/plugins/deepmodebot/commands/review-pr.md +10 -0
  30. package/plugins/deepmodebot/commands/tournament.md +12 -0
  31. package/plugins/deepmodebot/hooks/hooks.json +26 -0
  32. package/plugins/deepmodebot/hooks.json +24 -0
  33. package/plugins/deepmodebot/mcp_config.json +11 -0
  34. package/plugins/deepmodebot/scripts/antigravity-guard.mjs +413 -0
  35. package/plugins/deepmodebot/scripts/omp-mcp-server.mjs +1091 -0
  36. package/plugins/deepmodebot/skills/agent-harnesses/SKILL.md +57 -0
  37. package/plugins/deepmodebot/skills/agent-harnesses/assets/sdks/bun.lock +391 -0
  38. package/plugins/deepmodebot/skills/agent-harnesses/assets/sdks/check.ts +53 -0
  39. package/plugins/deepmodebot/skills/agent-harnesses/assets/sdks/check_antigravity.py +38 -0
  40. package/plugins/deepmodebot/skills/agent-harnesses/assets/sdks/check_claude.mjs +11 -0
  41. package/plugins/deepmodebot/skills/agent-harnesses/assets/sdks/package.json +11 -0
  42. package/plugins/deepmodebot/skills/agent-harnesses/assets/sdks/requirements.txt +1 -0
  43. package/plugins/deepmodebot/skills/agent-harnesses/references/ai-native-tooling.md +190 -0
  44. package/plugins/deepmodebot/skills/agent-harnesses/references/ai-sdk-selection.md +50 -0
  45. package/plugins/deepmodebot/skills/agent-harnesses/references/antigravity.md +108 -0
  46. package/plugins/deepmodebot/skills/agent-harnesses/references/claude-code.md +166 -0
  47. package/plugins/deepmodebot/skills/agent-harnesses/references/codex.md +151 -0
  48. package/plugins/deepmodebot/skills/agent-harnesses/references/delegation-efficiency.md +230 -0
  49. package/plugins/deepmodebot/skills/agent-harnesses/references/langchain-ecosystem.md +124 -0
  50. package/plugins/deepmodebot/skills/agent-harnesses/references/omp.md +183 -0
  51. package/plugins/deepmodebot/skills/agent-harnesses/references/protocols.md +172 -0
  52. package/plugins/deepmodebot/skills/agent-harnesses/references/sdks.md +228 -0
  53. package/plugins/deepmodebot/skills/agent-harnesses/references/self-authoring.md +171 -0
  54. package/plugins/deepmodebot/skills/cloud-devsecops/SKILL.md +24 -0
  55. package/plugins/deepmodebot/skills/cloud-devsecops/references/aws.md +264 -0
  56. package/plugins/deepmodebot/skills/cloud-devsecops/references/azure.md +261 -0
  57. package/plugins/deepmodebot/skills/cloud-devsecops/references/containers.md +96 -0
  58. package/plugins/deepmodebot/skills/cloud-devsecops/references/devops-tools.md +297 -0
  59. package/plugins/deepmodebot/skills/cloud-devsecops/references/devsecops-pipeline.md +258 -0
  60. package/plugins/deepmodebot/skills/cloud-devsecops/references/gcp.md +258 -0
  61. package/plugins/deepmodebot/skills/cloud-devsecops/references/kubernetes.md +74 -0
  62. package/plugins/deepmodebot/skills/cloud-devsecops/references/local-emulators.md +265 -0
  63. package/plugins/deepmodebot/skills/contribute/SKILL.md +134 -0
  64. package/plugins/deepmodebot/skills/create-verification-skill/LICENSE +21 -0
  65. package/plugins/deepmodebot/skills/create-verification-skill/SKILL.md +101 -0
  66. package/plugins/deepmodebot/skills/create-verification-skill/references/feature-map-example/README.md +47 -0
  67. package/plugins/deepmodebot/skills/create-verification-skill/references/feature-map-example/create-note.md +39 -0
  68. package/plugins/deepmodebot/skills/create-verification-skill/references/feature-map-example/search.md +45 -0
  69. package/plugins/deepmodebot/skills/deep-stack/SKILL.md +53 -0
  70. package/plugins/deepmodebot/skills/deep-stack/references/AGENTS.template.md +52 -0
  71. package/plugins/deepmodebot/skills/deep-stack/references/agentic-workflow.md +114 -0
  72. package/plugins/deepmodebot/skills/deep-stack/references/any-app-stack.md +51 -0
  73. package/plugins/deepmodebot/skills/deep-stack/references/design-workflow.md +101 -0
  74. package/plugins/deepmodebot/skills/deep-stack/references/isolate.md +23 -0
  75. package/plugins/deepmodebot/skills/deep-stack/references/philosophy.md +306 -0
  76. package/plugins/deepmodebot/skills/deep-stack/references/prove.md +31 -0
  77. package/plugins/deepmodebot/skills/deep-stack/references/stack.md +119 -0
  78. package/plugins/deepmodebot/skills/deep-stack/references/structure.md +22 -0
  79. package/plugins/deepmodebot/skills/deep-stack/references/unslop/LICENSE +21 -0
  80. package/plugins/deepmodebot/skills/deep-stack/references/unslop/unslop.md +80 -0
  81. package/plugins/deepmodebot/skills/deepmodebot/LICENSE +23 -0
  82. package/plugins/deepmodebot/skills/deepmodebot/SKILL.md +198 -0
  83. package/plugins/deepmodebot/skills/deepmodebot/assets/agents-md/agents_md.py +207 -0
  84. package/plugins/deepmodebot/skills/deepmodebot/assets/agents-md/test_agents_md.py +146 -0
  85. package/plugins/deepmodebot/skills/deepmodebot/assets/architecture-review/report-template.html +92 -0
  86. package/plugins/deepmodebot/skills/deepmodebot/assets/contain/claude-guard.sh +42 -0
  87. package/plugins/deepmodebot/skills/deepmodebot/assets/contain/claude_guard.py +135 -0
  88. package/plugins/deepmodebot/skills/deepmodebot/assets/contain/omp-contain-link.ts +12 -0
  89. package/plugins/deepmodebot/skills/deepmodebot/assets/contain/omp-contain.ts +115 -0
  90. package/plugins/deepmodebot/skills/deepmodebot/assets/contain/test_antigravity_guard.py +483 -0
  91. package/plugins/deepmodebot/skills/deepmodebot/assets/contain/test_audit_regressions.py +139 -0
  92. package/plugins/deepmodebot/skills/deepmodebot/assets/contain/test_contain.py +301 -0
  93. package/plugins/deepmodebot/skills/deepmodebot/assets/contain/test_omp_mcp.py +602 -0
  94. package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/design.py +242 -0
  95. package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/evidence.py +293 -0
  96. package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/record.py +387 -0
  97. package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/review.py +339 -0
  98. package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/test_design.py +69 -0
  99. package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/test_evidence.py +160 -0
  100. package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/test_record.py +180 -0
  101. package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/test_review.py +265 -0
  102. package/plugins/deepmodebot/skills/deepmodebot/assets/git-guardrails/git-guard-patterns.txt +44 -0
  103. package/plugins/deepmodebot/skills/deepmodebot/assets/git-guardrails/git-guard.sh +132 -0
  104. package/plugins/deepmodebot/skills/deepmodebot/assets/git-guardrails/git-guard.ts +122 -0
  105. package/plugins/deepmodebot/skills/deepmodebot/assets/git-guardrails/test_git_guard.py +192 -0
  106. package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/bot.py +3037 -0
  107. package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/brand.json +11 -0
  108. package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/brand.py +51 -0
  109. package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/ghapp.py +361 -0
  110. package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/install.py +274 -0
  111. package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/local_updates.py +576 -0
  112. package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/review_context.py +204 -0
  113. package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_bot.py +2182 -0
  114. package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_brand.py +19 -0
  115. package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_local_updates.py +691 -0
  116. package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_review_context.py +127 -0
  117. package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_workspace_cleanup.py +496 -0
  118. package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/workspace_cleanup.py +351 -0
  119. package/plugins/deepmodebot/skills/deepmodebot/assets/loop/loop.py +2394 -0
  120. package/plugins/deepmodebot/skills/deepmodebot/assets/loop/plan.py +583 -0
  121. package/plugins/deepmodebot/skills/deepmodebot/assets/loop/test_loop.py +1426 -0
  122. package/plugins/deepmodebot/skills/deepmodebot/assets/loop/test_plan.py +320 -0
  123. package/plugins/deepmodebot/skills/deepmodebot/assets/loop/test_windows_job.py +326 -0
  124. package/plugins/deepmodebot/skills/deepmodebot/assets/loop/windows_job.py +244 -0
  125. package/plugins/deepmodebot/skills/deepmodebot/assets/perf-audit/bench_harness.py +165 -0
  126. package/plugins/deepmodebot/skills/deepmodebot/assets/perf-audit/perf_audit.py +240 -0
  127. package/plugins/deepmodebot/skills/deepmodebot/assets/perf-audit/test_bench_harness.py +55 -0
  128. package/plugins/deepmodebot/skills/deepmodebot/assets/perf-audit/test_perf_audit.py +53 -0
  129. package/plugins/deepmodebot/skills/deepmodebot/assets/pr-agent/diff_coverage.py +350 -0
  130. package/plugins/deepmodebot/skills/deepmodebot/assets/pr-agent/pr_agent_local.py +370 -0
  131. package/plugins/deepmodebot/skills/deepmodebot/assets/pr-agent/test_diff_coverage.py +94 -0
  132. package/plugins/deepmodebot/skills/deepmodebot/assets/pr-conversation/arena.html +425 -0
  133. package/plugins/deepmodebot/skills/deepmodebot/assets/pr-conversation/arena.py +579 -0
  134. package/plugins/deepmodebot/skills/deepmodebot/assets/pr-conversation/arena_tui.py +839 -0
  135. package/plugins/deepmodebot/skills/deepmodebot/assets/pr-conversation/font8x8_basic.hex +1 -0
  136. package/plugins/deepmodebot/skills/deepmodebot/assets/pr-conversation/show_thread.py +329 -0
  137. package/plugins/deepmodebot/skills/deepmodebot/assets/pr-conversation/test_arena.py +610 -0
  138. package/plugins/deepmodebot/skills/deepmodebot/assets/repo-references.json +637 -0
  139. package/plugins/deepmodebot/skills/deepmodebot/assets/scrape/test_yt_enrich.py +250 -0
  140. package/plugins/deepmodebot/skills/deepmodebot/assets/scrape/yt_enrich.py +1820 -0
  141. package/plugins/deepmodebot/skills/deepmodebot/assets/scrape/yt_meta.py +156 -0
  142. package/plugins/deepmodebot/skills/deepmodebot/assets/scrape/yt_transcript_relay.js +54 -0
  143. package/plugins/deepmodebot/skills/deepmodebot/assets/security-audit/audit-pr.sh +122 -0
  144. package/plugins/deepmodebot/skills/deepmodebot/assets/security-audit/gate.cjs +155 -0
  145. package/plugins/deepmodebot/skills/deepmodebot/assets/security-audit/prompt.md +13 -0
  146. package/plugins/deepmodebot/skills/deepmodebot/assets/tournament/test_tournament.py +654 -0
  147. package/plugins/deepmodebot/skills/deepmodebot/assets/tournament/tournament.py +1285 -0
  148. package/plugins/deepmodebot/skills/deepmodebot/assets/wizard/wizard.sh +234 -0
  149. package/plugins/deepmodebot/skills/deepmodebot/assets/workspace-map/test_workspace_map.py +879 -0
  150. package/plugins/deepmodebot/skills/deepmodebot/assets/workspace-map/workspace_map.py +2436 -0
  151. package/plugins/deepmodebot/skills/deepmodebot/references/README.md +61 -0
  152. package/plugins/deepmodebot/skills/deepmodebot/references/catalog.md +105 -0
  153. package/plugins/deepmodebot/skills/deepmodebot/references/contain.md +39 -0
  154. package/plugins/deepmodebot/skills/deepmodebot/references/factory-landscape.md +147 -0
  155. package/plugins/deepmodebot/skills/deepmodebot/references/flows.md +50 -0
  156. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/authoring-a-skill.md +37 -0
  157. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/babysit.md +77 -0
  158. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/bug-fix.md +34 -0
  159. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/end-to-end.md +50 -0
  160. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/eval.md +39 -0
  161. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/feature.md +60 -0
  162. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/handoff.md +52 -0
  163. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/hillclimb.md +46 -0
  164. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/investigation.md +20 -0
  165. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/opening-a-pr.md +97 -0
  166. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/pause-safely.md +30 -0
  167. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/perf-issue.md +31 -0
  168. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/phased-build.md +146 -0
  169. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/prototype.md +31 -0
  170. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/refactoring.md +60 -0
  171. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/reference-rebuild.md +45 -0
  172. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/run-a-goal.md +143 -0
  173. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/runtime-forensics.md +22 -0
  174. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/self-authoring.md +130 -0
  175. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/session-pickup.md +33 -0
  176. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/setup.md +105 -0
  177. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/shipping.md +52 -0
  178. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/spec.md +67 -0
  179. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/tickets.md +56 -0
  180. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/trace-forensics.md +24 -0
  181. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/triage.md +102 -0
  182. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/visual-parity.md +19 -0
  183. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/wayfinder.md +44 -0
  184. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/work-a-queue.md +189 -0
  185. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/worktree-cleanup.md +35 -0
  186. package/plugins/deepmodebot/skills/deepmodebot/references/principles/attack-the-premise.md +7 -0
  187. package/plugins/deepmodebot/skills/deepmodebot/references/principles/boundary-discipline.md +8 -0
  188. package/plugins/deepmodebot/skills/deepmodebot/references/principles/build-the-lever.md +8 -0
  189. package/plugins/deepmodebot/skills/deepmodebot/references/principles/encode-lessons-in-structure.md +6 -0
  190. package/plugins/deepmodebot/skills/deepmodebot/references/principles/exhaust-the-design-space.md +4 -0
  191. package/plugins/deepmodebot/skills/deepmodebot/references/principles/experience-first.md +7 -0
  192. package/plugins/deepmodebot/skills/deepmodebot/references/principles/explain-the-number.md +9 -0
  193. package/plugins/deepmodebot/skills/deepmodebot/references/principles/fix-root-causes.md +6 -0
  194. package/plugins/deepmodebot/skills/deepmodebot/references/principles/foundational-thinking.md +9 -0
  195. package/plugins/deepmodebot/skills/deepmodebot/references/principles/guard-the-context-window.md +7 -0
  196. package/plugins/deepmodebot/skills/deepmodebot/references/principles/laziness-protocol.md +6 -0
  197. package/plugins/deepmodebot/skills/deepmodebot/references/principles/make-operations-idempotent.md +7 -0
  198. package/plugins/deepmodebot/skills/deepmodebot/references/principles/migrate-callers-then-delete-legacy-apis.md +5 -0
  199. package/plugins/deepmodebot/skills/deepmodebot/references/principles/minimize-reader-load.md +7 -0
  200. package/plugins/deepmodebot/skills/deepmodebot/references/principles/model-the-domain.md +7 -0
  201. package/plugins/deepmodebot/skills/deepmodebot/references/principles/never-block-on-the-human.md +7 -0
  202. package/plugins/deepmodebot/skills/deepmodebot/references/principles/outcome-oriented-execution.md +6 -0
  203. package/plugins/deepmodebot/skills/deepmodebot/references/principles/prove-it-works.md +8 -0
  204. package/plugins/deepmodebot/skills/deepmodebot/references/principles/redesign-from-first-principles.md +7 -0
  205. package/plugins/deepmodebot/skills/deepmodebot/references/principles/separate-before-serializing-shared-state.md +6 -0
  206. package/plugins/deepmodebot/skills/deepmodebot/references/principles/sequence-verifiable-units.md +7 -0
  207. package/plugins/deepmodebot/skills/deepmodebot/references/principles/subtract-before-you-add.md +6 -0
  208. package/plugins/deepmodebot/skills/deepmodebot/references/principles/test-behavior-not-implementation.md +7 -0
  209. package/plugins/deepmodebot/skills/deepmodebot/references/principles/type-system-discipline.md +6 -0
  210. package/plugins/deepmodebot/skills/deepmodebot/references/rust-migration-case-studies.md +26 -0
  211. package/plugins/deepmodebot/skills/deepmodebot/references/startup-ideas.md +21 -0
  212. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/agent-collaboration.md +82 -0
  213. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/architect.md +32 -0
  214. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/architecture-review.md +43 -0
  215. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/arena.md +20 -0
  216. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/benchmark-checklist.md +31 -0
  217. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/blast-radius.md +19 -0
  218. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/correct.md +20 -0
  219. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/course.md +47 -0
  220. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/coworkers.md +70 -0
  221. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/domain-model.md +69 -0
  222. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/figure-it-out.md +25 -0
  223. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/git-guardrails.md +44 -0
  224. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/github-app.md +160 -0
  225. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/goal-review.md +156 -0
  226. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/grill.md +27 -0
  227. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/how.md +23 -0
  228. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/in-your-own-words.md +12 -0
  229. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/inner-loop.md +39 -0
  230. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/interrogate.md +16 -0
  231. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/issue-conversation.md +52 -0
  232. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/no-comments.md +29 -0
  233. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/open-design-evidence.md +65 -0
  234. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/panel.md +34 -0
  235. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/pr-agent.md +39 -0
  236. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/pr-conversation.md +135 -0
  237. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/pr-review.md +138 -0
  238. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/pre-commit.md +31 -0
  239. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/prior-art.md +44 -0
  240. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/questionnaire.md +46 -0
  241. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/re-explain.md +23 -0
  242. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/recall.md +19 -0
  243. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/reflect.md +20 -0
  244. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/research.md +99 -0
  245. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/retro.md +30 -0
  246. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/scrape.md +32 -0
  247. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/security-audit.md +40 -0
  248. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/sharpen.md +15 -0
  249. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/show-me-your-work.md +19 -0
  250. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/sme-review.md +49 -0
  251. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/swarm.md +14 -0
  252. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/tdd.md +55 -0
  253. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/teach.md +20 -0
  254. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/technical-writing.md +22 -0
  255. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/tool-routing.md +85 -0
  256. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/tournament.md +44 -0
  257. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/tracker.md +78 -0
  258. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/unslop.md +15 -0
  259. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/visual-e2e.md +78 -0
  260. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/why.md +31 -0
  261. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/wizard.md +25 -0
  262. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/workspace-map.md +35 -0
  263. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/writing-for-agents.md +66 -0
  264. package/plugins/deepmodebot/skills/deepmodebot/scripts/check_skill.py +93 -0
  265. package/plugins/deepmodebot/skills/deepmodebot/scripts/trending.py +598 -0
  266. package/plugins/deepmodebot/skills/domain-rules/SKILL.md +131 -0
  267. package/plugins/deepmodebot/skills/domain-rules/references/agent-engineering.md +105 -0
  268. package/plugins/deepmodebot/skills/domain-rules/references/ai-concepts.md +103 -0
  269. package/plugins/deepmodebot/skills/domain-rules/references/aws-networking.md +121 -0
  270. package/plugins/deepmodebot/skills/domain-rules/references/backend-system-design.md +162 -0
  271. package/plugins/deepmodebot/skills/domain-rules/references/data-structures-and-cache-optimization.md +48 -0
  272. package/plugins/deepmodebot/skills/domain-rules/references/devops-and-fundamentals.md +137 -0
  273. package/plugins/deepmodebot/skills/domain-rules/references/engineering-practice.md +100 -0
  274. package/plugins/deepmodebot/skills/domain-rules/references/high-scale-server-optimization.md +181 -0
  275. package/plugins/deepmodebot/skills/domain-rules/references/language-ecosystems.md +56 -0
  276. package/plugins/deepmodebot/skills/frontend-ui/SKILL.md +146 -0
  277. package/plugins/deepmodebot/skills/frontend-ui/references/patterns/live-demos.md +38 -0
  278. package/plugins/deepmodebot/skills/frontend-ui/references/patterns/mobbin-shipped-apps.md +28 -0
  279. package/plugins/deepmodebot/skills/frontend-ui/references/patterns/motion-clips.md +269 -0
  280. package/plugins/deepmodebot/skills/frontend-ui/references/patterns/motion-graphics.md +62 -0
  281. package/plugins/deepmodebot/skills/frontend-ui/references/patterns/pinterest-animations.md +217 -0
  282. package/plugins/deepmodebot/skills/frontend-ui/references/patterns/pinterest-patterns.md +101 -0
  283. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/01-workflow.md +25 -0
  284. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/02-review-rubric.md +21 -0
  285. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/03-ai-tells.md +46 -0
  286. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/04-components.md +21 -0
  287. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/04a-agent-ui.md +153 -0
  288. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/05-motion.md +106 -0
  289. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/05a-motion-graphics.md +121 -0
  290. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/06-typography-layout.md +48 -0
  291. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/06a-color.md +26 -0
  292. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/07-copy.md +11 -0
  293. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/08-quality-floor.md +63 -0
  294. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/09-steering-agents.md +13 -0
  295. package/plugins/deepmodebot/skills/maintain-verification-skill/LICENSE +21 -0
  296. package/plugins/deepmodebot/skills/maintain-verification-skill/SKILL.md +47 -0
  297. package/plugins/deepmodebot/skills/project-brief/SKILL.md +100 -0
  298. package/plugins/deepmodebot/skills/project-brief/assets/CONTRIBUTING.template.md +124 -0
  299. package/plugins/deepmodebot/skills/project-brief/assets/ISSUE_TEMPLATE/task.yml +61 -0
  300. package/plugins/deepmodebot/skills/project-brief/assets/PROJECT_BRIEF.template.md +98 -0
  301. package/plugins/deepmodebot/skills/project-brief/assets/PULL_REQUEST_TEMPLATE.md +35 -0
  302. package/plugins/deepmodebot/skills/project-brief/assets/pr-overlap.py +643 -0
  303. package/plugins/deepmodebot/skills/project-brief/assets/sync-roadmap.py +314 -0
  304. package/plugins/deepmodebot/skills/secrets-and-auth/SKILL.md +60 -0
  305. package/plugins/deepmodebot/skills/secrets-and-auth/references/agent-authentication.md +198 -0
  306. package/plugins/deepmodebot/skills/secrets-and-auth/references/leak-prevention.md +206 -0
  307. package/plugins/deepmodebot/skills/secrets-and-auth/references/logins-and-passwords.md +165 -0
  308. package/plugins/deepmodebot/skills/secrets-and-auth/references/secrets-and-env.md +182 -0
  309. package/plugins/deepmodebot/skills/software-architecture/SKILL.md +47 -0
  310. package/plugins/deepmodebot/skills/software-architecture/references/backend-infrastructure.md +273 -0
  311. package/plugins/deepmodebot/skills/software-architecture/references/databases.md +277 -0
  312. package/plugins/deepmodebot/skills/software-architecture/references/monorepos.md +210 -0
  313. package/plugins/deepmodebot/skills/software-architecture/references/ontology.md +287 -0
@@ -0,0 +1,182 @@
1
+ # Secrets and .env for AI agents: free ways to store, share, and inject them
2
+
3
+ Summary (checked 2026-11-11):
4
+ - Best free pattern: the agent never holds the real value. Use a credential broker that swaps a placeholder for the real secret at the network edge: Claude Code sandbox `mask` mode, the Varlock proxy (MIT, local), or Infisical Agent Vault (MIT OSS binary, or cloud with 5,000 free brokered requests/month) ([Claude Code](https://code.claude.com/docs/en/sandboxing), [Varlock](https://varlock.dev/guides/proxy/), [Infisical](https://infisical.com/pricing)).
5
+ - To keep secrets in git, use dotenvx (BSD-3) or SOPS + age (MPL-2.0 / BSD-3). Each person or machine gets its own private key, kept in the OS keystore or outside the repo. Rotate the real credential when someone loses access ([dotenvx](https://github.com/dotenvx/dotenvx), [SOPS](https://github.com/getsops/sops), [age](https://github.com/FiloSottile/age)).
6
+ - Hosted free tiers that fit a solo dev or tiny team: Infisical (5 identities, MIT self-host), Bitwarden Secrets Manager (2 users, 3 projects, 3 machine accounts), Doppler (3 users), Phase (5 users or service accounts), Akeyless (5 clients). Give each agent its own scoped machine identity.
7
+ - Lock down the harness: in Codex set `inherit = "core"` and `ignore_default_excludes = false`. In Claude Code, add `sandbox.credentials` deny or mask entries, because `Read(./.env)` deny rules alone are bypassable. In Antigravity (`agy`), enable `--sandbox` / `enableTerminalSandbox: true`, `allowNonWorkspaceAccess: false`, and `Deny > Ask > Allow` rules. In MCP configs, reference env vars or `variables` and never paste literal keys.
8
+
9
+ ## Core rules
10
+
11
+ 1. Order of preference: broker (agent holds a placeholder) > runtime injection into the app process only > encrypted file in the repo > plaintext `.env` that is gitignored. Never paste a value into a prompt, an MCP config, or an agent settings file [inference].
12
+ 2. One identity per agent or per run, scoped to the fewest projects and environments, with the shortest TTL that works. Keep the orchestrator's credentials out of the agent's environment ([Infisical](https://infisical.com/docs/documentation/platform/agent-vault/how-it-works)).
13
+ 3. Output redaction is defense in depth, not a boundary. Matching is exact, so transformed or derived values still leak ([dotenvx](https://dotenvx.com/docs/cli/run-redact/)).
14
+ 4. In CI, prefer OIDC federation over stored long-lived secrets: "You won't need to duplicate your cloud credentials as long-lived GitHub secrets" ([GitHub](https://docs.github.com/en/actions/concepts/security/openid-connect)).
15
+ 5. Removing someone's key does not revoke what they already decrypted. Rotate at the provider ([git-crypt README](https://github.com/AGWA/git-crypt), [OWASP](https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html)).
16
+
17
+ ## 1. Encrypted in the repo (.env committed as ciphertext)
18
+
19
+ | Tool | What it does | Free terms / license | Latest release | Agent-relevant notes | Source |
20
+ |---|---|---|---|---|---|
21
+ | dotenvx | Encrypts each value in `.env*` (secp256k1/ECIES). `dotenvx run -- cmd` decrypts just in time | BSD-3-Clause. Armor (hosted key custody, approvals, audit) is a separate product; see its page for pricing | v2.38.2, 2026-10-20 | Has first-party Claude, Codex, and Cursor guides. Private key lives in the OS secret store by default since 2.25.0, and in a file in non-interactive mode since 2.38.0 | [repo](https://github.com/dotenvx/dotenvx), [CHANGELOG](https://github.com/dotenvx/dotenvx/blob/main/CHANGELOG.md) |
22
+ | SOPS | Encrypts values in YAML/JSON/ENV/INI/binary with age, PGP, AWS/GCP/Azure KMS, or Vault/OpenBao | MPL-2.0. CNCF Sandbox (accepted 2023-05-17) | v3.13.3, 2026-07-23 (commits 2026-11-09) | Supports multiple recipients plus `updatekeys` and `rotate`. `sops exec-env` injects decrypted values without writing a file | [repo](https://github.com/getsops/sops), [CNCF](https://www.cncf.io/projects/sops/) |
23
+ | age | Small file-encryption tool and format. Recipients can be `age1...` keys or SSH `ssh-ed25519`/`ssh-rsa` keys | BSD-3-Clause | v1.3.2, 2026-08-29 | Recipients files list one key per line. Post-quantum support. YubiKey via `age-plugin-yubikey` | [repo](https://github.com/FiloSottile/age) |
24
+ | rage | Rust implementation of age | Apache-2.0 (GitHub metadata) | v0.12.1, 2026-07-14 | Same format, so it is a drop-in for age recipients | [repo](https://github.com/str4d/rage) |
25
+ | git-crypt | Transparent per-file encryption through git filters (GPG or a symmetric key) | GPL-3.0 | 0.8.0, 2025-09-24: **no release in 13+ months** | README: "does not support revoking access". Leaks file length and change patterns. Avoid for agent workflows | [repo](https://github.com/AGWA/git-crypt) |
26
+ | git-secret | GPG-encrypts files in the repo | MIT | v0.5.0, 2022-06-05: **releases stale** (commits 2026-09) | GPG only, so key distribution is heavy. Prefer SOPS + age | [repo](https://github.com/sobolevn/git-secret) |
27
+ | Varlock | `.env.schema` with `@sensitive` decorators, validation, redaction, leak scan, provider plugins, and a local credential proxy | MIT | Monorepo packages released 2026-10-29. Site lists 1.24.0 | Agents read the schema instead of the values. `varlock run --` injects. `varlock proxy run -- claude` gives the agent placeholders | [site](https://varlock.dev/), [repo](https://github.com/dmno-dev/varlock) |
28
+
29
+ dotenvx flow for agents ([README](https://github.com/dotenvx/dotenvx), [Claude guide](https://dotenvx.com/docs/claude/)):
30
+ ```sh
31
+ dotenvx encrypt -f .env.production # ciphertext is safe to commit; never commit .env.keys
32
+ dotenvx encrypt -f .env.production --with <public-key> # encrypt with a key created elsewhere (no private key here)
33
+ DOTENV_PRIVATE_KEY_PRODUCTION=... dotenvx run -- node index.js # CI: key comes from the CI secret store
34
+ dotenvx run --redact -- claude -p '...' # v2.38.2: values become [REDACTED] in stdout/stderr
35
+ ```
36
+ - Change on `main`, not yet released: `run --redact` is removed and redaction moves to a `Dotenvxfile` ("redacted true"). The `rotate` command was removed in 2.0.0 and is not back as of 2.38.2. Pin your version ([CHANGELOG](https://github.com/dotenvx/dotenvx/blob/main/CHANGELOG.md)).
37
+ - Redaction still gives the agent's child process the real value, so an agent that writes the value to a file or sends it over the network leaks it ([run --redact](https://dotenvx.com/docs/cli/run-redact/)) [inference].
38
+
39
+ SOPS + age multi-recipient setup, one key per person or machine ([age identity docs](https://github.com/getsops/docs/blob/main/content/en/docs/usage/identities/age/_index.md), [key management](https://github.com/getsops/docs/blob/main/content/en/docs/usage/key-management/_index.md)):
40
+ ```yaml
41
+ # .sops.yaml
42
+ creation_rules:
43
+ - path_regex: \.env(\..*)?\.enc$
44
+ age: >-
45
+ age1alice...,age1laptop2...,age1ci...
46
+ ```
47
+ ```sh
48
+ age-keygen -o ~/.config/sops/age/keys.txt # Windows: %AppData%\sops\age\keys.txt; or SOPS_AGE_KEY_FILE / SOPS_AGE_KEY_CMD
49
+ sops encrypt --input-type dotenv --output-type dotenv .env > .env.enc
50
+ sops updatekeys .env.enc # add or remove recipients from .sops.yaml
51
+ sops rotate -i .env.enc # new data key; still rotate the real credentials
52
+ sops exec-env .env.enc 'npm start' # inject into a child process, no plaintext file
53
+ ```
54
+ - `SOPS_AGE_KEY_CMD` can fetch the key from a password manager, so the key file never sits next to the repo ([SOPS age docs](https://github.com/getsops/docs/blob/main/content/en/docs/usage/identities/age/_index.md)).
55
+
56
+ ## 2. Secret managers with a free tier or free self-hosting
57
+
58
+ | Tool | What it does | Free terms / license | Latest release | Agent-relevant notes | Source |
59
+ |---|---|---|---|---|---|
60
+ | Infisical | Secrets manager plus CLI, daemon agent, machine identities, Agent Vault broker | Cloud Free: 5 identities (humans + machines), unlimited projects, 3 environments, 10 syncs. No versioning, rotation, or dynamic secrets. Core MIT; `ee/` is proprietary | Platform v0.167.8 and CLI v0.45.6, 2026-11-10 | `infisical secrets-manager run --` injects env. Machine identities log in for short-lived access tokens. The `infisical agent` daemon renders secrets to files | [pricing](https://infisical.com/pricing), [LICENSE](https://github.com/Infisical/infisical/blob/main/LICENSE), [CLI](https://infisical.com/docs/cli/reference-agents) |
61
+ | Bitwarden Secrets Manager | End-to-end encrypted secrets, projects, machine accounts, `bws` CLI | Free: unlimited secrets, 2 users, 3 projects, 3 machine accounts. Self-host is Enterprise only. SDK/CLI under the Bitwarden SDK License, which is source-available, not OSI open source | bws v2.1.0, 2026-05-21 | `bws run -- 'cmd'`, token in `BWS_ACCESS_TOKEN`. Docs warn not to run untrusted executables under `bws run` | [product](https://bitwarden.com/products/secrets-manager/), [CLI](https://bitwarden.com/help/secrets-manager-cli/), [license](https://github.com/bitwarden/sdk-sm/blob/main/LICENSE) |
62
+ | OpenBao | Community fork of Vault (KV, dynamic secrets, PKI, many auth methods) under LF OpenSSF | MPL-2.0, fully OSS | v2.7.2, 2026-10-26 | Free self-host. Dynamic DB/cloud creds and short-TTL tokens per agent. SOPS can use it as a key source | [site](https://openbao.org/), [repo](https://github.com/openbao/openbao) |
63
+ | HashiCorp Vault | Same feature family | **BSL 1.1 (source-available, not OSS)** for 1.15+. Production use is allowed except competitive hosted offerings | v2.2.1, 2026-10-22 | Prefer OpenBao if you want OSS | [LICENSE](https://github.com/hashicorp/vault/blob/main/LICENSE) |
64
+ | Doppler | SaaS secrets manager, `doppler run --` | Developer plan: free for 3 users ($8/mo per extra user), 50 service tokens, 10 projects, 4 environments, 3-day activity log. Service is proprietary; CLI is Apache-2.0 | CLI 3.77.1, 2026-10-22 | Billed per human seat: "AI agents and non-human identities ride free". Service accounts are Team-plan only | [pricing](https://www.doppler.com/pricing), [CLI docs](https://docs.doppler.com/docs/cli), [CLI repo](https://github.com/DopplerHQ/cli) |
65
+ | Phase | E2E-encrypted secrets manager, `phase run` | Cloud Free: 5 users or service accounts, 3 apps, 3 environments. Self-host Free: unlimited users and service accounts. Console MIT except `ee/`; CLI GPL-3.0 | Console v2.79.0, 2026-11-02; CLI v2.3.3, 2026-10-21 | Free tier lists "AI Agent Integration" and "Phase Agents Relay" (not evaluated here) [unverified] | [pricing](https://phase.dev/pricing), [console](https://github.com/phasehq/console), [CLI](https://github.com/phasehq/cli) |
66
+ | Akeyless | SaaS vault with gateway, dynamic and rotated secrets | Free: 5 clients, 500 static, 5 dynamic, 5 rotated secrets, 1 gateway cluster, 3-day audit. No SAML/OIDC/JWT auth on Free. Proprietary. Limits page last modified 2025-09-23 | n/a (SaaS) | A "client" is any identity that consumes secrets, so 5 agents use the whole free tier | [plan limits](https://www.akeyless.io/sla-support-tiers-and-plans-limits/) |
67
+ | 1Password (paid) | `op run --env-file` resolves `op://vault/item/field` references; service accounts | **Paid subscription.** Service accounts are immutable, rate-limited, and can be created with `--expires-in` | n/a | Masks secrets in output by default (`--no-masking` turns it off). Credential Broker for OIDC CI is in public preview | [service accounts](https://developer.1password.com/docs/service-accounts/get-started), [op run](https://developer.1password.com/docs/cli/secrets-environment-variables/) |
68
+ | AWS Secrets Manager | Cloud KV with rotation | $0.40/secret/month + $0.05 per 10,000 API calls. New accounts get up to $200 in free-tier credits | n/a | Pair with IAM roles or OIDC, not access keys in the agent env | [pricing](https://aws.amazon.com/secrets-manager/pricing/) |
69
+ | GCP Secret Manager | Cloud KV | Always-free: 6 active secret versions and 10,000 access operations/month. After that, $0.03 per 10,000 accesses and about $0.06/version/month [inference from hourly rate] | n/a | Workload identity federation avoids key files | [pricing](https://cloud.google.com/secret-manager/pricing) |
70
+ | Azure Key Vault | Cloud KV/HSM | Standard tier secrets operations are about $0.03 per 10,000 transactions [unverified: prices render client-side] | n/a | Use managed identity | [pricing](https://azure.microsoft.com/en-us/pricing/details/key-vault/) |
71
+
72
+ Injection commands (all start the child process with secrets as env vars; the agent can read them if it is the child):
73
+ ```sh
74
+ infisical secrets-manager run --env=dev --path=/api -- npm start # --token or INFISICAL_TOKEN for machine identities
75
+ bws run --project-id <id> -- 'npm run start'
76
+ doppler run -- your-command
77
+ op run --env-file=./prod.env -- your-command
78
+ phase run --env production 'npm start' # Phase CLI README
79
+ ```
80
+ - Infisical `run` never injects `HOME`, `PATH`, `SHELL`, and similar names, and with `--watch` it restarts the command when secrets change ([CLI reference](https://infisical.com/docs/cli/reference-agents)).
81
+
82
+ ## 3. Local OS stores and password-store CLIs (free, offline)
83
+
84
+ | Tool | What it does | License | Latest release | Agent-relevant notes | Source |
85
+ |---|---|---|---|---|---|
86
+ | Python `keyring` | One API over macOS Keychain, Freedesktop Secret Service (libsecret/GNOME), KWallet, and Windows Credential Locker | MIT | v25.7.0, 2025-11-16 | `keyring get svc user` in a launcher script keeps values out of files. Any process running as your user can usually read them [inference] | [repo](https://github.com/jaraco/keyring) |
87
+ | dotenvx native store | Stores dotenvx private keys in the OS secret store | BSD-3 | see above | `--no-native` turns off OS store lookups | [README](https://github.com/dotenvx/dotenvx) |
88
+ | `pass` | GPG-encrypted files in a git repo, one secret per file | GPL-2.0+ | Tag 1.7.4, 2021-06-11: **no release in 5 years** (commits through 2026-10) | Varlock has a `pass` plugin. GPG key handling is the cost | [mirror](https://github.com/zx2c4/password-store) |
89
+ | gopass | Team-oriented `pass` successor with recipients per store | MIT | v1.17.4, 2026-10-10 | Multi-recipient stores fit "share with agent machine X". Has gpg and age crypto backends (`docs/backends/age.md`) | [repo](https://github.com/gopasspw/gopass), [age backend](https://github.com/gopasspw/gopass/blob/master/docs/backends/age.md) |
90
+
91
+ ## 4. Credential brokers: the agent never holds the secret
92
+
93
+ | Tool | How it works | Free terms / license | Latest | Limits | Source |
94
+ |---|---|---|---|---|---|
95
+ | Claude Code sandbox `credentials` | `deny` unsets env vars and blocks file reads for sandboxed Bash. `mask` shows a per-session sentinel; the sandbox proxy swaps in the real value only for `injectHosts` (re-signs AWS SigV4) | Included with Claude Code. Runtime Apache-2.0 | sandbox-runtime v0.0.82, 2026-11-09 | Needs `network.tlsTerminate`. Masks honored only from user/managed settings or `--settings`, not repo `.claude/`. Bash only; MCP servers and hooks run outside. **No sandbox on native Windows: use WSL2** | [sandboxing](https://code.claude.com/docs/en/sandboxing), [runtime](https://github.com/anthropics/sandbox-runtime) |
96
+ | Varlock proxy | Local in-memory proxy. The agent holds placeholders; real values go only to TLS-verified upstreams set with `@proxy(domain=...)` and are scrubbed from responses | MIT | see §1 | Same host, same user: "not a sandbox". Add `--sandbox` or a container or VM | [proxy guide](https://varlock.dev/guides/proxy/) |
97
+ | Infisical Agent Vault (cloud) | Orchestrator creates a time-bound session scoped to an access bundle. The proxy adds credentials, enforces method and path rules, and handles HTTP APIs, MCP servers, DBs, and SSH | First 5,000 brokered requests/month free, then $1 per 10,000 | Platform v0.167.8 | Run the proxy outside the agent's container and give the agent network access only to the proxy. Session tokens travel over plain HTTP, so use one proxy per agent on a private network | [how it works](https://infisical.com/docs/documentation/platform/agent-vault/how-it-works), [pricing](https://infisical.com/pricing) |
98
+ | Agent Vault OSS binary | Standalone HTTP credential proxy plus vault on local SQLite or Postgres: `agent-vault run -- claude` | MIT except `ee/` | v0.40.2, 2026-10-22 | README: "no longer recommended for new setups"; it points to the Infisical service | [repo](https://github.com/Infisical/agent-vault) |
99
+ | CyberArk Secretless Broker | Connection broker: the app connects to localhost and the broker authenticates to MySQL, Postgres, SSH (beta), or HTTP (beta) | Apache-2.0 | v2.0.0, 2026-09-16 | Built around Conjur and Kubernetes sidecars. Heavy for a single dev box | [repo](https://github.com/cyberark/secretless-broker) |
100
+ | omp auth broker | Keeps provider OAuth refresh tokens on a broker; clients get redacted snapshots and ask the broker to refresh | MIT (omp) | omp main, 2026-11-11 | Covers the model-provider credentials omp itself uses, not your app's secrets | [auth-broker doc](https://github.com/can1357/oh-my-pi/blob/main/docs/auth-broker-gateway.md) |
101
+
102
+ Claude Code user-level settings for masking (from [sandboxing](https://code.claude.com/docs/en/sandboxing)):
103
+ ```json
104
+ { "sandbox": { "enabled": true, "allowUnsandboxedCommands": false, "failIfUnavailable": true,
105
+ "network": { "tlsTerminate": {}, "allowedDomains": ["*.github.com", "registry.npmjs.org"] },
106
+ "credentials": {
107
+ "files": [ { "path": "~/.aws/credentials", "mode": "deny" }, { "path": "~/.ssh", "mode": "deny" } ],
108
+ "envVars": [ { "name": "GH_TOKEN", "mode": "mask", "injectHosts": ["api.github.com"] },
109
+ { "name": "NPM_TOKEN", "mode": "deny" } ] } } }
110
+ ```
111
+ - "There is no built-in credential deny list, so only the files and variables you list are restricted." The default sandbox read policy still allows `~/.ssh` and `~/.aws/credentials` ([sandboxing](https://code.claude.com/docs/en/sandboxing)).
112
+
113
+ ## 5. How each harness handles env and MCP secrets
114
+
115
+ | Harness | Control | Default and caveat | Source |
116
+ |---|---|---|---|
117
+ | Codex | `[shell_environment_policy]`: `inherit = all/core/none`, `filters` (`"AWS_*" = "exclude"`, or include to allowlist), `set`. `ignore_default_excludes` | **Default `ignore_default_excludes = true`, so names containing KEY, SECRET, or TOKEN are passed to commands.** Set it to `false`. Legacy `exclude`/`include_only` arrays cannot be combined with `filters` in the same layer | [config-advanced](https://developers.openai.com/codex/config-advanced), [reference](https://developers.openai.com/codex/config-reference) |
118
+ | Codex MCP | `mcp_servers.<id>.env_vars` (allowlist for stdio), `bearer_token_env_var`, `env_http_headers`, `http_headers_helper` (command prints headers) | Project `.codex/config.toml` loads only for trusted projects and cannot redirect credentials or change provider auth | [config-advanced](https://developers.openai.com/codex/config-advanced), [reference](https://developers.openai.com/codex/config-reference) |
119
+ | Claude Code | `permissions.deny: ["Read(./.env)", "Read(./.env.*)"]` | Covers built-in file tools and recognized Bash readers (`cat`, `head`, redirects), but **not** `grep -r` or a Python/Node script that opens the file. For OS-level enforcement, enable the sandbox | [settings](https://code.claude.com/docs/en/settings), [permissions](https://code.claude.com/docs/en/permissions) |
120
+ | Claude Code | `CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1` | Strips credentials (matched by name or value) from Bash, hooks, and stdio MCP servers. Leaves GitHub tokens and proxy settings in place. On Linux it forces every command to run sandboxed | [env vars](https://code.claude.com/docs/en/env-vars), [sandboxing](https://code.claude.com/docs/en/sandboxing) |
121
+ | Claude Code MCP | `.mcp.json` supports `${VAR}` and `${VAR:-default}` in `command`, `args`, `env`, `url`, `headers` | Commit `"Authorization": "Bearer ${API_KEY}"`, never the key itself | [mcp](https://code.claude.com/docs/en/mcp) |
122
+ | omp | Loads project `.env`, then `~/.omp/agent/.env`, `~/.omp/.env`, `~/.env`. Shell subprocesses have project-dotenv credentials filtered out | `secrets.enabled: true` (off by default) replaces secret-looking env values, `secrets.yml` entries, and built-in token patterns with HMAC placeholders before provider calls, and restores them in tool args | [env vars](https://github.com/can1357/oh-my-pi/blob/main/docs/environment-variables.md), [secrets](https://github.com/can1357/oh-my-pi/blob/main/docs/secrets.md) |
123
+ | omp MCP | `${VAR}` expansion; `"!cmd"` values run a command (10 s timeout) and use its stdout, re-run on 401/403; a bare var name copies from env | Use `"!cmd"` to mint short-lived tokens from `bws`/`op`/`infisical` [inference] | [mcp-config](https://github.com/can1357/oh-my-pi/blob/main/docs/mcp-config.md) |
124
+ | Antigravity (`agy`) | `--sandbox` / `enableTerminalSandbox: true`, `allowNonWorkspaceAccess: false`; `Deny > Ask > Allow` rules (`read_file`, `command`, `mcp`) | OS sandbox (Linux namespaces, macOS Seatbelt, Win11 24H2+ AppContainer) blocks `~/.ssh`, `.env`, and network except `read_url(...)`; no-op on unsupported hosts (`proceed-in-sandbox` falls back to `request-review`); Windows AppContainer keeps folders outside user profile readable | [sandbox](https://antigravity.google/docs/sandbox), [permissions](https://antigravity.google/docs/permissions) |
125
+ | Antigravity MCP & plugins | `.agents/mcp_config.json` / `~/.gemini/config/mcp_config.json` `variables` and `env`; OAuth PKCE tokens in `~/.gemini/antigravity/mcp_oauth_tokens.json`; `${PLUGIN_DATA}` persistent dir | Declaring `variables` installs the plugin disabled until filled in `/plugin`; unconfigured MCP tools default to `Ask`; never commit literals or `mcp_oauth_tokens.json`; `${PLUGIN_DATA}` is outside the workspace | [mcp](https://antigravity.google/docs/mcp), [build-plugins](https://antigravity.google/docs/build-plugins) |
126
+ | MCP servers (spec) | Token passthrough is an anti-pattern. Servers must accept only tokens issued for themselves | Do not forward the client's token to downstream APIs | [MCP security](https://modelcontextprotocol.io/specification/2026-07-28/basic/security_best_practices) |
127
+
128
+ Codex hardening snippet ([config-advanced](https://developers.openai.com/codex/config-advanced)):
129
+ ```toml
130
+ [shell_environment_policy]
131
+ inherit = "core"
132
+ ignore_default_excludes = false # drop *KEY*, *SECRET*, *TOKEN* names
133
+ [shell_environment_policy.filters]
134
+ "AWS_*" = "exclude"
135
+ "AZURE_*" = "exclude"
136
+ ```
137
+
138
+ ## 6. Sharing between people, machines, and agents
139
+
140
+ | Need | Free approach | Notes | Source |
141
+ |---|---|---|---|
142
+ | Add a laptop, CI runner, or agent VM | Generate an age key on that machine; commit only its public key to `.sops.yaml`; run `sops updatekeys` | Private keys never travel. SSH ed25519 keys work as recipients | [SOPS key mgmt](https://github.com/getsops/docs/blob/main/content/en/docs/usage/key-management/_index.md), [age](https://github.com/FiloSottile/age) |
143
+ | dotenvx team | One keypair per env file. Share the private key out of band (password manager, `bws`, or `op`), or encrypt with `--with <public-key>` | Never commit `.env.keys`. No `rotate` command since 2.0.0, so re-key by hand | [README](https://github.com/dotenvx/dotenvx), [CHANGELOG](https://github.com/dotenvx/dotenvx/blob/main/CHANGELOG.md) |
144
+ | Hosted manager | One machine identity or account per agent and per environment, read-only, scoped to one project or path | Bitwarden Free caps at 3 machine accounts, Infisical Free at 5 identities total, Akeyless Free at 5 clients | [Bitwarden](https://bitwarden.com/products/secrets-manager/), [Infisical](https://infisical.com/pricing), [Akeyless](https://www.akeyless.io/sla-support-tiers-and-plans-limits/) |
145
+ | One-off handoff to a human | Infisical secret sharing (all plans) or Phase Lockbox links | Prefer expiring links over chat. 28% of incidents originate in Slack, Jira, or Confluence | [Infisical](https://infisical.com/pricing), [Phase](https://phase.dev/pricing), [GitGuardian](https://blog.gitguardian.com/the-state-of-secrets-sprawl-2026) |
146
+ | Revocation | Remove the recipient (`sops updatekeys`), then `sops rotate`, **then rotate the upstream credential** | git-crypt cannot revoke at all. Old ciphertext stays in git history [inference] | [git-crypt](https://github.com/AGWA/git-crypt), [SOPS](https://github.com/getsops/docs/blob/main/content/en/docs/usage/key-management/_index.md) |
147
+ | Rotation cadence | Short-lived or dynamic credentials where possible (OpenBao, AWS STS via OIDC); otherwise scheduled rotation plus expiry | OWASP covers creation, rotation, revocation, and expiration as lifecycle stages | [OWASP](https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html) |
148
+
149
+ ## Threats and failure modes
150
+
151
+ - **Agent reads the file another way.** Claude Code `Read` deny rules don't stop `grep -r` or a script that opens `.env` itself ([permissions](https://code.claude.com/docs/en/permissions)). Only OS-level sandbox reads or a placeholder value close this gap.
152
+ - **Env inheritance.** Sandboxed commands inherit Claude Code's environment "including any secrets in its environment" unless `credentials` or `CLAUDE_CODE_SUBPROCESS_ENV_SCRUB` is set ([sandboxing](https://code.claude.com/docs/en/sandboxing)). Codex passes KEY/SECRET/TOKEN vars by default ([config-advanced](https://developers.openai.com/codex/config-advanced)).
153
+ - **Injectors expose plaintext to the child.** `bws run`, `op run`, `infisical run`, `dotenvx run`, and `sops exec-env` all put real values in the child's environment. If the child is the agent, the agent has the secret. Bitwarden warns against running untrusted executables under `bws run` ([bws](https://bitwarden.com/help/secrets-manager-cli/)).
154
+ - **Redaction gaps.** Exact-match only, so derived, encoded, or split values pass through ([dotenvx](https://dotenvx.com/docs/cli/run-redact/)). Response scrubbing in Varlock is "defense-in-depth, not a boundary" ([Varlock](https://varlock.dev/guides/proxy/)).
155
+ - **Same-user proxy bypass.** A local proxy that runs as you can be bypassed by an agent that spawns a process outside it ([Varlock](https://varlock.dev/guides/proxy/)). Infisical recommends running the proxy outside the agent's environment and limiting the agent's network to the proxy ([Infisical](https://infisical.com/docs/documentation/platform/agent-vault/how-it-works)).
156
+ - **Self-escalation.** If the agent can read the orchestrator's machine identity, "it could give itself more access" ([Infisical](https://infisical.com/docs/documentation/platform/agent-vault/how-it-works)).
157
+ - **Secrets in agent config files.** GitGuardian found 31,088 secrets in `.claude/settings.local.json` on public GitHub, 5,343 still valid ([GitGuardian](https://blog.gitguardian.com/claude-code-settings-local-json-secrets-docker-hub/)). It also found 24,008 secrets in MCP config files, 2,117 valid ([GitGuardian](https://blog.gitguardian.com/the-state-of-secrets-sprawl-2026)).
158
+ - **AI-assisted commits leak more.** Claude Code-assisted commits leaked secrets at 3.2% vs a 1.5% baseline, and AI-service secret leaks rose 81% in 2025 ([GitGuardian](https://blog.gitguardian.com/the-state-of-secrets-sprawl-2026)).
159
+ - **Prompt-injected exfiltration.** Untrusted content steers the agent into sending env or files to an attacker host. Mitigate with a domain allowlist, deny unsandboxed retries, and placeholders ([OWASP LLM02](https://genai.owasp.org/llmrisk/llm022025-sensitive-information-disclosure/), [OWASP Agentic Top 10](https://genai.owasp.org/resource/owasp-top-10-for-agentic-applications-for-2026/), [sandboxing](https://code.claude.com/docs/en/sandboxing)).
160
+ - **Repo-controlled config loosening.** A cloned repo's settings could redirect credentials. Claude Code ignores repo `mask`/`tlsTerminate`, and Codex ignores untrusted project config ([sandboxing](https://code.claude.com/docs/en/sandboxing), [config-advanced](https://developers.openai.com/codex/config-advanced)).
161
+ - **Revocation illusion.** Re-encrypting without rotating the upstream credential leaves old copies valid; git-crypt has no revocation ([git-crypt](https://github.com/AGWA/git-crypt)).
162
+ - **MCP token passthrough.** A server forwards client tokens to downstream APIs without checking audience ([MCP](https://modelcontextprotocol.io/specification/2026-07-28/basic/security_best_practices)).
163
+ - **Windows gap.** Claude Code runs commands unsandboxed on native Windows, so credential masking and denies need WSL2 ([sandboxing](https://code.claude.com/docs/en/sandboxing)).
164
+
165
+ ## Recommendation for a solo dev / small team, all free
166
+
167
+ 1. **Source of truth.** Pick one:
168
+ - SOPS + age: one age key per person, machine, and CI runner, listed in `.sops.yaml`.
169
+ - dotenvx: private keys in the OS store, `.env.keys` gitignored.
170
+ - Infisical Free (5 identities), or self-hosted Infisical, Phase, or OpenBao if you outgrow it.
171
+ 2. **Agent sessions.** Start agents from a clean environment:
172
+ - Codex: `inherit = "core"`, `ignore_default_excludes = false`.
173
+ - Claude Code: in WSL2 or Linux/macOS, with `sandbox.enabled`, `allowUnsandboxedCommands: false`, `failIfUnavailable: true`, `credentials` denies for `~/.ssh` and `~/.aws`, and `CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1`.
174
+ - omp: `secrets.enabled: true`.
175
+ - Antigravity (`agy`): `--sandbox` / `enableTerminalSandbox: true`, `allowNonWorkspaceAccess: false`, `Deny` rules for `read_file(.env*)` and `read_file(~/.ssh/**)`, and `variables` instead of literal tokens in `mcp_config.json`.
176
+ 3. **Secrets the agent must use** (GitHub, npm, APIs): broker them.
177
+ - Claude Code `mask` with `injectHosts`, or `varlock proxy run -- <agent>` inside a container.
178
+ - Infisical Agent Vault for headless or CI agents (5,000 free requests/month).
179
+ 4. **Secrets only the app needs**: inject at the app's own process with `sops exec-env`, `dotenvx run`, `infisical secrets-manager run`, or `bws run`, outside the agent's shell. Let the agent read `.env.schema` or `.env.example` instead of the values.
180
+ 5. **Identities**: one machine identity per agent, read-only, one environment, short TTL. In CI, use OIDC to the cloud instead of stored keys.
181
+ 6. **MCP**: `${VAR}` references only. Gitignore `.claude/settings.local.json` and `.env*` except encrypted files. Scan before commit, for example with `varlock scan` or `dotenvx protect`.
182
+ 7. **Offboarding or a suspected leak**: remove the recipient or identity, re-encrypt, rotate every upstream credential that person or agent could have seen, and revoke broker sessions.
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: software-architecture
3
+ description: "Cited guidance on repo layout and monorepo tooling, domain vocabulary and typed models, knowledge graphs, choosing and migrating databases, multi-tenancy, queues and durable workflows, API style, reliability, observability, deployment, and IaC. Use when designing or changing structure, data models, databases, or backend infrastructure."
4
+ metadata:
5
+ as-of: "2026-11-11"
6
+ ---
7
+
8
+ # Architecture: monorepos, ontology, databases, backend infrastructure
9
+
10
+ Read before designing or changing a project's shape: repo layout and workspace tooling, the domain vocabulary and data model, the database and its migrations, or the backend services, jobs, APIs, observability, and deployment. Researched 2026-11-11 from primary sources (official docs, specs, vendor pricing and engineering blogs, GitHub releases and licenses). Each claim carries its link; `[inference]` and `[unverified]` mean what they say. Versions, licenses, and free tiers move: recheck the one you pick.
11
+
12
+ | File | Read when |
13
+ |---|---|
14
+ | `references/monorepos.md` | Monorepo or not; `apps/` and `packages/` layout; pnpm, Turborepo, Nx, uv, Go, Cargo, Bazel; enforced boundaries; affected-only CI and caching; nested `AGENTS.md`; worktrees for parallel agents |
15
+ | `references/ontology.md` | Naming the domain: glossary, bounded contexts, ADRs; one typed model (Pydantic, Zod, LinkML) feeding API, DB, and agent tools; RDF, OWL, SHACL; property graphs; semantic layers; Palantir-style ontology for agent actions; GraphRAG and agent memory |
16
+ | `references/databases.md` | Choosing a database or extension, hosted free tiers and branching, schema and migrations in the repo, ORMs, zero-downtime migrations, tenancy and RLS, IDs, backups, and letting agents near a database safely |
17
+ | `references/backend-infrastructure.md` | Monolith or services, reliability (timeouts, retries, idempotency, SLOs, health checks), queues and durable workflows, caching, API style and errors, OpenTelemetry, deployment and IaC, capacity and cost |
18
+
19
+ These files build on `skill://domain-rules/references/backend-system-design.md` and `skill://deepmodebot/references/principles/model-the-domain.md`; where they disagree, these primary-source files win. For opinionated SvelteKit/Convex/Cloudflare web-app defaults, see `skill://deep-stack`; this skill holds primary-source defaults for relational monoliths, Postgres 18, and single-package vs monorepo decisions. Cloud security lives in `skill://cloud-devsecops`; secrets and auth in `skill://secrets-and-auth`.
20
+
21
+ ## Rules for the agent
22
+
23
+ 1. **Name before you build.** Add or reuse terms in `docs/GLOSSARY.md` and map each to one code, DB, API, and event name. Record a choice between real options as an ADR in `docs/adr/`.
24
+ 2. **One source of truth for the domain model.** A typed model (Pydantic or Zod; LinkML when three or more artifacts or languages need it) feeds the API schema, DB mapping, and agent tool schemas. Never hand-maintain two copies.
25
+ 3. **Start simple and say what would force a change.** Modular monolith, one Postgres, a Postgres-backed job queue, REST plus OpenAPI. Add a service, queue, graph, or vector store only when you can name the force (scale, isolation, ownership, query shape) and write it in the ADR.
26
+ 4. **One repo, enforced boundaries.** `apps/*` and `packages/*`; one package owns each database's schema and migrations; boundaries checked in CI (`turbo boundaries` or dependency-cruiser, import-linter, Go `internal/`).
27
+ 5. **Migrations are expand-contract and reviewed.** Lint them (Squawk), set `lock_timeout`, build indexes concurrently, and never run destructive commands (`DROP`, `TRUNCATE`, `migrate reset`, `push --force`) against shared data without the user's yes.
28
+ 6. **Agents get least-privilege data access.** Separate owner, app, and read-only agent roles; a branch database per PR or agent; no production credentials for agents. Read-only still leaks: prompt injection can exfiltrate what the role can read.
29
+ 7. **Every remote call has a timeout; retry at one layer** with capped exponential backoff and jitter, and only idempotent operations (`Idempotency-Key` on creates and payments).
30
+ 8. **Observe from day one.** OpenTelemetry traces and JSON logs with trace IDs, liveness that checks nothing external, readiness that does, and one availability and one latency SLO per user-facing API.
31
+ 9. **Check the license and release date before adopting a tool.** BSL, SSPL, FSL, and AGPL each carry different obligations; archived or unmaintained tools are not defaults.
32
+ 10. **Prove it on the real thing.** Tests run against a real database (Testcontainers or PGlite) with migrations applied, not mocks; load-test before launch.
33
+
34
+ ## Default stack for a solo dev or small team
35
+
36
+ | Area | Default | Grows into |
37
+ |---|---|---|
38
+ | Repo | One repo: pnpm workspaces with catalogs, `apps/*` + `packages/*`, Turborepo with free Vercel Remote Cache; Python as a uv workspace, Go as one module | Nx when you want generators and a project graph; Bazel or Pants only when CI time is the bottleneck |
39
+ | Agent context | Root `AGENTS.md` under ~200 lines with the package map and commands; a short `AGENTS.md` per app; one worktree per parallel agent under `.worktrees/` | Per-package skills and verify skills |
40
+ | Domain | `docs/GLOSSARY.md`, ADRs, one Pydantic or Zod model; agents act through typed action tools, never raw write SQL | LinkML for multi-language models; Apache AGE on Postgres for graph traversal; Graphiti for agent memory |
41
+ | Database | Postgres 18 (Neon Free for branching, or Supabase Free with auth and storage); `packages/db` owns schema, migrations, seeds, client, and types | Paid plan with PITR before real users; pgvector, FTS, and pg_partman before separate stores |
42
+ | Data access | Drizzle (TS), SQLAlchemy 2 + Alembic (Python), sqlc + goose (Go); `uuidv7()` keys; `tenant_id` + RLS with `FORCE ROW LEVEL SECURITY` | db-per-tenant only for contractual isolation |
43
+ | Backend | One container, `web` and `worker` processes, modules by domain with a public `index` | Split a service only for a named force |
44
+ | Jobs and workflows | pg-boss or Graphile Worker (Node), River (Go), DBOS or pgmq (Python), enqueued in the business transaction | DBOS, Hatchet, or Temporal when flows run minutes or wait on humans |
45
+ | API | REST + OpenAPI 3.1, RFC 9457 errors, cursor pagination, idempotency keys | gRPC for internal service-to-service; tRPC only for a TS-only frontend |
46
+ | Observability | OpenTelemetry SDK and Collector to SigNoz self-hosted or a vendor free tier; Sentry free tier for errors | Grafana LGTM when you run your own stack |
47
+ | Deploy | Render, Railway, or Fly for zero ops, or Kamal or Coolify on one VPS; preview deploy per PR; OpenFeature-compatible flags | OpenTofu once there are cloud resources beyond the PaaS; Kubernetes only when a team operates it |
@@ -0,0 +1,273 @@
1
+ # Backend infrastructure and system design for agent-built apps (2026)
2
+
3
+ Strongest recommendations, checked 2026-11-11:
4
+ - Start as one deployable modular monolith on Postgres; split a service only when a named force (independent scaling, blast radius, team ownership) appears. Even the famous Prime Video case was one team collapsing a distributed pipeline into one process for a 90% cost cut ([Prime Video Tech](https://www.primevideotech.com/video-streaming/scaling-up-the-prime-video-audio-video-monitoring-service-and-reducing-costs-by-90)).
5
+ - Every remote call gets a timeout; retry at exactly one layer, with capped exponential backoff plus jitter, and only for idempotent operations ([AWS Builders' Library](https://aws.amazon.com/builders-library/timeouts-retries-and-backoff-with-jitter/)).
6
+ - Background work: a Postgres-backed queue (pg-boss, River, Graphile Worker, pgmq) until you need multi-step, long-running, or human-wait flows; then a durable-execution engine (Temporal, DBOS, Hatchet, Restate, Inngest, Trigger.dev). Check each license: Restate is BSL, Inngest is SSPL.
7
+ - Instrument with OpenTelemetry from day one (traces and logs stable); define 1-3 SLOs and spend the error budget deliberately ([Google SRE book](https://sre.google/sre-book/service-level-objectives/)).
8
+ - Deploy containers to a PaaS (Fly.io, Railway, Render) or one VPS with Kamal/Coolify; skip Kubernetes until a team operates it; use OpenTofu (MPL-2.0) not Terraform (BSL) for new IaC.
9
+
10
+ Scope: this file adds primary-source, decision-ready infrastructure guidance. It builds on, and does not repeat, `skill://domain-rules/references/backend-system-design.md` (API naming, indexing, cache-aside basics, queue basics), the `model-the-domain` principle, `skill://cloud-devsecops` (cloud security, CI/CD, IaC scanning, local emulators) and `skill://secrets-and-auth` (secrets, auth). Prices and free tiers change monthly; re-check the cited page before committing a user to one.
11
+
12
+ ## 1. Architecture shape
13
+
14
+ | Stage | Architecture | Infra | Why | Source |
15
+ |---|---|---|---|---|
16
+ | Prototype (0 users, 1 dev) | One process, one repo, one Postgres; modules by domain folder | PaaS free/hobby tier or one VPS | Boundaries are unknown; distribution would freeze wrong ones | [Fowler, MonolithFirst](https://martinfowler.com/bliki/MonolithFirst.html) |
17
+ | First users (1-10k, 1-5 devs) | Modular monolith + separate worker process from the same codebase; Postgres queue | PaaS paid tier or Kamal on 1-2 VMs; managed Postgres with PITR | Two process types cover web + async; one deploy pipeline | [Shopify, Deconstructing the Monolith](https://shopify.engineering/deconstructing-monolith-designing-software-maximizes-developer-productivity), [37signals, Kamal 2](https://dev.37signals.com/kamal-2) |
18
+ | Growth (several teams, one hot path) | Extract only the module with a distinct scaling, release, or isolation need; keep the rest monolithic | Containers on managed orchestration (ECS, Cloud Run, or K8s if a team owns it); IaC | Split along proven seams; cost of a network hop is paid only where it buys something | [Prime Video Tech](https://www.primevideotech.com/video-streaming/scaling-up-the-prime-video-audio-video-monitoring-service-and-reducing-costs-by-90) |
19
+ | Large multi-tenant SaaS, strict blast-radius needs | Cell-based architecture: N identical stacks, thin router, tenant-to-cell mapping | Per-cell accounts or stacks | Limits a bad deploy or noisy tenant to one cell | [AWS cell-based whitepaper](https://docs.aws.amazon.com/wellarchitected/latest/reducing-scope-of-impact-with-cell-based-architecture/reducing-scope-of-impact-with-cell-based-architecture.html) |
20
+
21
+ Rules:
22
+ - Fowler: almost all successful microservice stories started as a monolith that grew too big; teams that started with microservices often got into serious trouble ([MonolithFirst](https://martinfowler.com/bliki/MonolithFirst.html)).
23
+ - Read the Prime Video case precisely: one audio/video monitoring service moved from Step Functions + Lambda components to a single ECS process; it is not "Amazon abandoned microservices" ([Prime Video Tech](https://www.primevideotech.com/video-streaming/scaling-up-the-prime-video-audio-video-monitoring-service-and-reducing-costs-by-90)).
24
+ - Enforce module boundaries in code, not by network. Shopify's 2024 Packwerk retrospective reports that "privacy checks" (public/private constants) became a shortcut that did not fix the real problem, which is the dependency graph ([Shopify](https://shopify.engineering/a-packwerk-retrospective)). TS equivalent [inference]: per-module `index.ts` public API plus a lint rule (eslint `no-restricted-imports` or dependency-cruiser) banning deep imports.
25
+ - "Majestic monolith": a small team gains more from one coherent app than from service boundaries it cannot staff ([DHH](https://signalvnoise.com/svn3/the-majestic-monolith/)).
26
+ - Split triggers (need at least one, written down in an ADR) [inference]: different scaling profile (CPU-bound media vs I/O web), different release cadence or owner team, regulatory isolation, different runtime language, or a failure domain that must not take down the core.
27
+ - Cells are for blast-radius limits at scale; the whitepaper itself frames them as a resiliency investment with routing, migration and observability costs ([AWS](https://docs.aws.amazon.com/wellarchitected/latest/reducing-scope-of-impact-with-cell-based-architecture/reducing-scope-of-impact-with-cell-based-architecture.html)). Small apps: no cells; do keep a tenant ID on every row so cells stay possible [inference].
28
+ - Twelve-Factor still holds for config in env, stateless processes, backing services as attached resources, disposability, dev/prod parity, logs as event streams ([12factor.net](https://12factor.net/)). It was open-sourced on 2024-11-12 for community modernization ([announcement](https://12factor.net/blog/open-source-announcement)); the [twelve-factor repo](https://github.com/twelve-factor/twelve-factor) (CC-BY-4.0) has had no commit since 2025-07-10, so treat the revision as stalled and the original text as canonical.
29
+ - Hexagonal (ports and adapters): domain core depends on interfaces; DB, HTTP, queue are adapters. Use it at module edges that talk to external systems, not as layers of ceremony everywhere ([AWS Prescriptive Guidance](https://docs.aws.amazon.com/prescriptive-guidance/latest/cloud-design-patterns/hexagonal-architecture.html)).
30
+
31
+ Modular monolith layout (TypeScript; same shape in Go `internal/<module>` or Python packages) [inference]:
32
+ ```
33
+ apps/api/src/
34
+ modules/billing/{index.ts, domain/, adapters/db.ts, adapters/stripe.ts, http.ts, jobs.ts}
35
+ modules/catalog/{index.ts, ...}
36
+ platform/{db.ts, queue.ts, telemetry.ts, config.ts} # shared infra, no domain logic
37
+ main.ts # web process
38
+ worker.ts # job process, same image, different command
39
+ ```
40
+ Each module owns its tables (prefix or schema); other modules call `modules/<x>/index.ts`, never its tables.
41
+
42
+ ## 2. Reliability
43
+
44
+ Frameworks to check designs against (all free to read):
45
+
46
+ | Framework | Shape | Source |
47
+ |---|---|---|
48
+ | AWS Well-Architected | 6 pillars: operational excellence, security, reliability, performance efficiency, cost optimization, sustainability; framework doc dated 2024-11-06 | [AWS](https://docs.aws.amazon.com/wellarchitected/latest/framework/welcome.html) |
49
+ | Azure Well-Architected | 5 pillars: reliability, security, cost optimization, operational excellence, performance efficiency | [Microsoft Learn](https://learn.microsoft.com/en-us/azure/well-architected/) |
50
+ | Google Cloud Well-Architected (renamed from Architecture Framework) | Pillars plus cross-pillar perspectives; changelog maintained | [Google Cloud](https://docs.cloud.google.com/architecture/framework) |
51
+ | Google SRE book + workbook | SLIs, SLOs, error budgets, burn-rate alerting | [SLO chapter](https://sre.google/sre-book/service-level-objectives/), [Implementing SLOs](https://sre.google/workbook/implementing-slos/) |
52
+
53
+ SLO method:
54
+ - SLI = good events / valid events, measured as close to the user as possible (load balancer or client), e.g. "HTTP 2xx/3xx/4xx under 300 ms / all requests" ([SRE book](https://sre.google/sre-book/service-level-objectives/)).
55
+ - SLO = target over a window (e.g. 99.5% over 28 days). Error budget = 1 - SLO. Write an error budget policy: the workbook example requires a postmortem when one incident burns over 20% of the 4-week budget ([SRE workbook](https://sre.google/workbook/error-budget-policy/)).
56
+ - Alert on burn rate with multiple windows (fast burn pages, slow burn tickets), not on raw CPU ([SRE workbook, Alerting on SLOs](https://sre.google/workbook/alerting-on-slos/)).
57
+
58
+ Timeouts, retries, backoff (from [AWS Builders' Library](https://aws.amazon.com/builders-library/timeouts-retries-and-backoff-with-jitter/)):
59
+ - Set connect and request timeouts on every remote call, including cross-process on one host. Pick the value from the dependency's latency at your acceptable false-timeout rate (Amazon example: 0.1% -> use p99.9), padded for internet clients.
60
+ - Retries multiply: 5 layers x 3 tries = 243x load on the database. Retry at one layer only.
61
+ - Use capped exponential backoff with jitter; also jitter cron and periodic jobs.
62
+ - Amazon prefers a local token bucket that limits retries over circuit breakers, because breakers add hard-to-test modal behavior. This refines the existing deepmodebot "circuit breaker on every third-party call" rule: use a retry budget first, add a breaker where a fallback exists ([Azure circuit breaker pattern](https://learn.microsoft.com/en-us/azure/architecture/patterns/circuit-breaker)).
63
+ - Do not retry non-idempotent calls; 4xx are generally not retryable, 429/503 are, honoring `Retry-After` ([RFC 9110](https://www.rfc-editor.org/rfc/rfc9110)).
64
+
65
+ ```ts
66
+ // full jitter: sleep = random(0, min(cap, base * 2^attempt))
67
+ const delay = (n: number, base = 100, cap = 10_000) => Math.random() * Math.min(cap, base * 2 ** n);
68
+ ```
69
+
70
+ Idempotency:
71
+ - Client sends `Idempotency-Key` (Stripe: up to 255 chars, no PII); server stores key + request fingerprint + response; same key with different params is an error; v1 keys may be pruned after 24 hours ([Stripe API](https://docs.stripe.com/api/idempotent_requests)). Design write-up: [Stripe blog](https://stripe.com/blog/idempotency), [AWS Builders' Library](https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/).
72
+ - Implementation [inference]: table `idempotency_keys(key, user_id, request_hash, status, response, created_at)`, unique on `(user_id, key)`, insert in the same transaction as the side effect.
73
+
74
+ Overload protection:
75
+ - Rate limiting: token bucket per API key/user; Stripe runs four limiters: request rate, concurrent requests, fleet-usage load shedder, worker-utilization load shedder ([Stripe](https://stripe.com/blog/rate-limiters)). Return 429 with `Retry-After`.
76
+ - Load shedding: reject early and cheaply when over capacity so accepted work still meets latency; prioritize health checks and paying traffic ([AWS Builders' Library](https://aws.amazon.com/builders-library/using-load-shedding-to-avoid-overload/)).
77
+ - Queues hide overload: bound queue depth, alarm on age of oldest message, and plan how to drain a backlog ([AWS Builders' Library](https://aws.amazon.com/builders-library/avoiding-insurmountable-queue-backlogs/)).
78
+ - Graceful degradation: decide per feature what to drop (recommendations, search suggestions) when a dependency fails; serve stale cache rather than error [inference].
79
+
80
+ Health checks ([Kubernetes probes](https://kubernetes.io/docs/concepts/configuration/liveness-readiness-startup-probes/)):
81
+
82
+ | Probe | Answers | Must not |
83
+ |---|---|---|
84
+ | Liveness `/livez` | Is this process wedged (deadlock)? Restart it | Check the DB or other dependencies; docs warn misconfigured liveness probes cause cascading failures |
85
+ | Readiness `/readyz` | Can it take traffic now (warmed, connected)? | Fail permanently; it only removes the pod from load balancing |
86
+ | Startup | Slow boot finished? Delays liveness | Be omitted on apps with long migrations or cache warmup |
87
+
88
+ PaaS platforms (Fly, Render, Railway) use one HTTP health check; point it at readiness-style logic that stays cheap [inference].
89
+
90
+ ## 3. Async work, workflows, scheduling
91
+
92
+ | Workload | Pick | Why | Source |
93
+ |---|---|---|---|
94
+ | Emails, webhooks out, thumbnails; already on Postgres | Postgres queue: pg-boss (Node), River (Go), Graphile Worker (Node), pgmq (any language, SQL API) | Enqueue in the same transaction as the business write: no outbox, no extra infra | [River transactional enqueueing](https://riverqueue.com/docs/transactional-enqueueing) |
95
+ | Multi-step, long-running, waits for humans/timers, must survive deploys | Durable execution (table below) | Engine checkpoints each step; code resumes after crash | [Lambda durable functions](https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html) |
96
+ | Fan-out events to many consumers, replay, analytics | Kafka (or Redpanda), NATS JetStream lighter option | Durable partitioned log, consumer offsets | [Kafka 4.1 upgrade notes](https://kafka.apache.org/41/getting-started/upgrade/) |
97
+ | Task routing, priorities, RPC-ish messaging, polyglot | RabbitMQ | Mature broker, exchanges, quorum queues | [rabbitmq-server](https://github.com/rabbitmq/rabbitmq-server) |
98
+ | On AWS, no servers to run | SQS (+ DLQ) and EventBridge Scheduler | Managed, pay per request; set visibility timeout > job time | [SQS visibility timeout](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html), [DLQ](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html) |
99
+ | Cron | Queue library's scheduler (pg-boss, River, Graphile Worker all ship cron) or EventBridge Scheduler; never `setInterval` in a web replica | Exactly one firing across replicas; persisted schedule | [EventBridge Scheduler](https://docs.aws.amazon.com/eventbridge/latest/userguide/using-eventbridge-scheduler.html) |
100
+
101
+ Queues and streams (latest release from GitHub API, 2026-11-11):
102
+
103
+ | Tool | What | License | Latest | Agent notes | Source |
104
+ |---|---|---|---|---|---|
105
+ | pg-boss | Node job queue on Postgres, cron, retries | MIT | 12.38.2 (2026-11-10) | `SKIP LOCKED` based; very active; can enqueue on your own transaction's connection [unverified] | [repo](https://github.com/timgit/pg-boss) |
106
+ | River | Go job queue on Postgres, transactional enqueue | MPL-2.0 | v0.51.2 (2026-11-09) | Pre-1.0 API; pin versions | [repo](https://github.com/riverqueue/river) |
107
+ | Graphile Worker | Node job queue on Postgres, LISTEN/NOTIFY | MIT | v0.18.0 (2026-09-08) | Pre-1.0; good with any Node stack | [repo](https://github.com/graphile/worker) |
108
+ | pgmq | Postgres extension, SQS-like visibility timeout API | PostgreSQL | v1.13.1 (2026-10-20) | Repo moved to `pgmq/pgmq`; needs extension install (not on every managed PG) | [repo](https://github.com/pgmq/pgmq) |
109
+ | NATS JetStream | Lightweight pub/sub + persistent streams, KV | Apache-2.0 | v2.15.3 (2026-11-11) | Single Go binary; good self-host choice | [repo](https://github.com/nats-io/nats-server) |
110
+ | RabbitMQ | AMQP broker, streams | MPL-2.0 | v4.4.0 (2026-10-19) | Use quorum queues for durability | [repo](https://github.com/rabbitmq/rabbitmq-server) |
111
+ | Apache Kafka | Distributed log; KRaft-only since 4.0; share groups ("queues for Kafka") previewed in 4.1 | Apache-2.0 | 4.4.0 | Heavy for small teams; managed offerings cost money | [downloads](https://downloads.apache.org/kafka/), [4.1 notes](https://kafka.apache.org/41/getting-started/upgrade/) |
112
+ | Redpanda | Kafka-API compatible, C++ | Community: BSL (no offering as a service; converts to Apache-2.0 4 years after merge); Enterprise: RCL | v26.2.2 (2026-08-22) | Not OSI open source | [licensing](https://docs.redpanda.com/current/get-started/licensing/overview/) |
113
+
114
+ Durable execution engines:
115
+
116
+ | Tool | Model | License | Latest | Free tier (managed) | Source |
117
+ |---|---|---|---|---|---|
118
+ | Temporal | Workflows + activities, SDKs for Go/Java/Python/TS/.NET/Ruby/PHP; self-host server | MIT | v1.32.2 (2026-11-02) | $150 credits for 90 days, then pay-as-you-go from $0/mo, $50 per 1M actions (first 5M) | [pricing](https://temporal.io/pricing), [repo](https://github.com/temporalio/temporal) |
119
+ | DBOS Transact | Library; checkpoints workflows into your Postgres; no separate server | MIT | py 3.5.0 (2026-11-10) | Library free; Pro (Conductor tooling) $99/mo | [pricing](https://www.dbos.dev/pricing), [repo](https://github.com/dbos-inc/dbos-transact-py) |
120
+ | Hatchet | Task queue + workflows on Postgres | MIT | v0.114.2 (2026-10-26) | 1M runs + 1M events/mo free, then $30 per 1M runs | [pricing](https://hatchet.run/pricing), [repo](https://github.com/hatchet-dev/hatchet) |
121
+ | Restate | Durable handlers, virtual objects; single binary | BSL 1.1 with use grant: free in production except running a public Restate platform service | v1.8.1 (2026-10-21) | Cloud free plan 100k actions/mo | [pricing](https://restate.dev/pricing), [LICENSE](https://github.com/restatedev/restate) |
122
+ | Inngest | Event-driven step functions; serverless friendly | SSPL v1 with Apache-2.0 future license | v1.52.0 (2026-11-10) | Free 50k executions/mo, pauses at quota | [pricing](https://www.inngest.com/pricing), [repo](https://github.com/inngest/inngest) |
123
+ | Trigger.dev | TS background tasks, long runs on managed compute | Apache-2.0 | v4.8.4 (2026-11-10) | $5/mo compute credit, 20 concurrent runs | [pricing](https://trigger.dev/pricing), [repo](https://github.com/triggerdotdev/trigger.dev) |
124
+ | AWS Lambda durable functions | Checkpoint/replay steps, executions up to one year | Proprietary (paid service) | n/a | Lambda free tier: 1M requests + 400k GB-s/mo; durable ops billed separately | [docs](https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html), [pricing](https://aws.amazon.com/lambda/pricing/) |
125
+ | Cloudflare Workflows | Durable steps on Workers | Proprietary (paid service) | n/a | See Workers plan limits | [docs](https://developers.cloudflare.com/workflows/) |
126
+
127
+ Pick rule [inference]: Python/TS app already on Postgres and small team -> DBOS or Hatchet (no new datastore). Polyglot or many long-lived workflows with a team to run it -> Temporal. TS-only, serverless host -> Inngest or Trigger.dev cloud. Need self-host without license questions -> Temporal, DBOS, Hatchet, Trigger.dev.
128
+
129
+ Transactional outbox (when the queue is not in your database) ([AWS Prescriptive Guidance](https://docs.aws.amazon.com/prescriptive-guidance/latest/cloud-design-patterns/transactional-outbox.html)):
130
+ ```sql
131
+ -- one statement, one transaction: the event exists only if this call changed the order
132
+ WITH paid AS (
133
+ UPDATE orders SET status = 'paid' WHERE id = $1 AND status = 'pending' RETURNING id
134
+ )
135
+ INSERT INTO outbox (id, topic, payload)
136
+ SELECT uuidv7(), 'order.paid', $2 FROM paid; -- 0 rows: order missing or already paid; no event
137
+ -- relay: SELECT ... FROM outbox WHERE sent_at IS NULL ORDER BY id LIMIT 100 FOR UPDATE SKIP LOCKED; publish; mark sent
138
+ ```
139
+ Guard the state transition (`status = 'pending'`) so a retried request inserts no second event, and check the inserted row count to tell the caller whether anything changed. `uuidv7()` (Postgres 18) is time-ordered, so the relay's `ORDER BY id` approximates insert order; on older Postgres generate v7 IDs in the app. Consumers must still be idempotent by event `id`: the relay delivers at least once ([AWS](https://docs.aws.amazon.com/prescriptive-guidance/latest/cloud-design-patterns/transactional-outbox.html)).
140
+
141
+ ## 4. Caching and CDNs
142
+
143
+ - Cache-aside basics live in the existing backend file; here: name the invalidation trigger for every cached key (TTL only, write-through, or explicit delete on write) before adding the cache ([AWS caching patterns](https://docs.aws.amazon.com/whitepapers/latest/database-caching-strategies-using-redis/caching-patterns.html)).
144
+ - HTTP caching is defined by [RFC 9111](https://www.rfc-editor.org/rfc/rfc9111); practical guide: [MDN Caching](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching).
145
+
146
+ | Resource | Header | Why |
147
+ |---|---|---|
148
+ | Hashed static assets (`app.3f9a.js`) | `Cache-Control: public, max-age=31536000, immutable` | Filename changes on deploy |
149
+ | HTML shell | `Cache-Control: no-cache` + `ETag` | Revalidate each time, cheap 304 |
150
+ | Public API GET, tolerant of staleness | `Cache-Control: public, s-maxage=60, stale-while-revalidate=300` | CDN absorbs bursts |
151
+ | Per-user or authenticated data | `Cache-Control: private, no-store` (or `private, max-age=0`) | Prevents shared caches leaking data |
152
+
153
+ - Put a CDN in front of static assets from day one (most PaaS and Cloudflare free plans do this) [inference]. Never let a CDN cache responses that vary by `Authorization` or cookies without `Vary` or `private` ([RFC 9111](https://www.rfc-editor.org/rfc/rfc9111)).
154
+
155
+ ## 5. API styles and design
156
+
157
+ | Situation | Pick | Why | Source |
158
+ |---|---|---|---|
159
+ | Public or third-party API, webhooks, mixed clients | REST + OpenAPI 3.1/3.2 | Universal tooling, HTTP caching, codegen | [OAS 3.2.0](https://spec.openapis.org/oas/v3.2.0.html) |
160
+ | TS frontend and TS backend in one repo, no external consumers | tRPC | End-to-end types without codegen; not for public APIs | [tRPC docs](https://trpc.io/docs) |
161
+ | Internal service-to-service, polyglot, streaming | gRPC (protobuf) | Contracts, codegen, HTTP/2 streaming | [gRPC intro](https://grpc.io/docs/what-is-grpc/introduction/) |
162
+ | Many client shapes over a rich graph, a team to run it | GraphQL | Client-selected fields; needs query cost limits and persisted queries | [GraphQL spec](https://spec.graphql.org/) |
163
+
164
+ - OpenAPI 3.2.0 shipped 2025-09-19 (streaming/sequential media types, `QUERY` method, hierarchical tags); 3.2.1 is the latest patch ([OAI announcement](https://www.openapis.org/blog/2025/09/23/announcing-openapi-v3-2), [release](https://github.com/OAI/OpenAPI-Specification/releases/tag/3.2.0)). Use 3.1 when your generator lacks 3.2 support [inference].
165
+ - Style guides to follow instead of inventing rules: [Google AIP](https://google.aip.dev/158) (resource-oriented, 158 pagination, 193 errors, 185 versioning), [Microsoft API guidelines](https://github.com/microsoft/api-guidelines), [Zalando RESTful guidelines](https://opensource.zalando.com/restful-api-guidelines/).
166
+ - Pagination: cursor/page-token, not offset, for anything that grows; return `next_page_token`, treat it as opaque, cap `page_size` ([AIP-158](https://google.aip.dev/158)).
167
+ - Versioning: major version in the path (`/v1`), additive changes only within a version ([AIP-185](https://google.aip.dev/185)); Stripe-style dated versions are an option for a public API with many integrators [inference].
168
+ - Errors: `application/problem+json` per [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) (obsoletes RFC 7807):
169
+ ```json
170
+ {"type":"https://example.com/problems/insufficient-funds","title":"Insufficient funds","status":403,"detail":"Balance 30, cost 50","instance":"/v1/payments/abc"}
171
+ ```
172
+
173
+ ## 6. Observability
174
+
175
+ OpenTelemetry signal status ([spec status](https://opentelemetry.io/docs/specs/status/)): traces API/SDK/protocol stable; metrics API and protocol stable, SDK mixed; logs bridge API, SDK, protocol stable (use your normal logger plus an OTel appender, not the bridge API directly); profiles in development, public alpha announced 2026 ([OTel blog](https://opentelemetry.io/blog/2026/profiles-alpha/)). Collector is still 0.x (v0.165.0, 2026-11-06) ([repo](https://github.com/open-telemetry/opentelemetry-collector)).
176
+ - Rules: structured JSON logs with `trace_id`/`span_id`; follow [semantic conventions](https://opentelemetry.io/docs/specs/semconv/) for attribute names; export OTLP to a Collector so the backend is swappable; sample traces at the head only after volume forces it [inference].
177
+
178
+ | Tool | What | License | Latest | Agent notes | Source |
179
+ |---|---|---|---|---|---|
180
+ | Grafana LGTM (Loki, Grafana, Tempo, Mimir) | Logs, dashboards, traces, metrics | AGPL-3.0 | Loki v3.7.9, Tempo v3.1.1, Mimir 3.2.4 (Oct 2026) | Most moving parts; Grafana Cloud free tier exists (limits on vendor page) | [grafana.com/oss](https://grafana.com/oss/), [loki](https://github.com/grafana/loki) |
181
+ | SigNoz | OTel-native all-in-one on ClickHouse | MIT core, `ee/` dirs under enterprise license | v0.149.0 (2026-11-04) | Single docker-compose self-host | [repo](https://github.com/SigNoz/signoz) |
182
+ | OpenObserve | Logs/metrics/traces, object-storage backed | AGPL-3.0 | v1.2.0-rc1 (2026-11-04, pre-release) | Lightest single binary | [repo](https://github.com/openobserve/openobserve) |
183
+ | Uptrace | OTel APM on ClickHouse | AGPL-3.0 | v2.1.0-rc.2 (2026-10-22, pre-release) | Smaller community | [repo](https://github.com/uptrace/uptrace) |
184
+ | Sentry (self-hosted) | Errors, performance, replays | FSL-1.1-Apache-2.0 (source-available; each release becomes Apache-2.0 after 2 years); AI features closed | 26.10.1 (2026-10-29) | Self-host is heavy (many containers); SaaS free tier is easier | [licensing](https://open.sentry.io/licensing), [self-hosted](https://github.com/getsentry/self-hosted) |
185
+
186
+ AGPL is fine for running unmodified backends internally; modifying and offering them as a network service triggers source obligations [inference; check with counsel].
187
+
188
+ ## 7. Deployment and infrastructure
189
+
190
+ | Situation | Pick | Why | Source |
191
+ |---|---|---|---|
192
+ | Solo dev, wants zero ops | Render or Railway (git push deploys, managed Postgres) | Hobby/free entry points; previews | [Render pricing](https://render.com/pricing), [Railway pricing](https://railway.com/pricing) |
193
+ | Needs regions near users, long-lived processes, volumes | Fly.io | Pay-as-you-go, no platform fee; $1 trial credit; managed Postgres from $38/mo | [Fly pricing](https://fly.io/docs/about/pricing/), [free trial](https://fly.io/docs/about/free-trial/) |
194
+ | Cost-sensitive, own VPS (Hetzner etc.) | Kamal (CLI, SSH + Docker) or Coolify/Dokploy (self-hosted PaaS UI) | Fixed cost, no lock-in; you own patching and backups | [Kamal](https://kamal-deploy.org/), [Coolify pricing](https://coolify.io/pricing) |
195
+ | Spiky, stateless HTTP, edge latency | Cloudflare Workers | Free: 100k requests/day, 10 ms CPU per invocation | [Workers pricing](https://developers.cloudflare.com/workers/platform/pricing/) |
196
+ | Event glue on AWS | Lambda | Free tier 1M requests + 400k GB-s/mo; cold starts, 15-min max (durable functions extend) | [Lambda pricing](https://aws.amazon.com/lambda/pricing/) |
197
+ | Many services, platform team exists | Kubernetes (managed: EKS/GKE/AKS) | Standard scheduling, probes, rollouts; real ops cost | [K8s probes](https://kubernetes.io/docs/concepts/configuration/liveness-readiness-startup-probes/) |
198
+
199
+ - Free tier caveats: Render free web services spin down after 15 minutes idle and take time to wake ([Render](https://render.com/docs/free)); Railway's free plan is a 30-day trial with $5 credit, then $1/mo with 0.5 GB RAM per service ([Railway](https://railway.com/pricing)).
200
+
201
+ | Tool | What | License | Latest | Agent notes | Source |
202
+ |---|---|---|---|---|---|
203
+ | Kamal | Zero-downtime Docker deploys to any host via SSH, kamal-proxy | MIT | v2.12.0 (2026-06-18) | Runs HEY and Basecamp; needs a registry | [repo](https://github.com/basecamp/kamal) |
204
+ | Coolify | Self-hosted PaaS (Heroku-like UI) | Apache-2.0 | v4.7.5 (2026-11-10) | Self-host free; cloud from $5/mo | [repo](https://github.com/coollabsio/coolify) |
205
+ | Dokploy | Self-hosted PaaS on Docker Swarm | Apache-2.0 except `/proprietary` dirs | v0.31.0 (2026-11-05) | Check which features sit in proprietary dirs | [repo](https://github.com/Dokploy/dokploy) |
206
+ | OpenTofu | Terraform-compatible IaC, Linux Foundation | MPL-2.0 | v1.13.9 (2026-11-05) | Default for new IaC; `tofu` CLI | [docs](https://opentofu.org/docs/intro/), [repo](https://github.com/opentofu/opentofu) |
207
+ | Terraform | HashiCorp/IBM IaC | BSL 1.1 since 1.6.0 (licensor now IBM) | v1.17.2 (2026-11-11) | Fine to use internally; not OSI open source; competing-product limits | [LICENSE](https://github.com/hashicorp/terraform) |
208
+ | Pulumi | IaC in TS/Python/Go | Apache-2.0 | v3.274.1 (2026-11-05) | State in Pulumi Cloud (paid tiers) or self-managed backend | [repo](https://github.com/pulumi/pulumi) |
209
+ | SST | TS IaC for AWS/Cloudflare apps | MIT | v4.17.2 (2026-10-08) | Opinionated; good for serverless TS | [repo](https://github.com/sst/sst) |
210
+
211
+ Environments and releases:
212
+ - Three environments are enough: local (Docker Compose), preview per PR (Render/Railway/Fly support this), production; plus staging only if data migrations need rehearsal [inference]. Dev/prod parity: same Postgres major version and same container image ([12factor.net](https://12factor.net/)).
213
+ - Blue/green: two full stacks, switch traffic, keep old for rollback; canary: send a small slice, compare SLIs against the control, then widen ([SRE workbook, Canarying Releases](https://sre.google/workbook/canarying-releases/)). Kamal and PaaS do rolling/zero-downtime swaps; true canary needs weighted routing.
214
+ - Database changes use expand/contract: add column -> deploy code that writes both -> backfill -> switch reads -> drop old, so any two adjacent releases work against the same schema [inference].
215
+ - Feature flags decouple deploy from release; code against the vendor-neutral OpenFeature API (CNCF incubating) ([CNCF](https://www.cncf.io/projects/openfeature/), [spec](https://openfeature.dev/specification/)).
216
+
217
+ | Flag tool | License | Latest | Notes | Source |
218
+ |---|---|---|---|---|
219
+ | OpenFeature SDKs + flagd | Apache-2.0 | spec repo active (2026-11) | Standard API; flagd can serve flags from a JSON file in git | [spec](https://github.com/open-feature/spec) |
220
+ | Unleash | AGPL-3.0 per repo LICENSE | v8.3.1 (2026-10-29) | Self-host; enterprise features paid | [repo](https://github.com/Unleash/unleash) |
221
+ | Flagsmith | BSD-3-Clause | v2.290.0 (2026-11-05) | Most permissive self-host | [repo](https://github.com/Flagsmith/flagsmith) |
222
+ | GrowthBook | MIT core, enterprise dirs under commercial license | v5.2.0 (2026-11-03) | Flags + A/B experiments with stats | [repo](https://github.com/growthbook/growthbook) |
223
+
224
+ Rule: every flag has an owner and removal date; stale flags are dead code [inference].
225
+
226
+ ## 8. Capacity and cost
227
+
228
+ Back-of-envelope method (Google's non-abstract large system design: estimate with real numbers, then iterate the design) ([SRE workbook NALSD](https://sre.google/workbook/non-abstract-design/)):
229
+ 1. Requests: DAU x actions per user per day / 86,400 = average RPS; x3 to x10 for peak [inference].
230
+ 2. Storage: rows per day x bytes per row x retention x (1 + index overhead, ~1x) [inference].
231
+ 3. Bandwidth: peak RPS x response size.
232
+ 4. Compare with one box: if peak RPS and data fit one Postgres + 2 app instances with headroom, stop designing for scale.
233
+ Worked example [inference]: 10k DAU x 50 req/day = 500k/day = ~6 RPS avg, ~60 RPS peak; 1 KB rows x 20k/day x 365 = ~7 GB/yr. One small managed Postgres covers it.
234
+
235
+ | Tool | What | License | Latest | Agent notes | Source |
236
+ |---|---|---|---|---|---|
237
+ | k6 | Load tests in JS, thresholds as pass/fail | AGPL-3.0 | v2.3.0 (2026-09-21) | Use test types: smoke, average-load, stress, spike, soak, breakpoint | [test types](https://grafana.com/docs/k6/latest/testing-guides/test-types/), [repo](https://github.com/grafana/k6) |
238
+ | Locust | Load tests in Python, distributed | MIT | 2.47.0 (2026-10-21) | Good for Python teams; user-behavior scripting | [docs](https://docs.locust.io/en/stable/), [repo](https://github.com/locustio/locust) |
239
+ | Vegeta | Constant-rate HTTP load CLI/library (Go) | MIT | v12.13.0 (2025-10-31) | No release in 12+ months (commits through 2026-09); fine for quick rate tests | [repo](https://github.com/tsenart/vegeta) |
240
+
241
+ - Load test against a production-like environment, with thresholds tied to SLOs (e.g. `p(95)<300`, error rate < 1%), never against third-party APIs you call [inference].
242
+
243
+ Cost guardrails:
244
+ - Set budgets and alerts on day one: [AWS Budgets](https://docs.aws.amazon.com/cost-management/latest/userguide/budgets-managing-costs.html), [Railway usage limits](https://docs.railway.com/reference/usage-limits); prefer services that pause at quota (Inngest free plan, Hatchet) over ones that bill unbounded overage ([Inngest](https://www.inngest.com/pricing), [Hatchet](https://hatchet.run/pricing)).
245
+ - Well-Architected's cost pillar: tag resources by owner/env, review monthly, delete idle previews ([AWS](https://docs.aws.amazon.com/wellarchitected/latest/framework/welcome.html)).
246
+ - Watch the usual surprises [inference]: egress (Fly $0.02/GB NA/EU, Railway $0.05/GB), NAT gateways, log ingestion volume, managed DB minimums, and preview environments left running ([Fly](https://fly.io/docs/about/pricing/), [Railway](https://railway.com/pricing)).
247
+
248
+ ## Traps for agents
249
+ - Proposing microservices, Kafka, or Kubernetes for a new single-team app. Default to the modular monolith ([Fowler](https://martinfowler.com/bliki/MonolithFirst.html)); require a written split trigger.
250
+ - Citing Prime Video as "Amazon went back to monoliths"; it was one monitoring service ([Prime Video Tech](https://www.primevideotech.com/video-streaming/scaling-up-the-prime-video-audio-video-monitoring-service-and-reducing-costs-by-90)).
251
+ - Adding retries at every layer (SDK default + app loop + queue redelivery) and multiplying load; retrying POSTs without an idempotency key ([AWS Builders' Library](https://aws.amazon.com/builders-library/timeouts-retries-and-backoff-with-jitter/)).
252
+ - Calling HTTP clients without a timeout: Python `requests` never times out unless `timeout=` is set ([Requests docs](https://requests.readthedocs.io/en/latest/user/quickstart/)); Node `fetch` defaults are minutes long [unverified]. Pass `AbortSignal.timeout(ms)` or `timeout=` explicitly.
253
+ - Liveness probes that check the database, so a DB blip restarts every pod ([Kubernetes](https://kubernetes.io/docs/concepts/configuration/liveness-readiness-startup-probes/)).
254
+ - Publishing to a broker after `COMMIT` (dual write) instead of transactional enqueue or an outbox ([AWS](https://docs.aws.amazon.com/prescriptive-guidance/latest/cloud-design-patterns/transactional-outbox.html)).
255
+ - Running cron with `setInterval` inside web replicas (fires N times, dies on deploy).
256
+ - Calling BSL/SSPL/FSL tools "open source": Restate's pricing page says "permissive license" but the repo LICENSE is BSL 1.1 ([LICENSE](https://github.com/restatedev/restate)); Terraform and Redpanda are BSL, Inngest SSPL, Sentry FSL. Report the license from the repo, not the marketing page.
257
+ - Recommending Terraform for new code without noting OpenTofu, or writing `terraform` commands for a repo using `tofu` [inference].
258
+ - Offset pagination and ad-hoc error JSON in new APIs; use page tokens and RFC 9457 ([AIP-158](https://google.aip.dev/158), [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457)).
259
+ - Caching authenticated responses at a CDN, or adding a cache with no invalidation story ([RFC 9111](https://www.rfc-editor.org/rfc/rfc9111)).
260
+ - Quoting free-tier numbers or plan names from training data; they change often. Fetch the pricing page and cite its date.
261
+ - Treating OTel metrics SDKs and profiles as uniformly stable; check the per-language README ([OTel status](https://opentelemetry.io/docs/specs/status/)).
262
+ - Leaving a deploy target on a free tier that sleeps (Render) for webhooks or cron, then missing events ([Render](https://render.com/docs/free)).
263
+
264
+ ## Default for a solo dev / small team
265
+ - Shape: one repo, one container image, two commands (`web`, `worker`), modules by domain with an `index.ts` public API and a lint rule against deep imports.
266
+ - Data and jobs: managed Postgres with PITR; jobs via pg-boss or Graphile Worker (Node), River (Go), DBOS or pgmq over SQL (Python); enqueue inside the business transaction.
267
+ - Workflows: none until a flow spans minutes+ or waits on humans; then DBOS or Hatchet (MIT, Postgres) or Temporal Cloud ($150 credits).
268
+ - API: REST + OpenAPI 3.1, RFC 9457 errors, cursor pagination, `Idempotency-Key` on creates and payments; tRPC only for an internal TS-only frontend.
269
+ - Reliability: timeouts on every call, one retry layer with full jitter, 429 + `Retry-After`, `/livez` (no deps) and `/readyz`; one availability SLO and one latency SLO per user-facing API.
270
+ - Observability: OTel SDK + Collector -> SigNoz self-host or a vendor free tier; Sentry SaaS free tier for errors; JSON logs with trace IDs.
271
+ - Deploy: Render/Railway/Fly for zero-ops, or Kamal/Coolify on one VPS for fixed cost; preview deploy per PR; expand/contract migrations; OpenFeature-compatible flags (flagd file or Flagsmith).
272
+ - IaC: none for a pure PaaS app (platform config file in repo); OpenTofu once you have cloud resources beyond the PaaS.
273
+ - Capacity and cost: write the back-of-envelope numbers in the design doc; k6 smoke + average-load tests in CI before launch; budgets and usage limits set on every account on day one.