groundwork-method 0.0.1 → 0.10.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 (629) hide show
  1. package/CHANGELOG.md +781 -0
  2. package/LICENSE +21 -0
  3. package/README.md +44 -29
  4. package/bin/groundwork.js +1654 -0
  5. package/dist/src/generators/add-capability/generator.d.ts +8 -0
  6. package/dist/src/generators/add-capability/generator.js +60 -0
  7. package/dist/src/generators/add-capability/generator.js.map +1 -0
  8. package/dist/src/generators/cli-app/generator.d.ts +9 -0
  9. package/dist/src/generators/cli-app/generator.js +140 -0
  10. package/dist/src/generators/cli-app/generator.js.map +1 -0
  11. package/dist/src/generators/docs-site/generator.d.ts +5 -0
  12. package/dist/src/generators/docs-site/generator.js +441 -0
  13. package/dist/src/generators/docs-site/generator.js.map +1 -0
  14. package/dist/src/generators/electron-app/generator.d.ts +6 -0
  15. package/dist/src/generators/electron-app/generator.js +261 -0
  16. package/dist/src/generators/electron-app/generator.js.map +1 -0
  17. package/dist/src/generators/flutter-app/generator.d.ts +6 -0
  18. package/dist/src/generators/flutter-app/generator.js +314 -0
  19. package/dist/src/generators/flutter-app/generator.js.map +1 -0
  20. package/dist/src/generators/go-microservice/generator.d.ts +8 -0
  21. package/dist/src/generators/go-microservice/generator.js +232 -0
  22. package/dist/src/generators/go-microservice/generator.js.map +1 -0
  23. package/dist/src/generators/nextjs-app/generator.d.ts +8 -0
  24. package/dist/src/generators/nextjs-app/generator.js +294 -0
  25. package/dist/src/generators/nextjs-app/generator.js.map +1 -0
  26. package/dist/src/generators/python-microservice/generator.d.ts +13 -0
  27. package/dist/src/generators/python-microservice/generator.js +265 -0
  28. package/dist/src/generators/python-microservice/generator.js.map +1 -0
  29. package/dist/src/generators/shared/brand-tokens.d.ts +89 -0
  30. package/dist/src/generators/shared/brand-tokens.js +308 -0
  31. package/dist/src/generators/shared/brand-tokens.js.map +1 -0
  32. package/dist/src/generators/shared/capabilities.d.ts +101 -0
  33. package/dist/src/generators/shared/capabilities.js +279 -0
  34. package/dist/src/generators/shared/capabilities.js.map +1 -0
  35. package/dist/src/generators/shared/provenance.d.ts +2 -0
  36. package/dist/src/generators/shared/provenance.js +85 -0
  37. package/dist/src/generators/shared/provenance.js.map +1 -0
  38. package/dist/src/generators/shared/scaffold-helpers.d.ts +72 -0
  39. package/dist/src/generators/shared/scaffold-helpers.js +309 -0
  40. package/dist/src/generators/shared/scaffold-helpers.js.map +1 -0
  41. package/dist/src/generators/system-test-runner/generator.d.ts +23 -0
  42. package/dist/src/generators/system-test-runner/generator.js +125 -0
  43. package/dist/src/generators/system-test-runner/generator.js.map +1 -0
  44. package/dist/src/generators/workspace-dev-cli/generator.d.ts +7 -0
  45. package/dist/src/generators/workspace-dev-cli/generator.js +138 -0
  46. package/dist/src/generators/workspace-dev-cli/generator.js.map +1 -0
  47. package/generators.json +57 -0
  48. package/lib/repo-map/grammars/tree-sitter-c.wasm +0 -0
  49. package/lib/repo-map/grammars/tree-sitter-cpp.wasm +0 -0
  50. package/lib/repo-map/grammars/tree-sitter-csharp.wasm +0 -0
  51. package/lib/repo-map/grammars/tree-sitter-dart.wasm +0 -0
  52. package/lib/repo-map/grammars/tree-sitter-go.wasm +0 -0
  53. package/lib/repo-map/grammars/tree-sitter-java.wasm +0 -0
  54. package/lib/repo-map/grammars/tree-sitter-javascript.wasm +0 -0
  55. package/lib/repo-map/grammars/tree-sitter-kotlin.wasm +0 -0
  56. package/lib/repo-map/grammars/tree-sitter-lua.wasm +0 -0
  57. package/lib/repo-map/grammars/tree-sitter-php.wasm +0 -0
  58. package/lib/repo-map/grammars/tree-sitter-python.wasm +0 -0
  59. package/lib/repo-map/grammars/tree-sitter-ruby.wasm +0 -0
  60. package/lib/repo-map/grammars/tree-sitter-rust.wasm +0 -0
  61. package/lib/repo-map/grammars/tree-sitter-scala.wasm +0 -0
  62. package/lib/repo-map/grammars/tree-sitter-swift.wasm +0 -0
  63. package/lib/repo-map/grammars/tree-sitter-tsx.wasm +0 -0
  64. package/lib/repo-map/grammars/tree-sitter-typescript.wasm +0 -0
  65. package/lib/repo-map/index.js +386 -0
  66. package/lib/repo-map/languages.js +514 -0
  67. package/lib/repo-map/pagerank.js +59 -0
  68. package/migrations/README.md +60 -0
  69. package/migrations/_template/cli-migration.js +27 -0
  70. package/migrations/gw-bet-prose-redesign.js +105 -0
  71. package/migrations/gw-drop-test-manifest.js +37 -0
  72. package/migrations/gw-register-serena-mcp.js +42 -0
  73. package/migrations/gw-relocate-hidden-skills.js +40 -0
  74. package/migrations/gw-seed-config-toml.js +24 -0
  75. package/migrations/index.json +40 -0
  76. package/package.json +70 -6
  77. package/src/AGENTS.md +36 -0
  78. package/src/config/config.toml +30 -0
  79. package/src/config/groundwork-state.json +5 -0
  80. package/src/docs/llms.txt +72 -0
  81. package/src/docs/principles/ai-native/agent-native-systems.md +90 -0
  82. package/src/docs/principles/ai-native/agentic-systems.md +78 -0
  83. package/src/docs/principles/ai-native/ai-engineering.md +100 -0
  84. package/src/docs/principles/ai-native/ai-native-product.md +76 -0
  85. package/src/docs/principles/delivery/cost-engineering.md +89 -0
  86. package/src/docs/principles/delivery/day-2-operational-baseline.md +57 -0
  87. package/src/docs/principles/delivery/devex.md +88 -0
  88. package/src/docs/principles/delivery/platform.md +101 -0
  89. package/src/docs/principles/delivery/progressive-delivery.md +92 -0
  90. package/src/docs/principles/design/ai-native-design.md +73 -0
  91. package/src/docs/principles/design/design-foundations.md +80 -0
  92. package/src/docs/principles/design/design-systems-and-tokens.md +72 -0
  93. package/src/docs/principles/design/interaction-and-motion.md +69 -0
  94. package/src/docs/principles/design/layout-and-space.md +72 -0
  95. package/src/docs/principles/design/usability-and-ux.md +68 -0
  96. package/src/docs/principles/design/visual-design.md +84 -0
  97. package/src/docs/principles/foundations/code-craft.md +86 -0
  98. package/src/docs/principles/foundations/continuous-discovery.md +75 -0
  99. package/src/docs/principles/foundations/documentation.md +102 -0
  100. package/src/docs/principles/foundations/prioritization-and-appetite.md +78 -0
  101. package/src/docs/principles/foundations/product-engineering.md +90 -0
  102. package/src/docs/principles/foundations/product-risks.md +89 -0
  103. package/src/docs/principles/foundations/requirements-and-specs.md +80 -0
  104. package/src/docs/principles/foundations/success-metrics.md +66 -0
  105. package/src/docs/principles/foundations/testing.md +82 -0
  106. package/src/docs/principles/index.md +23 -0
  107. package/src/docs/principles/quality/accessibility.md +88 -0
  108. package/src/docs/principles/quality/observability.md +84 -0
  109. package/src/docs/principles/quality/performance.md +84 -0
  110. package/src/docs/principles/quality/privacy.md +92 -0
  111. package/src/docs/principles/quality/reliability.md +89 -0
  112. package/src/docs/principles/quality/security.md +78 -0
  113. package/src/docs/principles/stack/postgres.md +100 -0
  114. package/src/docs/principles/system-design/api-design.md +86 -0
  115. package/src/docs/principles/system-design/architecture-decisions.md +81 -0
  116. package/src/docs/principles/system-design/code-structure.md +104 -0
  117. package/src/docs/principles/system-design/data-engineering.md +87 -0
  118. package/src/docs/principles/system-design/durable-execution.md +89 -0
  119. package/src/docs/principles/system-design/evolutionary-architecture.md +81 -0
  120. package/src/docs/principles/system-design/identity-and-access.md +76 -0
  121. package/src/docs/principles/system-design/integration-patterns.md +84 -0
  122. package/src/docs/principles/system-design/real-time.md +83 -0
  123. package/src/docs/principles/system-design/surface-architecture.md +74 -0
  124. package/src/docs/ways-of-working/documentation.md +69 -0
  125. package/src/docs/ways-of-working/how-we-work.md +76 -0
  126. package/src/docs/ways-of-working/units-of-work.md +40 -0
  127. package/src/engineer-skills/groundwork-electron-engineer/SKILL.md +118 -0
  128. package/src/engineer-skills/groundwork-electron-engineer/references/ipc-contracts.md +138 -0
  129. package/src/engineer-skills/groundwork-electron-engineer/references/packaging-and-updates.md +82 -0
  130. package/src/engineer-skills/groundwork-electron-engineer/references/process-model.md +94 -0
  131. package/src/engineer-skills/groundwork-electron-engineer/references/security.md +107 -0
  132. package/src/engineer-skills/groundwork-electron-engineer/references/testing-and-smoke.md +107 -0
  133. package/src/engineer-skills/groundwork-electron-engineer/references/theming-and-tokens.md +74 -0
  134. package/src/engineer-skills/groundwork-electron-engineer/sync-anchor.md +14 -0
  135. package/src/engineer-skills/groundwork-flutter-engineer/SKILL.md +108 -0
  136. package/src/engineer-skills/groundwork-flutter-engineer/references/accessibility.md +92 -0
  137. package/src/engineer-skills/groundwork-flutter-engineer/references/architecture.md +189 -0
  138. package/src/engineer-skills/groundwork-flutter-engineer/references/data-and-contracts.md +136 -0
  139. package/src/engineer-skills/groundwork-flutter-engineer/references/navigation.md +122 -0
  140. package/src/engineer-skills/groundwork-flutter-engineer/references/platform-channels.md +93 -0
  141. package/src/engineer-skills/groundwork-flutter-engineer/references/releases-and-distribution.md +84 -0
  142. package/src/engineer-skills/groundwork-flutter-engineer/references/state-management.md +166 -0
  143. package/src/engineer-skills/groundwork-flutter-engineer/references/testing.md +135 -0
  144. package/src/engineer-skills/groundwork-flutter-engineer/references/theming-and-design-tokens.md +109 -0
  145. package/src/engineer-skills/groundwork-flutter-engineer/references/widgets-and-composition.md +123 -0
  146. package/src/engineer-skills/groundwork-flutter-engineer/sync-anchor.md +15 -0
  147. package/src/engineer-skills/groundwork-go-engineer/SKILL.md +171 -0
  148. package/src/engineer-skills/groundwork-go-engineer/references/api-design.md +82 -0
  149. package/src/engineer-skills/groundwork-go-engineer/references/architecture.md +42 -0
  150. package/src/engineer-skills/groundwork-go-engineer/references/capability-ports.md +50 -0
  151. package/src/engineer-skills/groundwork-go-engineer/references/code-craft-security.md +34 -0
  152. package/src/engineer-skills/groundwork-go-engineer/references/concurrency.md +108 -0
  153. package/src/engineer-skills/groundwork-go-engineer/references/go-services.md +77 -0
  154. package/src/engineer-skills/groundwork-go-engineer/references/http-handlers.md +172 -0
  155. package/src/engineer-skills/groundwork-go-engineer/references/implementation-patterns.md +156 -0
  156. package/src/engineer-skills/groundwork-go-engineer/references/integration-realtime-data.md +57 -0
  157. package/src/engineer-skills/groundwork-go-engineer/references/observability.md +49 -0
  158. package/src/engineer-skills/groundwork-go-engineer/references/postgres.md +41 -0
  159. package/src/engineer-skills/groundwork-go-engineer/references/reliability-performance.md +105 -0
  160. package/src/engineer-skills/groundwork-go-engineer/references/testing.md +139 -0
  161. package/src/engineer-skills/groundwork-go-engineer/sync-anchor.md +11 -0
  162. package/src/engineer-skills/groundwork-nextjs-engineer/SKILL.md +107 -0
  163. package/src/engineer-skills/groundwork-nextjs-engineer/references/architecture.md +323 -0
  164. package/src/engineer-skills/groundwork-nextjs-engineer/references/data-fetching.md +458 -0
  165. package/src/engineer-skills/groundwork-nextjs-engineer/references/documentation.md +324 -0
  166. package/src/engineer-skills/groundwork-nextjs-engineer/references/error-boundaries.md +383 -0
  167. package/src/engineer-skills/groundwork-nextjs-engineer/references/mutations-and-forms.md +396 -0
  168. package/src/engineer-skills/groundwork-nextjs-engineer/references/performance-and-deployment.md +947 -0
  169. package/src/engineer-skills/groundwork-nextjs-engineer/references/routing-and-navigation.md +405 -0
  170. package/src/engineer-skills/groundwork-nextjs-engineer/references/server-components.md +394 -0
  171. package/src/engineer-skills/groundwork-nextjs-engineer/references/tailwind-and-styling.md +134 -0
  172. package/src/engineer-skills/groundwork-nextjs-engineer/references/testing.md +433 -0
  173. package/src/engineer-skills/groundwork-nextjs-engineer/references/type-system.md +368 -0
  174. package/src/engineer-skills/groundwork-nextjs-engineer/references/ux-principles.md +278 -0
  175. package/src/engineer-skills/groundwork-nextjs-engineer/references/visual-language.md +69 -0
  176. package/src/engineer-skills/groundwork-nextjs-engineer/sync-anchor.md +9 -0
  177. package/src/engineer-skills/groundwork-python-engineer/SKILL.md +196 -0
  178. package/src/engineer-skills/groundwork-python-engineer/references/api-standards.md +88 -0
  179. package/src/engineer-skills/groundwork-python-engineer/references/architecture.md +57 -0
  180. package/src/engineer-skills/groundwork-python-engineer/references/async-patterns.md +103 -0
  181. package/src/engineer-skills/groundwork-python-engineer/references/capability-ports.md +44 -0
  182. package/src/engineer-skills/groundwork-python-engineer/references/database.md +88 -0
  183. package/src/engineer-skills/groundwork-python-engineer/references/documentation-mcp.md +167 -0
  184. package/src/engineer-skills/groundwork-python-engineer/references/implementation-patterns.md +166 -0
  185. package/src/engineer-skills/groundwork-python-engineer/references/ml-pipelines.md +119 -0
  186. package/src/engineer-skills/groundwork-python-engineer/references/ml-systems-ai-engineering.md +74 -0
  187. package/src/engineer-skills/groundwork-python-engineer/references/observability.md +57 -0
  188. package/src/engineer-skills/groundwork-python-engineer/references/resilience.md +126 -0
  189. package/src/engineer-skills/groundwork-python-engineer/references/testing.md +177 -0
  190. package/src/engineer-skills/groundwork-python-engineer/sync-anchor.md +13 -0
  191. package/src/generators/add-capability/generator.ts +70 -0
  192. package/src/generators/add-capability/schema.json +30 -0
  193. package/src/generators/capabilities/llm/capability.json +28 -0
  194. package/src/generators/capabilities/llm/providers/anthropic/footprint.json +13 -0
  195. package/src/generators/capabilities/llm/providers/anthropic/stacks/go/internal/llm/llm.go.template +102 -0
  196. package/src/generators/capabilities/llm/providers/anthropic/stacks/python/src/__packageName__/adapters/llm.py.template +61 -0
  197. package/src/generators/capabilities/llm/providers/local/footprint.json +13 -0
  198. package/src/generators/capabilities/llm/providers/local/stacks/go/internal/llm/llm.go.template +102 -0
  199. package/src/generators/capabilities/llm/providers/local/stacks/python/src/__packageName__/adapters/llm.py.template +53 -0
  200. package/src/generators/capabilities/llm/providers/localai/footprint.json +29 -0
  201. package/src/generators/capabilities/llm/providers/localai/stacks/go/internal/llm/llm.go.template +102 -0
  202. package/src/generators/capabilities/llm/providers/localai/stacks/python/src/__packageName__/adapters/llm.py.template +53 -0
  203. package/src/generators/capabilities/llm/providers/none/footprint.json +9 -0
  204. package/src/generators/capabilities/llm/providers/none/stacks/go/internal/llm/llm.go.template +35 -0
  205. package/src/generators/capabilities/llm/providers/none/stacks/python/src/__packageName__/adapters/llm.py.template +25 -0
  206. package/src/generators/capabilities/llm/providers/ollama/footprint.json +20 -0
  207. package/src/generators/capabilities/llm/providers/ollama/stacks/go/internal/llm/llm.go.template +102 -0
  208. package/src/generators/capabilities/llm/providers/ollama/stacks/python/src/__packageName__/adapters/llm.py.template +53 -0
  209. package/src/generators/capabilities/llm/providers/openai/footprint.json +13 -0
  210. package/src/generators/capabilities/llm/providers/openai/stacks/go/internal/llm/llm.go.template +98 -0
  211. package/src/generators/capabilities/llm/providers/openai/stacks/python/src/__packageName__/adapters/llm.py.template +60 -0
  212. package/src/generators/capabilities/llm/stacks/go/internal/core/service/llm.go.template +12 -0
  213. package/src/generators/capabilities/llm/stacks/go/internal/llm/llm_test.go.template +33 -0
  214. package/src/generators/capabilities/llm/stacks/python/src/__packageName__/core/llm.py.template +15 -0
  215. package/src/generators/capabilities/llm/stacks/python/tests/contracts/test_llm.py.template +37 -0
  216. package/src/generators/cli-app/files/README.md.template +76 -0
  217. package/src/generators/cli-app/files/build.mjs.template +15 -0
  218. package/src/generators/cli-app/files/package.json.template +21 -0
  219. package/src/generators/cli-app/files/src/cli.ts.template +67 -0
  220. package/src/generators/cli-app/files/src/commands/hello.ts.template +17 -0
  221. package/src/generators/cli-app/files/src/commands/status.ts.template +23 -0
  222. package/src/generators/cli-app/files/src/core/client.test.ts.template +80 -0
  223. package/src/generators/cli-app/files/src/core/client.ts.template +64 -0
  224. package/src/generators/cli-app/files/src/registry.test.ts.template +35 -0
  225. package/src/generators/cli-app/files/src/registry.ts.template +31 -0
  226. package/src/generators/cli-app/files/tsconfig.json.template +16 -0
  227. package/src/generators/cli-app/files/tsconfig.test.json.template +11 -0
  228. package/src/generators/cli-app/generator.ts +138 -0
  229. package/src/generators/cli-app/schema.json +24 -0
  230. package/src/generators/docs-site/files/.gitignore.ejs +40 -0
  231. package/src/generators/docs-site/files/app/docs/__slug__/page.tsx +101 -0
  232. package/src/generators/docs-site/files/app/docs/layout.tsx +14 -0
  233. package/src/generators/docs-site/files/app/docs.css +43 -0
  234. package/src/generators/docs-site/files/app/layout.tsx +24 -0
  235. package/src/generators/docs-site/files/app/page.tsx +135 -0
  236. package/src/generators/docs-site/files/app/source.ts +8 -0
  237. package/src/generators/docs-site/files/components/mermaid.tsx +67 -0
  238. package/src/generators/docs-site/files/next.config.mjs +10 -0
  239. package/src/generators/docs-site/files/package.json +32 -0
  240. package/src/generators/docs-site/files/pnpm-workspace.yaml +7 -0
  241. package/src/generators/docs-site/files/postcss.config.mjs +6 -0
  242. package/src/generators/docs-site/files/source.config.ts +77 -0
  243. package/src/generators/docs-site/files/tailwind.config.js +10 -0
  244. package/src/generators/docs-site/files/tsconfig.json +27 -0
  245. package/src/generators/docs-site/generator.ts +476 -0
  246. package/src/generators/docs-site/schema.json +17 -0
  247. package/src/generators/electron-app/docs/principles/stack/electron/index.md +47 -0
  248. package/src/generators/electron-app/docs/principles/stack/electron/ipc-contracts.md +71 -0
  249. package/src/generators/electron-app/docs/principles/stack/electron/packaging-and-updates.md +59 -0
  250. package/src/generators/electron-app/docs/principles/stack/electron/process-model.md +53 -0
  251. package/src/generators/electron-app/docs/principles/stack/electron/security.md +70 -0
  252. package/src/generators/electron-app/docs/principles/stack/typescript/frontend.md +65 -0
  253. package/src/generators/electron-app/files/.gitignore.template +20 -0
  254. package/src/generators/electron-app/files/README.md.template +125 -0
  255. package/src/generators/electron-app/files/electron.vite.config.ts +31 -0
  256. package/src/generators/electron-app/files/eslint.config.mjs +92 -0
  257. package/src/generators/electron-app/files/forge.config.ts.template +44 -0
  258. package/src/generators/electron-app/files/package.json.template +54 -0
  259. package/src/generators/electron-app/files/playwright.config.ts +18 -0
  260. package/src/generators/electron-app/files/project.json.template +65 -0
  261. package/src/generators/electron-app/files/src/main/core-client.test.ts +81 -0
  262. package/src/generators/electron-app/files/src/main/core-client.ts +55 -0
  263. package/src/generators/electron-app/files/src/main/index.ts +157 -0
  264. package/src/generators/electron-app/files/src/main/ipc.ts +52 -0
  265. package/src/generators/electron-app/files/src/main/policy.test.ts +71 -0
  266. package/src/generators/electron-app/files/src/main/policy.ts +73 -0
  267. package/src/generators/electron-app/files/src/preload/index.ts +23 -0
  268. package/src/generators/electron-app/files/src/renderer/index.html.template +20 -0
  269. package/src/generators/electron-app/files/src/renderer/src/App.test.tsx +61 -0
  270. package/src/generators/electron-app/files/src/renderer/src/App.tsx.template +43 -0
  271. package/src/generators/electron-app/files/src/renderer/src/assets/main.css +40 -0
  272. package/src/generators/electron-app/files/src/renderer/src/env.d.ts +14 -0
  273. package/src/generators/electron-app/files/src/renderer/src/main.tsx +25 -0
  274. package/src/generators/electron-app/files/src/shared/ipc.ts +54 -0
  275. package/src/generators/electron-app/files/tests/smoke/app.spec.ts.template +68 -0
  276. package/src/generators/electron-app/files/tool/electron_exec.sh.template +83 -0
  277. package/src/generators/electron-app/files/tsconfig.json +7 -0
  278. package/src/generators/electron-app/files/tsconfig.node.json +27 -0
  279. package/src/generators/electron-app/files/tsconfig.web.json +22 -0
  280. package/src/generators/electron-app/files/vitest.config.ts +32 -0
  281. package/src/generators/electron-app/files/vitest.setup.ts +1 -0
  282. package/src/generators/electron-app/generator.ts +288 -0
  283. package/src/generators/electron-app/schema.json +23 -0
  284. package/src/generators/flutter-app/docs/principles/stack/flutter/architecture.md +78 -0
  285. package/src/generators/flutter-app/docs/principles/stack/flutter/index.md +38 -0
  286. package/src/generators/flutter-app/docs/principles/stack/flutter/platform-channels.md +51 -0
  287. package/src/generators/flutter-app/docs/principles/stack/flutter/releases-and-distribution.md +59 -0
  288. package/src/generators/flutter-app/docs/principles/stack/flutter/state-management.md +85 -0
  289. package/src/generators/flutter-app/docs/principles/stack/flutter/testing.md +74 -0
  290. package/src/generators/flutter-app/docs/principles/stack/flutter/widgets-and-composition.md +69 -0
  291. package/src/generators/flutter-app/files/.gitignore.template +30 -0
  292. package/src/generators/flutter-app/files/README.md.template +100 -0
  293. package/src/generators/flutter-app/files/analysis_options.yaml.template +18 -0
  294. package/src/generators/flutter-app/files/integration_test/app_test.dart.template +30 -0
  295. package/src/generators/flutter-app/files/lib/app.dart.template +24 -0
  296. package/src/generators/flutter-app/files/lib/config/app_config.dart +15 -0
  297. package/src/generators/flutter-app/files/lib/data/repositories/status_repository.dart +36 -0
  298. package/src/generators/flutter-app/files/lib/data/services/api_client.dart +71 -0
  299. package/src/generators/flutter-app/files/lib/domain/models/health_status.dart +23 -0
  300. package/src/generators/flutter-app/files/lib/main.dart +11 -0
  301. package/src/generators/flutter-app/files/lib/router.dart +23 -0
  302. package/src/generators/flutter-app/files/lib/ui/core/theme/app_theme.dart +110 -0
  303. package/src/generators/flutter-app/files/lib/ui/home/home_view.dart +89 -0
  304. package/src/generators/flutter-app/files/lib/ui/home/home_view_model.dart.template +38 -0
  305. package/src/generators/flutter-app/files/project.json.template +51 -0
  306. package/src/generators/flutter-app/files/pubspec.yaml.template +47 -0
  307. package/src/generators/flutter-app/files/test/api_client_test.dart.template +63 -0
  308. package/src/generators/flutter-app/files/test/fakes/fake_status_repository.dart.template +19 -0
  309. package/src/generators/flutter-app/files/test/home_view_test.dart.template +58 -0
  310. package/src/generators/flutter-app/files/tool/flutter_exec.sh.template +60 -0
  311. package/src/generators/flutter-app/generator.ts +362 -0
  312. package/src/generators/flutter-app/schema.json +23 -0
  313. package/src/generators/go-microservice/docs/principles/stack/go/concurrency.md +123 -0
  314. package/src/generators/go-microservice/docs/principles/stack/go/index.md +70 -0
  315. package/src/generators/go-microservice/docs/principles/stack/go/testing.md +152 -0
  316. package/src/generators/go-microservice/files/.air.toml.template +38 -0
  317. package/src/generators/go-microservice/files/.env.template +4 -0
  318. package/src/generators/go-microservice/files/.golangci.yml.template +82 -0
  319. package/src/generators/go-microservice/files/Dockerfile.dev.template +12 -0
  320. package/src/generators/go-microservice/files/asyncapi-pubsub.yaml.template +33 -0
  321. package/src/generators/go-microservice/files/asyncapi-ws.yaml.template +34 -0
  322. package/src/generators/go-microservice/files/cmd/api/main.go.template +149 -0
  323. package/src/generators/go-microservice/files/cmd/api/main_test.go.template +99 -0
  324. package/src/generators/go-microservice/files/cmd/worker/cleanup/main.go.template +39 -0
  325. package/src/generators/go-microservice/files/db/schema.sql.template +24 -0
  326. package/src/generators/go-microservice/files/go.mod.template +39 -0
  327. package/src/generators/go-microservice/files/internal/config/config.go.template +52 -0
  328. package/src/generators/go-microservice/files/internal/config/otel.go.template +93 -0
  329. package/src/generators/go-microservice/files/internal/core/domain/errors.go.template +16 -0
  330. package/src/generators/go-microservice/files/internal/core/domain/model.go.template +28 -0
  331. package/src/generators/go-microservice/files/internal/core/domain/user.go.template +13 -0
  332. package/src/generators/go-microservice/files/internal/core/pagination.go.template +16 -0
  333. package/src/generators/go-microservice/files/internal/core/service/app_service.go.template +79 -0
  334. package/src/generators/go-microservice/files/internal/core/service/event_hub.go.template +9 -0
  335. package/src/generators/go-microservice/files/internal/core/service/message_queue.go.template +10 -0
  336. package/src/generators/go-microservice/files/internal/core/service/outbox_repository.go.template +31 -0
  337. package/src/generators/go-microservice/files/internal/core/service/repository.go.template +23 -0
  338. package/src/generators/go-microservice/files/internal/core/service/user_repository.go.template +15 -0
  339. package/src/generators/go-microservice/files/internal/core/service/user_service.go.template +43 -0
  340. package/src/generators/go-microservice/files/internal/entrypoints/api/app_handler.go.template +108 -0
  341. package/src/generators/go-microservice/files/internal/entrypoints/api/auth_middleware_test.go.template +52 -0
  342. package/src/generators/go-microservice/files/internal/entrypoints/api/clerk_webhook.go.template +202 -0
  343. package/src/generators/go-microservice/files/internal/entrypoints/api/clerk_webhook_test.go.template +82 -0
  344. package/src/generators/go-microservice/files/internal/entrypoints/api/health_handler.go.template +80 -0
  345. package/src/generators/go-microservice/files/internal/entrypoints/api/idempotency/middleware.go.template +87 -0
  346. package/src/generators/go-microservice/files/internal/entrypoints/api/idempotency/middleware_test.go.template +76 -0
  347. package/src/generators/go-microservice/files/internal/entrypoints/api/idempotency/repository.go.template +37 -0
  348. package/src/generators/go-microservice/files/internal/entrypoints/api/middleware_auth.go.template +40 -0
  349. package/src/generators/go-microservice/files/internal/entrypoints/api/middleware_loadshed.go.template +38 -0
  350. package/src/generators/go-microservice/files/internal/entrypoints/api/middleware_logging.go.template +40 -0
  351. package/src/generators/go-microservice/files/internal/entrypoints/api/middleware_ratelimit.go.template +48 -0
  352. package/src/generators/go-microservice/files/internal/entrypoints/api/middleware_test.go.template +81 -0
  353. package/src/generators/go-microservice/files/internal/entrypoints/api/router.go.template +105 -0
  354. package/src/generators/go-microservice/files/internal/entrypoints/api/types.go.template +70 -0
  355. package/src/generators/go-microservice/files/internal/entrypoints/api/websocket_handler.go.template +39 -0
  356. package/src/generators/go-microservice/files/internal/httpclient/http_client.go.template +87 -0
  357. package/src/generators/go-microservice/files/internal/kafka/kafka.go.template +34 -0
  358. package/src/generators/go-microservice/files/internal/postgres/postgres.go.template +195 -0
  359. package/src/generators/go-microservice/files/internal/postgres/postgres_test.go.template +156 -0
  360. package/src/generators/go-microservice/files/internal/postgres/user_repository.go.template +56 -0
  361. package/src/generators/go-microservice/files/internal/pubsub/gcp_pubsub.go.template +35 -0
  362. package/src/generators/go-microservice/files/internal/websocket/client.go.template +151 -0
  363. package/src/generators/go-microservice/files/internal/websocket/hub.go.template +261 -0
  364. package/src/generators/go-microservice/files/scripts/apply-schema.sh.template +21 -0
  365. package/src/generators/go-microservice/files/tools/tools.go.template +10 -0
  366. package/src/generators/go-microservice/generator.ts +240 -0
  367. package/src/generators/go-microservice/schema.json +63 -0
  368. package/src/generators/nextjs-app/docs/principles/stack/typescript/frontend.md +65 -0
  369. package/src/generators/nextjs-app/files/.dockerignore.template +7 -0
  370. package/src/generators/nextjs-app/files/.env.example.template +24 -0
  371. package/src/generators/nextjs-app/files/.gitignore.template +5 -0
  372. package/src/generators/nextjs-app/files/Dockerfile +53 -0
  373. package/src/generators/nextjs-app/files/app/(auth)/sign-in/__sign-in__/page.tsx.template +9 -0
  374. package/src/generators/nextjs-app/files/app/(auth)/sign-up/__sign-up__/page.tsx.template +9 -0
  375. package/src/generators/nextjs-app/files/app/api/config/route.ts.template +39 -0
  376. package/src/generators/nextjs-app/files/app/api/healthz/route.test.ts +15 -0
  377. package/src/generators/nextjs-app/files/app/api/healthz/route.ts +5 -0
  378. package/src/generators/nextjs-app/files/app/api/proxy/__path__/route.test.ts.template +55 -0
  379. package/src/generators/nextjs-app/files/app/api/proxy/__path__/route.ts.template +126 -0
  380. package/src/generators/nextjs-app/files/app/error.tsx +39 -0
  381. package/src/generators/nextjs-app/files/app/global-error.tsx +68 -0
  382. package/src/generators/nextjs-app/files/app/globals.css +105 -0
  383. package/src/generators/nextjs-app/files/app/layout.tsx +59 -0
  384. package/src/generators/nextjs-app/files/app/loading.tsx +13 -0
  385. package/src/generators/nextjs-app/files/app/not-found.tsx +30 -0
  386. package/src/generators/nextjs-app/files/app/page.tsx +20 -0
  387. package/src/generators/nextjs-app/files/components/providers/default.tsx +19 -0
  388. package/src/generators/nextjs-app/files/components/providers/production.tsx +32 -0
  389. package/src/generators/nextjs-app/files/components/providers/telemetry.tsx +76 -0
  390. package/src/generators/nextjs-app/files/components/render-smoke.test.tsx +29 -0
  391. package/src/generators/nextjs-app/files/components/theme-provider.tsx +11 -0
  392. package/src/generators/nextjs-app/files/components.json +21 -0
  393. package/src/generators/nextjs-app/files/eslint.config.mjs +120 -0
  394. package/src/generators/nextjs-app/files/hooks/use-toast.ts +7 -0
  395. package/src/generators/nextjs-app/files/instrumentation.ts +90 -0
  396. package/src/generators/nextjs-app/files/lib/api/fetcher.ts.template +130 -0
  397. package/src/generators/nextjs-app/files/lib/config.ts +21 -0
  398. package/src/generators/nextjs-app/files/lib/logger.ts +29 -0
  399. package/src/generators/nextjs-app/files/lib/schemas/index.ts +19 -0
  400. package/src/generators/nextjs-app/files/lib/utils.ts +6 -0
  401. package/src/generators/nextjs-app/files/next.config.mjs +9 -0
  402. package/src/generators/nextjs-app/files/package.json +70 -0
  403. package/src/generators/nextjs-app/files/postcss.config.mjs +8 -0
  404. package/src/generators/nextjs-app/files/proxy.test.ts.template +30 -0
  405. package/src/generators/nextjs-app/files/proxy.ts +31 -0
  406. package/src/generators/nextjs-app/files/public/.gitkeep +1 -0
  407. package/src/generators/nextjs-app/files/tsconfig.json +42 -0
  408. package/src/generators/nextjs-app/files/vitest.config.mts +15 -0
  409. package/src/generators/nextjs-app/files/vitest.setup.ts +7 -0
  410. package/src/generators/nextjs-app/generator.ts +307 -0
  411. package/src/generators/nextjs-app/schema.json +44 -0
  412. package/src/generators/python-microservice/docs/principles/stack/python/async.md +168 -0
  413. package/src/generators/python-microservice/docs/principles/stack/python/documentation.md +240 -0
  414. package/src/generators/python-microservice/docs/principles/stack/python/mcp.md +147 -0
  415. package/src/generators/python-microservice/docs/principles/stack/python/resilience.md +193 -0
  416. package/src/generators/python-microservice/docs/principles/stack/python/testing.md +281 -0
  417. package/src/generators/python-microservice/files/.env.example.template +30 -0
  418. package/src/generators/python-microservice/files/Dockerfile.template +36 -0
  419. package/src/generators/python-microservice/files/db/schema.sql.template +19 -0
  420. package/src/generators/python-microservice/files/pyproject.toml.template +76 -0
  421. package/src/generators/python-microservice/files/scripts/apply-schema.sh.template +25 -0
  422. package/src/generators/python-microservice/files/src/__packageName__/adapters/comfyui.py.template +87 -0
  423. package/src/generators/python-microservice/files/src/__packageName__/adapters/config.py.template +48 -0
  424. package/src/generators/python-microservice/files/src/__packageName__/adapters/database.py.template +21 -0
  425. package/src/generators/python-microservice/files/src/__packageName__/adapters/message_queue.py.template +29 -0
  426. package/src/generators/python-microservice/files/src/__packageName__/adapters/repository.py.template +130 -0
  427. package/src/generators/python-microservice/files/src/__packageName__/adapters/telemetry.py.template +68 -0
  428. package/src/generators/python-microservice/files/src/__packageName__/adapters/websocket_hub.py.template +36 -0
  429. package/src/generators/python-microservice/files/src/__packageName__/core/domain/entities.py.template +22 -0
  430. package/src/generators/python-microservice/files/src/__packageName__/core/domain/exceptions.py.template +43 -0
  431. package/src/generators/python-microservice/files/src/__packageName__/core/ports.py.template +42 -0
  432. package/src/generators/python-microservice/files/src/__packageName__/core/service/example_service.py.template +68 -0
  433. package/src/generators/python-microservice/files/src/__packageName__/entrypoints/api/dependencies.py.template +50 -0
  434. package/src/generators/python-microservice/files/src/__packageName__/entrypoints/api/middleware.py.template +131 -0
  435. package/src/generators/python-microservice/files/src/__packageName__/entrypoints/api/router.py.template +37 -0
  436. package/src/generators/python-microservice/files/src/__packageName__/entrypoints/api/websocket_handler.py.template +20 -0
  437. package/src/generators/python-microservice/files/src/__packageName__/entrypoints/worker/cleanup.py.template +35 -0
  438. package/src/generators/python-microservice/files/src/__packageName__/entrypoints/worker/worker.py.template +28 -0
  439. package/src/generators/python-microservice/files/src/__packageName__/main.py.template +108 -0
  440. package/src/generators/python-microservice/files/tests/test_main.py.template +74 -0
  441. package/src/generators/python-microservice/files/tests/test_middleware.py.template +109 -0
  442. package/src/generators/python-microservice/files/tests/test_worker.py.template +16 -0
  443. package/src/generators/python-microservice/generator.ts +286 -0
  444. package/src/generators/python-microservice/schema.json +86 -0
  445. package/src/generators/shared/brand-tokens.ts +301 -0
  446. package/src/generators/shared/capabilities.ts +349 -0
  447. package/src/generators/shared/provenance.ts +61 -0
  448. package/src/generators/shared/scaffold-helpers.ts +309 -0
  449. package/src/generators/system-test-runner/files/tests/bets/.gitkeep +0 -0
  450. package/src/generators/system-test-runner/files/tests/bets/_archive/.gitkeep +0 -0
  451. package/src/generators/system-test-runner/files/tests/conftest.py.template +503 -0
  452. package/src/generators/system-test-runner/files/tests/pyproject.toml.template +20 -0
  453. package/src/generators/system-test-runner/files/tests/system/pages/__init__.py.template +9 -0
  454. package/src/generators/system-test-runner/files/tests/system/pages/base_page.py.template +36 -0
  455. package/src/generators/system-test-runner/files/tests/system/test_a11y_smoke.py.template +132 -0
  456. package/src/generators/system-test-runner/files/tests/system/test_contract_conformance.py.template +140 -0
  457. package/src/generators/system-test-runner/files/tests/system/test_layout_geometry.py.template +109 -0
  458. package/src/generators/system-test-runner/files/tests/system/test_render_smoke.py.template +227 -0
  459. package/src/generators/system-test-runner/files/tests/system/test_system.py.template +158 -0
  460. package/src/generators/system-test-runner/files/tests/system/test_token_conformance.py.template +206 -0
  461. package/src/generators/system-test-runner/files/tests/system/test_visual_regression.py.template +104 -0
  462. package/src/generators/system-test-runner/generator.ts +142 -0
  463. package/src/generators/system-test-runner/schema.json +24 -0
  464. package/src/generators/workspace-dev-cli/cli-src/build.mjs +42 -0
  465. package/src/generators/workspace-dev-cli/cli-src/dist/dev-bundle.js +2168 -0
  466. package/src/generators/workspace-dev-cli/cli-src/src/commands/bet.ts +442 -0
  467. package/src/generators/workspace-dev-cli/cli-src/src/commands/completion.ts +87 -0
  468. package/src/generators/workspace-dev-cli/cli-src/src/commands/doctor.ts +139 -0
  469. package/src/generators/workspace-dev-cli/cli-src/src/commands/lifecycle.ts +548 -0
  470. package/src/generators/workspace-dev-cli/cli-src/src/commands/quality.ts +127 -0
  471. package/src/generators/workspace-dev-cli/cli-src/src/commands/surface.ts +214 -0
  472. package/src/generators/workspace-dev-cli/cli-src/src/index.ts +127 -0
  473. package/src/generators/workspace-dev-cli/cli-src/src/registry.ts +194 -0
  474. package/src/generators/workspace-dev-cli/cli-src/src/theme/color.ts +130 -0
  475. package/src/generators/workspace-dev-cli/cli-src/src/theme/render.ts +158 -0
  476. package/src/generators/workspace-dev-cli/cli-src/src/theme/tokens.ts +122 -0
  477. package/src/generators/workspace-dev-cli/cli-src/src/util/context.ts +43 -0
  478. package/src/generators/workspace-dev-cli/cli-src/src/util/extensions.ts +99 -0
  479. package/src/generators/workspace-dev-cli/cli-src/src/util/paths.ts +46 -0
  480. package/src/generators/workspace-dev-cli/cli-src/src/util/proc.ts +106 -0
  481. package/src/generators/workspace-dev-cli/cli-src/src/util/prompt.ts +108 -0
  482. package/src/generators/workspace-dev-cli/cli-src/src/util/runners.ts +70 -0
  483. package/src/generators/workspace-dev-cli/cli-src/src/util/services.ts +221 -0
  484. package/src/generators/workspace-dev-cli/cli-src/src/util/version.ts +21 -0
  485. package/src/generators/workspace-dev-cli/cli-src/tsconfig.json +16 -0
  486. package/src/generators/workspace-dev-cli/files/.agents/skills/workspace-cli/SKILL.md.template +74 -0
  487. package/src/generators/workspace-dev-cli/files/dev.template +16 -0
  488. package/src/generators/workspace-dev-cli/files/docker-compose.yml.template +20 -0
  489. package/src/generators/workspace-dev-cli/files/scripts/cli/templates/milestone-test.pytmpl.template +46 -0
  490. package/src/generators/workspace-dev-cli/files/scripts/cli/templates/slice-test.pytmpl.template +38 -0
  491. package/src/generators/workspace-dev-cli/generator.ts +136 -0
  492. package/src/generators/workspace-dev-cli/schema.json +22 -0
  493. package/src/hidden-skills/code-intelligence.md +129 -0
  494. package/src/hidden-skills/groundwork-architect/SKILL.md +114 -0
  495. package/src/hidden-skills/groundwork-architect/references/agentic-systems.md +44 -0
  496. package/src/hidden-skills/groundwork-architect/references/ai-native-architecture.md +37 -0
  497. package/src/hidden-skills/groundwork-architect/references/api-and-contracts.md +45 -0
  498. package/src/hidden-skills/groundwork-architect/references/core-and-boundaries.md +45 -0
  499. package/src/hidden-skills/groundwork-architect/references/data-architecture.md +33 -0
  500. package/src/hidden-skills/groundwork-architect/references/decision-records.md +34 -0
  501. package/src/hidden-skills/groundwork-architect/references/durable-execution.md +45 -0
  502. package/src/hidden-skills/groundwork-architect/references/evolutionary-architecture.md +37 -0
  503. package/src/hidden-skills/groundwork-architect/references/identity-and-access.md +41 -0
  504. package/src/hidden-skills/groundwork-architect/references/integration-patterns.md +39 -0
  505. package/src/hidden-skills/groundwork-architect/references/observability.md +36 -0
  506. package/src/hidden-skills/groundwork-architect/references/performance-and-scale.md +41 -0
  507. package/src/hidden-skills/groundwork-architect/references/platform-and-delivery.md +47 -0
  508. package/src/hidden-skills/groundwork-architect/references/realtime-and-async.md +28 -0
  509. package/src/hidden-skills/groundwork-architect/references/reliability.md +31 -0
  510. package/src/hidden-skills/groundwork-architect/references/security-and-trust.md +47 -0
  511. package/src/hidden-skills/groundwork-architect/references/surface-architecture.md +40 -0
  512. package/src/hidden-skills/groundwork-architect/sync-anchor.md +34 -0
  513. package/src/hidden-skills/groundwork-architecture/architecture-template.md +50 -0
  514. package/src/hidden-skills/groundwork-architecture/instructions.md +139 -0
  515. package/src/hidden-skills/groundwork-architecture/phases/01-context-ingestion.md +18 -0
  516. package/src/hidden-skills/groundwork-architecture/phases/02-technical-constraints.md +27 -0
  517. package/src/hidden-skills/groundwork-architecture/phases/03-service-design.md +19 -0
  518. package/src/hidden-skills/groundwork-architecture/phases/04-data-flow-communication.md +23 -0
  519. package/src/hidden-skills/groundwork-architecture/phases/05-component-boundaries-contracts.md +17 -0
  520. package/src/hidden-skills/groundwork-architecture/phases/06-draft-review-present.md +38 -0
  521. package/src/hidden-skills/groundwork-architecture/phases/07-commit.md +33 -0
  522. package/src/hidden-skills/groundwork-architecture/templates/architecture-cache.md +43 -0
  523. package/src/hidden-skills/groundwork-architecture-extract/instructions.md +163 -0
  524. package/src/hidden-skills/groundwork-architecture-extract/templates/architecture-extract-cache.md +21 -0
  525. package/src/hidden-skills/groundwork-bet/briefs/slice-worker.md +191 -0
  526. package/src/hidden-skills/groundwork-bet/instructions.md +88 -0
  527. package/src/hidden-skills/groundwork-bet/templates/bet-progress-test.md +126 -0
  528. package/src/hidden-skills/groundwork-bet/templates/change-proposal.md +38 -0
  529. package/src/hidden-skills/groundwork-bet/templates/decomposition/meta.json +4 -0
  530. package/src/hidden-skills/groundwork-bet/templates/decomposition/milestone-index.md +35 -0
  531. package/src/hidden-skills/groundwork-bet/templates/decomposition/slice.md +35 -0
  532. package/src/hidden-skills/groundwork-bet/templates/pitch.md +45 -0
  533. package/src/hidden-skills/groundwork-bet/templates/technical-design/01-ui-design.md +51 -0
  534. package/src/hidden-skills/groundwork-bet/templates/technical-design/02-data-flows.md +36 -0
  535. package/src/hidden-skills/groundwork-bet/templates/technical-design/03-api-design.md +90 -0
  536. package/src/hidden-skills/groundwork-bet/templates/technical-design/04-data-design.md +29 -0
  537. package/src/hidden-skills/groundwork-bet/workflows/01-discovery.md +198 -0
  538. package/src/hidden-skills/groundwork-bet/workflows/02-design.md +168 -0
  539. package/src/hidden-skills/groundwork-bet/workflows/03-decomposition.md +246 -0
  540. package/src/hidden-skills/groundwork-bet/workflows/04-delivery.md +193 -0
  541. package/src/hidden-skills/groundwork-bet/workflows/05-validation.md +199 -0
  542. package/src/hidden-skills/groundwork-design-system/instructions.md +125 -0
  543. package/src/hidden-skills/groundwork-design-system/templates/brand-tokens.md +182 -0
  544. package/src/hidden-skills/groundwork-design-system/templates/design-system-cache.md +64 -0
  545. package/src/hidden-skills/groundwork-design-system/tracks/_foundation.md +136 -0
  546. package/src/hidden-skills/groundwork-design-system/tracks/agentic-protocol.md +269 -0
  547. package/src/hidden-skills/groundwork-design-system/tracks/cli.md +355 -0
  548. package/src/hidden-skills/groundwork-design-system/tracks/graphical-ui.md +330 -0
  549. package/src/hidden-skills/groundwork-design-system-extract/instructions.md +124 -0
  550. package/src/hidden-skills/groundwork-design-system-extract/templates/design-system-extract-cache.md +19 -0
  551. package/src/hidden-skills/groundwork-designer/SKILL.md +108 -0
  552. package/src/hidden-skills/groundwork-designer/references/accessibility.md +33 -0
  553. package/src/hidden-skills/groundwork-designer/references/ai-native-design.md +37 -0
  554. package/src/hidden-skills/groundwork-designer/references/design-review.md +29 -0
  555. package/src/hidden-skills/groundwork-designer/references/design-systems-and-tokens.md +33 -0
  556. package/src/hidden-skills/groundwork-designer/references/interaction-and-motion.md +37 -0
  557. package/src/hidden-skills/groundwork-designer/references/layout-and-space.md +33 -0
  558. package/src/hidden-skills/groundwork-designer/references/usability-and-ux.md +33 -0
  559. package/src/hidden-skills/groundwork-designer/references/visual-craft.md +49 -0
  560. package/src/hidden-skills/groundwork-designer/sync-anchor.md +20 -0
  561. package/src/hidden-skills/groundwork-doc-sync/instructions.md +100 -0
  562. package/src/hidden-skills/groundwork-elicit/instructions.md +66 -0
  563. package/src/hidden-skills/groundwork-elicit/methods.md +65 -0
  564. package/src/hidden-skills/groundwork-infra-adopt/instructions.md +168 -0
  565. package/src/hidden-skills/groundwork-infra-adopt/templates/infra-adopt-cache.md +21 -0
  566. package/src/hidden-skills/groundwork-mvp/instructions.md +223 -0
  567. package/src/hidden-skills/groundwork-mvp/templates/mvp-cache.md +9 -0
  568. package/src/hidden-skills/groundwork-patch/instructions.md +40 -0
  569. package/src/hidden-skills/groundwork-persona/instructions.md +54 -0
  570. package/src/hidden-skills/groundwork-product/SKILL.md +102 -0
  571. package/src/hidden-skills/groundwork-product/references/ai-native-product.md +45 -0
  572. package/src/hidden-skills/groundwork-product/references/discovery-and-opportunity.md +38 -0
  573. package/src/hidden-skills/groundwork-product/references/product-risks.md +52 -0
  574. package/src/hidden-skills/groundwork-product/references/requirements-and-specs.md +39 -0
  575. package/src/hidden-skills/groundwork-product/references/scope-and-sequencing.md +35 -0
  576. package/src/hidden-skills/groundwork-product/references/shaping-and-appetite.md +48 -0
  577. package/src/hidden-skills/groundwork-product/references/success-metrics-and-signals.md +37 -0
  578. package/src/hidden-skills/groundwork-product/sync-anchor.md +19 -0
  579. package/src/hidden-skills/groundwork-product-brief/instructions.md +231 -0
  580. package/src/hidden-skills/groundwork-product-brief-extract/instructions.md +139 -0
  581. package/src/hidden-skills/groundwork-product-brief-extract/templates/product-brief-extract-cache.md +17 -0
  582. package/src/hidden-skills/groundwork-review/checklists/architecture.md +93 -0
  583. package/src/hidden-skills/groundwork-review/checklists/bet-pitch.md +94 -0
  584. package/src/hidden-skills/groundwork-review/checklists/decomposition.md +135 -0
  585. package/src/hidden-skills/groundwork-review/checklists/design-system.md +85 -0
  586. package/src/hidden-skills/groundwork-review/checklists/domain-entity.md +66 -0
  587. package/src/hidden-skills/groundwork-review/checklists/implementation-readiness.md +46 -0
  588. package/src/hidden-skills/groundwork-review/checklists/infrastructure.md +68 -0
  589. package/src/hidden-skills/groundwork-review/checklists/maturity.md +71 -0
  590. package/src/hidden-skills/groundwork-review/checklists/product-brief.md +69 -0
  591. package/src/hidden-skills/groundwork-review/checklists/technical-design.md +112 -0
  592. package/src/hidden-skills/groundwork-review/instructions.md +181 -0
  593. package/src/hidden-skills/groundwork-scaffold/instructions.md +254 -0
  594. package/src/hidden-skills/groundwork-scaffold/phases/01-ingestion-service-mapping.md +87 -0
  595. package/src/hidden-skills/groundwork-scaffold/phases/02-scaffolding-execution.md +15 -0
  596. package/src/hidden-skills/groundwork-scaffold/phases/03-service-documentation-api-stubs.md +100 -0
  597. package/src/hidden-skills/groundwork-scaffold/phases/04-infrastructure-verification.md +17 -0
  598. package/src/hidden-skills/groundwork-scaffold/phases/05-draft-review.md +19 -0
  599. package/src/hidden-skills/groundwork-scaffold/phases/06-commit.md +19 -0
  600. package/src/hidden-skills/groundwork-scaffold/templates/scaffold-cache.md +23 -0
  601. package/src/hidden-skills/groundwork-scan/instructions.md +164 -0
  602. package/src/hidden-skills/groundwork-scan/references/digest-schema.md +66 -0
  603. package/src/hidden-skills/groundwork-scan/references/exclusions.md +44 -0
  604. package/src/hidden-skills/groundwork-scan/templates/architecture-findings.md +42 -0
  605. package/src/hidden-skills/groundwork-scan/templates/design-findings.md +23 -0
  606. package/src/hidden-skills/groundwork-scan/templates/overview.md +26 -0
  607. package/src/hidden-skills/groundwork-scan/templates/product-findings.md +23 -0
  608. package/src/hidden-skills/groundwork-scan/templates/scan-state.json +19 -0
  609. package/src/hidden-skills/groundwork-stack-forge/instructions.md +150 -0
  610. package/src/hidden-skills/groundwork-stack-forge/references/authoring-engineer-skills.md +107 -0
  611. package/src/hidden-skills/groundwork-surface-activation/instructions.md +138 -0
  612. package/src/hidden-skills/groundwork-update/briefs/reconcile-worker.md +196 -0
  613. package/src/hidden-skills/groundwork-update/instructions.md +200 -0
  614. package/src/hidden-skills/groundwork-writer/SKILL.md +278 -0
  615. package/src/hidden-skills/maturity-model.md +125 -0
  616. package/src/hidden-skills/operating-contract.md +400 -0
  617. package/src/hidden-skills/repo-map-schema.md +90 -0
  618. package/src/hidden-skills/templates/adr.md +57 -0
  619. package/src/hidden-skills/templates/capability-ports.md +71 -0
  620. package/src/hidden-skills/templates/discovery-notes.md +33 -0
  621. package/src/hidden-skills/templates/domain-entity.md +80 -0
  622. package/src/hidden-skills/templates/gap-ledger.md +21 -0
  623. package/src/hidden-skills/templates/handoff.md +37 -0
  624. package/src/hidden-skills/templates/maturity.md +39 -0
  625. package/src/hidden-skills/templates/surfaces.md +207 -0
  626. package/src/skills/groundwork-check/SKILL.md +56 -0
  627. package/src/skills/groundwork-check/instructions.md +70 -0
  628. package/src/skills/groundwork-orchestrator/SKILL.md +176 -0
  629. package/src/skills/groundwork-orchestrator/workflow-index.md +50 -0
@@ -0,0 +1,76 @@
1
+ ---
2
+ title: Identity & Access
3
+ description: Authentication and authorization as architecture — human identity on OIDC/OAuth 2.1, workload identity via SPIFFE, first-class agent identity, and authorization modeled rather than scattered.
4
+ status: active
5
+ last_reviewed: 2026-06-19
6
+ ---
7
+ # Identity & Access
8
+
9
+ ## TL;DR
10
+
11
+ Who may do what is an architectural decision made with the boundaries, not a middleware bolted on afterward. Humans authenticate through a proven OIDC/OAuth 2.1 provider; services authenticate each other with **workload identity** (SPIFFE/SPIRE short-lived SVIDs, mTLS through the mesh, no secret in code); and in an agent-led system, agents are **first-class non-human identities** with their own credentials and explicit delegation. Authorization is modelled once and enforced everywhere, not re-implemented per endpoint.
12
+
13
+ ## Why this matters
14
+
15
+ Identity is where most breaches actually land — a stolen long-lived secret, an over-broad role, a service that trusted the network. And it is the hardest thing to retrofit: once authorization logic is scattered across handlers and the trust model is implicit, tightening it touches everything. Deciding identity and access at the architecture stage — the trust boundaries, the credential lifetimes, the authorization model — is far cheaper than discovering them during an incident. In 2026 the surface widened again: machines and agents now outnumber humans as actors, and each needs an identity the system can reason about.
16
+
17
+ ## Our principles
18
+
19
+ ### 1. Authn and authz are architecture
20
+
21
+ The trust model — who is authenticated, how, and what each identity may do — is decided with the service boundaries, because it shapes every contract and data path. Authentication establishes *who*; authorization decides *what they may do*; we keep the two distinct and design both deliberately rather than letting them accrete in middleware.
22
+
23
+ ### 2. Human identity is boring and standard
24
+
25
+ We do not invent auth. Humans authenticate through a proven identity provider over **OIDC / OAuth 2.1**; sessions and tokens follow current OWASP guidance. OAuth 2.1 is still a consolidating draft, but its substance is not in doubt — it folds the settled security best practice (RFC 9700) into the base spec: mandatory PKCE on every authorization-code flow, no implicit grant, no resource-owner password grant. Track those practices, not the RFC's publication date. Custom JWT handling, bespoke session cookies, and home-grown MFA are how teams learn about auth vulnerabilities the hard way.
26
+
27
+ ### 3. Workload identity is the service perimeter
28
+
29
+ Services prove who they are with cryptographic **workload identity** — short-lived, auto-rotating credentials bound to the workload, mTLS between services, no secret in application code. Machine identity is the new perimeter; "it came from inside the network" authenticates nothing.
30
+
31
+ How you *issue* that identity is a sizing decision, not dogma, and SPIFFE/SPIRE is not the default answer for everyone. If you already run a service mesh you already have SPIFFE-compatible identity — Istio issues X.509 SVIDs and mTLS by default — so the marginal cost is near zero. On a single cloud, the provider's own workload identity (IAM roles, workload identity federation, OIDC-federated tokens) gives you keyless, short-lived credentials with no new infrastructure to operate. Reach for SPIFFE/SPIRE directly when you span clouds or run off-mesh workloads that need *one* portable identity plane — and budget for it honestly: SPIRE is mature but non-trivial to run well. The anti-pattern is the static service API key in an env var, not "didn't deploy SPIRE."
32
+
33
+ ### 4. Authorization is modelled, not scattered
34
+
35
+ Choose the model for the question you are actually answering. **Role-based (RBAC)** for coarse, stable job functions. **Relationship-based (ReBAC, the Zanzibar model)** when access follows the graph — "this user can see this document because it lives in a folder shared with a group they belong to" — which is exactly where RBAC dies of role explosion. **Attribute/policy-based (ABAC)** when the decision turns on context the subject doesn't carry: time, location, resource state. Most real systems combine them, and the practical path is one direction: start with roles, and reach for ReBAC the moment you catch yourself encoding sharing or hierarchy *as* roles.
36
+
37
+ Enforce through one path, not a thicket of per-endpoint checks, and externalise shared or complex policy so the rules are inspectable. But externalising the *decision* is not the same as adding a network hop per request — a central policy service that every call must round-trip is both a latency tax and a new single point of failure. Distribute the engine (embedded library, sidecar, or local cache with a short TTL) so policy is authored centrally and evaluated locally, and reserve the synchronous call to a central decision point for genuinely sensitive, low-volume actions. Authorization copy-pasted across handlers is authorization that will be wrong somewhere; authorization behind one slow network dependency is an outage waiting to happen.
38
+
39
+ ### 5. Agent and non-human identity is first-class
40
+
41
+ An automated actor — a service account, a CI job, an AI agent — has its own identity, not a borrowed human one. In an agent-led system this is load-bearing: an agent carries its own identity into every request, consequential tool calls are authorised per-action, and **delegation is explicit**. The mechanism is token exchange (RFC 8693): the issued token carries an `act` claim naming the actor, so the audit trail records *which* agent acted on *whose* behalf — and nested exchanges record the full chain when one agent calls another. MCP's authorization model builds on exactly this, layered on OAuth 2.1 + PKCE.
42
+
43
+ Two gaps the standards are still closing, which you must design around rather than assume away. First, PKCE protects the exchange but does **not** authenticate the client — a non-human client's identity has to be asserted by the infrastructure it runs on, which is precisely what workload identity (principle 3) provides; agent identity and workload identity are the same problem at two altitudes. Second, classic OAuth has no front-channel way to capture a user's *explicit consent* for an agent to act for them; in-flight IETF on-behalf-of-user drafts add a `requested_actor`/`actor_token` flow for this, but until they land, treat consent for consequential agent delegation as something you design explicitly, not something the protocol hands you. An agent with a shared admin key is excessive agency by another name.
44
+
45
+ ### 6. Least privilege, short-lived credentials
46
+
47
+ Every identity — human, workload, or agent — starts with the minimum it needs and is widened only on evidence. Credentials are short-lived and auto-rotated by default; a static, long-lived secret is a breach with a long fuse. Short-lived is necessary but not sufficient: a bearer token is replayable by anyone who captures it for as long as it lives, so bind tokens to their holder — sender-constrained via DPoP or mTLS, as the OAuth Security BCP (RFC 9700) and OAuth 2.1 now recommend — so a stolen token is useless off the key it was issued to. Roles and scopes are reviewed the way code is reviewed.
48
+
49
+ ### 7. Tenant isolation is an identity boundary
50
+
51
+ In a multi-tenant system, the tenant is part of every identity and every authorization decision, enforced at the data boundary, not assumed from a query parameter. Cross-tenant access is the highest-severity failure class; the identity model is where it is prevented.
52
+
53
+ ## How we apply this
54
+
55
+ The architect decides the trust model, the identity mechanisms, and the authorization model with the boundaries; the engineer skills implement them, and the security perimeter ([Security](../quality/security.md)) is where they are stress-tested. Workload identity and the policy engine are shared infrastructure, not per-service code.
56
+
57
+ - [Security & Trust](../quality/security.md) — the perimeter identity sits inside.
58
+ - [Agentic Systems](../ai-native/agentic-systems.md) — agent identity, delegation, per-action authorization.
59
+
60
+ ## Anti-patterns we reject
61
+
62
+ - **Implicit network trust.** "It's an internal call, it's authenticated." It is not.
63
+ - **Long-lived static secrets.** A shared service key in an env var is a breach waiting for its trigger.
64
+ - **Scattered authorization.** Per-endpoint permission checks that drift out of agreement.
65
+ - **Borrowed identity for machines.** A bot or agent acting as a human admin, with no trace of who really acted.
66
+ - **Invented auth.** Custom JWT / session / MFA instead of the battle-tested standard.
67
+ - **Tenant-by-query-param.** Trusting a client-supplied tenant id instead of binding it to the authenticated identity.
68
+
69
+ ## Further reading
70
+
71
+ - *OAuth 2.1* and *OpenID Connect* — the standard human-auth stack.
72
+ - *OAuth 2.0 Security Best Current Practice*, RFC 9700 — sender-constrained tokens, PKCE, the rules OAuth 2.1 folds in.
73
+ - *OAuth 2.0 Token Exchange*, RFC 8693 — delegation and the `act` claim behind on-behalf-of.
74
+ - *SPIFFE/SPIRE* (CNCF) — workload identity and short-lived SVIDs.
75
+ - *Zero Trust Architecture*, NIST SP 800-207 — identity as the perimeter.
76
+ - *Zanzibar*, Google — the model behind relationship-based authorization (OpenFGA, SpiceDB).
@@ -0,0 +1,84 @@
1
+ ---
2
+ title: Integration Patterns
3
+ description: Webhooks, the outbox pattern, idempotency, and the sync-vs-async trade-off.
4
+ status: active
5
+ last_reviewed: 2026-06-19
6
+ ---
7
+ # Integration Patterns
8
+
9
+ ## TL;DR
10
+
11
+ Services integrate through a small set of well-understood patterns: synchronous request/response for reads and strict writes, asynchronous events for everything else, the transactional outbox for "database and event must agree," webhooks for pushing to third parties, and idempotency everywhere. We pick the pattern based on the guarantee the integration needs, not on whatever felt easy at the time.
12
+
13
+ ## Why this matters
14
+
15
+ Most production incidents trace back to an integration that chose the wrong consistency model. A synchronous call where an async event belonged, an event without idempotency, a "fire and forget" webhook that silently dropped on a retry. Integration patterns are one of the few areas where the cost of getting it wrong is paid every day, forever, in an intermittent stream of weirdness. Getting them right means thinking about guarantees explicitly, not architectural fashion.
16
+
17
+ ## Our principles
18
+
19
+ ### 1. Choose by coupling, not by transport — and async is not free decoupling
20
+
21
+ Between services, async events are our default, because a synchronous call binds the caller's availability and latency to the callee's. But the rule that earns its keep is *choose by the guarantee, not the transport*. Respected practitioners default the other way — sync is simpler to build, trace, and reason about, with no eventual-consistency semantics to explain to consumers — and they are right that async-by-default, applied thoughtlessly, buys a distributed monolith: the same request/reply shape over a queue, now with worse debugging. Async only decouples when the caller genuinely stops needing the result inline. Request/reply over a broker is synchronous coupling with extra steps and no inline answer.
22
+
23
+ Decision rule: stay synchronous when the caller needs the result to proceed (most user-facing reads) or needs the write committed before it continues (strict writes), and when caller and callee share a team and a release cadence. Go async when the work can complete after the caller returns, when the consumer set is open or changing, or when you need load-leveling between a fast producer and a slow consumer. If the design is "send a message, then block waiting for the reply," that is sync — build it as sync.
24
+
25
+ ### 2. The outbox pattern solves the dual-write problem — pick the relay deliberately
26
+
27
+ When a state change requires both a database write and an event, and we need both or neither, publishing to the broker after the DB commits is a *dual write*: a crash between the two steps leaves the system permanently inconsistent, and at scale it will happen. The fix is to make the event part of the same transaction — write it to an `outbox` table inside the state-change transaction, then relay the outbox to the broker.
28
+
29
+ How the relay reads the outbox is a real choice, not a detail. A polling relay is the simplest correct option and right for moderate volume. Log-based change data capture (Debezium tailing the write-ahead log) removes both the polling load and the polling latency, at the cost of running and operating a CDC pipeline. The two compose: CDC *over the outbox table* gives near-real-time relay with a clean, app-controlled event schema, instead of streaming raw table changes and coupling every consumer to your column layout. Decision rule: poll until its load or latency is the thing that hurts, then move to CDC over the outbox table; reach for raw-table CDC only when the source genuinely is the table (replication, search indexing), not a domain event.
30
+
31
+ ### 3. Every consumer is idempotent
32
+
33
+ Every message handler — webhook receiver, message broker worker, retry-on-failure task — is idempotent. It either carries its own de-duplication key or it operates on keys that make replay safe (an `UPSERT` on a natural key, a conditional update guarded by a version). "At-least-once delivery" is the only delivery guarantee we ever get, and idempotent handling is the only response that works.
34
+
35
+ ### 4. Retries have policies, not just defaults
36
+
37
+ Every retry policy has an explicit maximum, an explicit backoff curve *with jitter*, and an explicit dead-letter destination. "Retry forever with 1-second backoff" is not a policy — it is how a transient failure becomes a thundering herd, and backoff without jitter just re-synchronizes that herd on the next tick. Cap the aggregate, too: retries should consume only a small, bounded fraction of total traffic (a *retry budget*), or one slow dependency turns every caller into an amplifier. Retries that hit the dead-letter queue fire an alert; the queue is not a garbage bin.
38
+
39
+ ### 5. Webhooks follow the Standard Webhooks shape
40
+
41
+ Don't reinvent webhook security; follow the Standard Webhooks spec. Sign with HMAC-SHA256 over `id.timestamp.body`, never a shared secret in a query string. Carry a stable event id (so receivers de-duplicate) and a timestamp (so receivers reject anything outside a short replay window). Support key rotation — multiple active signing keys, published via JWKS for asymmetric setups — so a key can be retired without downtime. Surface a retry history to the sender, and outbound, sign exactly as you expect inbound to be signed. A CloudEvents-shaped payload keeps producer and consumer honest about envelope vs. data. An unsigned webhook is not a webhook; it is an unauthenticated POST endpoint.
42
+
43
+ ### 6. Timeouts are end-to-end budgets
44
+
45
+ Every synchronous call has a timeout, and the timeout is allocated from a *budget* set by the outermost caller. A request with a 2-second budget at the edge does not get to spend 1.5 seconds on a single downstream call — that leaves no slack for retries, for the handler itself, or for the next downstream. Budgeting is a cooperative discipline; without it, tail latencies compound unpredictably ([Performance](../quality/performance.md)).
46
+
47
+ ### 7. Circuit breakers cut both ways — prefer retry budgets for overload
48
+
49
+ The classic circuit breaker opens after a threshold of failures, fast-fails while open, and probes periodically for recovery. It earns its place against a *binary* dependency — one downstream, all-or-nothing — where fast-failing beats tying up threads on an inevitable timeout. But Marc Brooker's critique holds: a breaker is designed to turn partial failure into total failure, and in a sharded or cell-based system it cannot distinguish "the dependency is down" from "one partition is down," so it either degrades every caller or might as well not exist. A tripped breaker also slows recovery and complicates testing.
50
+
51
+ Decision rule: for overload — the common case — cap retries with a token bucket or retry budget and shed load at the source, rather than swinging a global breaker. Reserve the breaker for genuinely all-or-nothing dependencies, and scope it per-partition, never across a whole sharded fleet.
52
+
53
+ ### 8. Every integration has a contract test
54
+
55
+ A test that exercises the real integration — the real signature verification, the real retry curve, the real idempotency behaviour — runs in CI against an emulator. "It works in the happy path" is not a test; an integration that has only happy-path coverage is an incident waiting for its trigger.
56
+
57
+ ### 9. Multi-step flows: choreography, orchestration, or durable execution
58
+
59
+ Step count is a weak proxy; the real axis is who owns the end-to-end outcome. Choreography — each service reacts to events and emits its own — keeps services loosely coupled but makes the overall flow implicit: no single place shows what is supposed to happen or where it stalled, and that cost grows with every step and branch. Orchestration puts one coordinator in charge of the sequence and its compensations, buying visibility and explicit failure handling at the price of a central coupling point.
60
+
61
+ Decision rule: choreography when the steps are genuinely independent reactions with no shared deadline or rollback; orchestration when there is a real business transaction — ordering, compensation, a timeout that spans steps. For anything long-running, multi-step, or compensating, reach for durable execution (workflow-as-code) rather than hand-assembling outbox + idempotency + retry + sweeper for the hundredth time ([Durable Execution](durable-execution.md)).
62
+
63
+ ## How we apply this
64
+
65
+ - [Reliability](../quality/reliability.md) — the broader system-level treatment of failure modes.
66
+ - [Testing](../foundations/testing.md) — the contract-testing discipline.
67
+
68
+ ## Anti-patterns we reject
69
+
70
+ - **Sync chains three deep.** Service A calls B calls C calls D. Every failure mode in the chain is now a failure mode for A.
71
+ - **Async that is secretly sync.** Request/reply over a queue where the caller blocks for the response. You paid the full eventual-consistency and debugging tax and bought none of the decoupling.
72
+ - **"Fire and forget" webhooks.** No signature, no retry, no idempotency. Works once; the next incident it causes is unfixable from the outside.
73
+ - **Commit-and-then-publish.** Without the outbox, the dual write will leave the system inconsistent every time a process dies between steps. It will happen.
74
+ - **Global retry policies.** "All HTTP calls retry 3 times with 1-second backoff." What matters is the *specific* downstream's failure profile, the caller's latency budget, and a cap on retries as a fraction of traffic.
75
+ - **Dead-letter queues as logs.** If the DLQ is silently accumulating, integration is not working; it is just failing quietly. Alert and act.
76
+
77
+ ## Further reading
78
+
79
+ - *Release It!*, Michael Nygard — the canonical treatment of stability patterns (circuit breakers, bulkheads, timeouts).
80
+ - *Enterprise Integration Patterns*, Hohpe & Woolf — old but foundational; the vocabulary most of this page inherits.
81
+ - *Microservices Patterns*, Chris Richardson — a practical mapping of these patterns onto a modern service architecture.
82
+ - Pat Helland, "Life Beyond Distributed Transactions" — the paper that made the outbox pattern obvious in retrospect.
83
+ - Marc Brooker, "Will circuit breakers solve my problems?" — why breakers turn partial failures into total ones, and the case for retry budgets under overload.
84
+ - The Standard Webhooks spec (standardwebhooks.com) — the interoperable signing, replay-window, and verification shape worth adopting rather than reinventing.
@@ -0,0 +1,83 @@
1
+ ---
2
+ title: Real-Time
3
+ description: WebSockets, streaming, backpressure, and the patterns that make live experiences survive a degraded network.
4
+ status: active
5
+ last_reviewed: 2026-06-19
6
+ ---
7
+ # Real-Time
8
+
9
+ ## TL;DR
10
+
11
+ Real-time features are long-lived bidirectional contracts between client and server, not request-response interactions. They must survive reconnection, handle backpressure without losing state, and never treat the network as a guarantee. Every real-time feature we ship is designed against the assumption that the connection will drop mid-flight.
12
+
13
+ ## Why this matters
14
+
15
+ The difference between a real-time product that feels smooth and one that feels broken is almost always the difference in how the implementers thought about failure modes: reconnection, duplicated messages, out-of-order delivery, and backpressure. Getting real-time right is less about picking a protocol and more about having a disciplined stance on those failure modes.
16
+
17
+ ## Our principles
18
+
19
+ ### 1. Transport is a per-direction decision
20
+
21
+ **SSE** is the default for server→client streaming — auto-reconnecting (via `Last-Event-ID`), CDN-friendly, no sticky sessions, plain HTTP — and it is the streaming substrate for AI (MCP and LLM token delivery ride it; OpenAI and Anthropic both stream tokens over SSE). Its real constraints are worth knowing at design time, not discovering in production: SSE is text-only, and over HTTP/1.1 a browser caps concurrent connections per origin at six, so several open tabs starve each other — serve it over HTTP/2+ where streams multiplex over one connection. The native `EventSource` API also cannot set request headers, so carry auth in a cookie or use a `fetch`-based SSE reader when you need an `Authorization` header.
22
+
23
+ **WebSockets** are for genuinely bidirectional connections where the client also pushes frequently — collaborative cursors, typing, mid-stream control. Reaching for a WebSocket to push a one-way stream is over-engineering.
24
+
25
+ **Long-polling** is not a primary transport and we never design around it. But it is the universal floor: it traverses every proxy, WAF, and corporate firewall ever shipped, because all of them understand plain request-response HTTP. On hostile networks that break persistent connections, long-polling is the legitimate degraded fallback (the Socket.IO model: attempt the upgrade, fall back when it fails). Rejecting it outright costs you the users behind the worst networks.
26
+
27
+ Decision rule: one-way server→client → SSE over HTTP/2; client pushes frequently mid-stream → WebSocket; datagram or multiplexed-stream workloads (media, gaming, high-fanout) → consider WebTransport (§9); and keep long-polling as the fallback only when you must serve clients on networks you do not control.
28
+
29
+ ### 2. Every message carries a sequence number
30
+
31
+ Every event on the wire carries a monotonic sequence. The client can detect gaps; the server can detect duplicates; the pair of them can resynchronise after a reconnect without the client having to refetch everything. Sequence numbers are per-session, not global.
32
+
33
+ ### 3. Reconnection is the normal case, not the error case
34
+
35
+ Clients reconnect with exponential backoff, jitter, and a resumption token that tells the server where they left off. "Reconnected" is logged, not paged. If a reconnection rate spikes, that is a signal about network or server health — not a client bug.
36
+
37
+ ### 4. Backpressure is explicit
38
+
39
+ When the server is producing faster than the client is consuming, the server either **sheds** (drops non-critical messages, logs the shed rate), **coalesces** (merges consecutive updates into a single event), or **blocks** (applies flow control). What it does *not* do is buffer unbounded. Buffering unbounded is how a real-time service dies.
40
+
41
+ ### 5. Echo suppression is a design concern
42
+
43
+ In streaming scenarios where a client's own output may be re-ingested as incoming events, the suppression mechanism — whether it is a sender ID on the stream, a per-session filter at the gateway, or client-side gating — is part of the protocol design, not a bolt-on fix. Echo handling is specified before the first line of code.
44
+
45
+ ### 6. Idempotent handlers
46
+
47
+ The client will reconnect and resend. The server must handle the resend gracefully — the same sequence number processed twice has no additional effect. This is the same principle as HTTP idempotency keys ([API Design](api-design.md)), applied to the streaming surface.
48
+
49
+ ### 7. Observability is unbroken across the socket
50
+
51
+ A trace that enters via HTTP, opens a WebSocket, streams many events, and closes — all of it belongs to the same trace. OTel instrumentation propagates the trace context into the socket, and every event carries it forward. A broken real-time trace is a test failure, not a nuisance (see [Testing](../foundations/testing.md)).
52
+
53
+ ### 8. Client state is recoverable, not sacred
54
+
55
+ Any state held on the client that matters must be recoverable from the server. We do not rely on the client's in-memory view surviving. If the client crashes or navigates away, rejoining the session should produce the same observable state — the server is the source of truth.
56
+
57
+ ### 9. LLM streaming and local-first collaboration
58
+
59
+ The canonical AI real-time pattern is **SSE for the token data-plane** plus a WebSocket (or internal gRPC) **control-plane** for cancel and feedback injection — its failure modes (slow first token, partial-response loss on a provider retry, backpressure stalls) extend the ones above.
60
+
61
+ For multi-user editing the live debate is **OT vs CRDT**, and it is a genuine fork, not a settled question. **OT** (operational transformation — what Google Docs runs on) keeps the server authoritative: clients send operations, the server transforms and orders them, and steady-state memory is just the current document. It is lean on the wire but demands a reliable central coordinator and notoriously fiddly transform logic. **CRDTs** (Yjs, Automerge) push merge rules into the data structure so replicas converge with no coordinator — the local copy is the source of truth and edits survive disconnection — at the cost of metadata overhead from tombstones and version vectors (even columnar-encoded Automerge runs well above raw-text size). Decision rule: server-authoritative editing against a reliable backend → OT is leaner; offline-first, peer-to-peer, or local-first where clients edit while disconnected → CRDT earns its overhead. This is also the principled home for echo suppression and recoverable state.
62
+
63
+ **WebTransport** crossed into Baseline in March 2026 when Safari 26.4 shipped it, joining Chrome, Edge, and Firefox. It is now a real option for datagram and multiplexed-stream workloads where head-of-line blocking hurts. It does not replace SSE for token streaming, and because it rides QUIC/UDP it can be blocked on corporate networks that permit only TCP — ship it with a WebSocket or HTTP fallback path, never as the sole transport.
64
+
65
+ ## How we apply this
66
+
67
+ - [Reliability](../quality/reliability.md) — the broader resiliency patterns these principles sit inside.
68
+ - [Observability](../quality/observability.md) — how we trace across streaming connections.
69
+
70
+ ## Anti-patterns we reject
71
+
72
+ - **Treating the socket as a fire-and-forget event bus.** No sequence numbers, no resumption, no idempotency. Works in demos; breaks in production.
73
+ - **Per-connection unbounded buffers.** A slow client should not kill the server's memory. Shed, coalesce, or block.
74
+ - **Reconnect-then-refetch-everything.** If the full state refresh is the recovery strategy, the protocol is broken. Use resumption tokens.
75
+ - **Ad-hoc event schemas.** Real-time events are contracts. They belong in AsyncAPI specs, versioned, generated.
76
+ - **Client-side reconciliation of echoes.** Echo suppression on the client is a fallback, not a design. Handle it at the gateway where the full context is available.
77
+
78
+ ## Further reading
79
+
80
+ - *Designing Data-Intensive Applications*, Martin Kleppmann — the chapters on streaming, ordering, and exactly-once semantics.
81
+ - *The Little Book of Semaphores*, Allen B. Downey — the fundamentals of flow control.
82
+ - *High Performance Browser Networking*, Ilya Grigorik — the chapters on WebSocket and real-time transports.
83
+ - The WebSocket RFC (RFC 6455) — worth reading at least once if you are going to build on top of it.
@@ -0,0 +1,74 @@
1
+ ---
2
+ title: Surface Architecture
3
+ description: Architecting the surfaces that sit over a headless capability core — the backend-for-frontend seam, surface decomposition, render placement, and the design system as a contract.
4
+ status: active
5
+ last_reviewed: 2026-06-19
6
+ ---
7
+ # Surface Architecture
8
+
9
+ ## TL;DR
10
+
11
+ A surface — web app, mobile app, CLI, desktop, an agent UI — is an adapter over the capability core, not a place for business logic. Its architecture is about the **seam**: how the surface reaches the core (a backend-for-frontend that shapes contracts to that surface), how a large surface is decomposed without sprawling, where rendering runs, and how the design system serves as a shared contract. Get the seam right and the surface stays thin, replaceable, and consistent with every sibling surface.
12
+
13
+ ## Why this matters
14
+
15
+ The most common way a system rots from the front is by letting business logic leak into the surface — validation rules, pricing, state machines re-implemented in a component because the API "didn't quite return the right shape." Now the rule lives in two places and they drift. The discipline of surface architecture is to keep the core authoritative and the surface an adapter: rendering, interaction, and orchestration of contracts, nothing more. That is also what lets a second surface (a mobile app, a CLI, an agent) be added without re-deriving the domain.
16
+
17
+ ## Our principles
18
+
19
+ ### 1. Surfaces are adapters over the core
20
+
21
+ A surface renders state and orchestrates calls to the core's contracts; it holds no domain rules. The capability core owns business logic and is designed headless and validated with no surface running. If a rule has to be true on every surface, it lives in the core — a surface that re-implements it is a drift waiting to happen.
22
+
23
+ ### 2. The backend-for-frontend shapes the contract per surface
24
+
25
+ A **BFF** adapts the core's contracts to what one surface actually needs — aggregating, trimming, and reshaping so the client is not stitching together six calls or over-fetching a viewport's worth of data. The unit is the *user experience*, not the device: a single web app serving customers, partners, and admins may warrant three BFFs, not one (Sam Newman's distinction). React Server Components are a built-in BFF for a web surface — the server-component tree *is* the aggregation layer.
26
+
27
+ The contested part is whether you need a separate BFF tier at all. You do not when there is one surface, when the core's contract is already flexible enough to let each client select and embed what it needs, or when GraphQL federation lets the client shape its own query — a dedicated BFF there is just another tier to operate. Reach for one when surfaces diverge sharply in their data needs, when chatty round-trips or over-fetching hurt, or when frontend and backend teams keep colliding on contract changes. Either way the BFF is an adapter, not a second core: the moment business rules accrete there you have built a shadow core, and a little duplication between BFFs is cheaper than the coupling you recreate by merging them back into one general-purpose tier.
28
+
29
+ ### 3. Render on the server and at the edge by default
30
+
31
+ Push rendering and data assembly to the server; ship the client the least work it can do. Server-first rendering flattens latency, shrinks the JavaScript payload, and concentrates the server/client boundary in one place instead of scattering fetch logic through the component tree.
32
+
33
+ This is a default, not a dogma. Server Components add a real boundary to reason about — no `useState`, `useEffect`, or context on the server — and they are a poor fit for surfaces dominated by continuous client interaction: complex editors, real-time collaborative canvases, local-first apps that must run offline. There the state lives on the client by nature, and forcing it through the server buys latency and complexity for nothing. The decision rule: render on the server when the surface is content- and navigation-shaped — the data changes between requests, not between keystrokes — and keep state on the client when interaction is continuous and local. Most surfaces are both: render the shell and the data-bound regions on the server, island the interactive parts.
34
+
35
+ The *edge* is a separate, narrower call. It wins for latency-sensitive work that needs little or no data — auth, redirects, personalization, A/B splits — and loses when the render needs the database, because the edge node is far from your data and the round-trips dominate. Put compute at the edge only when it sits close to what it reads.
36
+
37
+ ### 4. Decompose a large surface by domain, right-sized
38
+
39
+ A surface decomposes the way services do — by bounded domain, only when teams or load genuinely demand it. The driver is organizational, not technical: **micro-frontends** earn their cost when independent teams must build, test, and deploy parts of one surface on their own cadence. Absent that, a single well-structured surface — a "modular monolith" front-end with strict internal module boundaries — is simpler and correct, and it is where the field has settled: the State of Frontend survey reports self-described micro-frontend use falling from roughly 75% in 2022 to 24% in 2024 as teams found the DevOps overhead outran the benefit. The distributed-monolith failure mode has a front-end twin: many micro-frontends that must deploy in lock-step. Module Federation, the main micro-frontend mechanism, is increasingly used *inside* a monolith to update parts independently — proof the runtime tool is useful without the team-splitting topology.
40
+
41
+ ### 5. The design system is architecture
42
+
43
+ The design system — tokens and components — is a contract between every surface, not decoration. It is versioned, it is the single source of visual and interaction truth, and a surface consumes it rather than re-inventing it. Design-system-as-architecture is what keeps ten screens and three platforms feeling like one product.
44
+
45
+ ### 6. The contract presumes no surface
46
+
47
+ The core's contract serves every surface and presumes none — a session assumption baked into a response, markup where data belongs, or pagination sized to one viewport is the bug the next surface hits. An agent driving the interface (via **AG-UI**) is itself a surface type, and the most demanding test of a surface-neutral contract.
48
+
49
+ ### 7. Accessibility and performance are architectural budgets
50
+
51
+ A surface ships against committed budgets — interaction latency, bundle size, accessibility floors — enforced in CI, because they are properties of the architecture, not polish applied at the end. A surface that meets its budget only on a fast laptop has no budget.
52
+
53
+ ## How we apply this
54
+
55
+ The architect owns the *seam* — the core/surface boundary, the BFF, the decomposition decision, render placement. The design system's content and the surface's UI implementation belong to the design-system and surface-engineer skills; this reference decides where the line sits, not how the button looks.
56
+
57
+ - [How We Structure Code](code-structure.md) — the surface is a driving edge over the core.
58
+ - [API Design](api-design.md) — the surface-neutral contract the BFF adapts.
59
+ - [Agentic Systems](../ai-native/agentic-systems.md) — agent-driven surfaces and AG-UI.
60
+
61
+ ## Anti-patterns we reject
62
+
63
+ - **Business logic in the surface.** A pricing rule in a component. It will drift from the core.
64
+ - **The fat BFF.** A backend-for-frontend that grows its own domain rules and becomes a shadow core.
65
+ - **Micro-frontends by default.** Distributing one surface across teams that don't need it, then deploying them in lock-step.
66
+ - **The re-invented design system.** Each screen styling its own buttons; consistency dies one component at a time.
67
+ - **Viewport-shaped contracts.** A response only the current web layout can consume, which the mobile app and the agent cannot.
68
+ - **Client-heavy by reflex.** Shipping a megabyte of JavaScript to render what the server could have sent as HTML.
69
+
70
+ ## Further reading
71
+
72
+ - *Backend for Frontend*, Sam Newman — the BFF pattern and its boundaries.
73
+ - *Micro Frontends*, Luca Mezzalira — decomposition of large front-ends, and when not to.
74
+ - *Design Systems*, Alla Kholmatova — the design system as a shared, versioned contract.
@@ -0,0 +1,69 @@
1
+ ---
2
+ title: Documentation Protocol
3
+ description: How GroundWork keeps documentation current — Living Documents, doc hierarchy, and groundwork-check.
4
+ status: active
5
+ last_reviewed: 2026-05-26
6
+ ---
7
+
8
+ # Documentation Protocol
9
+
10
+ ## The Living Documents Protocol
11
+
12
+ All `docs/` artifacts are living documents. Any phase of any bet that surfaces new information that refines an existing document updates that document immediately, before moving on. This is not optional — stale docs are worse than no docs.
13
+
14
+ The direction does not matter:
15
+
16
+ - A bet can update the product brief.
17
+ - Architecture can update the design system.
18
+ - Delivery can update architecture.
19
+ - A user interview can update everything.
20
+
21
+ Updates are surgical and targeted. Change only what new information warrants. Do not rewrite sections that remain accurate. Do not ask for permission — these are refinements consistent with decisions already made. After updating, report what changed and why.
22
+
23
+ ## The Document Hierarchy
24
+
25
+ Every GroundWork project contains a defined set of documents. Each has a different ownership model.
26
+
27
+ **`docs/principles/**` and `docs/ways-of-working/**`** — project-owned from the moment they are deployed. Edit freely to match your team's practices. These documents describe how your team works and what your team values. GroundWork seeds them; your team owns them.
28
+
29
+ **`docs/product-brief.md`, `docs/design-system.md`, `docs/architecture/index.md`** — owned by the product and architecture. Updated via the relevant GroundWork skill when significant new information surfaces. Do not edit these ad hoc. Changes go through the skill so that discovery notes, operating contract protocols, and downstream consistency checks are applied.
30
+
31
+ **`docs/architecture/domain/<entity>.md`** — created by the architecture phase, extended by bet planning. Each bet that touches a domain entity updates its stub. Domain stubs are the contract between teams working on different components of the same entity.
32
+
33
+ **`docs/architecture/decisions/NNNN-<slug>.md`** — append-only. Never edited after acceptance. To revise a decision, write a new ADR that supersedes the old one. The superseded ADR's `status:` field is updated to reference the new one; its content is never changed.
34
+
35
+ **`docs/bets/<slug>/`** — immutable once a bet is committed. These are historical records. They document what was decided, why, and on what terms. Do not edit committed bet documents.
36
+
37
+ ## How groundwork-check Works
38
+
39
+ `groundwork-check` detects documentation drift — the state where docs describe the system differently from the code. Run it in CI or on demand.
40
+
41
+ What it flags:
42
+
43
+ - Docs that describe the system differently from the code — mismatched API signatures, schema fields, service names.
44
+ - `docs/architecture/domain/` entities missing from the codebase, or codebase domain concepts with no corresponding stub.
45
+ - `docs/architecture/decisions/` numbering gaps or invalid status values.
46
+
47
+ What it does not flag:
48
+
49
+ - `docs/principles/**` and `docs/ways-of-working/**` are not checked for code drift — these are project-stable documents not derived from code. groundwork-check does flag `last_reviewed` ages above 12 months as a low-severity advisory to prompt periodic review.
50
+
51
+ When groundwork-check flags something: investigate, do not suppress. Fix the doc or fix the code — the mismatch is the bug. Suppressing a drift flag leaves the system in an unverifiable state.
52
+
53
+ ## Docs and Skills
54
+
55
+ Docs are for humans and project state. Skills are how agents act on them.
56
+
57
+ Skills read docs to understand the current system. Docs record what the skills have built. They are complementary, not redundant. A skill that writes a bet plan reads `docs/architecture/index.md` to understand service boundaries — that reading depends on the architecture doc being current. A doc that describes a domain entity accurately depends on the architecture skill having updated it after the last bet touched it.
58
+
59
+ The Living Documents protocol is what keeps this relationship coherent. When it breaks — when a skill writes code that the docs do not reflect — groundwork-check surfaces the gap.
60
+
61
+ ## ADR Conventions
62
+
63
+ **When to write one**: Any decision a future engineer should not relitigate without a new ADR. Significance test: would someone joining six months from now need to know this to avoid repeating the decision? If yes, write an ADR.
64
+
65
+ **How to write one**: Use the template at `.groundwork/skills/templates/adr.md`. Number sequentially with zero-padded four digits: 0001, 0002, 0003. The slug is a short hyphenated description of the decision.
66
+
67
+ **How to supersede**: Change `status:` to `superseded by [NNNN](NNNN-slug.md)` and add a note at the bottom explaining what changed and why. Never edit an ADR's content after acceptance. Supersede it instead.
68
+
69
+ **What goes in the decision record**: the context (what forced the decision), the decision itself, the consequences (what this enables and what it closes off). Do not document options that were not seriously considered — decision records are not design documents.
@@ -0,0 +1,76 @@
1
+ ---
2
+ title: How We Work
3
+ description: The GroundWork lifecycle — Setup, Delivery Loop, and Living Documents.
4
+ status: active
5
+ last_reviewed: 2026-05-26
6
+ ---
7
+
8
+ # How We Work
9
+
10
+ GroundWork is an AI-driven framework that enforces **Upfront Technical Delivery**: software is meticulously designed, contracted, and verified *before* code is written, eliminating "just-in-time" engineering.
11
+
12
+ ## The GroundWork Lifecycle
13
+
14
+ GroundWork operates in two modes: **Setup** (one-time) and **Delivery Loop** (ongoing).
15
+
16
+ ### Setup
17
+
18
+ A greenfield setup runs six phases in sequence, each producing a canonical document the next phase depends on:
19
+
20
+ | Phase | Skill | Output |
21
+ |---|---|---|
22
+ | 1. Product Brief | `groundwork-product-brief` | `docs/product-brief.md` |
23
+ | 2. Design System | `groundwork-design-system` | `docs/design-system.md` |
24
+ | 3. Architecture | `groundwork-architecture` | `docs/architecture/index.md` |
25
+ | 4. Scaffolding | `groundwork-scaffold` | `docs/architecture/infrastructure.md` |
26
+ | 5. MVP Planning | `groundwork-mvp` | `docs/bets/<slug>/pitch.md` |
27
+ | 6. First Bet | `groundwork-bet` | First delivered feature; enters Delivery Loop afterwards |
28
+
29
+ Every setup phase commits to its final document, then hands off to the orchestrator, which routes to the next incomplete phase. The MVP→Bet handoff is the one exception that preserves context across the transition — the rich greenfield discovery feeds directly into the first bet without a context reset.
30
+
31
+ Brownfield projects (initialising GroundWork against an existing codebase) are on the roadmap. They are not currently implemented.
32
+
33
+ ### Delivery Loop
34
+
35
+ After the first bet ships, the project enters an ongoing cycle. Every bet runs `groundwork-bet`'s five phases:
36
+
37
+ | Bet Phase | Purpose |
38
+ |---|---|
39
+ | Discovery | Shape the problem into a Pitch — problem statement, appetite, solution sketch, success signal, and explicit no-gos. |
40
+ | Design Foundations | Produce the technical design contract: interface design, data flows, API contracts, and data schema. The design is locked before any decomposition begins. |
41
+ | Decomposition | Break the bet into milestones and slices; author bet-progress tests from the locked design. Tests are written red, up front. |
42
+ | Delivery | Turn bet-progress tests green, slice by slice. All APIs must be documented in machine-readable format (OpenAPI/protobuf/AsyncAPI) by end of delivery. |
43
+ | Validation | Run the full test suite, archive the bet-progress suite, apply Living Documents updates to upstream docs, and seed the next bet via discovery notes. |
44
+
45
+ Discovery produces a **Pitch**. When the team decides to execute the Pitch, it becomes a **Bet** — active from that moment through Validation. Multiple Pitches may exist at once; committing to one converts it to the active Bet.
46
+
47
+ **Roadmap:** A Betting Table will support queuing and prioritising multiple Pitches before committing to one. The current implementation takes one Pitch at a time.
48
+
49
+ All `docs/` artifacts are living documents. They grow as the project learns. Any phase, any bet, any conversation: if new information surfaces that refines an existing document, update it immediately.
50
+
51
+ ## The Operating Contract
52
+
53
+ All methodology skills share a single set of behavioral protocols defined in the Operating Contract (`operating-contract.md`). These protocols govern:
54
+
55
+ - **Discovery Notes**: How out-of-phase signals are captured under a canonical 5-section header set (`## Product Brief`, `## Design System`, `## Architecture`, `## Design Details`, `## Bets`) and carried forward to the phase that needs them.
56
+ - **Living Documents**: How any phase or bet updates upstream `docs/` artifacts when new information warrants — surgically, without asking permission, with a report of what changed.
57
+ - **Phase Lifecycle**: How each phase initialises (checks cache and discovery notes), executes (works through its stages), commits (writes the final artifact, runs Living Documents scan, updates discovery notes), and hands off.
58
+
59
+ Every methodology skill loads and follows the Operating Contract. The protocols are defined once and referenced everywhere — never duplicated.
60
+
61
+ ## The Philosophy: Upfront Technical Delivery
62
+
63
+ GroundWork explicitly rejects the common AI-assisted workflow of "just start coding and figure it out." Instead, it operationalises a disciplined progression:
64
+
65
+ 1. **Pitch**: Every bet begins with a problem statement bounded by an appetite (an opportunity-cost judgment of how much time the work is worth). A Pitch includes a falsifiable success signal — a measurable outcome that confirms the bet delivered its intended value.
66
+ 2. **Design First**: Before any decomposition begins, Design Foundations produces the technical contract — interface design, data flows, API contracts, and data schema. This is the document Decomposition and Delivery execute against.
67
+ 3. **Tests-Up-Front**: With the design locked, Decomposition authors bet-progress tests derived from the design contract — failing tests that define exactly what "done" means for each milestone and slice. These are Proof of Work.
68
+ 4. **Constrained Delivery**: Implementation turns bet-progress tests green, slice by slice. All APIs must be documented in machine-readable format (OpenAPI, protobuf, or AsyncAPI) by the end of delivery — clients are generated from this documentation. Discovering a flaw in the contracts means pausing, reverting to Design Foundations, updating, and re-approving — not improvising.
69
+ 5. **Validation & Living Documents**: After tests pass, upstream docs are surgically updated to reflect what the bet delivered. The architecture, brief, design system, and infrastructure documents continue to describe the system as it is.
70
+
71
+ If a developer cannot implement the API contracts purely from the Architecture and Design Foundations artifacts, those artifacts are incomplete. **GroundWork builds the map before it drives the car.**
72
+
73
+ ## Where to Go Next
74
+
75
+ - [Units of Work](units-of-work.md) — the delivery vocabulary: what a Bet, Milestone, and Slice are and how they nest.
76
+ - [Documentation Protocol](documentation.md) — how Living Documents work in practice, the document hierarchy, and how `groundwork-check` detects drift.
@@ -0,0 +1,40 @@
1
+ ---
2
+ title: Units of Work
3
+ description: How GroundWork structures delivery — Bet, Milestone, and Slice.
4
+ status: active
5
+ last_reviewed: 2026-05-26
6
+ ---
7
+
8
+ # Units of Work
9
+
10
+ GroundWork organises delivery through three nested units — **Bet**, **Milestone**, and **Slice** — each defined by the contract its dependents can rely on. A Bet's appetite holds while scope is designed. A Milestone's capability is provable behind a flag before customers see it. A Slice's API surface is testable before anything consumes it.
11
+
12
+ ## Pitch
13
+
14
+ A Pitch is the shaped plan for solving a problem within an appetite. It contains: a problem statement, a high-level solution sketch, explicit rabbit holes and no-gos, and a falsifiable success signal — the measurable outcome that confirms the bet delivered its intended value. The appetite is an opportunity-cost judgment made before the solution is designed, not a post-design estimate.
15
+
16
+ A Pitch does not contain milestones or slices. Those are derived in Decomposition, after the design is locked in Design Foundations.
17
+
18
+ Multiple Pitches may exist at once. Committing to a Pitch converts it into an active Bet.
19
+
20
+ ## Bet
21
+
22
+ A Bet is the committed execution of a Pitch — active from the moment the team decides to execute through Validation. A Bet operates on a fixed appetite with variable scope: the worth it is bounded to — judged by opportunity cost, not a calendar-time estimate — is set upfront and does not move; scope adjusts to fit what can be delivered within it.
23
+
24
+ Milestones and slices are defined in the Decomposition phase, from the locked technical design. They are not part of the Pitch.
25
+
26
+ ## Milestone
27
+
28
+ A Milestone is a demonstrable state the product reaches within a Bet — visible in the UI and verifiable behind a feature flag, but not yet exposed to customers. Milestones sequence by dependency: a Milestone that requires an earlier one to be complete must declare that dependency explicitly.
29
+
30
+ The Milestone is not a customer release. It is an internal proof point: the capability exists, can be demonstrated, and composes with other Milestones toward a customer-releasable Bet.
31
+
32
+ ## Slice
33
+
34
+ A Slice is a vertical cut through a single tech stack component — a service, a module, or a domain area — that delivers a new capability at that component's API boundary. A Slice spans the full depth of its component (schema, business logic, API surface) and stops there. The component above it — the UI or a downstream service — can consume it once the Slice is complete.
35
+
36
+ The hamburger method defines what "vertical" means in practice: rather than building all schemas across components, then all business logic, then all APIs, each Slice delivers one complete column through a single component's layers. The column is independently testable before anything above it is built.
37
+
38
+ Milestones close when every Slice that contributes to the Milestone's required API surface is complete.
39
+
40
+ **Brownfield systems**: Services in brownfield codebases often own multiple domains or share domain logic across services. A Slice is architecture-agnostic — the definition does not assume one service equals one domain. What matters is that a Slice delivers a testable API-level capability at a component boundary, regardless of how that component's internal responsibilities are structured.