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,87 @@
1
+ # Phase 1: Ingestion & Service Mapping
2
+
3
+ Read `docs/architecture/index.md` to identify every service, database, and messaging component the system requires. This document is the source of truth for what needs to be built.
4
+
5
+ Read `.groundwork/config/generators.json` to discover the available generators. Then read the schema for each generator relevant to the architecture — schemas define the full parameter space (authentication models, messaging integrations, WebSocket support, database inclusion) and understanding them before mapping ensures each generator is configured correctly.
6
+
7
+ Also read `.groundwork/config/config.toml` if it exists: entries under `[defaults.generators]` (flags keyed by generator name) and `[defaults]` (llm_provider, llm_model) are the user's standing preferences. Fold them into the mapping proposal as the configured starting position — named as coming from their config, never silently applied, and overridden without ceremony when the architecture demands it.
8
+
9
+ With the architecture and schemas in hand, **propose the full service-to-generator mapping in a single structured pass** — one row per service with the generator choice, key parameters, and a one-line rationale. Proposing everything at once exposes cross-service inconsistencies that per-service interrogation hides, and lets the user react to the complete picture rather than approving one service at a time.
10
+
11
+ For each service in the proposal:
12
+ - Identify which generator produces this service.
13
+ - Determine the parameters from the architecture's capability decisions: authentication model, messaging integration, WebSocket requirement. Use the Generator Capability Mapping below to translate architectural language into specific flag values — architecture documents are written in vendor-neutral capability terms, and the generators are flag-driven, so an explicit translation table is the contract between the two.
14
+ - Derive a service name that follows the architecture's naming conventions.
15
+
16
+ Planning ends before execution begins because running generators from a partially-confirmed plan generates services that don't match the architecture — fixing generated code is harder than correcting a mapping. Once every service is confirmed, write the complete execution plan to `scaffold-cache.md` — every generator command in order with all parameters — and get final approval for the full plan before proceeding. Mark the Service Mapping phase complete in `scaffold-cache.md`.
17
+
18
+ Count the services in `docs/architecture/index.md`, count the confirmed mappings, and verify they match before closing Phase 1.
19
+
20
+ **Surfaces:** Read the surface registry — `docs/surfaces.md` and its machine twin `.groundwork/surfaces.json` — when it exists. The registry, not the design system, decides what gets scaffolded and how it gets tested, because the architecture phase already settled each surface's scaffold target and test medium there. Each `active` surface drives two mapping decisions:
21
+
22
+ - **Scaffold target.** A surface whose `scaffold` field names a generator (`nextjs-app`, `cli-app`, `flutter-app`, `electron-app`) gets its own generator invocation in the execution plan, named by its slug. A `scaffold: forged` surface gets no generator invocation either — `groundwork-stack-forge` builds its seed directly (see the unsupported-stack options below) — but it joins the test fixtures via `--surfaces` like any other surface. A `scaffold: manual` surface gets no generator invocation — the registry never blocks on tooling — but the execution plan still records its three obligations: an entry in `docs/architecture/infrastructure.md`'s Surfaces group (Phase 5), registration in the test fixtures via the `--surfaces` entry below, and an operational-expectations note stating what the manual implementation must meet to keep that registration honest — a health endpoint, `./dev` integration, and a reach value the fixtures can use.
23
+ - **Test medium.** Run `system-test-runner` once, passing every active surface in `--surfaces`: a JSON array of `{"slug", "medium", "reach"?}` where `medium` is the surface's registry `testMedium` and `reach` is a static base URL (`playwright`/`protocol-client` surfaces — omit it to discover the docker-compose service named after the slug) or the launch command for a `subprocess-cli` surface (a generated `cli-app` builds to `node services/<slug>/dist/cli.js`); `flutter-integration` and `playwright-electron` surfaces omit it — their reach is the app's own test-harness command, discovered as `npx nx run <slug>:test-integration` / `npx nx run <slug>:smoke` once `services/<slug>` is scaffolded. The generator emits a session `surfaces` fixture keyed by slug plus one runner fixture per surface — `<slug>_page` (`playwright`), `<slug>_runner` (`subprocess-cli`, and `flutter-integration`/`playwright-electron`, where it drives the app's own integration_test or Playwright `_electron` suite as a subprocess through the app's toolchain guard), `<slug>_client` (`protocol-client`) — and includes `pytest-playwright` whenever a `playwright` surface is present. A medium with no fixture family is registered in the `surfaces` fixture and nothing more; its tests arrive with its tooling.
24
+
25
+ **When no registry exists**, the project predates it — behave exactly as before: read `docs/design-system.md`, identify the single interface track (`graphical-ui`, `cli`, or `agentic-protocol`), and pass it as `--interfaceMedium`, the deprecated single-surface alias. That flag alone determines whether `pytest-playwright` and the `frontend_base_url` fixture are generated. Browser-driven interface proof is fully supported for `graphical-ui`; for `cli` and `agentic-protocol`, bet-progress tests use `subprocess`/HTTP against the running endpoint (no shared fixture is generated — write those tests against bare `subprocess`/HTTP).
26
+
27
+ **Capability registry:** Read the capability-ports registry — `.groundwork/capability-ports.json` and its prose twin `docs/architecture/index.md` §3 — when it exists. It records each technical capability → provider → footprint the architecture settled, and it is the authority for *which infrastructure exists and why*: infrastructure is a consequence of a provider's footprint, never a scaffold default. Map each entry to an action:
28
+
29
+ - A provider with an `env` / `compose-service` / `runner` footprint becomes a generator flag on the service that owns the capability (e.g. `python-microservice --llm --llmProvider anthropic`, `--postgres`) — or, when the service is already scaffolded, an `add-capability --service <slug> --capability <c> --provider <p>` invocation in the plan.
30
+ - A provider of `none` is the **bare interface**: scaffold it with `--provider none` (or `add-capability ... --provider none`) so the service gets the interface, a not-yet-implemented stub, and a strict-xfail contract test — the provider is a bet, recorded in the hand-off as the first delivery's work. Add no infrastructure for a `none` capability.
31
+
32
+ A capability whose provider the available generators cannot produce is the reversal path below, not a silent substitution. When no registry exists, the project predates it — derive capabilities from the architecture prose as before.
33
+
34
+ **Generator Capability Mapping:**
35
+
36
+ | Architectural decision | Generator + flag |
37
+ |---|---|
38
+ | End-user authentication via Clerk | `nextjs-app --auth clerk`, `go-microservice --auth clerk` |
39
+ | Service-to-service authentication | `go-microservice --auth service` |
40
+ | No authentication required | `--auth none` (or omit `--auth`) |
41
+ | Transactional outbox via Kafka | `--messaging kafka` |
42
+ | Transactional outbox via GCP Pub/Sub | `--messaging gcp-pubsub` |
43
+ | Lightweight pub/sub via Redis (Python only) | `python-microservice --messaging redis` |
44
+ | WebSocket real-time delivery | `--websockets` |
45
+ | Frontend → backend API proxy | `nextjs-app --apiProxy` |
46
+ | Command-line application as the product (or a CLI surface for a service) | `cli-app --name <name>` (add `--repl` when the design system specified an interactive/REPL paradigm; add `--core` when the CLI fronts workspace services — e.g. its registry access path is http-direct — to scaffold the core-access seam and the `status` wiring-proof command; omit `--core` for a standalone tool) |
47
+ | Mobile surface (registry `platform: mobile`) | `flutter-app --name <slug>` (never joins docker-compose; the Flutter SDK is a runtime prerequisite, not a generation one) |
48
+ | Desktop surface (registry `platform: desktop`) | `electron-app --name <slug>` (never joins docker-compose; the Electron binary downloads at bootstrap, and the boot smoke needs a display — xvfb on Linux CI) |
49
+ | LLM integration (Python service) | `python-microservice --llm --llmProvider <openai\|anthropic\|local\|none>` (default `openai`; `local` = self-hosted OpenAI-compatible endpoint) |
50
+ | LLM as a bare interface / undecided provider (a bet) | `python-microservice --llm --llmProvider none` (interface + stub + strict-xfail contract test; no SDK, no infra) |
51
+ | Add a capability to an already-scaffolded service | `add-capability --service <slug> --capability <c> --provider <p>` (Day-2 / inside a bet; `--provider none` for a bare interface) |
52
+ | GPU inference on RunPod (Python service) | `python-microservice --runpod` |
53
+ | PostgreSQL on a Python service | `python-microservice --postgres` |
54
+ | REST surface on a Python service | `python-microservice --rest` |
55
+ | Docker Compose test topology (surface registry present) | `system-test-runner --surfaces '<JSON array of {slug, medium, reach?} from .groundwork/surfaces.json>'` |
56
+ | Docker Compose test topology (no registry — single interface type) | `system-test-runner --interfaceMedium <graphical-ui\|cli\|agentic-protocol>` |
57
+ | Fumadocs documentation site | `docs-site --name <slug>` |
58
+
59
+ This table is the one place to update when generator flags evolve. When a new flag ships, add a row here; when a flag is removed, delete the row. The mapping is the contract between architecture's vocabulary and scaffold's execution — keep it current.
60
+
61
+ **When the generators cannot honour an architecture decision.** This is common and expected: the architecture may have chosen a vendor, language, or topology the available generators do not produce (e.g. a TypeScript backend when only Go/Python exist, a native macOS AppKit app, Supabase auth when only Clerk is wired). Surface the genuine trade-off to the user as a single decision (Protocol 4) with three honest options:
62
+
63
+ 1. **Reverse onto a supported stack.** Adopt the generator's path. This almost always *reverses* an architecture Key Decision or supersedes an ADR — a **reversal** under Protocol 2, not a refinement. At commit (Phase 6) follow the Reversal Protocol in full: reconcile the architecture *body* (not just its summary), reconcile every dependent doc the reversal touches — the domain entity docs (`Owner:`, fields), service docs, infrastructure — write the superseding ADR, and re-invoke `groundwork-review` on each mutated doc. The committed architecture must describe the system you actually scaffolded, with no residue of the abandoned one.
64
+ 2. **Forge it.** Keep the chosen stack and build a first-class starting point for it: **load and run `.groundwork/skills/groundwork-stack-forge/instructions.md`.** It researches the stack, authors a self-contained engineer skill, builds a Day-2 seed wired into `./dev`, and writes a Day-2 checklist into the hand-off for MVP. This is the path that keeps GroundWork worth using off the paved road — reach for it when the stack choice is deliberate and the team will keep building in it. The forged seed becomes the service/surface in this mapping; record it in the execution plan like any other unit.
65
+ 3. **Hand-roll manually.** Record the surface as `scaffold: manual` with its operational obligations (a health signal, `./dev` integration, a test reach), and leave the implementation to the team with no scaffolding support. Choose this only when the component is throwaway or the team explicitly wants no help — otherwise option 2 serves them better.
66
+
67
+ Take the user's call; never silently substitute a default the architecture did not choose.
68
+
69
+ **LLM provider: scaffold the boilerplate, hand the integration to the bet.** When the architecture names an LLM provider, map it to `--llmProvider` (`openai`, `anthropic`, or `local` for a self-hosted OpenAI-compatible endpoint) so the generated LLM client targets the right SDK and a sensible default model from the start. When the provider is genuinely undecided or deferred, use `--llmProvider none`: the **bare interface** — the text-generation interface, a not-yet-implemented stub, and a strict-xfail contract test, with no SDK and no infrastructure. `none` is the honest scaffold of "hand the integration to the bet": the interface is the spec, the provider is the bet, and the xfail test flips red the moment it is implemented. Reach for it instead of picking a provider the product has not committed to. But be precise about what the generator delivers and what it does not. The `--llm` flag produces a *generic LLM client*: a single `generate_text` call behind the text-generation interface, with retries and a circuit breaker. It does **not** implement the provider-specific behaviour an architecture usually depends on — prompt caching a large shared context, streaming responses, structured outputs, a moderation/safety gate, or tool use. Those are **bet/MVP development work**, not scaffold output. Record them in the scaffold hand-off as work the first bet must build, and say so plainly when presenting the scaffold. Never describe the generated client as "provider-agnostic" or imply it already satisfies an architectural capability it only stubs — an honest "the LLM client is scaffolded; prompt caching and streaming are bet work" is worth more than a green checkmark that papers over the gap. If the architecture's provider is a real vendor the flag does not offer, that is the reversal path above, not a silent substitution to whatever the generator defaults to.
70
+
71
+ **Generator availability:**
72
+
73
+ | Generator | What it produces | Key parameters |
74
+ |---|---|---|
75
+ | `go-microservice` | Go API with PostgreSQL, optional auth and messaging | `--name`, `--auth` (none/service/clerk), `--messaging` (none/kafka/gcp-pubsub), `--websockets` |
76
+ | `python-microservice` | Python FastAPI service, optional PostgreSQL and messaging | `--name`, `--rest`, `--postgres`, `--messaging` (none/redis/kafka/gcp-pubsub), `--websockets`, `--llm`, `--llmProvider` (openai/anthropic/local/none, default openai), `--runpod`, `--native` |
77
+ | `nextjs-app` | Next.js frontend with App Router | `--name`, `--auth` (none/clerk), `--apiProxy`, `--websockets` |
78
+ | `cli-app` | Branded Node+TypeScript command-line application, themed from `brand-tokens.json`; standalone by default, or a frontend for workspace services with `--core` | `--name`, `--repl` (scaffold the interactive REPL layer), `--core` (wire the workspace core-access seam + `status` wiring proof; `API_BASE_URL` overrides the gateway URL) |
79
+ | `flutter-app` | Flutter mobile app (official MVVM architecture, Riverpod, go_router), themed from `brand-tokens.json`; pubspec-based — wires into Nx via run-commands targets, never joins docker-compose | `--name`, `--org` (reverse-domain bundle id prefix, default `com.example`) |
80
+ | `electron-app` | Electron desktop app (hardened main/preload/renderer split, typed IPC, React + Tailwind renderer), themed from `brand-tokens.json`; wires into Nx via run-commands targets, never joins docker-compose | `--name`, `--org` (reverse-domain app id prefix, default `com.example`) |
81
+ | `system-test-runner` | Docker Compose test topology and system test suite | `--surfaces` (JSON array of `{slug, medium, reach?}` from the surface registry), `--interfaceMedium` (deprecated single-surface alias: graphical-ui/cli/agentic-protocol, default: graphical-ui) |
82
+ | `docs-site` | Fumadocs documentation site that serves the live `docs/` tree (product brief, architecture, bets) with H1-derived titles; registers as a native `./dev` runner (`pnpm dev`, not autostarted), never joins docker-compose | `--name` |
83
+ | `add-capability` | Adds a capability interface + provider implementation (or a bare `none` interface) to an existing service | `--service`, `--capability` (default `llm`), `--provider` (capability default, or `none`), `--stack` (auto-detected) |
84
+
85
+ `workspace-dev-cli` is handled in initialization and does not appear in service mapping.
86
+
87
+ **Offer a documentation site (optional, default off).** Independent of the architecture's services, offer the user a browsable site for the project's own `docs/` — product brief, architecture, and the bets as they land. Present it once as a single optional decision (Protocol 4), **default to skipping it**, and frame it plainly: "a local site to browse your docs and bets; not part of the running product." If they accept, add `docs-site --name docs` to the execution plan — it registers as a native `./dev` runner and shows up in `infrastructure.md`'s footprint matrix like any other managed unit (Phase 5). If they decline, add nothing and say nothing further. The docs site is a developer affordance, never inferred from the architecture and never a service the architecture must justify.
@@ -0,0 +1,15 @@
1
+ # Phase 2: Scaffolding Execution
2
+
3
+ **If command execution tools are available:** Execute the confirmed generator commands in order. For each command:
4
+ 1. Run `npx --yes nx g "$(pwd)/.groundwork/config/generators.json:<generator-name>" <parameters>`. The absolute `$(pwd)` prefix is required because Nx calls `require.resolve` on the collection argument — a relative path resolves against Nx's own `node_modules`, not the workspace root.
5
+ 2. Verify the expected output files exist (e.g., `services/<name>/go.mod` for a Go service, `services/<name>/package.json` for a Next.js app).
6
+
7
+ After all generators have run, verify that `docker-compose.yml` includes entries for every scaffolded service.
8
+
9
+ Then reconcile against `.groundwork/capability-ports.json`: every capability with a `compose-service` footprint must have its service in `docker-compose.yml`, every `runner` footprint an entry in `.dev/dev.config.json` `runners[]`, and every `none` capability its stub plus a strict-xfail contract test in the service. A declared footprint with no materialization is a mapping or generation error — fix it before advancing, since the generators inject infrastructure only on demand and a missing provider leaves the capability silently unsatisfied.
10
+
11
+ Go and Python generators automatically install the corresponding `groundwork-go-engineer` or `groundwork-python-engineer` skill into `.agents/skills/`. The Next.js generator installs `groundwork-nextjs-engineer`. Verify each skill file exists after its generator runs — the generator promotes it directly from the framework package, so if any are missing, re-run that service's generator.
12
+
13
+ Mark the Scaffolding Execution phase complete in `scaffold-cache.md` and proceed to Phase 3.
14
+
15
+ **If command execution tools are unavailable:** The execution plan is already in `scaffold-cache.md`. Present the full runbook to the user as a single handoff — all commands in order, with the expected output for each. Do not ask them to run one command and report back. Accept their confirmation and mark the Scaffolding Execution phase complete. Note that infrastructure verification (Phase 4) must be done manually.
@@ -0,0 +1,100 @@
1
+ # Phase 3: Service Documentation & API Stubs
2
+
3
+ For each scaffolded service, create two files: a service document and an API stub. These give every developer a consistent entry point into each service from day one — before any product code exists.
4
+
5
+ Create `docs/architecture/services/` and `docs/architecture/api/` if they do not exist.
6
+
7
+ ## Service Document
8
+
9
+ Write `docs/architecture/services/<service-name>.md` for each service:
10
+
11
+ ```markdown
12
+ # <service-name>
13
+
14
+ **Generator:** <generator-name>
15
+ **Language:** Go | TypeScript | Python
16
+ **Port:** <port>
17
+ **Base path:** `services/<service-name>/`
18
+
19
+ ## Overview
20
+
21
+ <One paragraph: what this service does and its role in the system. Derive from the architecture document.>
22
+
23
+ ## Dependencies
24
+
25
+ | Dependency | Type | Notes |
26
+ |---|---|---|
27
+ | PostgreSQL | Database | `<service-name>` database — DB-backed services only; a stateless frontend owns no database |
28
+ | `<other-service>` | Service | Called via HTTP — URL at `<OTHER_SERVICE_URL>` env var |
29
+ | `<external-provider>` | External | e.g. Clerk, GCP Pub/Sub |
30
+
31
+ ## API
32
+
33
+ [`docs/architecture/api/<service-name>.md`](../api/<service-name>.md)
34
+
35
+ ## Environment Variables
36
+
37
+ | Variable | Required | Description |
38
+ |---|---|---|
39
+ | `PORT` | Yes | Service port (default: <port>) |
40
+ | `<database connection vars>` | Yes | Database connection — language-specific names, DB-backed services only (see population rules) |
41
+
42
+ See `services/<service-name>/.env.example` for the full list.
43
+
44
+ ## Running Locally
45
+
46
+ ```bash
47
+ ./dev start <service-name>
48
+ ```
49
+
50
+ ## Testing
51
+
52
+ ```bash
53
+ <unit test command for this language>
54
+ ```
55
+ ```
56
+
57
+ **Population rules:**
58
+
59
+ - Derive the port from `docker-compose.yml` or the architecture document after generation. Do not guess.
60
+ - List every inter-service dependency by name with the env var the calling service uses to reach it. If service A calls service B, service A's doc names service B and the env var (e.g. `AUTH_SERVICE_URL`).
61
+ - List every external dependency — databases, auth providers, message brokers. Derive from the generator flags and the architecture document.
62
+ - A stateless frontend owns no database. The `nextjs-app` generator scaffolds no datastore, so its service doc omits the PostgreSQL dependency row and every database environment variable. Only a service scaffolded with a database — a Go microservice, or a Python microservice with `--postgres` — names a database. Naming a database for a frontend describes infrastructure that does not exist.
63
+ - The database connection is exposed through language-specific environment variables, so populate the variables the generated service actually reads. A Go service reads a single `DATABASE_URL` connection string. A Python service reads discrete variables — `DB_HOST`, `DB_PORT`, `DB_USER`, `DB_PASSWORD`, `DB_NAME` — and composes the connection internally. The generated `.env.example` is the ground truth; do not assume `DATABASE_URL` for a service that reads discrete variables.
64
+ - Read the generated `.env.example` for each service to populate the environment variables table. If `.env.example` does not exist, list only variables derivable from the generator flags.
65
+ - Derive the unit test command from the language: `go test ./...` for Go, `uv run pytest` for Python, `pnpm test` for Next.js.
66
+ - Do not invent variables, routes, or descriptions. If a value cannot be derived from existing files or the architecture document, leave its cell blank rather than fabricating a placeholder.
67
+
68
+ **Drift frontmatter.** Open each `docs/architecture/services/<name>.md` and `docs/architecture/api/<name>.md` with YAML frontmatter so `groundwork-check` can detect drift automatically: `generation_mode: generated`, `source_of_truth:` (the canonical code paths for this service — its `services/<name>/` root and any contract files), and `last_reviewed:` (today's date). The `generated` mode routes `groundwork-check`'s recovery to re-running the generator; the brownfield extract phases use `extracted` instead. Both stamp the same three keys, so the check glob reads greenfield and brownfield docs identically.
69
+
70
+ ## API Stub
71
+
72
+ Write `docs/architecture/api/<service-name>.md` for each service that exposes HTTP endpoints — Go microservices and Python microservices with `--rest`. Skip frontend apps and the system-test-runner.
73
+
74
+ ```markdown
75
+ # <service-name> API
76
+
77
+ **Base URL:** `http://localhost:<port>`
78
+ **Auth:** <Bearer JWT | Service token (`X-Service-Token` header) | None>
79
+
80
+ ## Health
81
+
82
+ ### GET /health
83
+
84
+ **Response:** `200 OK`
85
+ ```json
86
+ {"status": "ok"}
87
+ ```
88
+
89
+ ## Endpoints
90
+
91
+ <!-- Routes are defined in `services/<service-name>/`. Populate this section as endpoints are implemented. -->
92
+ ```
93
+
94
+ **Population rules:**
95
+
96
+ - Derive auth from the generator flags: `--auth clerk` → Bearer JWT, `--auth service` → service token header, `--auth none` → no auth.
97
+ - **If the architecture document already specifies this service's contract — an explicit endpoint, an event stream, a request/response or SSE event schema (e.g. a streaming generation endpoint with named events) — transcribe that contract into the Endpoints section.** This is not inventing routes; it is carrying forward a commitment the architecture already made, so the system's key interface has a documented home from day one. Mark each as `status: planned`.
98
+ - Only when the architecture specifies *no* contract for the service, leave the Endpoints section as a placeholder comment for the team to populate as routes are built. Never fabricate routes the architecture did not commit.
99
+
100
+ Mark the Service Documentation phase complete in `scaffold-cache.md` and proceed to Phase 4.
@@ -0,0 +1,17 @@
1
+ # Phase 4: Infrastructure Verification
2
+
3
+ Boot the infrastructure and prove it works. The infrastructure document must describe a system that runs, not a system that should run in theory — a document based on an unverified scaffold has no value to the team that inherits it.
4
+
5
+ 1. **Boot** — start the full local stack: `./dev start`.
6
+ 2. **Migrate** — run database migrations for every service that includes PostgreSQL. Check the generated service for the migration command (typically `./dev migrate` or a service-level script).
7
+ 3. **Test** — run the system integration tests pre-baked into the scaffolds. These tests verify cluster health, service connectivity, database availability, and cross-service communication.
8
+ 4. **Self-heal** — if a service fails to start or a test fails, debug and repair it. Read logs, inspect generated configuration, fix port collisions, adjust environment variables, and iterate until everything is green. A failure here indicates a defect in the GroundWork generators — resolve it so the team does not encounter it.
9
+ 5. **Reconcile capability footprints** — for every capability in `.groundwork/capability-ports.json`, confirm its footprint is real, not just declared: a `compose-service` provider has a running container; a `runner` provider appears in `./dev status` (probe `./dev status --json` and check its `runners` array); an `env` provider has its variables present in the service's config / `.env.example`; a `none` bare interface has its strict-xfail contract test in the service's suite (the bet is visible, not forgotten). The managed set `./dev` reports must equal the architecture's surfaces + services + runners — a mismatch is a gap between what the architecture declared and what the scaffold built, and is resolved here, not papered over in the doc.
10
+
11
+ 6. **Seed the code map** — run `npx groundwork-method repo-map` to build the initial `.groundwork/cache/repo-map.json` from the scaffolded source (tree-sitter import edges + PageRank centrality). The project is born with a current code map rather than waiting for the first agent to build one, and it is the concrete evidence Phase 5 cites for maturity dimension D5.
12
+
13
+ Do not advance to Phase 5 until the entire system boots cleanly, all tests pass, every capability footprint reconciles, and the code map is seeded.
14
+
15
+ Mark the Infrastructure Verification phase complete in `scaffold-cache.md`.
16
+
17
+ **If execution tools are unavailable:** Skip this phase and record in `scaffold-cache.md` that verification and the code-map seed are pending. The infrastructure document in Phase 5 must flag this explicitly — it cannot present ports and commands as verified facts if the system has not been booted, and the D5 assessment must show the map as not-yet-built rather than assumed present.
@@ -0,0 +1,19 @@
1
+ # Phase 5: Draft & Review
2
+
3
+ Once the system is verified (or verification is documented as pending):
4
+
5
+ 1. **Draft.** Write `docs/architecture/infrastructure.md` following the quality standard in the entry `instructions.md`. Apply the `groundwork-writer` skill: declarative, active voice, no hedging. Record the actual ports, commands, and verification results — not what they should be in theory. Include the **What `./dev start` does** section: one row per managed unit (container, native app-service, or registered runner) with its run mode and boot command, derived from the final `docker-compose.yml` + `.dev/dev.config.json`. The set must match `./dev status --json` (its `docker`/`native`/`runners` arrays) — if you cannot make the doc and the CLI agree, the gap is a reconciliation failure to fix in Phase 4, not to describe around.
6
+
7
+ When `scaffold-cache.md` records verification as pending (Phase 4 was skipped), open the document body with a `## Verification Status` section stating that the system was not booted and that the ports, commands, and health checks below are derived from generated configuration, not observed from a running system, so the reader must run the Phase 4 verification steps before relying on them. Two to three sentences is enough — the point is that no reader can mistake an unverified scaffold for a verified one. Omit the section entirely when verification ran green; the `## Verification` results section covers that case.
8
+
9
+ 1b. **Draft `docs/maturity.md`.** Read the maturity model at `.groundwork/skills/maturity-model.md` and write the initial assessment from the template at `.groundwork/skills/templates/maturity.md`. A freshly scaffolded project scores ✅ on most dimensions — cite the evidence this phase just produced (booted stack, generated harness, registered Serena, a code map regenerable via `npx groundwork-method repo-map`). Open roadmap rows for what scaffolding cannot wire: D6 (CI does not yet invoke `groundwork check`) and any dimension verification left pending. Seed `## History` with one line. This doc is how the project tracks regressions against the target state it was born at.
10
+
11
+ 2. **Review.** Announce that the review process is starting, then invoke the review subagent (Protocol 9) once per document: `document_path: docs/architecture/infrastructure.md` with `document_type: infrastructure`, and `document_path: docs/maturity.md` with `document_type: maturity`. Report the verdict and any findings before proceeding. The gate is fail-closed (Protocol 8): proceed only on a parseable `VERDICT: PRESENT` for each; a review that errors, hangs, or returns no verdict follows Protocol 9's failure path.
12
+
13
+ 3. **Revise loop.** If the verdict is **REVISE**, apply all 🔴 Critical findings directly to the document. Re-run the review. Repeat until the verdict is **PRESENT**. After 3 REVISE verdicts, apply the revise cap defined in Protocol 8.
14
+
15
+ 4. **Author the getting-started on-ramp.** With `infrastructure.md` settled, write the three `docs/getting-started/` files — `index.md`, `setup.md`, and `dev-cli-reference.md` — to the standard in the entry `instructions.md` ("The developer on-ramp"). Apply `groundwork-writer`. Pull `setup.md`'s prerequisites, install commands, and env requirements from what Phase 4 actually did and from `infrastructure.md`; build `dev-cli-reference.md` by reading `./dev help` output, not from memory. These are the docs the docs-site landing page routes a fresh-clone developer to, so they must stand on their own. There is no separate review document type for them — the present-and-approve step below is their gate. Seed the section's sidebar order if absent: write `docs/getting-started/meta.json` as `{ "pages": ["index", "setup", "dev-cli-reference", "..."] }`.
16
+
17
+ 5. **Present.** Output `infrastructure.md` in full in the chat and summarise the getting-started set (the three files and what each covers). Surface any 🟡 Advisory findings so the user can decide whether to act on them.
18
+
19
+ 6. Ask the user whether to save as-is or refine anything first. Proceed to Phase 6 only on explicit approval.
@@ -0,0 +1,19 @@
1
+ # Phase 6: Commit
2
+
3
+ Execute only after explicit user approval from Phase 5. Follow Protocol 3.4 of the Operating Contract.
4
+
5
+ 1. **Write the Downstream Context file (Protocol 5).** The published docs (`docs/architecture/infrastructure.md`, the `docs/getting-started/` set, `docs/maturity.md`) carry no summary section — they are clean reference documentation. Apply `groundwork-writer` to write `.groundwork/context/scaffold.md` — the four-subsection contract per Protocol 5: Key Decisions (the ports, the boot command, the test command, the database schema model), Binding Constraints (anything MVP Planning must respect: env var requirements, manual verification gaps), Deferred Questions, Out of Scope. Add a one-line `llms.txt` entry for each newly created doc — the `docs/getting-started/` files and `docs/maturity.md` included.
6
+
7
+ 2. **Write the hand-off file.** Copy `.groundwork/skills/templates/handoff.md` to `.groundwork/cache/handoff/scaffold.md` and fill in only the sections that have content: rejected generator parameters or service-name choices, deferred verification steps if execution tools were unavailable, user instincts about future infrastructure (CI/CD, observability) not yet scaffolded, and any other context MVP Planning needs to understand the running system. Omit empty sections. **If a stack was forged this phase** (the scaffold cache carries a `## Forged Stack Checklist` from `groundwork-stack-forge`), copy that checklist into the hand-off so MVP scopes the to-be-built Day-2 items into the first bets — it is the seed's path from skeleton to a full Day-2 app.
8
+
9
+ 3. **Clean up caches.** Remove the scaffold cache and the consumed previous hand-off: `run_command("rm -f .groundwork/cache/scaffold-cache.md .groundwork/cache/handoff/architecture.md")`. Cache Isolation (Protocol 7) requires the previous hand-off to be deleted once consumed.
10
+
11
+ 4. Apply the Living Documents protocol — scan the conversation for insights that refine any existing `docs/` artifact. Apply surgical updates and refresh the affected Downstream Context files in `.groundwork/context/` (Protocol 5). Report what changed. **Scaffold-time vendor/language/topology changes are reversals** (Protocol 2): reconcile the architecture body and every dependent doc — domain entities, service docs, infrastructure — write the superseding ADR, and re-invoke `groundwork-review` on each mutated doc before committing. Because this reversal supersedes ADRs, re-review **every** `docs/architecture/domain/*.md` (`document_type: domain-entity`), not only the ones you remembered to edit — these stubs carry no summary and are the dependents most often left stale. Do not leave the architecture body or domain docs describing the design you replaced.
12
+
13
+ 5. Update discovery notes — scan for out-of-phase signals not captured in real time. Append new signals to `.groundwork/cache/discovery-notes.md`. Remove entries incorporated into the committed artifact or the hand-off file.
14
+
15
+ 6. Confirm that the phase is complete.
16
+
17
+ 7. Recommend a fresh context for the next phase — a clean context gives the next skill full working memory.
18
+
19
+ 8. Immediately load and execute the `groundwork-orchestrator` skill to proceed to MVP Planning. Do not ask the user to invoke it.
@@ -0,0 +1,23 @@
1
+ # Scaffold Cache
2
+
3
+ > This file tracks phase progress for the scaffold workflow and stores the confirmed execution plan. It is used to resume work and to drive Phase 2 execution. Do not edit manually.
4
+
5
+ ## CLI Initialization
6
+ status: pending
7
+ notes:
8
+
9
+ ## Service Mapping
10
+ status: pending
11
+ notes:
12
+
13
+ ## Scaffolding Execution
14
+ status: pending
15
+ notes:
16
+
17
+ ## Service Documentation
18
+ status: pending
19
+ notes:
20
+
21
+ ## Infrastructure Verification
22
+ status: pending
23
+ notes:
@@ -0,0 +1,164 @@
1
+ ---
2
+ name: groundwork-scan
3
+ description: >
4
+ Reads an existing codebase as Phase 0 of the brownfield track — classify the
5
+ repo, build a deterministic structural map, scan partition by partition — and
6
+ writes a scan baseline to `.groundwork/cache/` that the extract phases distil
7
+ into canonical docs. Produces structured findings, no `docs/` artifact.
8
+ ---
9
+
10
+ # groundwork-scan
11
+
12
+ You are a staff engineer dropped into an unfamiliar codebase with one job: understand it well enough that the phases after you can rebuild GroundWork's canonical documents from what already exists. You read the code so the extract phases do not have to read it again.
13
+
14
+ This is Phase 0 of the brownfield track. The repository already holds working software. You produce no `docs/` artifact — you produce a **scan baseline** in `.groundwork/cache/` that the product-brief, design-system, and architecture extract phases distil into canonical docs. Your output is structured findings, not prose for a human.
15
+
16
+ The discipline that makes this work is **read structure deterministically, interpret meaning selectively**. A parser reads every file; you read the files that carry meaning. You never load the whole repository into working context — you build an exact structural map first, then go deep only where it matters, writing findings to disk and discarding the detail as you go.
17
+
18
+ ---
19
+
20
+ ## How This Works
21
+
22
+ The scan moves through five stages: classify the repo, build a deterministic structural map, confirm scope with the user, scan partition by partition, then finalise and hand off. Each stage narrows what the next must read.
23
+
24
+ - **Classification before reading.** Knowing the repo shape and per-part technology tells you which files carry contracts and which are noise, before you open a single source file.
25
+ - **The structural map does the heavy lifting.** An exact dependency and symbol graph tells you where the architectural hubs are, so you read those deeply and skim the leaves — instead of reading everything at uniform depth and exhausting context.
26
+ - **Write and purge.** Findings go to disk the moment a partition is scanned, and only a one-line summary stays in working context. This is what lets the scan cover a large repository without overflowing — and what lets it resume after an interruption.
27
+
28
+ Your single point of contact with the user is a short scope-confirmation in Stage 2. Everything else is autonomous.
29
+
30
+ ---
31
+
32
+ ## Operating Contract
33
+
34
+ The shared operating contract at `.groundwork/skills/operating-contract.md` (contract v1) governs how this skill operates. Read it before taking any other action. The scan is a Sequential Setup *preparation* phase with three deliberate carve-outs defined in the contract's **Brownfield Scan** section: it writes no `docs/` artifact (so no Downstream Context file and no hand-off file), it runs no review gate, and its findings persist past its own completion rather than being deleted at commit. Protocols 1 (Discovery Notes) and 4 (Pacing) still apply.
35
+
36
+ ---
37
+
38
+ ## The `fan_out` Hint
39
+
40
+ The orchestrator passes a `fan_out` hint when it invokes this skill: `parallel` when a sub-agent dispatch tool is available in this environment, `sequential` otherwise. Honour it. Stage 3 branches on this value rather than probing your own tool set — a runtime that misjudges its capabilities and calls a dispatch tool that does not exist breaks the scan. If no hint reached you, default to `sequential`; it is correct everywhere, and the only cost is wall-clock time.
41
+
42
+ ---
43
+
44
+ ## Initialization & Resume Protocol
45
+
46
+ ### Step 1: Scan State Check
47
+
48
+ Check if `.groundwork/cache/scan-state.json` exists.
49
+
50
+ - If it **does not exist**, copy the template from `.groundwork/skills/groundwork-scan/templates/scan-state.json` to `.groundwork/cache/scan-state.json`.
51
+ - If it **does exist**, read it. If any partitions have a status of `complete`, summarise the coverage so far — the classification and which partitions are scanned — and ask whether the user wants to resume or start fresh. On resume, skip directly to the first partition still `pending` in Stage 3. On a fresh start, reset the scan state and findings from the templates.
52
+
53
+ ### Step 2: Cache Isolation Check
54
+
55
+ Verify the scan caches are clean (Protocol 7). A stale `scan/` findings directory or an orphaned `scan-state.json` from a previous run that did not complete must be confirmed with the user before reuse. If foreign state is found, ask the user to confirm a clean restart.
56
+
57
+ ---
58
+
59
+ ## Stage 0: Self-Orient (silent)
60
+
61
+ Before classifying, establish what is already known. Read `.groundwork/cache/discovery-notes.md` if it exists — a user who began elsewhere may have left signals. This is the only context you carry in; the rest you derive from the code.
62
+
63
+ ---
64
+
65
+ ## Stage 1: Classify
66
+
67
+ Determine the repository's shape and the technology of each part **without reading source files**. Read only the signals that reveal structure cheaply: the directory tree (depth-limited), package manifests (`package.json`, `go.mod`, `pyproject.toml`, `Cargo.toml`, and the like), lockfiles (to confirm a stack, not to read), `docker-compose*`, IaC roots, and the top-level `README`.
68
+
69
+ Establish:
70
+
71
+ - **Repo shape** — a single service, a multi-part repo (a client and a server), or a monorepo of many packages and services.
72
+ - **Per-part project type** — language and framework for each part, matched from its key files (a `package.json` with `next.config.*` is a Next.js app; a `go.mod` with a `cmd/` directory is a Go service).
73
+
74
+ Write the classification into `scan-state.json`. The exclusion globs and the contract-bearing file priorities you will apply are defined in `.groundwork/skills/groundwork-scan/references/exclusions.md` — load it now; it governs every read that follows.
75
+
76
+ ---
77
+
78
+ ## Stage 1.5: Structural Map (deterministic)
79
+
80
+ Build an exact map of the codebase — module boundaries, import and call edges, the symbols each file exports, and where the contract files live — so the scan in Stage 3 reads the architectural hubs deeply and skims the leaves. A function called by twenty others is more valuable context than a private helper called once, and only a real dependency graph tells you which is which.
81
+
82
+ **Preferred path — the deterministic generator.** Run `npx groundwork-method repo-map`. It parses the tracked source tree with tree-sitter, resolves import edges, ranks files by PageRank centrality, and writes `.groundwork/cache/repo-map.json` — module/partition boundaries, the import edges, a centrality ranking, the contract index, and a per-file symbol index. It maps Go, Python, TypeScript/JavaScript, Java, and Dart at full graph fidelity (real edges + centrality) and many more languages at symbols fidelity; check the `coverage` and `unmapped` fields to see what it captured (and what it did not). It runs without a network or an LSP, and is incremental: a parse cache keyed by content hash means every rerun reparses only changed files. This is the producer — deterministic, and free of the hallucinated edges an LLM invents.
83
+
84
+ **Live navigation — Serena (when registered).** Serena complements the map rather than producing it: the generator gives you the whole-repo aggregate Serena cannot export, and Serena answers the precise per-symbol questions the map does not. Use `get_symbols_overview` and `find_referencing_symbols` while reading the centrality hubs deeply in Stage 3. Find it with a tool search for the code-intelligence or symbol capability before assuming it is absent.
85
+
86
+ **Fallback path — LLM inference.** When the generator cannot run, or for a language it does not cover and the project has not enabled (the `unmapped` list names these — a language can be added in-repo via `.groundwork/config/repo-map.languages.js`, see `code-intelligence.md`), infer the missing structure from targeted reads — entry points, manifests, and import statements — and write those parts of `repo-map.json` in the **same shape**. The downstream contract is identical; only the means of producing it differs. Do not let the fallback change what the file holds.
87
+
88
+ `repo-map.json` is a first-class GroundWork artifact (schema: `.groundwork/skills/repo-map-schema.md`): the architecture extract phase reads it for exact dependency facts, and `groundwork-check` reuses it for impact analysis. Treat its shape as a contract, not an internal scratch file. It carries `generated_at_commit`, so `groundwork-check` and `npx groundwork-method repo-map --check` can tell when it has drifted from HEAD and a refresh is owed.
89
+
90
+ ---
91
+
92
+ ## Stage 2: Confirm Scope (the one interview point)
93
+
94
+ The scan is otherwise autonomous. Confirm exactly two things with the user, paced per Protocol 4 — keep this tight, you are confirming inferences, not interrogating:
95
+
96
+ 1. **Partition boundaries.** Present the parts you detected and how you intend to partition the scan. The rule is one partition per service or package; a single-service repo partitions per top-level source area instead, and an oversized partition is sub-partitioned in Stage 3. Let the user correct a boundary you read wrong; they know the repo.
97
+ 2. **Scan depth.** Offer the three depths and recommend one based on repo size and the user's intent:
98
+ - **Quick** — manifests, configs, the README, and contract/route files only; no deep source reading. Right for a first orientation or a very large repo.
99
+ - **Deep** — quick plus every file in the critical directories the project type designates. The default for most repos.
100
+ - **Exhaustive** — every code file except the exclusions. Right when the extract phases must miss nothing.
101
+
102
+ Record the confirmed partitions and depth in `scan-state.json`. If the user volunteers product, design, or architecture opinions here, capture them under the matching header in `.groundwork/cache/discovery-notes.md` (Protocol 1) and steer back — they belong to the extract phases, not the scan.
103
+
104
+ ---
105
+
106
+ ## Stage 3: Partition & Scan
107
+
108
+ Each partition yields one **digest** — a structured, capped summary defined in `.groundwork/skills/groundwork-scan/references/digest-schema.md`. Load that schema now; both execution paths produce it identically, and that identity is what lets the evaluation-tested sequential path certify the output contract for the parallel path it cannot exercise. A digest is never raw file contents — it is the interpreted result of reading them.
109
+
110
+ Branch on the `fan_out` hint.
111
+
112
+ ### Stage 3a: Parallel Fan-Out (`fan_out: parallel`)
113
+
114
+ Dispatch one scan sub-agent per partition, guided by the structural map so each agent knows its partition's hubs.
115
+
116
+ - **Bound the fan-out at 8 concurrent sub-agents.** With more partitions than that, run in waves. With a single partition far larger than the rest (a file count or size well beyond its siblings), sub-partition it by sub-directory, or under Quick/Deep depth priority-sample it rather than reading every file. Sampling always includes the contract-bearing files (specs, migrations, config) and the high-centrality modules — rank by `repo-map.json`'s centrality when present; the budget falls on the leaves, never on the contracts. A concurrency cap alone does not bound one oversized partition; handle it explicitly.
117
+ - Give each sub-agent its partition root, the exclusion globs, the scan depth, the partition's hub symbols from the structural map, and the digest schema — with the instruction to return the structured digest only, never file contents.
118
+ - **Assemble without reading files yourself.** As each digest returns, route its fields into the concern-split findings files (below) with `append_file`, update the partition's status and one-line summary in `scan-state.json`, and move on. You never open a source file in the parent context — the sub-agents read; you assemble. This is what keeps the parent lean at full fan-out.
119
+
120
+ ### Stage 3b: Sequential Batch (`fan_out: sequential`)
121
+
122
+ Scan one partition per batch, resumable across turns. The atomic unit is one partition, so crossing a turn boundary mid-scan is always safe — the next turn reads `scan-state.json` and continues from the first `pending` partition.
123
+
124
+ For each pending partition:
125
+
126
+ 1. List its files and select what to read per the scan depth and the exclusion/priority rules.
127
+ 2. Read the selected files.
128
+ 3. Extract the digest (the same schema as 3a).
129
+ 4. **Immediately** append the digest's fields to the concern-split findings files.
130
+ 5. Update the partition's status to `complete` and write its one-line summary in `scan-state.json`.
131
+ 6. **Purge** the detail from working context — keep only the one-line summary.
132
+ 7. Move to the next partition.
133
+
134
+ An oversized single partition is sub-partitioned or priority-sampled exactly as in 3a, so no batch is unbounded.
135
+
136
+ ### Findings Layout (both paths)
137
+
138
+ Route every digest's fields into these files under `.groundwork/cache/scan/`, each consumed by exactly one downstream phase (Protocol 7). Create them from the templates in `.groundwork/skills/groundwork-scan/templates/` on first write.
139
+
140
+ | File | Holds | Consumer |
141
+ |---|---|---|
142
+ | `scan/overview.md` | Repo shape, per-part project type, partition map, scan depth, coverage and gaps | all three extracts (shared) |
143
+ | `scan/product-findings.md` | README value proposition, user-facing capabilities, product surface, inferred users, licensing/monetisation signals | `groundwork-product-brief-extract` |
144
+ | `scan/design-findings.md` | Interface surfaces (every one the repo carries, typed), design tokens, component library inventory, theme/Tailwind config, UI framework, interaction and accessibility signals | `groundwork-design-system-extract` |
145
+ | `scan/architecture-findings.md` | Service/partition map with each partition's surface type, entry points, external contracts (OpenAPI/AsyncAPI/proto/routes), data models and migrations, persistence, internal and external dependencies, infra/deployment (compose, IaC, CI, env examples), notable patterns, risks and TODOs | `groundwork-architecture-extract` |
146
+
147
+ The digest schema's field-to-file routing is defined alongside the schema in `references/digest-schema.md` — follow it exactly so each extract finds what it expects under its own header.
148
+
149
+ ---
150
+
151
+ ## Stage 4: Finalise
152
+
153
+ Both paths converge here. Verify every partition in `scan-state.json` is `complete`. Write `scan/overview.md`: the repo shape, the partition map, and — this matters — an honest **coverage and gaps** note recording what was read fully versus sampled at the chosen depth. A downstream phase that knows a directory was only sampled can ask the user about it; one that assumes full coverage cannot. Silent truncation reads as completeness it did not earn. Set `status: complete` in `scan-state.json`.
154
+
155
+ Do not delete the findings. They are the durable hand-off the extract phases consume; `groundwork-infra-adopt` deletes the shared scan cache at the end of setup.
156
+
157
+ ---
158
+
159
+ ## Stage 5: Present & Hand Off
160
+
161
+ 1. Present a short summary to the user: the repo shape, the partitions scanned, what each findings slice captured, and any coverage gaps. This is orientation, not a document — keep it brief.
162
+ 2. **Record completion.** Add `"scan"` to the `completed` array in `.groundwork/config/state.json` — this is the durable marker the orchestrator reads, since the scan leaves no `docs/` artifact to reconcile against. Then write `.groundwork/cache/scan/complete.md` containing a one-line completion note; this terminal marker is the signal that the scan finished — written only here, at the true end.
163
+ 3. Capture any out-of-phase signals from the conversation into `.groundwork/cache/discovery-notes.md` (Protocol 1).
164
+ 4. Immediately load and execute the `groundwork-orchestrator` skill to route to the first extract phase. Do not ask the user to invoke it — hand off automatically.
@@ -0,0 +1,66 @@
1
+ # Partition Digest Schema
2
+
3
+ Every partition — whether scanned by a sub-agent (parallel) or in a sequential batch — yields exactly one digest in this shape. The schema is identical across both execution paths on purpose: a consumer reading a digest cannot tell, and must not need to tell, which path produced it. That identical output contract is what lets the cheaper sequential path stand in for the parallel one wherever sub-agent fan-out is unavailable.
4
+
5
+ **Every field is bounded.** Lists cap at ~12 items, each ≤20 words; strings cap at ~3 sentences. This bound is the lever that keeps the parent context lean at full fan-out and keeps each sequential batch's footprint small. A digest is the *interpreted* result of reading files — never raw file contents, never a file dump.
6
+
7
+ ```json
8
+ {
9
+ "partition_id": "api",
10
+ "root_path": "services/api",
11
+ "project_type": "go-service | nextjs-app | python-service | cli | library | ...",
12
+ "purpose": "≤3 sentences: what this partition does and why it exists",
13
+ "entry_points": ["cmd/server/main.go"],
14
+ "exported_surface": ["public packages, exported modules, or HTTP routes"],
15
+ "external_contracts": [
16
+ {"kind": "openapi | asyncapi | protobuf | graphql | route-file | none", "path": "api/openapi.yaml"}
17
+ ],
18
+ "data_models": [{"name": "User", "source": "schema.prisma | migrations/0003.sql | models.py"}],
19
+ "persistence": ["postgres via migrations/", "redis"],
20
+ "infra_deployment": ["docker-compose.yml", "terraform/", ".github/workflows/ci.yml", ".env.example"],
21
+ "dependencies": {"internal": ["services/auth"], "external": ["stripe-go", "nats.go"]},
22
+ "communication": ["sync HTTP -> auth", "async publish order.created -> nats"],
23
+ "notable_patterns": ["hexagonal layering", "transactional outbox"],
24
+ "design_tokens": ["tailwind.config.ts", "tokens.css"],
25
+ "ui_components": ["components/ui/* (shadcn)", "design-system package"],
26
+ "theme_framework": ["Tailwind with class-strategy dark mode", "CSS modules", "lipgloss terminal rendering"],
27
+ "interaction_a11y": ["aria labels on form components", "focus-visible ring convention", "prefers-reduced-motion variants", "i18n via locale files"],
28
+ "product_signals": ["README value prop", "user-facing features inferred from routes"],
29
+ "inferred_users": ["admin vs member roles in auth middleware", "onboarding copy addresses ops teams"],
30
+ "licensing_signals": ["LICENSE (MIT)", "billing integration", "plan tiers in config"],
31
+ "interface_type": "graphical-ui | cli | agentic-protocol | none",
32
+ "risks_todos": ["TODO: replace polling with webhooks", "v1 client deprecated", "no OpenAPI spec for public routes"],
33
+ "evidence_paths": ["file paths backing the claims above"]
34
+ }
35
+ ```
36
+
37
+ ## Field → Findings-File Routing
38
+
39
+ Route each field into the findings file its downstream consumer reads. A field can feed more than one file.
40
+
41
+ | Digest field | Findings file / section |
42
+ |---|---|
43
+ | `purpose` (product framing), `product_signals` | `scan/product-findings.md` → Value Proposition, User-Facing Capabilities |
44
+ | `inferred_users` | `scan/product-findings.md` → Inferred Users |
45
+ | `licensing_signals` | `scan/product-findings.md` → Licensing & Monetisation Signals |
46
+ | `design_tokens`, `ui_components` | `scan/design-findings.md` → Design Tokens, Component Library |
47
+ | `theme_framework` | `scan/design-findings.md` → Theme & Framework |
48
+ | `interaction_a11y` | `scan/design-findings.md` → Interaction & Accessibility Signals |
49
+ | `interface_type` | `scan/product-findings.md` → Product Surface; `scan/design-findings.md` → Interface Surfaces; `scan/architecture-findings.md` → Service / Partition Map (Surface column) |
50
+ | `purpose`, `entry_points`, `exported_surface` | `scan/architecture-findings.md` → Service / Partition Map, Entry Points |
51
+ | `external_contracts` | `scan/architecture-findings.md` → External Contracts |
52
+ | `data_models`, `persistence` | `scan/architecture-findings.md` → Data Models & Persistence |
53
+ | `dependencies` | `scan/architecture-findings.md` → Dependencies |
54
+ | `communication` | `scan/architecture-findings.md` → Communication Patterns |
55
+ | `infra_deployment` | `scan/architecture-findings.md` → Infrastructure & Deployment |
56
+ | `notable_patterns` | `scan/architecture-findings.md` → Notable Patterns |
57
+ | `risks_todos` | `scan/architecture-findings.md` → Risks & TODOs |
58
+ | `project_type`, repo shape | `scan/overview.md` → Parts, Partition Map |
59
+
60
+ `infra_deployment` is a distinct field, not a kind of contract — docker-compose, IaC, CI, and env examples have a guaranteed home so they are never lost between the contract and dependency slots.
61
+
62
+ The audience- and surface-facing fields read from predictable places. `inferred_users` is who the partition appears built for — the auth model (roles, permission tiers, tenancy), user-facing copy, and the shape of admin versus consumer routes; record it as inference, never as fact. `licensing_signals` comes from LICENSE files, package-manifest license metadata, and anything monetisation-shaped: billing integrations, plan tiers, paywall gates. `theme_framework` names the UI framework and styling approach — Tailwind, CSS-in-JS, CSS modules, a terminal rendering library — plus dark-mode handling; `design_tokens` holds the token sources themselves, `theme_framework` holds how the surface is styled. `interaction_a11y` records the interaction and accessibility posture visible in components: ARIA usage, focus and keyboard handling, motion and reduced-motion conventions, i18n setup. A backend partition legitimately leaves most of these empty — an empty field is itself a finding, and the extract phases interview for what no partition surfaced.
63
+
64
+ When `external_contracts` is empty for a partition that exposes routes, record the absence in `risks_todos` as a missing-contract gap. The architecture extract phase promotes it to a blocks-delivery entry in the gap ledger — the contract-driven bet loop depends on machine-readable contracts.
65
+
66
+ Every partition whose `interface_type` is not `none` is an **interface surface**, and the findings record all of them — a repo can carry a web app and a CLI, and each gets its own line in both destinations. The design extract recovers a design section per surface type and the architecture extract writes the surface registry from these lines; a surface dropped here never reaches either.
@@ -0,0 +1,44 @@
1
+ # Exclusions & File Priority
2
+
3
+ Governs what the scan reads and what it skips, at every depth. The goal is to read what carries meaning and never burn context on generated, vendored, or binary noise.
4
+
5
+ ## Always Exclude
6
+
7
+ Never read these — they are dependencies, build output, or noise, not the project's own code:
8
+
9
+ - `node_modules/`, `vendor/`, `.venv/`, `venv/`, `target/`, `.git/`
10
+ - `dist/`, `build/`, `out/`, `.next/`, `.nuxt/`, `coverage/`
11
+ - Minified and sourcemap files: `*.min.js`, `*.min.css`, `*.map`
12
+ - Lockfiles — confirm a stack from them, never read their contents: `package-lock.json`, `pnpm-lock.yaml`, `yarn.lock`, `go.sum`, `poetry.lock`, `Cargo.lock`, `uv.lock`
13
+ - Binary and media: images, fonts, audio, video, archives, compiled binaries
14
+ - Generated code clearly marked as such (a `// Code generated ... DO NOT EDIT` header, `*.pb.go`, `*_gen.go`)
15
+
16
+ ## Contract-Bearing Priority (read first, at every depth)
17
+
18
+ These files carry the most architectural signal per byte. Read them first in every partition, even at Quick depth, because the architecture extract phase depends on them:
19
+
20
+ - **API contracts** — OpenAPI/Swagger (`openapi.{yaml,json}`, `swagger.{yaml,json}`), AsyncAPI, Protobuf (`*.proto`), GraphQL SDL (`*.graphql`, `schema.gql`)
21
+ - **Data schema** — DB migrations (`migrations/`, `*.sql`), ORM models (`schema.prisma`, `models.py`, `entity.ts`), seed files
22
+ - **Routes & handlers** — route registration, controllers, resolvers, command definitions — the public surface
23
+ - **Manifests** — `package.json`, `go.mod`, `pyproject.toml`, `Cargo.toml`, `requirements.txt`
24
+ - **Infrastructure** — `docker-compose*.{yml,yaml}`, Dockerfiles, `*.tf`, `k8s/` and `helm/` manifests, CI workflows (`.github/workflows/`)
25
+ - **Config & env** — `*.env.example`, config files that declare ports, dependencies, and feature flags
26
+
27
+ ## Depth Behaviour
28
+
29
+ - **Quick** — the contract-bearing priority files, the README, and top-level config only. No deep source reading.
30
+ - **Deep** — Quick plus every file in the critical directories for the project type (the source roots, the route/handler layers, the model layers). Skim test fixtures and generated assets.
31
+ - **Exhaustive** — every file except the Always Exclude set.
32
+
33
+ ## Critical Directories by Project Type
34
+
35
+ Stay generic — these are structural heuristics, never product-domain assumptions:
36
+
37
+ - **Go service** — `cmd/`, `internal/`, `pkg/`, `api/`, `migrations/`
38
+ - **Python service** — the package root, `app/`, `api/`, `models/`, `alembic/` or `migrations/`
39
+ - **Next.js / React app** — `app/`, `pages/`, `components/`, `lib/`, `src/`, the Tailwind/theme config
40
+ - **Node service** — `src/`, `routes/`, `controllers/`, `models/`
41
+ - **CLI** — the command tree, the entry binary, the config layer
42
+ - **Library** — the public entry module and its exported surface
43
+
44
+ When the project type is unrecognised, fall back to reading the manifest, the entry point, and any directory the structural map flags as high-centrality.