@zigrivers/scaffold 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (657) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +477 -0
  3. package/dist/cli/commands/adopt.d.ts +12 -0
  4. package/dist/cli/commands/adopt.d.ts.map +1 -0
  5. package/dist/cli/commands/adopt.js +107 -0
  6. package/dist/cli/commands/adopt.js.map +1 -0
  7. package/dist/cli/commands/adopt.test.d.ts +2 -0
  8. package/dist/cli/commands/adopt.test.d.ts.map +1 -0
  9. package/dist/cli/commands/adopt.test.js +277 -0
  10. package/dist/cli/commands/adopt.test.js.map +1 -0
  11. package/dist/cli/commands/build.d.ts +12 -0
  12. package/dist/cli/commands/build.d.ts.map +1 -0
  13. package/dist/cli/commands/build.js +105 -0
  14. package/dist/cli/commands/build.js.map +1 -0
  15. package/dist/cli/commands/build.test.d.ts +2 -0
  16. package/dist/cli/commands/build.test.d.ts.map +1 -0
  17. package/dist/cli/commands/build.test.js +272 -0
  18. package/dist/cli/commands/build.test.js.map +1 -0
  19. package/dist/cli/commands/dashboard.d.ts +14 -0
  20. package/dist/cli/commands/dashboard.d.ts.map +1 -0
  21. package/dist/cli/commands/dashboard.js +102 -0
  22. package/dist/cli/commands/dashboard.js.map +1 -0
  23. package/dist/cli/commands/dashboard.test.d.ts +2 -0
  24. package/dist/cli/commands/dashboard.test.d.ts.map +1 -0
  25. package/dist/cli/commands/dashboard.test.js +142 -0
  26. package/dist/cli/commands/dashboard.test.js.map +1 -0
  27. package/dist/cli/commands/decisions.d.ts +13 -0
  28. package/dist/cli/commands/decisions.d.ts.map +1 -0
  29. package/dist/cli/commands/decisions.js +62 -0
  30. package/dist/cli/commands/decisions.js.map +1 -0
  31. package/dist/cli/commands/decisions.test.d.ts +2 -0
  32. package/dist/cli/commands/decisions.test.d.ts.map +1 -0
  33. package/dist/cli/commands/decisions.test.js +154 -0
  34. package/dist/cli/commands/decisions.test.js.map +1 -0
  35. package/dist/cli/commands/info.d.ts +12 -0
  36. package/dist/cli/commands/info.d.ts.map +1 -0
  37. package/dist/cli/commands/info.js +110 -0
  38. package/dist/cli/commands/info.js.map +1 -0
  39. package/dist/cli/commands/info.test.d.ts +2 -0
  40. package/dist/cli/commands/info.test.d.ts.map +1 -0
  41. package/dist/cli/commands/info.test.js +392 -0
  42. package/dist/cli/commands/info.test.js.map +1 -0
  43. package/dist/cli/commands/init.d.ts +13 -0
  44. package/dist/cli/commands/init.d.ts.map +1 -0
  45. package/dist/cli/commands/init.js +46 -0
  46. package/dist/cli/commands/init.js.map +1 -0
  47. package/dist/cli/commands/init.test.d.ts +2 -0
  48. package/dist/cli/commands/init.test.d.ts.map +1 -0
  49. package/dist/cli/commands/init.test.js +156 -0
  50. package/dist/cli/commands/init.test.js.map +1 -0
  51. package/dist/cli/commands/knowledge.d.ts +4 -0
  52. package/dist/cli/commands/knowledge.d.ts.map +1 -0
  53. package/dist/cli/commands/knowledge.js +346 -0
  54. package/dist/cli/commands/knowledge.js.map +1 -0
  55. package/dist/cli/commands/knowledge.test.d.ts +2 -0
  56. package/dist/cli/commands/knowledge.test.d.ts.map +1 -0
  57. package/dist/cli/commands/knowledge.test.js +293 -0
  58. package/dist/cli/commands/knowledge.test.js.map +1 -0
  59. package/dist/cli/commands/list.d.ts +12 -0
  60. package/dist/cli/commands/list.d.ts.map +1 -0
  61. package/dist/cli/commands/list.js +73 -0
  62. package/dist/cli/commands/list.js.map +1 -0
  63. package/dist/cli/commands/list.test.d.ts +2 -0
  64. package/dist/cli/commands/list.test.d.ts.map +1 -0
  65. package/dist/cli/commands/list.test.js +166 -0
  66. package/dist/cli/commands/list.test.js.map +1 -0
  67. package/dist/cli/commands/next.d.ts +12 -0
  68. package/dist/cli/commands/next.d.ts.map +1 -0
  69. package/dist/cli/commands/next.js +75 -0
  70. package/dist/cli/commands/next.js.map +1 -0
  71. package/dist/cli/commands/next.test.d.ts +2 -0
  72. package/dist/cli/commands/next.test.d.ts.map +1 -0
  73. package/dist/cli/commands/next.test.js +236 -0
  74. package/dist/cli/commands/next.test.js.map +1 -0
  75. package/dist/cli/commands/reset.d.ts +13 -0
  76. package/dist/cli/commands/reset.d.ts.map +1 -0
  77. package/dist/cli/commands/reset.js +105 -0
  78. package/dist/cli/commands/reset.js.map +1 -0
  79. package/dist/cli/commands/reset.test.d.ts +2 -0
  80. package/dist/cli/commands/reset.test.d.ts.map +1 -0
  81. package/dist/cli/commands/reset.test.js +211 -0
  82. package/dist/cli/commands/reset.test.js.map +1 -0
  83. package/dist/cli/commands/run.d.ts +14 -0
  84. package/dist/cli/commands/run.d.ts.map +1 -0
  85. package/dist/cli/commands/run.js +379 -0
  86. package/dist/cli/commands/run.js.map +1 -0
  87. package/dist/cli/commands/run.test.d.ts +2 -0
  88. package/dist/cli/commands/run.test.d.ts.map +1 -0
  89. package/dist/cli/commands/run.test.js +535 -0
  90. package/dist/cli/commands/run.test.js.map +1 -0
  91. package/dist/cli/commands/skip.d.ts +13 -0
  92. package/dist/cli/commands/skip.d.ts.map +1 -0
  93. package/dist/cli/commands/skip.js +123 -0
  94. package/dist/cli/commands/skip.js.map +1 -0
  95. package/dist/cli/commands/skip.test.d.ts +2 -0
  96. package/dist/cli/commands/skip.test.d.ts.map +1 -0
  97. package/dist/cli/commands/skip.test.js +339 -0
  98. package/dist/cli/commands/skip.test.js.map +1 -0
  99. package/dist/cli/commands/status.d.ts +12 -0
  100. package/dist/cli/commands/status.d.ts.map +1 -0
  101. package/dist/cli/commands/status.js +79 -0
  102. package/dist/cli/commands/status.js.map +1 -0
  103. package/dist/cli/commands/status.test.d.ts +2 -0
  104. package/dist/cli/commands/status.test.d.ts.map +1 -0
  105. package/dist/cli/commands/status.test.js +245 -0
  106. package/dist/cli/commands/status.test.js.map +1 -0
  107. package/dist/cli/commands/update.d.ts +11 -0
  108. package/dist/cli/commands/update.d.ts.map +1 -0
  109. package/dist/cli/commands/update.js +159 -0
  110. package/dist/cli/commands/update.js.map +1 -0
  111. package/dist/cli/commands/update.test.d.ts +2 -0
  112. package/dist/cli/commands/update.test.d.ts.map +1 -0
  113. package/dist/cli/commands/update.test.js +140 -0
  114. package/dist/cli/commands/update.test.js.map +1 -0
  115. package/dist/cli/commands/validate.d.ts +12 -0
  116. package/dist/cli/commands/validate.d.ts.map +1 -0
  117. package/dist/cli/commands/validate.js +65 -0
  118. package/dist/cli/commands/validate.js.map +1 -0
  119. package/dist/cli/commands/validate.test.d.ts +2 -0
  120. package/dist/cli/commands/validate.test.d.ts.map +1 -0
  121. package/dist/cli/commands/validate.test.js +159 -0
  122. package/dist/cli/commands/validate.test.js.map +1 -0
  123. package/dist/cli/commands/version.d.ts +13 -0
  124. package/dist/cli/commands/version.d.ts.map +1 -0
  125. package/dist/cli/commands/version.js +89 -0
  126. package/dist/cli/commands/version.js.map +1 -0
  127. package/dist/cli/commands/version.test.d.ts +2 -0
  128. package/dist/cli/commands/version.test.d.ts.map +1 -0
  129. package/dist/cli/commands/version.test.js +63 -0
  130. package/dist/cli/commands/version.test.js.map +1 -0
  131. package/dist/cli/index.d.ts +4 -0
  132. package/dist/cli/index.d.ts.map +1 -0
  133. package/dist/cli/index.js +72 -0
  134. package/dist/cli/index.js.map +1 -0
  135. package/dist/cli/index.test.d.ts +2 -0
  136. package/dist/cli/index.test.d.ts.map +1 -0
  137. package/dist/cli/index.test.js +8 -0
  138. package/dist/cli/index.test.js.map +1 -0
  139. package/dist/cli/middleware/output-mode.d.ts +21 -0
  140. package/dist/cli/middleware/output-mode.d.ts.map +1 -0
  141. package/dist/cli/middleware/output-mode.js +27 -0
  142. package/dist/cli/middleware/output-mode.js.map +1 -0
  143. package/dist/cli/middleware/output-mode.test.d.ts +2 -0
  144. package/dist/cli/middleware/output-mode.test.d.ts.map +1 -0
  145. package/dist/cli/middleware/output-mode.test.js +41 -0
  146. package/dist/cli/middleware/output-mode.test.js.map +1 -0
  147. package/dist/cli/middleware/project-root.d.ts +21 -0
  148. package/dist/cli/middleware/project-root.d.ts.map +1 -0
  149. package/dist/cli/middleware/project-root.js +54 -0
  150. package/dist/cli/middleware/project-root.js.map +1 -0
  151. package/dist/cli/middleware/project-root.test.d.ts +2 -0
  152. package/dist/cli/middleware/project-root.test.d.ts.map +1 -0
  153. package/dist/cli/middleware/project-root.test.js +112 -0
  154. package/dist/cli/middleware/project-root.test.js.map +1 -0
  155. package/dist/cli/output/auto.d.ts +18 -0
  156. package/dist/cli/output/auto.d.ts.map +1 -0
  157. package/dist/cli/output/auto.js +43 -0
  158. package/dist/cli/output/auto.js.map +1 -0
  159. package/dist/cli/output/context.d.ts +19 -0
  160. package/dist/cli/output/context.d.ts.map +1 -0
  161. package/dist/cli/output/context.js +15 -0
  162. package/dist/cli/output/context.js.map +1 -0
  163. package/dist/cli/output/context.test.d.ts +2 -0
  164. package/dist/cli/output/context.test.d.ts.map +1 -0
  165. package/dist/cli/output/context.test.js +335 -0
  166. package/dist/cli/output/context.test.js.map +1 -0
  167. package/dist/cli/output/error-display.d.ts +31 -0
  168. package/dist/cli/output/error-display.d.ts.map +1 -0
  169. package/dist/cli/output/error-display.js +79 -0
  170. package/dist/cli/output/error-display.js.map +1 -0
  171. package/dist/cli/output/error-display.test.d.ts +2 -0
  172. package/dist/cli/output/error-display.test.d.ts.map +1 -0
  173. package/dist/cli/output/error-display.test.js +230 -0
  174. package/dist/cli/output/error-display.test.js.map +1 -0
  175. package/dist/cli/output/interactive.d.ts +22 -0
  176. package/dist/cli/output/interactive.d.ts.map +1 -0
  177. package/dist/cli/output/interactive.js +126 -0
  178. package/dist/cli/output/interactive.js.map +1 -0
  179. package/dist/cli/output/json.d.ts +17 -0
  180. package/dist/cli/output/json.d.ts.map +1 -0
  181. package/dist/cli/output/json.js +62 -0
  182. package/dist/cli/output/json.js.map +1 -0
  183. package/dist/cli/types.d.ts +11 -0
  184. package/dist/cli/types.d.ts.map +1 -0
  185. package/dist/cli/types.js +2 -0
  186. package/dist/cli/types.js.map +1 -0
  187. package/dist/config/loader.d.ts +22 -0
  188. package/dist/config/loader.d.ts.map +1 -0
  189. package/dist/config/loader.js +159 -0
  190. package/dist/config/loader.js.map +1 -0
  191. package/dist/config/loader.test.d.ts +2 -0
  192. package/dist/config/loader.test.d.ts.map +1 -0
  193. package/dist/config/loader.test.js +226 -0
  194. package/dist/config/loader.test.js.map +1 -0
  195. package/dist/config/migration.d.ts +15 -0
  196. package/dist/config/migration.d.ts.map +1 -0
  197. package/dist/config/migration.js +39 -0
  198. package/dist/config/migration.js.map +1 -0
  199. package/dist/config/migration.test.d.ts +2 -0
  200. package/dist/config/migration.test.d.ts.map +1 -0
  201. package/dist/config/migration.test.js +44 -0
  202. package/dist/config/migration.test.js.map +1 -0
  203. package/dist/config/schema.d.ts +121 -0
  204. package/dist/config/schema.d.ts.map +1 -0
  205. package/dist/config/schema.js +22 -0
  206. package/dist/config/schema.js.map +1 -0
  207. package/dist/config/schema.test.d.ts +2 -0
  208. package/dist/config/schema.test.d.ts.map +1 -0
  209. package/dist/config/schema.test.js +126 -0
  210. package/dist/config/schema.test.js.map +1 -0
  211. package/dist/core/adapters/adapter.d.ts +64 -0
  212. package/dist/core/adapters/adapter.d.ts.map +1 -0
  213. package/dist/core/adapters/adapter.js +25 -0
  214. package/dist/core/adapters/adapter.js.map +1 -0
  215. package/dist/core/adapters/adapter.test.d.ts +2 -0
  216. package/dist/core/adapters/adapter.test.d.ts.map +1 -0
  217. package/dist/core/adapters/adapter.test.js +175 -0
  218. package/dist/core/adapters/adapter.test.js.map +1 -0
  219. package/dist/core/adapters/claude-code.d.ts +9 -0
  220. package/dist/core/adapters/claude-code.d.ts.map +1 -0
  221. package/dist/core/adapters/claude-code.js +34 -0
  222. package/dist/core/adapters/claude-code.js.map +1 -0
  223. package/dist/core/adapters/claude-code.test.d.ts +2 -0
  224. package/dist/core/adapters/claude-code.test.d.ts.map +1 -0
  225. package/dist/core/adapters/claude-code.test.js +100 -0
  226. package/dist/core/adapters/claude-code.test.js.map +1 -0
  227. package/dist/core/adapters/codex.d.ts +10 -0
  228. package/dist/core/adapters/codex.d.ts.map +1 -0
  229. package/dist/core/adapters/codex.js +61 -0
  230. package/dist/core/adapters/codex.js.map +1 -0
  231. package/dist/core/adapters/codex.test.d.ts +2 -0
  232. package/dist/core/adapters/codex.test.d.ts.map +1 -0
  233. package/dist/core/adapters/codex.test.js +122 -0
  234. package/dist/core/adapters/codex.test.js.map +1 -0
  235. package/dist/core/adapters/universal.d.ts +10 -0
  236. package/dist/core/adapters/universal.d.ts.map +1 -0
  237. package/dist/core/adapters/universal.js +45 -0
  238. package/dist/core/adapters/universal.js.map +1 -0
  239. package/dist/core/adapters/universal.test.d.ts +2 -0
  240. package/dist/core/adapters/universal.test.d.ts.map +1 -0
  241. package/dist/core/adapters/universal.test.js +121 -0
  242. package/dist/core/adapters/universal.test.js.map +1 -0
  243. package/dist/core/assembly/context-gatherer.d.ts +17 -0
  244. package/dist/core/assembly/context-gatherer.d.ts.map +1 -0
  245. package/dist/core/assembly/context-gatherer.js +49 -0
  246. package/dist/core/assembly/context-gatherer.js.map +1 -0
  247. package/dist/core/assembly/context-gatherer.test.d.ts +2 -0
  248. package/dist/core/assembly/context-gatherer.test.d.ts.map +1 -0
  249. package/dist/core/assembly/context-gatherer.test.js +252 -0
  250. package/dist/core/assembly/context-gatherer.test.js.map +1 -0
  251. package/dist/core/assembly/depth-resolver.d.ts +11 -0
  252. package/dist/core/assembly/depth-resolver.d.ts.map +1 -0
  253. package/dist/core/assembly/depth-resolver.js +23 -0
  254. package/dist/core/assembly/depth-resolver.js.map +1 -0
  255. package/dist/core/assembly/depth-resolver.test.d.ts +2 -0
  256. package/dist/core/assembly/depth-resolver.test.d.ts.map +1 -0
  257. package/dist/core/assembly/depth-resolver.test.js +100 -0
  258. package/dist/core/assembly/depth-resolver.test.js.map +1 -0
  259. package/dist/core/assembly/engine.d.ts +22 -0
  260. package/dist/core/assembly/engine.d.ts.map +1 -0
  261. package/dist/core/assembly/engine.js +215 -0
  262. package/dist/core/assembly/engine.js.map +1 -0
  263. package/dist/core/assembly/engine.test.d.ts +2 -0
  264. package/dist/core/assembly/engine.test.d.ts.map +1 -0
  265. package/dist/core/assembly/engine.test.js +462 -0
  266. package/dist/core/assembly/engine.test.js.map +1 -0
  267. package/dist/core/assembly/instruction-loader.d.ts +16 -0
  268. package/dist/core/assembly/instruction-loader.d.ts.map +1 -0
  269. package/dist/core/assembly/instruction-loader.js +40 -0
  270. package/dist/core/assembly/instruction-loader.js.map +1 -0
  271. package/dist/core/assembly/instruction-loader.test.d.ts +2 -0
  272. package/dist/core/assembly/instruction-loader.test.d.ts.map +1 -0
  273. package/dist/core/assembly/instruction-loader.test.js +109 -0
  274. package/dist/core/assembly/instruction-loader.test.js.map +1 -0
  275. package/dist/core/assembly/knowledge-loader.d.ts +34 -0
  276. package/dist/core/assembly/knowledge-loader.d.ts.map +1 -0
  277. package/dist/core/assembly/knowledge-loader.js +204 -0
  278. package/dist/core/assembly/knowledge-loader.js.map +1 -0
  279. package/dist/core/assembly/knowledge-loader.test.d.ts +2 -0
  280. package/dist/core/assembly/knowledge-loader.test.d.ts.map +1 -0
  281. package/dist/core/assembly/knowledge-loader.test.js +205 -0
  282. package/dist/core/assembly/knowledge-loader.test.js.map +1 -0
  283. package/dist/core/assembly/meta-prompt-loader.d.ts +13 -0
  284. package/dist/core/assembly/meta-prompt-loader.d.ts.map +1 -0
  285. package/dist/core/assembly/meta-prompt-loader.js +91 -0
  286. package/dist/core/assembly/meta-prompt-loader.js.map +1 -0
  287. package/dist/core/assembly/meta-prompt-loader.test.d.ts +2 -0
  288. package/dist/core/assembly/meta-prompt-loader.test.d.ts.map +1 -0
  289. package/dist/core/assembly/meta-prompt-loader.test.js +232 -0
  290. package/dist/core/assembly/meta-prompt-loader.test.js.map +1 -0
  291. package/dist/core/assembly/methodology-change.d.ts +27 -0
  292. package/dist/core/assembly/methodology-change.d.ts.map +1 -0
  293. package/dist/core/assembly/methodology-change.js +41 -0
  294. package/dist/core/assembly/methodology-change.js.map +1 -0
  295. package/dist/core/assembly/methodology-change.test.d.ts +2 -0
  296. package/dist/core/assembly/methodology-change.test.d.ts.map +1 -0
  297. package/dist/core/assembly/methodology-change.test.js +145 -0
  298. package/dist/core/assembly/methodology-change.test.js.map +1 -0
  299. package/dist/core/assembly/methodology-resolver.d.ts +11 -0
  300. package/dist/core/assembly/methodology-resolver.d.ts.map +1 -0
  301. package/dist/core/assembly/methodology-resolver.js +19 -0
  302. package/dist/core/assembly/methodology-resolver.js.map +1 -0
  303. package/dist/core/assembly/methodology-resolver.test.d.ts +2 -0
  304. package/dist/core/assembly/methodology-resolver.test.d.ts.map +1 -0
  305. package/dist/core/assembly/methodology-resolver.test.js +87 -0
  306. package/dist/core/assembly/methodology-resolver.test.js.map +1 -0
  307. package/dist/core/assembly/preset-loader.d.ts +26 -0
  308. package/dist/core/assembly/preset-loader.d.ts.map +1 -0
  309. package/dist/core/assembly/preset-loader.js +146 -0
  310. package/dist/core/assembly/preset-loader.js.map +1 -0
  311. package/dist/core/assembly/preset-loader.test.d.ts +2 -0
  312. package/dist/core/assembly/preset-loader.test.d.ts.map +1 -0
  313. package/dist/core/assembly/preset-loader.test.js +107 -0
  314. package/dist/core/assembly/preset-loader.test.js.map +1 -0
  315. package/dist/core/assembly/update-mode.d.ts +25 -0
  316. package/dist/core/assembly/update-mode.d.ts.map +1 -0
  317. package/dist/core/assembly/update-mode.js +70 -0
  318. package/dist/core/assembly/update-mode.js.map +1 -0
  319. package/dist/core/assembly/update-mode.test.d.ts +2 -0
  320. package/dist/core/assembly/update-mode.test.d.ts.map +1 -0
  321. package/dist/core/assembly/update-mode.test.js +235 -0
  322. package/dist/core/assembly/update-mode.test.js.map +1 -0
  323. package/dist/core/dependency/dependency.d.ts +20 -0
  324. package/dist/core/dependency/dependency.d.ts.map +1 -0
  325. package/dist/core/dependency/dependency.js +104 -0
  326. package/dist/core/dependency/dependency.js.map +1 -0
  327. package/dist/core/dependency/dependency.test.d.ts +2 -0
  328. package/dist/core/dependency/dependency.test.d.ts.map +1 -0
  329. package/dist/core/dependency/dependency.test.js +166 -0
  330. package/dist/core/dependency/dependency.test.js.map +1 -0
  331. package/dist/core/dependency/eligibility.d.ts +17 -0
  332. package/dist/core/dependency/eligibility.d.ts.map +1 -0
  333. package/dist/core/dependency/eligibility.js +60 -0
  334. package/dist/core/dependency/eligibility.js.map +1 -0
  335. package/dist/core/dependency/eligibility.test.d.ts +2 -0
  336. package/dist/core/dependency/eligibility.test.d.ts.map +1 -0
  337. package/dist/core/dependency/eligibility.test.js +198 -0
  338. package/dist/core/dependency/eligibility.test.js.map +1 -0
  339. package/dist/core/dependency/graph.d.ts +12 -0
  340. package/dist/core/dependency/graph.d.ts.map +1 -0
  341. package/dist/core/dependency/graph.js +34 -0
  342. package/dist/core/dependency/graph.js.map +1 -0
  343. package/dist/core/knowledge/knowledge-update-assembler.d.ts +24 -0
  344. package/dist/core/knowledge/knowledge-update-assembler.d.ts.map +1 -0
  345. package/dist/core/knowledge/knowledge-update-assembler.js +46 -0
  346. package/dist/core/knowledge/knowledge-update-assembler.js.map +1 -0
  347. package/dist/core/knowledge/knowledge-update-assembler.test.d.ts +2 -0
  348. package/dist/core/knowledge/knowledge-update-assembler.test.d.ts.map +1 -0
  349. package/dist/core/knowledge/knowledge-update-assembler.test.js +93 -0
  350. package/dist/core/knowledge/knowledge-update-assembler.test.js.map +1 -0
  351. package/dist/core/knowledge/knowledge-update-template.md +55 -0
  352. package/dist/dashboard/generator.d.ts +37 -0
  353. package/dist/dashboard/generator.d.ts.map +1 -0
  354. package/dist/dashboard/generator.js +42 -0
  355. package/dist/dashboard/generator.js.map +1 -0
  356. package/dist/dashboard/generator.test.d.ts +2 -0
  357. package/dist/dashboard/generator.test.d.ts.map +1 -0
  358. package/dist/dashboard/generator.test.js +186 -0
  359. package/dist/dashboard/generator.test.js.map +1 -0
  360. package/dist/dashboard/template.d.ts +4 -0
  361. package/dist/dashboard/template.d.ts.map +1 -0
  362. package/dist/dashboard/template.js +190 -0
  363. package/dist/dashboard/template.js.map +1 -0
  364. package/dist/e2e/commands.test.d.ts +9 -0
  365. package/dist/e2e/commands.test.d.ts.map +1 -0
  366. package/dist/e2e/commands.test.js +499 -0
  367. package/dist/e2e/commands.test.js.map +1 -0
  368. package/dist/e2e/init.test.d.ts +10 -0
  369. package/dist/e2e/init.test.d.ts.map +1 -0
  370. package/dist/e2e/init.test.js +180 -0
  371. package/dist/e2e/init.test.js.map +1 -0
  372. package/dist/e2e/knowledge.test.d.ts +2 -0
  373. package/dist/e2e/knowledge.test.d.ts.map +1 -0
  374. package/dist/e2e/knowledge.test.js +103 -0
  375. package/dist/e2e/knowledge.test.js.map +1 -0
  376. package/dist/e2e/pipeline.test.d.ts +8 -0
  377. package/dist/e2e/pipeline.test.d.ts.map +1 -0
  378. package/dist/e2e/pipeline.test.js +295 -0
  379. package/dist/e2e/pipeline.test.js.map +1 -0
  380. package/dist/index.d.ts +3 -0
  381. package/dist/index.d.ts.map +1 -0
  382. package/dist/index.js +7 -0
  383. package/dist/index.js.map +1 -0
  384. package/dist/project/adopt.d.ts +28 -0
  385. package/dist/project/adopt.d.ts.map +1 -0
  386. package/dist/project/adopt.js +49 -0
  387. package/dist/project/adopt.js.map +1 -0
  388. package/dist/project/adopt.test.d.ts +2 -0
  389. package/dist/project/adopt.test.d.ts.map +1 -0
  390. package/dist/project/adopt.test.js +220 -0
  391. package/dist/project/adopt.test.js.map +1 -0
  392. package/dist/project/claude-md.d.ts +33 -0
  393. package/dist/project/claude-md.d.ts.map +1 -0
  394. package/dist/project/claude-md.js +112 -0
  395. package/dist/project/claude-md.js.map +1 -0
  396. package/dist/project/claude-md.test.d.ts +2 -0
  397. package/dist/project/claude-md.test.d.ts.map +1 -0
  398. package/dist/project/claude-md.test.js +151 -0
  399. package/dist/project/claude-md.test.js.map +1 -0
  400. package/dist/project/detector.d.ts +7 -0
  401. package/dist/project/detector.d.ts.map +1 -0
  402. package/dist/project/detector.js +78 -0
  403. package/dist/project/detector.js.map +1 -0
  404. package/dist/project/detector.test.d.ts +2 -0
  405. package/dist/project/detector.test.d.ts.map +1 -0
  406. package/dist/project/detector.test.js +137 -0
  407. package/dist/project/detector.test.js.map +1 -0
  408. package/dist/project/frontmatter.d.ts +17 -0
  409. package/dist/project/frontmatter.d.ts.map +1 -0
  410. package/dist/project/frontmatter.js +236 -0
  411. package/dist/project/frontmatter.js.map +1 -0
  412. package/dist/project/frontmatter.test.d.ts +2 -0
  413. package/dist/project/frontmatter.test.d.ts.map +1 -0
  414. package/dist/project/frontmatter.test.js +218 -0
  415. package/dist/project/frontmatter.test.js.map +1 -0
  416. package/dist/project/signals.d.ts +12 -0
  417. package/dist/project/signals.d.ts.map +1 -0
  418. package/dist/project/signals.js +2 -0
  419. package/dist/project/signals.js.map +1 -0
  420. package/dist/state/completion.d.ts +22 -0
  421. package/dist/state/completion.d.ts.map +1 -0
  422. package/dist/state/completion.js +82 -0
  423. package/dist/state/completion.js.map +1 -0
  424. package/dist/state/completion.test.d.ts +2 -0
  425. package/dist/state/completion.test.d.ts.map +1 -0
  426. package/dist/state/completion.test.js +246 -0
  427. package/dist/state/completion.test.js.map +1 -0
  428. package/dist/state/decision-logger.d.ts +16 -0
  429. package/dist/state/decision-logger.d.ts.map +1 -0
  430. package/dist/state/decision-logger.js +80 -0
  431. package/dist/state/decision-logger.js.map +1 -0
  432. package/dist/state/decision-logger.test.d.ts +2 -0
  433. package/dist/state/decision-logger.test.d.ts.map +1 -0
  434. package/dist/state/decision-logger.test.js +182 -0
  435. package/dist/state/decision-logger.test.js.map +1 -0
  436. package/dist/state/lock-manager.d.ts +18 -0
  437. package/dist/state/lock-manager.d.ts.map +1 -0
  438. package/dist/state/lock-manager.js +134 -0
  439. package/dist/state/lock-manager.js.map +1 -0
  440. package/dist/state/lock-manager.test.d.ts +2 -0
  441. package/dist/state/lock-manager.test.d.ts.map +1 -0
  442. package/dist/state/lock-manager.test.js +190 -0
  443. package/dist/state/lock-manager.test.js.map +1 -0
  444. package/dist/state/state-manager.d.ts +37 -0
  445. package/dist/state/state-manager.d.ts.map +1 -0
  446. package/dist/state/state-manager.js +125 -0
  447. package/dist/state/state-manager.js.map +1 -0
  448. package/dist/state/state-manager.test.d.ts +2 -0
  449. package/dist/state/state-manager.test.d.ts.map +1 -0
  450. package/dist/state/state-manager.test.js +240 -0
  451. package/dist/state/state-manager.test.js.map +1 -0
  452. package/dist/types/adapter.d.ts +24 -0
  453. package/dist/types/adapter.d.ts.map +1 -0
  454. package/dist/types/adapter.js +2 -0
  455. package/dist/types/adapter.js.map +1 -0
  456. package/dist/types/assembly.d.ts +89 -0
  457. package/dist/types/assembly.d.ts.map +1 -0
  458. package/dist/types/assembly.js +2 -0
  459. package/dist/types/assembly.js.map +1 -0
  460. package/dist/types/claude-md.d.ts +11 -0
  461. package/dist/types/claude-md.d.ts.map +1 -0
  462. package/dist/types/claude-md.js +2 -0
  463. package/dist/types/claude-md.js.map +1 -0
  464. package/dist/types/cli.d.ts +15 -0
  465. package/dist/types/cli.d.ts.map +1 -0
  466. package/dist/types/cli.js +2 -0
  467. package/dist/types/cli.js.map +1 -0
  468. package/dist/types/config.d.ts +40 -0
  469. package/dist/types/config.d.ts.map +1 -0
  470. package/dist/types/config.js +2 -0
  471. package/dist/types/config.js.map +1 -0
  472. package/dist/types/decision.d.ts +14 -0
  473. package/dist/types/decision.d.ts.map +1 -0
  474. package/dist/types/decision.js +2 -0
  475. package/dist/types/decision.js.map +1 -0
  476. package/dist/types/dependency.d.ts +12 -0
  477. package/dist/types/dependency.d.ts.map +1 -0
  478. package/dist/types/dependency.js +2 -0
  479. package/dist/types/dependency.js.map +1 -0
  480. package/dist/types/enums.d.ts +23 -0
  481. package/dist/types/enums.d.ts.map +1 -0
  482. package/dist/types/enums.js +11 -0
  483. package/dist/types/enums.js.map +1 -0
  484. package/dist/types/enums.test.d.ts +2 -0
  485. package/dist/types/enums.test.d.ts.map +1 -0
  486. package/dist/types/enums.test.js +13 -0
  487. package/dist/types/enums.test.js.map +1 -0
  488. package/dist/types/errors.d.ts +24 -0
  489. package/dist/types/errors.d.ts.map +1 -0
  490. package/dist/types/errors.js +2 -0
  491. package/dist/types/errors.js.map +1 -0
  492. package/dist/types/frontmatter.d.ts +43 -0
  493. package/dist/types/frontmatter.d.ts.map +1 -0
  494. package/dist/types/frontmatter.js +2 -0
  495. package/dist/types/frontmatter.js.map +1 -0
  496. package/dist/types/index.d.ts +14 -0
  497. package/dist/types/index.d.ts.map +1 -0
  498. package/dist/types/index.js +14 -0
  499. package/dist/types/index.js.map +1 -0
  500. package/dist/types/lock.d.ts +10 -0
  501. package/dist/types/lock.d.ts.map +1 -0
  502. package/dist/types/lock.js +2 -0
  503. package/dist/types/lock.js.map +1 -0
  504. package/dist/types/state.d.ts +49 -0
  505. package/dist/types/state.d.ts.map +1 -0
  506. package/dist/types/state.js +2 -0
  507. package/dist/types/state.js.map +1 -0
  508. package/dist/types/wizard.d.ts +14 -0
  509. package/dist/types/wizard.d.ts.map +1 -0
  510. package/dist/types/wizard.js +2 -0
  511. package/dist/types/wizard.js.map +1 -0
  512. package/dist/utils/errors.d.ts +42 -0
  513. package/dist/utils/errors.d.ts.map +1 -0
  514. package/dist/utils/errors.js +232 -0
  515. package/dist/utils/errors.js.map +1 -0
  516. package/dist/utils/errors.test.d.ts +2 -0
  517. package/dist/utils/errors.test.d.ts.map +1 -0
  518. package/dist/utils/errors.test.js +91 -0
  519. package/dist/utils/errors.test.js.map +1 -0
  520. package/dist/utils/fs.d.ts +11 -0
  521. package/dist/utils/fs.d.ts.map +1 -0
  522. package/dist/utils/fs.js +20 -0
  523. package/dist/utils/fs.js.map +1 -0
  524. package/dist/utils/fs.test.d.ts +2 -0
  525. package/dist/utils/fs.test.d.ts.map +1 -0
  526. package/dist/utils/fs.test.js +93 -0
  527. package/dist/utils/fs.test.js.map +1 -0
  528. package/dist/utils/index.d.ts +4 -0
  529. package/dist/utils/index.d.ts.map +1 -0
  530. package/dist/utils/index.js +4 -0
  531. package/dist/utils/index.js.map +1 -0
  532. package/dist/utils/levenshtein.d.ts +11 -0
  533. package/dist/utils/levenshtein.d.ts.map +1 -0
  534. package/dist/utils/levenshtein.js +37 -0
  535. package/dist/utils/levenshtein.js.map +1 -0
  536. package/dist/utils/levenshtein.test.d.ts +2 -0
  537. package/dist/utils/levenshtein.test.d.ts.map +1 -0
  538. package/dist/utils/levenshtein.test.js +34 -0
  539. package/dist/utils/levenshtein.test.js.map +1 -0
  540. package/dist/validation/config-validator.d.ts +10 -0
  541. package/dist/validation/config-validator.d.ts.map +1 -0
  542. package/dist/validation/config-validator.js +11 -0
  543. package/dist/validation/config-validator.js.map +1 -0
  544. package/dist/validation/dependency-validator.d.ts +10 -0
  545. package/dist/validation/dependency-validator.d.ts.map +1 -0
  546. package/dist/validation/dependency-validator.js +34 -0
  547. package/dist/validation/dependency-validator.js.map +1 -0
  548. package/dist/validation/frontmatter-validator.d.ts +12 -0
  549. package/dist/validation/frontmatter-validator.d.ts.map +1 -0
  550. package/dist/validation/frontmatter-validator.js +50 -0
  551. package/dist/validation/frontmatter-validator.js.map +1 -0
  552. package/dist/validation/index.d.ts +19 -0
  553. package/dist/validation/index.d.ts.map +1 -0
  554. package/dist/validation/index.js +64 -0
  555. package/dist/validation/index.js.map +1 -0
  556. package/dist/validation/index.test.d.ts +2 -0
  557. package/dist/validation/index.test.d.ts.map +1 -0
  558. package/dist/validation/index.test.js +241 -0
  559. package/dist/validation/index.test.js.map +1 -0
  560. package/dist/validation/state-validator.d.ts +15 -0
  561. package/dist/validation/state-validator.d.ts.map +1 -0
  562. package/dist/validation/state-validator.js +104 -0
  563. package/dist/validation/state-validator.js.map +1 -0
  564. package/dist/wizard/questions.d.ts +18 -0
  565. package/dist/wizard/questions.d.ts.map +1 -0
  566. package/dist/wizard/questions.js +46 -0
  567. package/dist/wizard/questions.js.map +1 -0
  568. package/dist/wizard/suggestion.d.ts +10 -0
  569. package/dist/wizard/suggestion.d.ts.map +1 -0
  570. package/dist/wizard/suggestion.js +17 -0
  571. package/dist/wizard/suggestion.js.map +1 -0
  572. package/dist/wizard/wizard.d.ts +19 -0
  573. package/dist/wizard/wizard.d.ts.map +1 -0
  574. package/dist/wizard/wizard.js +104 -0
  575. package/dist/wizard/wizard.js.map +1 -0
  576. package/dist/wizard/wizard.test.d.ts +2 -0
  577. package/dist/wizard/wizard.test.d.ts.map +1 -0
  578. package/dist/wizard/wizard.test.js +167 -0
  579. package/dist/wizard/wizard.test.js.map +1 -0
  580. package/knowledge/core/adr-craft.md +281 -0
  581. package/knowledge/core/api-design.md +501 -0
  582. package/knowledge/core/database-design.md +380 -0
  583. package/knowledge/core/domain-modeling.md +317 -0
  584. package/knowledge/core/operations-runbook.md +513 -0
  585. package/knowledge/core/security-review.md +523 -0
  586. package/knowledge/core/system-architecture.md +402 -0
  587. package/knowledge/core/task-decomposition.md +372 -0
  588. package/knowledge/core/testing-strategy.md +409 -0
  589. package/knowledge/core/user-stories.md +337 -0
  590. package/knowledge/core/user-story-innovation.md +171 -0
  591. package/knowledge/core/ux-specification.md +380 -0
  592. package/knowledge/finalization/apply-fixes-and-freeze.md +93 -0
  593. package/knowledge/finalization/developer-onboarding.md +376 -0
  594. package/knowledge/finalization/implementation-playbook.md +404 -0
  595. package/knowledge/product/gap-analysis.md +305 -0
  596. package/knowledge/product/prd-craft.md +324 -0
  597. package/knowledge/product/prd-innovation.md +204 -0
  598. package/knowledge/review/review-adr.md +203 -0
  599. package/knowledge/review/review-api-contracts.md +233 -0
  600. package/knowledge/review/review-database-schema.md +229 -0
  601. package/knowledge/review/review-domain-modeling.md +288 -0
  602. package/knowledge/review/review-implementation-tasks.md +202 -0
  603. package/knowledge/review/review-methodology.md +215 -0
  604. package/knowledge/review/review-operations.md +212 -0
  605. package/knowledge/review/review-prd.md +235 -0
  606. package/knowledge/review/review-security.md +213 -0
  607. package/knowledge/review/review-system-architecture.md +296 -0
  608. package/knowledge/review/review-testing-strategy.md +176 -0
  609. package/knowledge/review/review-user-stories.md +172 -0
  610. package/knowledge/review/review-ux-spec.md +208 -0
  611. package/knowledge/validation/critical-path-analysis.md +203 -0
  612. package/knowledge/validation/cross-phase-consistency.md +181 -0
  613. package/knowledge/validation/decision-completeness.md +218 -0
  614. package/knowledge/validation/dependency-validation.md +233 -0
  615. package/knowledge/validation/implementability-review.md +252 -0
  616. package/knowledge/validation/scope-management.md +223 -0
  617. package/knowledge/validation/traceability.md +198 -0
  618. package/methodology/custom-defaults.yml +43 -0
  619. package/methodology/deep.yml +42 -0
  620. package/methodology/mvp.yml +42 -0
  621. package/package.json +58 -0
  622. package/pipeline/architecture/review-architecture.md +44 -0
  623. package/pipeline/architecture/system-architecture.md +45 -0
  624. package/pipeline/decisions/adrs.md +45 -0
  625. package/pipeline/decisions/review-adrs.md +39 -0
  626. package/pipeline/finalization/apply-fixes-and-freeze.md +39 -0
  627. package/pipeline/finalization/developer-onboarding-guide.md +36 -0
  628. package/pipeline/finalization/implementation-playbook.md +45 -0
  629. package/pipeline/modeling/domain-modeling.md +57 -0
  630. package/pipeline/modeling/review-domain-modeling.md +41 -0
  631. package/pipeline/planning/implementation-tasks.md +57 -0
  632. package/pipeline/planning/review-tasks.md +38 -0
  633. package/pipeline/pre/create-prd.md +45 -0
  634. package/pipeline/pre/innovate-prd.md +47 -0
  635. package/pipeline/pre/innovate-user-stories.md +47 -0
  636. package/pipeline/pre/review-prd.md +44 -0
  637. package/pipeline/pre/review-user-stories.md +43 -0
  638. package/pipeline/pre/user-stories.md +48 -0
  639. package/pipeline/quality/operations.md +42 -0
  640. package/pipeline/quality/review-operations.md +37 -0
  641. package/pipeline/quality/review-security.md +40 -0
  642. package/pipeline/quality/review-testing.md +39 -0
  643. package/pipeline/quality/security.md +44 -0
  644. package/pipeline/quality/testing-strategy.md +42 -0
  645. package/pipeline/specification/api-contracts.md +44 -0
  646. package/pipeline/specification/database-schema.md +41 -0
  647. package/pipeline/specification/review-api.md +40 -0
  648. package/pipeline/specification/review-database.md +39 -0
  649. package/pipeline/specification/review-ux.md +38 -0
  650. package/pipeline/specification/ux-spec.md +43 -0
  651. package/pipeline/validation/critical-path-walkthrough.md +37 -0
  652. package/pipeline/validation/cross-phase-consistency.md +35 -0
  653. package/pipeline/validation/decision-completeness.md +36 -0
  654. package/pipeline/validation/dependency-graph-validation.md +36 -0
  655. package/pipeline/validation/implementability-dry-run.md +36 -0
  656. package/pipeline/validation/scope-creep-check.md +38 -0
  657. package/pipeline/validation/traceability-matrix.md +36 -0
@@ -0,0 +1,513 @@
1
+ ---
2
+ name: operations-runbook
3
+ description: Dev environment setup, CI/CD pipeline design, deployment, monitoring, and incident response
4
+ topics: [operations, cicd, deployment, monitoring, dev-environment, incident-response, local-dev]
5
+ ---
6
+
7
+ ## Dev Environment Setup
8
+
9
+ A productive development environment lets a developer (or AI agent) go from cloning the repo to running the application in under 5 minutes. The fewer manual steps, the fewer things that can go wrong.
10
+
11
+ ### Local Development Prerequisites
12
+
13
+ Document every system-level dependency with exact versions:
14
+
15
+ | Dependency | Version | Why |
16
+ |------------|---------|-----|
17
+ | Node.js | 20.x LTS | Runtime |
18
+ | Python | 3.12+ | Backend scripts |
19
+ | PostgreSQL | 16+ | Primary database |
20
+ | Redis | 7+ | Caching and sessions |
21
+ | Docker | 24+ | Database containers (optional) |
22
+
23
+ **Version management:** Recommend a version manager for each language runtime:
24
+ - Node.js: `nvm`, `fnm`, or `.nvmrc` for automatic version switching
25
+ - Python: `pyenv` with `.python-version`
26
+ - Ruby: `rbenv` with `.ruby-version`
27
+
28
+ Check in a `.node-version` or `.nvmrc` file so tools auto-select the correct version.
29
+
30
+ ### Environment Variables
31
+
32
+ Every project needs a clear environment variable strategy:
33
+
34
+ **`.env.example`** — Template committed to git with all required variables, default values for local development, and comments explaining each variable:
35
+
36
+ ```bash
37
+ # Application
38
+ APP_PORT=3000 # Port for the dev server
39
+ APP_ENV=development # development | staging | production
40
+ APP_URL=http://localhost:3000 # Base URL for the app
41
+
42
+ # Database
43
+ DATABASE_URL=postgresql://localhost:5432/myapp_dev # Local PostgreSQL
44
+ DATABASE_POOL_SIZE=5 # Connection pool size
45
+
46
+ # Authentication
47
+ JWT_SECRET=local-dev-secret-change-in-production # JWT signing key
48
+ SESSION_SECRET=local-session-secret # Session cookie secret
49
+
50
+ # External Services (optional for local dev)
51
+ # STRIPE_SECRET_KEY=sk_test_... # Uncomment when testing payments
52
+ # SENDGRID_API_KEY=SG.... # Uncomment when testing emails
53
+ ```
54
+
55
+ **`.env`** — Actual local configuration, gitignored. Created by copying `.env.example`.
56
+
57
+ **Required vs. optional:** Clearly mark which variables are required for the app to start and which are optional (features degrade gracefully without them).
58
+
59
+ ### One-Command Setup
60
+
61
+ Provide a single command that installs all dependencies, creates the database, runs migrations, seeds data, and starts the dev server:
62
+
63
+ ```bash
64
+ # First time setup
65
+ make setup # or: npm run setup
66
+
67
+ # Daily development
68
+ make dev # or: npm run dev
69
+ ```
70
+
71
+ The setup command should be idempotent — safe to run twice without breaking anything.
72
+
73
+ ### Database Setup for Local Development
74
+
75
+ **Option A: Local installation**
76
+ - Install database server natively
77
+ - Create dev database: `createdb myapp_dev` (PostgreSQL)
78
+ - Run migrations: `make db-migrate`
79
+ - Seed data: `make db-seed`
80
+
81
+ **Option B: Docker Compose**
82
+ ```yaml
83
+ services:
84
+ db:
85
+ image: postgres:16
86
+ ports: ["5432:5432"]
87
+ environment:
88
+ POSTGRES_DB: myapp_dev
89
+ POSTGRES_USER: postgres
90
+ POSTGRES_PASSWORD: postgres
91
+ volumes:
92
+ - pgdata:/var/lib/postgresql/data
93
+
94
+ redis:
95
+ image: redis:7
96
+ ports: ["6379:6379"]
97
+
98
+ volumes:
99
+ pgdata:
100
+ ```
101
+
102
+ Docker Compose is convenient for managing service dependencies but adds startup time and complexity. For simple stacks (SQLite, single service), skip Docker entirely.
103
+
104
+ **Option C: SQLite for development**
105
+ - No setup required
106
+ - Create database file on first run
107
+ - Fast, zero-configuration
108
+ - Trade-off: behavior differences from production PostgreSQL (no JSONB, different SQL dialect)
109
+
110
+ ### Hot Reloading Configuration
111
+
112
+ The dev server must reload automatically when code changes:
113
+
114
+ - **Frontend:** Vite HMR (React, Vue, Svelte), Next.js Fast Refresh, or webpack HMR
115
+ - **Backend (Node.js):** `tsx watch`, `nodemon`, or `ts-node-dev` for TypeScript; `node --watch` for plain Node
116
+ - **Backend (Python):** `uvicorn --reload` (FastAPI), `flask run --debug` (Flask), `manage.py runserver` (Django)
117
+ - **Full-stack:** Run frontend and backend concurrently with a process manager (`concurrently`, `honcho`, or Makefile with `&`)
118
+
119
+ ### Common Dev Commands
120
+
121
+ Every project should have a consistent set of commands. Use whatever mechanism fits the stack:
122
+
123
+ | Command | Purpose | Implementation |
124
+ |---------|---------|---------------|
125
+ | `make dev` | Start dev server with hot reload | Frontend + backend concurrently |
126
+ | `make test` | Run all tests | Test runner with coverage |
127
+ | `make test-watch` | Run tests in watch mode | Test runner in watch mode |
128
+ | `make lint` | Check code style | Linter for each language |
129
+ | `make format` | Auto-fix formatting | Formatter for each language |
130
+ | `make db-migrate` | Run pending migrations | Migration tool |
131
+ | `make db-seed` | Seed database with sample data | Seed script |
132
+ | `make db-reset` | Drop, recreate, migrate, seed | Compose the above |
133
+ | `make check` | Run all quality gates | lint + type-check + test |
134
+
135
+ Commands should be:
136
+ - Short and memorable (not `npx jest --runInBand --coverage --passWithNoTests`)
137
+ - Documented with help text
138
+ - Idempotent where possible
139
+ - Fast enough to run frequently
140
+
141
+ ### Troubleshooting Guide
142
+
143
+ Document solutions for common development issues:
144
+
145
+ **Port already in use:**
146
+ ```bash
147
+ lsof -i :3000 # Find the process
148
+ kill -9 <PID> # Kill it
149
+ ```
150
+
151
+ **Database connection refused:**
152
+ - Is the database running? `pg_isready` or `docker ps`
153
+ - Is the connection string correct? Check `.env`
154
+ - Is the port correct? Check for port conflicts
155
+
156
+ **Dependencies out of sync:**
157
+ ```bash
158
+ rm -rf node_modules && npm install # Node.js
159
+ rm -rf .venv && python -m venv .venv && pip install -r requirements.txt # Python
160
+ ```
161
+
162
+ **Migrations out of date:**
163
+ ```bash
164
+ make db-migrate # Run pending migrations
165
+ make db-reset # Nuclear option: start fresh
166
+ ```
167
+
168
+ ## CI/CD Pipeline
169
+
170
+ ### Pipeline Architecture
171
+
172
+ A CI/CD pipeline automates the path from code commit to production deployment. Design it in stages:
173
+
174
+ ```
175
+ Push to branch
176
+ -> Stage 1: Fast checks (30s)
177
+ Lint, format check, type check
178
+ -> Stage 2: Tests (2-5 min)
179
+ Unit tests, integration tests (parallel)
180
+ -> Stage 3: Build (1-2 min)
181
+ Compile, bundle, generate artifacts
182
+ -> Stage 4: Deploy (2-5 min, only on main)
183
+ Deploy to staging/production
184
+
185
+ PR merge to main
186
+ -> All stages above
187
+ -> Stage 5: Post-deploy verification
188
+ Smoke tests against deployed environment
189
+ ```
190
+
191
+ ### Stage Design
192
+
193
+ **Stage 1: Fast Checks**
194
+ - Run on every push and PR
195
+ - Fail fast: if linting fails, don't bother running tests
196
+ - Cache dependencies between runs
197
+ - Target: <30 seconds
198
+
199
+ ```yaml
200
+ # GitHub Actions example
201
+ lint:
202
+ runs-on: ubuntu-latest
203
+ steps:
204
+ - uses: actions/checkout@v4
205
+ - uses: actions/setup-node@v4
206
+ with: { node-version-file: '.nvmrc' }
207
+ - run: npm ci --ignore-scripts
208
+ - run: npm run lint
209
+ - run: npm run type-check
210
+ ```
211
+
212
+ **Stage 2: Tests**
213
+ - Run unit and integration tests in parallel
214
+ - Use a service container for the test database
215
+ - Upload coverage reports as artifacts
216
+ - Target: <5 minutes
217
+
218
+ ```yaml
219
+ test:
220
+ runs-on: ubuntu-latest
221
+ services:
222
+ postgres:
223
+ image: postgres:16
224
+ env:
225
+ POSTGRES_DB: test
226
+ POSTGRES_PASSWORD: test
227
+ ports: ['5432:5432']
228
+ steps:
229
+ - uses: actions/checkout@v4
230
+ - uses: actions/setup-node@v4
231
+ - run: npm ci
232
+ - run: npm run test:ci
233
+ env:
234
+ DATABASE_URL: postgresql://postgres:test@localhost:5432/test
235
+ ```
236
+
237
+ **Stage 3: Build**
238
+ - Compile TypeScript, bundle frontend assets, generate Docker image
239
+ - Verify the build artifact is valid (start the server and check health endpoint)
240
+ - Store the build artifact for deployment
241
+
242
+ **Stage 4: Deploy**
243
+ - Only runs on main branch (after PR merge)
244
+ - Deploy the build artifact from Stage 3
245
+ - Run database migrations before starting new version
246
+ - Verify health check after deployment
247
+
248
+ ### Parallelization and Caching
249
+
250
+ **Parallel jobs:** Run lint, unit tests, and integration tests as separate parallel jobs. The total pipeline time equals the longest individual job, not the sum.
251
+
252
+ **Dependency caching:** Cache `node_modules/` (keyed by `package-lock.json` hash), Python virtual environments, Docker layer cache. This turns a 60-second install into a 5-second cache restore.
253
+
254
+ **Test parallelization:** Split test files across multiple runners. Most test frameworks support `--shard` or `--split` modes.
255
+
256
+ ### Artifact Management
257
+
258
+ - Build artifacts (compiled code, Docker images) should be built once and deployed to all environments
259
+ - Store artifacts in a registry (Docker Hub, GitHub Container Registry, S3)
260
+ - Tag artifacts with the git SHA for traceability
261
+ - Set retention policies (keep last 30 days, keep releases forever)
262
+
263
+ ## Deployment Strategies
264
+
265
+ ### Blue-Green Deployment
266
+
267
+ Run two identical production environments (blue and green). At any time, one is live (serving traffic) and one is idle (ready for the next version).
268
+
269
+ **Process:**
270
+ 1. Deploy new version to the idle environment
271
+ 2. Run smoke tests against the idle environment
272
+ 3. Switch the load balancer to point to the idle environment
273
+ 4. The previously-live environment becomes idle
274
+
275
+ **Advantages:** Instant rollback (switch back), zero-downtime deployment, full environment testing before cutover.
276
+
277
+ **Disadvantages:** Requires double the infrastructure. Database migrations need careful handling (both environments share the database).
278
+
279
+ ### Canary Deployment
280
+
281
+ Route a small percentage of traffic (1-5%) to the new version while the majority continues on the current version.
282
+
283
+ **Process:**
284
+ 1. Deploy new version alongside current version
285
+ 2. Route 1% of traffic to the new version
286
+ 3. Monitor error rates, latency, and business metrics
287
+ 4. If metrics are healthy, gradually increase traffic (5%, 25%, 50%, 100%)
288
+ 5. If metrics degrade, route all traffic back to the current version
289
+
290
+ **Advantages:** Catches production-only issues with minimal blast radius. Real user traffic validates the deployment.
291
+
292
+ **Disadvantages:** Requires traffic routing infrastructure. Database schema changes must be compatible with both versions simultaneously.
293
+
294
+ ### Rolling Deployment
295
+
296
+ Replace instances one at a time. When a new instance is healthy, take down an old one.
297
+
298
+ **Process:**
299
+ 1. Start a new instance with the new version
300
+ 2. Wait for health check to pass
301
+ 3. Add the new instance to the load balancer
302
+ 4. Remove one old instance
303
+ 5. Repeat until all instances are new
304
+
305
+ **Advantages:** No extra infrastructure needed. Gradual rollout.
306
+
307
+ **Disadvantages:** During deployment, both versions run simultaneously (must be compatible). Rollback requires re-deploying the old version.
308
+
309
+ ### Feature Flags
310
+
311
+ Decouple deployment from release. Code is deployed but features are toggled off until ready.
312
+
313
+ **When to use:**
314
+ - Large features that take multiple PRs to complete
315
+ - Gradual rollout to users (A/B testing)
316
+ - Kill switch for risky features in production
317
+
318
+ **Implementation options:**
319
+ - Environment variables (simple, requires redeployment to change)
320
+ - Configuration file (slightly more flexible)
321
+ - Feature flag service (LaunchDarkly, Unleash, Flipt — most flexible, adds dependency)
322
+
323
+ ### Rollback Procedures
324
+
325
+ Every deployment strategy needs a documented rollback plan:
326
+
327
+ | Strategy | Rollback Method | Time to Rollback |
328
+ |----------|----------------|-----------------|
329
+ | Blue-green | Switch load balancer back | Seconds |
330
+ | Canary | Route 100% to old version | Seconds |
331
+ | Rolling | Re-deploy previous version | Minutes |
332
+ | Feature flags | Disable the flag | Seconds |
333
+
334
+ **Database rollback:** If the deployment included database migrations, rollback requires reverse migrations. Test reverse migrations before deploying. Some migrations are irreversible (dropping columns) — have a recovery plan.
335
+
336
+ ## Monitoring and Alerting
337
+
338
+ ### Four Golden Signals
339
+
340
+ Monitor these four metrics for every service:
341
+
342
+ **Latency:** How long requests take.
343
+ - Track p50, p95, p99 latency
344
+ - Separate success latency from error latency (errors are often fast — don't let them hide slow successes)
345
+ - Set thresholds based on user expectations (API: <200ms p95, page load: <1s p95)
346
+
347
+ **Traffic:** How many requests the service is handling.
348
+ - Requests per second, broken down by endpoint and status code
349
+ - Unusual traffic patterns indicate either success (organic growth) or problems (attack, bot traffic, retry storm)
350
+
351
+ **Errors:** The rate of failed requests.
352
+ - Track error rate as a percentage of total requests
353
+ - Categorize errors: client errors (4xx) vs. server errors (5xx)
354
+ - A sudden spike in 5xx errors is an incident. A gradual increase in 4xx may indicate a UX problem.
355
+
356
+ **Saturation:** How "full" the service is.
357
+ - CPU utilization, memory utilization, disk I/O, database connection pool usage
358
+ - Set alerts before hitting capacity (80% utilization triggers warning, 95% triggers critical)
359
+
360
+ ### Dashboard Design
361
+
362
+ Dashboards should answer one question: "Is the system healthy right now?"
363
+
364
+ **Overview dashboard:**
365
+ - Request rate (last 1 hour, with 24-hour comparison)
366
+ - Error rate (last 1 hour, with threshold lines)
367
+ - Latency percentiles (p50, p95, p99 — last 1 hour)
368
+ - Active users / sessions (if applicable)
369
+ - Key business metrics (orders/minute, signups/hour)
370
+
371
+ **Per-service dashboard:**
372
+ - Same golden signals but scoped to a single service
373
+ - Database connection pool (active, idle, waiting)
374
+ - Cache hit rate
375
+ - External dependency latency and error rates
376
+
377
+ ### Alerting Thresholds
378
+
379
+ Set alerts based on user impact, not arbitrary numbers:
380
+
381
+ | Alert | Condition | Severity | Response |
382
+ |-------|-----------|----------|----------|
383
+ | High error rate | 5xx rate > 1% for 5 minutes | Critical | Page on-call |
384
+ | High latency | p95 > 2s for 10 minutes | Warning | Investigate |
385
+ | Database saturation | Connection pool > 80% for 5 minutes | Warning | Scale or optimize |
386
+ | Disk space | < 20% free | Warning | Expand or clean up |
387
+ | Certificate expiry | < 14 days | Warning | Renew certificate |
388
+ | External API failure | > 50% error rate for 5 minutes | Critical | Activate circuit breaker |
389
+
390
+ **Alert fatigue prevention:**
391
+ - Every alert must have a documented response action. If nobody knows what to do when it fires, remove it.
392
+ - Use warning (investigate when convenient) vs. critical (respond now) to reduce noise
393
+ - Aggregate related alerts — don't page for each of 100 failing requests; page once for the pattern
394
+ - Tune thresholds based on historical data, not guesses
395
+
396
+ ### On-Call Rotation
397
+
398
+ If the project has a team:
399
+ - Define rotation schedule (weekly rotations are common)
400
+ - Document escalation paths (who to contact if on-call can't resolve)
401
+ - Ensure handoff includes current incidents and known issues
402
+ - Post-rotation review: were there incidents? Were runbooks adequate?
403
+
404
+ ## Incident Response
405
+
406
+ ### Runbook Format
407
+
408
+ Every anticipated failure mode should have a runbook entry:
409
+
410
+ ```markdown
411
+ ## Runbook: Database Connection Pool Exhausted
412
+
413
+ ### Symptoms
414
+ - Error logs: "Connection pool exhausted"
415
+ - API returns 503 for database-dependent endpoints
416
+ - Monitoring: connection pool utilization at 100%
417
+
418
+ ### Likely Causes
419
+ 1. Long-running queries holding connections
420
+ 2. Missing connection release in error paths
421
+ 3. Sudden traffic spike exceeding pool size
422
+ 4. Database server under load
423
+
424
+ ### Resolution Steps
425
+ 1. Check active queries: `SELECT * FROM pg_stat_activity WHERE state = 'active';`
426
+ 2. Kill long-running queries: `SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE duration > interval '5 minutes';`
427
+ 3. If caused by traffic spike: increase pool size in config and restart
428
+ 4. If caused by code bug: identify the query, create a fix task, increase pool temporarily
429
+
430
+ ### Prevention
431
+ - Set query timeout (30 seconds for API queries, 5 minutes for background jobs)
432
+ - Monitor pool utilization with alerts at 80%
433
+ - Review N+1 queries in code review
434
+ ```
435
+
436
+ ### Escalation Paths
437
+
438
+ Define when to escalate and to whom:
439
+
440
+ | Severity | Response Time | Who | Action |
441
+ |----------|--------------|-----|--------|
442
+ | SEV-1 (outage) | <15 minutes | On-call + team lead | All hands, user communication |
443
+ | SEV-2 (degraded) | <1 hour | On-call | Investigate and mitigate |
444
+ | SEV-3 (minor) | Next business day | Assigned engineer | Fix in normal workflow |
445
+
446
+ ### Post-Mortem Template
447
+
448
+ After every SEV-1 or SEV-2 incident:
449
+
450
+ ```markdown
451
+ ## Incident Post-Mortem: [Title]
452
+
453
+ ### Summary
454
+ One-paragraph description of what happened, impact, and duration.
455
+
456
+ ### Timeline
457
+ - HH:MM — First alert fired
458
+ - HH:MM — On-call acknowledged
459
+ - HH:MM — Root cause identified
460
+ - HH:MM — Mitigation applied
461
+ - HH:MM — Service fully recovered
462
+
463
+ ### Root Cause
464
+ Technical description of what went wrong and why.
465
+
466
+ ### Impact
467
+ - Duration: X hours
468
+ - Users affected: N
469
+ - Revenue impact: $X (if applicable)
470
+
471
+ ### What Went Well
472
+ - Detection was fast (alert fired within 2 minutes)
473
+ - Runbook was accurate
474
+
475
+ ### What Went Wrong
476
+ - Rollback procedure was untested
477
+ - Escalation was delayed due to unclear ownership
478
+
479
+ ### Action Items
480
+ | Action | Owner | Due Date |
481
+ |--------|-------|----------|
482
+ | Add database timeout | @alice | 2026-03-21 |
483
+ | Test rollback procedure monthly | @bob | Ongoing |
484
+ | Update runbook with new symptoms | @alice | 2026-03-18 |
485
+ ```
486
+
487
+ ### SLA Definitions
488
+
489
+ Define service level targets for the application:
490
+
491
+ | Metric | Target | Measurement Period |
492
+ |--------|--------|-------------------|
493
+ | Availability | 99.9% (8.7 hours downtime/year) | Monthly |
494
+ | API Latency (p95) | < 200ms | Monthly |
495
+ | Error Rate | < 0.1% | Weekly |
496
+ | Deploy Frequency | Daily | Weekly |
497
+ | Mean Time to Recovery | < 1 hour | Per incident |
498
+
499
+ ## Common Pitfalls
500
+
501
+ **Missing rollback procedures.** Deploying without a tested rollback plan. When the deployment breaks production, the team scrambles to figure out how to revert. Fix: every deployment strategy includes a documented, tested rollback procedure.
502
+
503
+ **Alert fatigue.** Too many alerts firing for non-critical issues. The on-call person starts ignoring alerts because most are noise. A real incident gets missed. Fix: every alert must have a clear response action. Remove alerts that routinely fire without requiring action.
504
+
505
+ **No local dev story.** "It works on the CI server" but developers can't run the application locally. Fix: document the local setup, make it one command, test it regularly by having new team members follow the instructions.
506
+
507
+ **Manual deployment steps.** Deployment requires an engineer to SSH into a server and run commands. This is error-prone, unreproducible, and blocks deployment on individual availability. Fix: fully automate deployment. A merge to main should trigger deployment automatically.
508
+
509
+ **No monitoring before launch.** Monitoring is added after the first incident, when it's most needed and least available. Fix: set up monitoring as part of the infrastructure phase, before any user traffic.
510
+
511
+ **Secrets in code.** API keys, database passwords, or JWT secrets committed to the repository. Fix: use environment variables loaded from a secrets manager. Scan the repository for accidentally committed secrets (git-secrets, truffleHog).
512
+
513
+ **Testing in production without feature flags.** Deploying untested features directly to all users. Fix: use feature flags to gradually expose new features. Test with a small percentage of traffic before full rollout.