groundwork-method 0.0.1 → 0.11.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 (647) hide show
  1. package/CHANGELOG.md +823 -0
  2. package/LICENSE +21 -0
  3. package/README.md +44 -29
  4. package/bin/groundwork.js +1723 -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 +173 -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 +79 -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 +108 -0
  106. package/src/docs/principles/index.md +24 -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 +123 -0
  128. package/src/engineer-skills/groundwork-electron-engineer/references/documentation.md +126 -0
  129. package/src/engineer-skills/groundwork-electron-engineer/references/ipc-contracts.md +138 -0
  130. package/src/engineer-skills/groundwork-electron-engineer/references/observability.md +37 -0
  131. package/src/engineer-skills/groundwork-electron-engineer/references/packaging-and-updates.md +82 -0
  132. package/src/engineer-skills/groundwork-electron-engineer/references/performance-and-reliability.md +80 -0
  133. package/src/engineer-skills/groundwork-electron-engineer/references/process-model.md +94 -0
  134. package/src/engineer-skills/groundwork-electron-engineer/references/security.md +107 -0
  135. package/src/engineer-skills/groundwork-electron-engineer/references/testing-and-smoke.md +129 -0
  136. package/src/engineer-skills/groundwork-electron-engineer/references/theming-and-tokens.md +74 -0
  137. package/src/engineer-skills/groundwork-electron-engineer/sync-anchor.md +22 -0
  138. package/src/engineer-skills/groundwork-flutter-engineer/SKILL.md +114 -0
  139. package/src/engineer-skills/groundwork-flutter-engineer/references/accessibility.md +92 -0
  140. package/src/engineer-skills/groundwork-flutter-engineer/references/architecture.md +189 -0
  141. package/src/engineer-skills/groundwork-flutter-engineer/references/data-and-contracts.md +136 -0
  142. package/src/engineer-skills/groundwork-flutter-engineer/references/documentation.md +122 -0
  143. package/src/engineer-skills/groundwork-flutter-engineer/references/navigation.md +122 -0
  144. package/src/engineer-skills/groundwork-flutter-engineer/references/observability.md +37 -0
  145. package/src/engineer-skills/groundwork-flutter-engineer/references/performance-and-reliability.md +100 -0
  146. package/src/engineer-skills/groundwork-flutter-engineer/references/platform-channels.md +93 -0
  147. package/src/engineer-skills/groundwork-flutter-engineer/references/releases-and-distribution.md +84 -0
  148. package/src/engineer-skills/groundwork-flutter-engineer/references/security.md +96 -0
  149. package/src/engineer-skills/groundwork-flutter-engineer/references/state-management.md +166 -0
  150. package/src/engineer-skills/groundwork-flutter-engineer/references/testing.md +160 -0
  151. package/src/engineer-skills/groundwork-flutter-engineer/references/theming-and-design-tokens.md +109 -0
  152. package/src/engineer-skills/groundwork-flutter-engineer/references/widgets-and-composition.md +123 -0
  153. package/src/engineer-skills/groundwork-flutter-engineer/sync-anchor.md +24 -0
  154. package/src/engineer-skills/groundwork-go-engineer/SKILL.md +174 -0
  155. package/src/engineer-skills/groundwork-go-engineer/references/api-design.md +82 -0
  156. package/src/engineer-skills/groundwork-go-engineer/references/architecture.md +42 -0
  157. package/src/engineer-skills/groundwork-go-engineer/references/capability-ports.md +50 -0
  158. package/src/engineer-skills/groundwork-go-engineer/references/code-craft-security.md +34 -0
  159. package/src/engineer-skills/groundwork-go-engineer/references/concurrency.md +108 -0
  160. package/src/engineer-skills/groundwork-go-engineer/references/documentation.md +130 -0
  161. package/src/engineer-skills/groundwork-go-engineer/references/go-services.md +77 -0
  162. package/src/engineer-skills/groundwork-go-engineer/references/http-handlers.md +172 -0
  163. package/src/engineer-skills/groundwork-go-engineer/references/implementation-patterns.md +156 -0
  164. package/src/engineer-skills/groundwork-go-engineer/references/integration-realtime-data.md +57 -0
  165. package/src/engineer-skills/groundwork-go-engineer/references/observability.md +49 -0
  166. package/src/engineer-skills/groundwork-go-engineer/references/postgres.md +41 -0
  167. package/src/engineer-skills/groundwork-go-engineer/references/reliability-performance.md +105 -0
  168. package/src/engineer-skills/groundwork-go-engineer/references/testing.md +201 -0
  169. package/src/engineer-skills/groundwork-go-engineer/sync-anchor.md +20 -0
  170. package/src/engineer-skills/groundwork-nextjs-engineer/SKILL.md +112 -0
  171. package/src/engineer-skills/groundwork-nextjs-engineer/references/accessibility.md +111 -0
  172. package/src/engineer-skills/groundwork-nextjs-engineer/references/architecture.md +323 -0
  173. package/src/engineer-skills/groundwork-nextjs-engineer/references/data-fetching.md +458 -0
  174. package/src/engineer-skills/groundwork-nextjs-engineer/references/documentation.md +324 -0
  175. package/src/engineer-skills/groundwork-nextjs-engineer/references/error-boundaries.md +383 -0
  176. package/src/engineer-skills/groundwork-nextjs-engineer/references/mutations-and-forms.md +396 -0
  177. package/src/engineer-skills/groundwork-nextjs-engineer/references/observability.md +48 -0
  178. package/src/engineer-skills/groundwork-nextjs-engineer/references/performance-and-deployment.md +947 -0
  179. package/src/engineer-skills/groundwork-nextjs-engineer/references/routing-and-navigation.md +405 -0
  180. package/src/engineer-skills/groundwork-nextjs-engineer/references/security.md +131 -0
  181. package/src/engineer-skills/groundwork-nextjs-engineer/references/server-components.md +394 -0
  182. package/src/engineer-skills/groundwork-nextjs-engineer/references/tailwind-and-styling.md +134 -0
  183. package/src/engineer-skills/groundwork-nextjs-engineer/references/testing.md +491 -0
  184. package/src/engineer-skills/groundwork-nextjs-engineer/references/type-system.md +368 -0
  185. package/src/engineer-skills/groundwork-nextjs-engineer/references/ux-principles.md +230 -0
  186. package/src/engineer-skills/groundwork-nextjs-engineer/references/visual-language.md +69 -0
  187. package/src/engineer-skills/groundwork-nextjs-engineer/sync-anchor.md +16 -0
  188. package/src/engineer-skills/groundwork-python-engineer/SKILL.md +199 -0
  189. package/src/engineer-skills/groundwork-python-engineer/references/api-standards.md +88 -0
  190. package/src/engineer-skills/groundwork-python-engineer/references/architecture.md +57 -0
  191. package/src/engineer-skills/groundwork-python-engineer/references/async-patterns.md +103 -0
  192. package/src/engineer-skills/groundwork-python-engineer/references/capability-ports.md +44 -0
  193. package/src/engineer-skills/groundwork-python-engineer/references/database.md +88 -0
  194. package/src/engineer-skills/groundwork-python-engineer/references/documentation-mcp.md +167 -0
  195. package/src/engineer-skills/groundwork-python-engineer/references/implementation-patterns.md +166 -0
  196. package/src/engineer-skills/groundwork-python-engineer/references/ml-pipelines.md +119 -0
  197. package/src/engineer-skills/groundwork-python-engineer/references/ml-systems-ai-engineering.md +74 -0
  198. package/src/engineer-skills/groundwork-python-engineer/references/observability.md +57 -0
  199. package/src/engineer-skills/groundwork-python-engineer/references/resilience.md +126 -0
  200. package/src/engineer-skills/groundwork-python-engineer/references/security.md +148 -0
  201. package/src/engineer-skills/groundwork-python-engineer/references/testing.md +216 -0
  202. package/src/engineer-skills/groundwork-python-engineer/sync-anchor.md +20 -0
  203. package/src/generators/add-capability/generator.ts +70 -0
  204. package/src/generators/add-capability/schema.json +30 -0
  205. package/src/generators/capabilities/llm/capability.json +28 -0
  206. package/src/generators/capabilities/llm/providers/anthropic/footprint.json +13 -0
  207. package/src/generators/capabilities/llm/providers/anthropic/stacks/go/internal/llm/llm.go.template +102 -0
  208. package/src/generators/capabilities/llm/providers/anthropic/stacks/python/src/__packageName__/adapters/llm.py.template +61 -0
  209. package/src/generators/capabilities/llm/providers/local/footprint.json +13 -0
  210. package/src/generators/capabilities/llm/providers/local/stacks/go/internal/llm/llm.go.template +102 -0
  211. package/src/generators/capabilities/llm/providers/local/stacks/python/src/__packageName__/adapters/llm.py.template +53 -0
  212. package/src/generators/capabilities/llm/providers/localai/footprint.json +29 -0
  213. package/src/generators/capabilities/llm/providers/localai/stacks/go/internal/llm/llm.go.template +102 -0
  214. package/src/generators/capabilities/llm/providers/localai/stacks/python/src/__packageName__/adapters/llm.py.template +53 -0
  215. package/src/generators/capabilities/llm/providers/none/footprint.json +9 -0
  216. package/src/generators/capabilities/llm/providers/none/stacks/go/internal/llm/llm.go.template +35 -0
  217. package/src/generators/capabilities/llm/providers/none/stacks/python/src/__packageName__/adapters/llm.py.template +25 -0
  218. package/src/generators/capabilities/llm/providers/ollama/footprint.json +20 -0
  219. package/src/generators/capabilities/llm/providers/ollama/stacks/go/internal/llm/llm.go.template +102 -0
  220. package/src/generators/capabilities/llm/providers/ollama/stacks/python/src/__packageName__/adapters/llm.py.template +53 -0
  221. package/src/generators/capabilities/llm/providers/openai/footprint.json +13 -0
  222. package/src/generators/capabilities/llm/providers/openai/stacks/go/internal/llm/llm.go.template +98 -0
  223. package/src/generators/capabilities/llm/providers/openai/stacks/python/src/__packageName__/adapters/llm.py.template +60 -0
  224. package/src/generators/capabilities/llm/stacks/go/internal/core/service/llm.go.template +12 -0
  225. package/src/generators/capabilities/llm/stacks/go/internal/llm/llm_test.go.template +33 -0
  226. package/src/generators/capabilities/llm/stacks/python/src/__packageName__/core/llm.py.template +15 -0
  227. package/src/generators/capabilities/llm/stacks/python/tests/contracts/test_llm.py.template +37 -0
  228. package/src/generators/cli-app/files/README.md.template +76 -0
  229. package/src/generators/cli-app/files/build.mjs.template +15 -0
  230. package/src/generators/cli-app/files/package.json.template +21 -0
  231. package/src/generators/cli-app/files/src/cli.ts.template +67 -0
  232. package/src/generators/cli-app/files/src/commands/hello.ts.template +17 -0
  233. package/src/generators/cli-app/files/src/commands/status.ts.template +23 -0
  234. package/src/generators/cli-app/files/src/core/client.test.ts.template +80 -0
  235. package/src/generators/cli-app/files/src/core/client.ts.template +64 -0
  236. package/src/generators/cli-app/files/src/registry.test.ts.template +35 -0
  237. package/src/generators/cli-app/files/src/registry.ts.template +31 -0
  238. package/src/generators/cli-app/files/tsconfig.json.template +16 -0
  239. package/src/generators/cli-app/files/tsconfig.test.json.template +11 -0
  240. package/src/generators/cli-app/generator.ts +138 -0
  241. package/src/generators/cli-app/schema.json +24 -0
  242. package/src/generators/docs-site/files/.gitignore.ejs +40 -0
  243. package/src/generators/docs-site/files/app/docs/__slug__/page.tsx +101 -0
  244. package/src/generators/docs-site/files/app/docs/layout.tsx +14 -0
  245. package/src/generators/docs-site/files/app/docs.css +43 -0
  246. package/src/generators/docs-site/files/app/layout.tsx +24 -0
  247. package/src/generators/docs-site/files/app/page.tsx +135 -0
  248. package/src/generators/docs-site/files/app/source.ts +8 -0
  249. package/src/generators/docs-site/files/components/mermaid.tsx +67 -0
  250. package/src/generators/docs-site/files/next.config.mjs +10 -0
  251. package/src/generators/docs-site/files/package.json +32 -0
  252. package/src/generators/docs-site/files/pnpm-workspace.yaml +7 -0
  253. package/src/generators/docs-site/files/postcss.config.mjs +6 -0
  254. package/src/generators/docs-site/files/source.config.ts +77 -0
  255. package/src/generators/docs-site/files/tailwind.config.js +10 -0
  256. package/src/generators/docs-site/files/tsconfig.json +27 -0
  257. package/src/generators/docs-site/generator.ts +476 -0
  258. package/src/generators/docs-site/schema.json +17 -0
  259. package/src/generators/electron-app/docs/principles/stack/electron/index.md +49 -0
  260. package/src/generators/electron-app/docs/principles/stack/electron/ipc-contracts.md +71 -0
  261. package/src/generators/electron-app/docs/principles/stack/electron/packaging-and-updates.md +59 -0
  262. package/src/generators/electron-app/docs/principles/stack/electron/process-model.md +53 -0
  263. package/src/generators/electron-app/docs/principles/stack/electron/security.md +70 -0
  264. package/src/generators/electron-app/docs/principles/stack/typescript/frontend.md +65 -0
  265. package/src/generators/electron-app/files/.gitignore.template +20 -0
  266. package/src/generators/electron-app/files/README.md.template +125 -0
  267. package/src/generators/electron-app/files/electron.vite.config.ts +31 -0
  268. package/src/generators/electron-app/files/eslint.config.mjs +92 -0
  269. package/src/generators/electron-app/files/forge.config.ts.template +44 -0
  270. package/src/generators/electron-app/files/package.json.template +54 -0
  271. package/src/generators/electron-app/files/playwright.config.ts +18 -0
  272. package/src/generators/electron-app/files/project.json.template +65 -0
  273. package/src/generators/electron-app/files/src/main/core-client.test.ts +81 -0
  274. package/src/generators/electron-app/files/src/main/core-client.ts +55 -0
  275. package/src/generators/electron-app/files/src/main/index.ts +157 -0
  276. package/src/generators/electron-app/files/src/main/ipc.ts +52 -0
  277. package/src/generators/electron-app/files/src/main/policy.test.ts +71 -0
  278. package/src/generators/electron-app/files/src/main/policy.ts +73 -0
  279. package/src/generators/electron-app/files/src/preload/index.ts +23 -0
  280. package/src/generators/electron-app/files/src/renderer/index.html.template +20 -0
  281. package/src/generators/electron-app/files/src/renderer/src/App.test.tsx +61 -0
  282. package/src/generators/electron-app/files/src/renderer/src/App.tsx.template +43 -0
  283. package/src/generators/electron-app/files/src/renderer/src/assets/main.css +40 -0
  284. package/src/generators/electron-app/files/src/renderer/src/env.d.ts +14 -0
  285. package/src/generators/electron-app/files/src/renderer/src/main.tsx +25 -0
  286. package/src/generators/electron-app/files/src/shared/ipc.ts +54 -0
  287. package/src/generators/electron-app/files/tests/smoke/app.spec.ts.template +133 -0
  288. package/src/generators/electron-app/files/tool/electron_exec.sh.template +83 -0
  289. package/src/generators/electron-app/files/tsconfig.json +7 -0
  290. package/src/generators/electron-app/files/tsconfig.node.json +27 -0
  291. package/src/generators/electron-app/files/tsconfig.web.json +22 -0
  292. package/src/generators/electron-app/files/vitest.config.ts +32 -0
  293. package/src/generators/electron-app/files/vitest.setup.ts +1 -0
  294. package/src/generators/electron-app/generator.ts +288 -0
  295. package/src/generators/electron-app/schema.json +23 -0
  296. package/src/generators/flutter-app/docs/principles/stack/flutter/architecture.md +78 -0
  297. package/src/generators/flutter-app/docs/principles/stack/flutter/index.md +38 -0
  298. package/src/generators/flutter-app/docs/principles/stack/flutter/platform-channels.md +51 -0
  299. package/src/generators/flutter-app/docs/principles/stack/flutter/releases-and-distribution.md +59 -0
  300. package/src/generators/flutter-app/docs/principles/stack/flutter/state-management.md +85 -0
  301. package/src/generators/flutter-app/docs/principles/stack/flutter/testing.md +86 -0
  302. package/src/generators/flutter-app/docs/principles/stack/flutter/widgets-and-composition.md +69 -0
  303. package/src/generators/flutter-app/files/.gitignore.template +30 -0
  304. package/src/generators/flutter-app/files/README.md.template +100 -0
  305. package/src/generators/flutter-app/files/analysis_options.yaml.template +18 -0
  306. package/src/generators/flutter-app/files/integration_test/app_test.dart.template +64 -0
  307. package/src/generators/flutter-app/files/lib/app.dart.template +24 -0
  308. package/src/generators/flutter-app/files/lib/config/app_config.dart +15 -0
  309. package/src/generators/flutter-app/files/lib/data/repositories/status_repository.dart +36 -0
  310. package/src/generators/flutter-app/files/lib/data/services/api_client.dart +71 -0
  311. package/src/generators/flutter-app/files/lib/domain/models/health_status.dart +23 -0
  312. package/src/generators/flutter-app/files/lib/main.dart +11 -0
  313. package/src/generators/flutter-app/files/lib/router.dart +23 -0
  314. package/src/generators/flutter-app/files/lib/ui/core/theme/app_theme.dart +110 -0
  315. package/src/generators/flutter-app/files/lib/ui/home/home_view.dart +89 -0
  316. package/src/generators/flutter-app/files/lib/ui/home/home_view_model.dart.template +38 -0
  317. package/src/generators/flutter-app/files/project.json.template +51 -0
  318. package/src/generators/flutter-app/files/pubspec.yaml.template +47 -0
  319. package/src/generators/flutter-app/files/test/api_client_test.dart.template +63 -0
  320. package/src/generators/flutter-app/files/test/fakes/fake_status_repository.dart.template +19 -0
  321. package/src/generators/flutter-app/files/test/home_view_test.dart.template +58 -0
  322. package/src/generators/flutter-app/files/tool/flutter_exec.sh.template +60 -0
  323. package/src/generators/flutter-app/generator.ts +362 -0
  324. package/src/generators/flutter-app/schema.json +23 -0
  325. package/src/generators/go-microservice/docs/principles/stack/go/concurrency.md +123 -0
  326. package/src/generators/go-microservice/docs/principles/stack/go/index.md +70 -0
  327. package/src/generators/go-microservice/docs/principles/stack/go/testing.md +168 -0
  328. package/src/generators/go-microservice/files/.air.toml.template +38 -0
  329. package/src/generators/go-microservice/files/.env.template +4 -0
  330. package/src/generators/go-microservice/files/.golangci.yml.template +82 -0
  331. package/src/generators/go-microservice/files/Dockerfile.dev.template +12 -0
  332. package/src/generators/go-microservice/files/asyncapi-pubsub.yaml.template +33 -0
  333. package/src/generators/go-microservice/files/asyncapi-ws.yaml.template +34 -0
  334. package/src/generators/go-microservice/files/cmd/api/main.go.template +149 -0
  335. package/src/generators/go-microservice/files/cmd/api/main_test.go.template +99 -0
  336. package/src/generators/go-microservice/files/cmd/worker/cleanup/main.go.template +39 -0
  337. package/src/generators/go-microservice/files/db/schema.sql.template +24 -0
  338. package/src/generators/go-microservice/files/go.mod.template +39 -0
  339. package/src/generators/go-microservice/files/internal/config/config.go.template +52 -0
  340. package/src/generators/go-microservice/files/internal/config/otel.go.template +93 -0
  341. package/src/generators/go-microservice/files/internal/core/domain/errors.go.template +16 -0
  342. package/src/generators/go-microservice/files/internal/core/domain/model.go.template +28 -0
  343. package/src/generators/go-microservice/files/internal/core/domain/user.go.template +13 -0
  344. package/src/generators/go-microservice/files/internal/core/pagination.go.template +16 -0
  345. package/src/generators/go-microservice/files/internal/core/service/app_service.go.template +79 -0
  346. package/src/generators/go-microservice/files/internal/core/service/event_hub.go.template +9 -0
  347. package/src/generators/go-microservice/files/internal/core/service/message_queue.go.template +10 -0
  348. package/src/generators/go-microservice/files/internal/core/service/outbox_repository.go.template +31 -0
  349. package/src/generators/go-microservice/files/internal/core/service/repository.go.template +23 -0
  350. package/src/generators/go-microservice/files/internal/core/service/user_repository.go.template +15 -0
  351. package/src/generators/go-microservice/files/internal/core/service/user_service.go.template +43 -0
  352. package/src/generators/go-microservice/files/internal/entrypoints/api/app_handler.go.template +108 -0
  353. package/src/generators/go-microservice/files/internal/entrypoints/api/auth_middleware_test.go.template +52 -0
  354. package/src/generators/go-microservice/files/internal/entrypoints/api/clerk_webhook.go.template +202 -0
  355. package/src/generators/go-microservice/files/internal/entrypoints/api/clerk_webhook_test.go.template +82 -0
  356. package/src/generators/go-microservice/files/internal/entrypoints/api/health_handler.go.template +80 -0
  357. package/src/generators/go-microservice/files/internal/entrypoints/api/idempotency/middleware.go.template +87 -0
  358. package/src/generators/go-microservice/files/internal/entrypoints/api/idempotency/middleware_test.go.template +76 -0
  359. package/src/generators/go-microservice/files/internal/entrypoints/api/idempotency/repository.go.template +37 -0
  360. package/src/generators/go-microservice/files/internal/entrypoints/api/middleware_auth.go.template +40 -0
  361. package/src/generators/go-microservice/files/internal/entrypoints/api/middleware_loadshed.go.template +38 -0
  362. package/src/generators/go-microservice/files/internal/entrypoints/api/middleware_logging.go.template +40 -0
  363. package/src/generators/go-microservice/files/internal/entrypoints/api/middleware_ratelimit.go.template +48 -0
  364. package/src/generators/go-microservice/files/internal/entrypoints/api/middleware_test.go.template +81 -0
  365. package/src/generators/go-microservice/files/internal/entrypoints/api/router.go.template +105 -0
  366. package/src/generators/go-microservice/files/internal/entrypoints/api/types.go.template +70 -0
  367. package/src/generators/go-microservice/files/internal/entrypoints/api/websocket_handler.go.template +39 -0
  368. package/src/generators/go-microservice/files/internal/httpclient/http_client.go.template +87 -0
  369. package/src/generators/go-microservice/files/internal/kafka/kafka.go.template +34 -0
  370. package/src/generators/go-microservice/files/internal/postgres/postgres.go.template +195 -0
  371. package/src/generators/go-microservice/files/internal/postgres/postgres_test.go.template +156 -0
  372. package/src/generators/go-microservice/files/internal/postgres/user_repository.go.template +56 -0
  373. package/src/generators/go-microservice/files/internal/pubsub/gcp_pubsub.go.template +35 -0
  374. package/src/generators/go-microservice/files/internal/websocket/client.go.template +151 -0
  375. package/src/generators/go-microservice/files/internal/websocket/hub.go.template +261 -0
  376. package/src/generators/go-microservice/files/scripts/apply-schema.sh.template +21 -0
  377. package/src/generators/go-microservice/files/tools/tools.go.template +10 -0
  378. package/src/generators/go-microservice/generator.ts +240 -0
  379. package/src/generators/go-microservice/schema.json +63 -0
  380. package/src/generators/nextjs-app/docs/principles/stack/typescript/frontend.md +65 -0
  381. package/src/generators/nextjs-app/files/.dockerignore.template +7 -0
  382. package/src/generators/nextjs-app/files/.env.example.template +24 -0
  383. package/src/generators/nextjs-app/files/.gitignore.template +5 -0
  384. package/src/generators/nextjs-app/files/Dockerfile +53 -0
  385. package/src/generators/nextjs-app/files/app/(auth)/sign-in/__sign-in__/page.tsx.template +9 -0
  386. package/src/generators/nextjs-app/files/app/(auth)/sign-up/__sign-up__/page.tsx.template +9 -0
  387. package/src/generators/nextjs-app/files/app/api/config/route.ts.template +39 -0
  388. package/src/generators/nextjs-app/files/app/api/healthz/route.test.ts +15 -0
  389. package/src/generators/nextjs-app/files/app/api/healthz/route.ts +5 -0
  390. package/src/generators/nextjs-app/files/app/api/proxy/__path__/route.test.ts.template +55 -0
  391. package/src/generators/nextjs-app/files/app/api/proxy/__path__/route.ts.template +126 -0
  392. package/src/generators/nextjs-app/files/app/error.tsx +39 -0
  393. package/src/generators/nextjs-app/files/app/global-error.tsx +68 -0
  394. package/src/generators/nextjs-app/files/app/globals.css +105 -0
  395. package/src/generators/nextjs-app/files/app/layout.tsx +59 -0
  396. package/src/generators/nextjs-app/files/app/loading.tsx +13 -0
  397. package/src/generators/nextjs-app/files/app/not-found.tsx +30 -0
  398. package/src/generators/nextjs-app/files/app/page.tsx +20 -0
  399. package/src/generators/nextjs-app/files/components/providers/default.tsx +19 -0
  400. package/src/generators/nextjs-app/files/components/providers/production.tsx +32 -0
  401. package/src/generators/nextjs-app/files/components/providers/telemetry.tsx +76 -0
  402. package/src/generators/nextjs-app/files/components/render-smoke.test.tsx +29 -0
  403. package/src/generators/nextjs-app/files/components/theme-provider.tsx +11 -0
  404. package/src/generators/nextjs-app/files/components.json +21 -0
  405. package/src/generators/nextjs-app/files/eslint.config.mjs +120 -0
  406. package/src/generators/nextjs-app/files/hooks/use-toast.ts +7 -0
  407. package/src/generators/nextjs-app/files/instrumentation.ts +90 -0
  408. package/src/generators/nextjs-app/files/lib/api/fetcher.ts.template +130 -0
  409. package/src/generators/nextjs-app/files/lib/config.ts +21 -0
  410. package/src/generators/nextjs-app/files/lib/logger.ts +29 -0
  411. package/src/generators/nextjs-app/files/lib/schemas/index.ts +19 -0
  412. package/src/generators/nextjs-app/files/lib/utils.ts +6 -0
  413. package/src/generators/nextjs-app/files/next.config.mjs +9 -0
  414. package/src/generators/nextjs-app/files/package.json +70 -0
  415. package/src/generators/nextjs-app/files/postcss.config.mjs +8 -0
  416. package/src/generators/nextjs-app/files/proxy.test.ts.template +30 -0
  417. package/src/generators/nextjs-app/files/proxy.ts +31 -0
  418. package/src/generators/nextjs-app/files/public/.gitkeep +1 -0
  419. package/src/generators/nextjs-app/files/tsconfig.json +42 -0
  420. package/src/generators/nextjs-app/files/vitest.config.mts +15 -0
  421. package/src/generators/nextjs-app/files/vitest.setup.ts +7 -0
  422. package/src/generators/nextjs-app/generator.ts +307 -0
  423. package/src/generators/nextjs-app/schema.json +44 -0
  424. package/src/generators/python-microservice/docs/principles/stack/python/async.md +168 -0
  425. package/src/generators/python-microservice/docs/principles/stack/python/documentation.md +240 -0
  426. package/src/generators/python-microservice/docs/principles/stack/python/mcp.md +147 -0
  427. package/src/generators/python-microservice/docs/principles/stack/python/resilience.md +193 -0
  428. package/src/generators/python-microservice/docs/principles/stack/python/testing.md +322 -0
  429. package/src/generators/python-microservice/files/.env.example.template +30 -0
  430. package/src/generators/python-microservice/files/Dockerfile.template +36 -0
  431. package/src/generators/python-microservice/files/db/schema.sql.template +19 -0
  432. package/src/generators/python-microservice/files/pyproject.toml.template +76 -0
  433. package/src/generators/python-microservice/files/scripts/apply-schema.sh.template +25 -0
  434. package/src/generators/python-microservice/files/src/__packageName__/adapters/comfyui.py.template +87 -0
  435. package/src/generators/python-microservice/files/src/__packageName__/adapters/config.py.template +48 -0
  436. package/src/generators/python-microservice/files/src/__packageName__/adapters/database.py.template +21 -0
  437. package/src/generators/python-microservice/files/src/__packageName__/adapters/message_queue.py.template +29 -0
  438. package/src/generators/python-microservice/files/src/__packageName__/adapters/repository.py.template +130 -0
  439. package/src/generators/python-microservice/files/src/__packageName__/adapters/telemetry.py.template +68 -0
  440. package/src/generators/python-microservice/files/src/__packageName__/adapters/websocket_hub.py.template +36 -0
  441. package/src/generators/python-microservice/files/src/__packageName__/core/domain/entities.py.template +22 -0
  442. package/src/generators/python-microservice/files/src/__packageName__/core/domain/exceptions.py.template +43 -0
  443. package/src/generators/python-microservice/files/src/__packageName__/core/ports.py.template +42 -0
  444. package/src/generators/python-microservice/files/src/__packageName__/core/service/example_service.py.template +68 -0
  445. package/src/generators/python-microservice/files/src/__packageName__/entrypoints/api/dependencies.py.template +50 -0
  446. package/src/generators/python-microservice/files/src/__packageName__/entrypoints/api/middleware.py.template +131 -0
  447. package/src/generators/python-microservice/files/src/__packageName__/entrypoints/api/router.py.template +37 -0
  448. package/src/generators/python-microservice/files/src/__packageName__/entrypoints/api/websocket_handler.py.template +20 -0
  449. package/src/generators/python-microservice/files/src/__packageName__/entrypoints/worker/cleanup.py.template +35 -0
  450. package/src/generators/python-microservice/files/src/__packageName__/entrypoints/worker/worker.py.template +28 -0
  451. package/src/generators/python-microservice/files/src/__packageName__/main.py.template +108 -0
  452. package/src/generators/python-microservice/files/tests/test_main.py.template +74 -0
  453. package/src/generators/python-microservice/files/tests/test_middleware.py.template +109 -0
  454. package/src/generators/python-microservice/files/tests/test_worker.py.template +16 -0
  455. package/src/generators/python-microservice/generator.ts +286 -0
  456. package/src/generators/python-microservice/schema.json +86 -0
  457. package/src/generators/shared/brand-tokens.ts +301 -0
  458. package/src/generators/shared/capabilities.ts +349 -0
  459. package/src/generators/shared/provenance.ts +61 -0
  460. package/src/generators/shared/scaffold-helpers.ts +309 -0
  461. package/src/generators/system-test-runner/NATIVE-CHECK-CONTRACT.md +20 -0
  462. package/src/generators/system-test-runner/files/tests/bets/.gitkeep +0 -0
  463. package/src/generators/system-test-runner/files/tests/bets/_archive/.gitkeep +0 -0
  464. package/src/generators/system-test-runner/files/tests/conftest.py.template +503 -0
  465. package/src/generators/system-test-runner/files/tests/pyproject.toml.template +20 -0
  466. package/src/generators/system-test-runner/files/tests/system/pages/__init__.py.template +9 -0
  467. package/src/generators/system-test-runner/files/tests/system/pages/base_page.py.template +36 -0
  468. package/src/generators/system-test-runner/files/tests/system/test_a11y_smoke.py.template +132 -0
  469. package/src/generators/system-test-runner/files/tests/system/test_contract_conformance.py.template +140 -0
  470. package/src/generators/system-test-runner/files/tests/system/test_layout_geometry.py.template +109 -0
  471. package/src/generators/system-test-runner/files/tests/system/test_render_smoke.py.template +257 -0
  472. package/src/generators/system-test-runner/files/tests/system/test_system.py.template +158 -0
  473. package/src/generators/system-test-runner/files/tests/system/test_token_conformance.py.template +206 -0
  474. package/src/generators/system-test-runner/files/tests/system/test_visual_regression.py.template +104 -0
  475. package/src/generators/system-test-runner/generator.ts +196 -0
  476. package/src/generators/system-test-runner/schema.json +24 -0
  477. package/src/generators/workspace-dev-cli/cli-src/build.mjs +42 -0
  478. package/src/generators/workspace-dev-cli/cli-src/dist/dev-bundle.js +2168 -0
  479. package/src/generators/workspace-dev-cli/cli-src/src/commands/bet.ts +442 -0
  480. package/src/generators/workspace-dev-cli/cli-src/src/commands/completion.ts +87 -0
  481. package/src/generators/workspace-dev-cli/cli-src/src/commands/doctor.ts +139 -0
  482. package/src/generators/workspace-dev-cli/cli-src/src/commands/lifecycle.ts +548 -0
  483. package/src/generators/workspace-dev-cli/cli-src/src/commands/quality.ts +127 -0
  484. package/src/generators/workspace-dev-cli/cli-src/src/commands/surface.ts +214 -0
  485. package/src/generators/workspace-dev-cli/cli-src/src/index.ts +127 -0
  486. package/src/generators/workspace-dev-cli/cli-src/src/registry.ts +194 -0
  487. package/src/generators/workspace-dev-cli/cli-src/src/theme/color.ts +130 -0
  488. package/src/generators/workspace-dev-cli/cli-src/src/theme/render.ts +158 -0
  489. package/src/generators/workspace-dev-cli/cli-src/src/theme/tokens.ts +122 -0
  490. package/src/generators/workspace-dev-cli/cli-src/src/util/context.ts +43 -0
  491. package/src/generators/workspace-dev-cli/cli-src/src/util/extensions.ts +99 -0
  492. package/src/generators/workspace-dev-cli/cli-src/src/util/paths.ts +46 -0
  493. package/src/generators/workspace-dev-cli/cli-src/src/util/proc.ts +106 -0
  494. package/src/generators/workspace-dev-cli/cli-src/src/util/prompt.ts +108 -0
  495. package/src/generators/workspace-dev-cli/cli-src/src/util/runners.ts +70 -0
  496. package/src/generators/workspace-dev-cli/cli-src/src/util/services.ts +221 -0
  497. package/src/generators/workspace-dev-cli/cli-src/src/util/version.ts +21 -0
  498. package/src/generators/workspace-dev-cli/cli-src/tsconfig.json +16 -0
  499. package/src/generators/workspace-dev-cli/files/.agents/skills/workspace-cli/SKILL.md.template +74 -0
  500. package/src/generators/workspace-dev-cli/files/dev.template +16 -0
  501. package/src/generators/workspace-dev-cli/files/docker-compose.yml.template +20 -0
  502. package/src/generators/workspace-dev-cli/files/scripts/cli/templates/milestone-test.pytmpl.template +46 -0
  503. package/src/generators/workspace-dev-cli/files/scripts/cli/templates/slice-test.pytmpl.template +38 -0
  504. package/src/generators/workspace-dev-cli/generator.ts +136 -0
  505. package/src/generators/workspace-dev-cli/schema.json +22 -0
  506. package/src/hidden-skills/code-intelligence.md +135 -0
  507. package/src/hidden-skills/groundwork-architect/SKILL.md +114 -0
  508. package/src/hidden-skills/groundwork-architect/references/agentic-systems.md +44 -0
  509. package/src/hidden-skills/groundwork-architect/references/ai-native-architecture.md +37 -0
  510. package/src/hidden-skills/groundwork-architect/references/api-and-contracts.md +45 -0
  511. package/src/hidden-skills/groundwork-architect/references/core-and-boundaries.md +45 -0
  512. package/src/hidden-skills/groundwork-architect/references/data-architecture.md +33 -0
  513. package/src/hidden-skills/groundwork-architect/references/decision-records.md +34 -0
  514. package/src/hidden-skills/groundwork-architect/references/durable-execution.md +45 -0
  515. package/src/hidden-skills/groundwork-architect/references/evolutionary-architecture.md +37 -0
  516. package/src/hidden-skills/groundwork-architect/references/identity-and-access.md +41 -0
  517. package/src/hidden-skills/groundwork-architect/references/integration-patterns.md +39 -0
  518. package/src/hidden-skills/groundwork-architect/references/observability.md +36 -0
  519. package/src/hidden-skills/groundwork-architect/references/performance-and-scale.md +41 -0
  520. package/src/hidden-skills/groundwork-architect/references/platform-and-delivery.md +47 -0
  521. package/src/hidden-skills/groundwork-architect/references/realtime-and-async.md +28 -0
  522. package/src/hidden-skills/groundwork-architect/references/reliability.md +31 -0
  523. package/src/hidden-skills/groundwork-architect/references/security-and-trust.md +47 -0
  524. package/src/hidden-skills/groundwork-architect/references/surface-architecture.md +40 -0
  525. package/src/hidden-skills/groundwork-architect/sync-anchor.md +34 -0
  526. package/src/hidden-skills/groundwork-architecture/architecture-template.md +50 -0
  527. package/src/hidden-skills/groundwork-architecture/instructions.md +139 -0
  528. package/src/hidden-skills/groundwork-architecture/phases/01-context-ingestion.md +18 -0
  529. package/src/hidden-skills/groundwork-architecture/phases/02-technical-constraints.md +27 -0
  530. package/src/hidden-skills/groundwork-architecture/phases/03-service-design.md +19 -0
  531. package/src/hidden-skills/groundwork-architecture/phases/04-data-flow-communication.md +23 -0
  532. package/src/hidden-skills/groundwork-architecture/phases/05-component-boundaries-contracts.md +17 -0
  533. package/src/hidden-skills/groundwork-architecture/phases/06-draft-review-present.md +38 -0
  534. package/src/hidden-skills/groundwork-architecture/phases/07-commit.md +33 -0
  535. package/src/hidden-skills/groundwork-architecture/templates/architecture-cache.md +43 -0
  536. package/src/hidden-skills/groundwork-architecture-extract/instructions.md +163 -0
  537. package/src/hidden-skills/groundwork-architecture-extract/templates/architecture-extract-cache.md +21 -0
  538. package/src/hidden-skills/groundwork-bet/briefs/acceptance-auditor.md +68 -0
  539. package/src/hidden-skills/groundwork-bet/briefs/blind-reviewer.md +56 -0
  540. package/src/hidden-skills/groundwork-bet/briefs/coverage-auditor.md +95 -0
  541. package/src/hidden-skills/groundwork-bet/briefs/edge-case-tracer.md +64 -0
  542. package/src/hidden-skills/groundwork-bet/briefs/experience-auditor.md +83 -0
  543. package/src/hidden-skills/groundwork-bet/briefs/slice-worker.md +257 -0
  544. package/src/hidden-skills/groundwork-bet/instructions.md +88 -0
  545. package/src/hidden-skills/groundwork-bet/templates/bet-progress-test.md +115 -0
  546. package/src/hidden-skills/groundwork-bet/templates/change-proposal.md +38 -0
  547. package/src/hidden-skills/groundwork-bet/templates/decomposition/meta.json +4 -0
  548. package/src/hidden-skills/groundwork-bet/templates/decomposition/milestone-index.md +31 -0
  549. package/src/hidden-skills/groundwork-bet/templates/decomposition/slice.md +31 -0
  550. package/src/hidden-skills/groundwork-bet/templates/pitch.md +45 -0
  551. package/src/hidden-skills/groundwork-bet/templates/technical-design/01-ui-design.md +51 -0
  552. package/src/hidden-skills/groundwork-bet/templates/technical-design/02-data-flows.md +36 -0
  553. package/src/hidden-skills/groundwork-bet/templates/technical-design/03-api-design.md +90 -0
  554. package/src/hidden-skills/groundwork-bet/templates/technical-design/04-data-design.md +29 -0
  555. package/src/hidden-skills/groundwork-bet/workflows/01-discovery.md +200 -0
  556. package/src/hidden-skills/groundwork-bet/workflows/02-design.md +178 -0
  557. package/src/hidden-skills/groundwork-bet/workflows/03-decomposition.md +242 -0
  558. package/src/hidden-skills/groundwork-bet/workflows/04-delivery.md +226 -0
  559. package/src/hidden-skills/groundwork-bet/workflows/05-validation.md +210 -0
  560. package/src/hidden-skills/groundwork-design-system/instructions.md +125 -0
  561. package/src/hidden-skills/groundwork-design-system/templates/brand-tokens.md +182 -0
  562. package/src/hidden-skills/groundwork-design-system/templates/design-system-cache.md +64 -0
  563. package/src/hidden-skills/groundwork-design-system/tracks/_foundation.md +136 -0
  564. package/src/hidden-skills/groundwork-design-system/tracks/agentic-protocol.md +269 -0
  565. package/src/hidden-skills/groundwork-design-system/tracks/cli.md +355 -0
  566. package/src/hidden-skills/groundwork-design-system/tracks/graphical-ui.md +330 -0
  567. package/src/hidden-skills/groundwork-design-system-extract/instructions.md +124 -0
  568. package/src/hidden-skills/groundwork-design-system-extract/templates/design-system-extract-cache.md +19 -0
  569. package/src/hidden-skills/groundwork-designer/SKILL.md +108 -0
  570. package/src/hidden-skills/groundwork-designer/references/accessibility.md +33 -0
  571. package/src/hidden-skills/groundwork-designer/references/ai-native-design.md +37 -0
  572. package/src/hidden-skills/groundwork-designer/references/design-review.md +29 -0
  573. package/src/hidden-skills/groundwork-designer/references/design-systems-and-tokens.md +33 -0
  574. package/src/hidden-skills/groundwork-designer/references/interaction-and-motion.md +37 -0
  575. package/src/hidden-skills/groundwork-designer/references/layout-and-space.md +33 -0
  576. package/src/hidden-skills/groundwork-designer/references/usability-and-ux.md +33 -0
  577. package/src/hidden-skills/groundwork-designer/references/visual-craft.md +49 -0
  578. package/src/hidden-skills/groundwork-designer/sync-anchor.md +20 -0
  579. package/src/hidden-skills/groundwork-doc-sync/instructions.md +100 -0
  580. package/src/hidden-skills/groundwork-elicit/instructions.md +66 -0
  581. package/src/hidden-skills/groundwork-elicit/methods.md +65 -0
  582. package/src/hidden-skills/groundwork-infra-adopt/instructions.md +168 -0
  583. package/src/hidden-skills/groundwork-infra-adopt/templates/infra-adopt-cache.md +21 -0
  584. package/src/hidden-skills/groundwork-mvp/instructions.md +223 -0
  585. package/src/hidden-skills/groundwork-mvp/templates/mvp-cache.md +9 -0
  586. package/src/hidden-skills/groundwork-patch/instructions.md +40 -0
  587. package/src/hidden-skills/groundwork-persona/instructions.md +65 -0
  588. package/src/hidden-skills/groundwork-product/SKILL.md +102 -0
  589. package/src/hidden-skills/groundwork-product/references/ai-native-product.md +45 -0
  590. package/src/hidden-skills/groundwork-product/references/discovery-and-opportunity.md +38 -0
  591. package/src/hidden-skills/groundwork-product/references/product-risks.md +52 -0
  592. package/src/hidden-skills/groundwork-product/references/requirements-and-specs.md +39 -0
  593. package/src/hidden-skills/groundwork-product/references/scope-and-sequencing.md +35 -0
  594. package/src/hidden-skills/groundwork-product/references/shaping-and-appetite.md +48 -0
  595. package/src/hidden-skills/groundwork-product/references/success-metrics-and-signals.md +37 -0
  596. package/src/hidden-skills/groundwork-product/sync-anchor.md +19 -0
  597. package/src/hidden-skills/groundwork-product-brief/instructions.md +231 -0
  598. package/src/hidden-skills/groundwork-product-brief-extract/instructions.md +139 -0
  599. package/src/hidden-skills/groundwork-product-brief-extract/templates/product-brief-extract-cache.md +17 -0
  600. package/src/hidden-skills/groundwork-review/checklists/architecture.md +93 -0
  601. package/src/hidden-skills/groundwork-review/checklists/bet-pitch.md +94 -0
  602. package/src/hidden-skills/groundwork-review/checklists/decomposition.md +135 -0
  603. package/src/hidden-skills/groundwork-review/checklists/design-system.md +85 -0
  604. package/src/hidden-skills/groundwork-review/checklists/domain-entity.md +66 -0
  605. package/src/hidden-skills/groundwork-review/checklists/implementation-readiness.md +47 -0
  606. package/src/hidden-skills/groundwork-review/checklists/infrastructure.md +68 -0
  607. package/src/hidden-skills/groundwork-review/checklists/maturity.md +71 -0
  608. package/src/hidden-skills/groundwork-review/checklists/product-brief.md +69 -0
  609. package/src/hidden-skills/groundwork-review/checklists/technical-design.md +112 -0
  610. package/src/hidden-skills/groundwork-review/instructions.md +181 -0
  611. package/src/hidden-skills/groundwork-scaffold/instructions.md +254 -0
  612. package/src/hidden-skills/groundwork-scaffold/phases/01-ingestion-service-mapping.md +87 -0
  613. package/src/hidden-skills/groundwork-scaffold/phases/02-scaffolding-execution.md +15 -0
  614. package/src/hidden-skills/groundwork-scaffold/phases/03-service-documentation-api-stubs.md +100 -0
  615. package/src/hidden-skills/groundwork-scaffold/phases/04-infrastructure-verification.md +17 -0
  616. package/src/hidden-skills/groundwork-scaffold/phases/05-draft-review.md +19 -0
  617. package/src/hidden-skills/groundwork-scaffold/phases/06-commit.md +19 -0
  618. package/src/hidden-skills/groundwork-scaffold/templates/scaffold-cache.md +23 -0
  619. package/src/hidden-skills/groundwork-scan/instructions.md +164 -0
  620. package/src/hidden-skills/groundwork-scan/references/digest-schema.md +66 -0
  621. package/src/hidden-skills/groundwork-scan/references/exclusions.md +44 -0
  622. package/src/hidden-skills/groundwork-scan/templates/architecture-findings.md +42 -0
  623. package/src/hidden-skills/groundwork-scan/templates/design-findings.md +23 -0
  624. package/src/hidden-skills/groundwork-scan/templates/overview.md +26 -0
  625. package/src/hidden-skills/groundwork-scan/templates/product-findings.md +23 -0
  626. package/src/hidden-skills/groundwork-scan/templates/scan-state.json +19 -0
  627. package/src/hidden-skills/groundwork-stack-forge/instructions.md +150 -0
  628. package/src/hidden-skills/groundwork-stack-forge/references/authoring-engineer-skills.md +107 -0
  629. package/src/hidden-skills/groundwork-surface-activation/instructions.md +138 -0
  630. package/src/hidden-skills/groundwork-update/briefs/reconcile-worker.md +196 -0
  631. package/src/hidden-skills/groundwork-update/instructions.md +200 -0
  632. package/src/hidden-skills/groundwork-writer/SKILL.md +278 -0
  633. package/src/hidden-skills/maturity-model.md +125 -0
  634. package/src/hidden-skills/operating-contract.md +400 -0
  635. package/src/hidden-skills/repo-map-schema.md +90 -0
  636. package/src/hidden-skills/templates/adr.md +57 -0
  637. package/src/hidden-skills/templates/capability-ports.md +71 -0
  638. package/src/hidden-skills/templates/discovery-notes.md +33 -0
  639. package/src/hidden-skills/templates/domain-entity.md +80 -0
  640. package/src/hidden-skills/templates/gap-ledger.md +21 -0
  641. package/src/hidden-skills/templates/handoff.md +37 -0
  642. package/src/hidden-skills/templates/maturity.md +39 -0
  643. package/src/hidden-skills/templates/surfaces.md +207 -0
  644. package/src/skills/groundwork-check/SKILL.md +56 -0
  645. package/src/skills/groundwork-check/instructions.md +70 -0
  646. package/src/skills/groundwork-orchestrator/SKILL.md +176 -0
  647. package/src/skills/groundwork-orchestrator/workflow-index.md +50 -0
@@ -0,0 +1,80 @@
1
+ # Performance & Reliability
2
+
3
+ ## Table of Contents
4
+ - [Where a Desktop App Spends Its Budget](#where-a-desktop-app-spends-its-budget)
5
+ - [The Main Process Is Never Blocked](#the-main-process-is-never-blocked)
6
+ - [Renderer Performance Is Web Performance](#renderer-performance-is-web-performance)
7
+ - [IPC Efficiency](#ipc-efficiency)
8
+ - [Memory Across Long-Lived Windows](#memory-across-long-lived-windows)
9
+ - [Cold Boot](#cold-boot)
10
+ - [Reliability of the IPC Layer](#reliability-of-the-ipc-layer)
11
+ - [A Backend That Is Unreachable](#a-backend-that-is-unreachable)
12
+ - [What Lives in the Core, Not Here](#what-lives-in-the-core-not-here)
13
+ - [Anti-Patterns](#anti-patterns)
14
+
15
+ ---
16
+
17
+ ## Where a Desktop App Spends Its Budget
18
+
19
+ Performance is a budget spent deliberately, allocated top-down and measured at the tail, not the average (`docs/principles/quality/performance.md`). A desktop shell spends it across three surfaces with different failure modes: the **main process**, where blocking work freezes every window at once; the **renderer**, which is a web app and pays the web's bundle and frame costs; and the **bridge** between them, where a chatty IPC pattern turns a cheap call into a per-frame tax. The process boundaries that contain these costs are the process-model's subject (`references/process-model.md`); this is the performance and reliability lens on them.
20
+
21
+ ## The Main Process Is Never Blocked
22
+
23
+ One main process serves every window. A synchronous parse, hash, or file walk on it freezes all of them simultaneously — there is no per-window isolation to fall back on (`references/process-model.md`). The test for any main-process code is the one the process model states: **can this take longer than a frame?** Reading a config file or registering a handler — no, main is fine. Parsing a large file, indexing, image work — yes, and it goes to a `utilityProcess` with its ports wired renderer↔utility directly so the heavy traffic never transits or blocks main (`references/process-model.md`).
24
+
25
+ `sendSync` over IPC is forbidden for the same reason from the other side: it blocks the renderer's event loop for the full round trip (`references/ipc-contracts.md`). Every privileged call is an async `invoke`.
26
+
27
+ ## Renderer Performance Is Web Performance
28
+
29
+ The renderer is a normal Vite + React app, so the web stack's performance discipline applies unchanged: lazy-load routes and heavy components behind code-split boundaries, keep the bundle lean, and gate deterministic budgets — bundle size, not noisy wall-clock — in CI (`docs/principles/quality/performance.md`). Two desktop-specific notes:
30
+
31
+ - **The bundle is local, but it is not free.** It loads from the bundle protocol rather than a network, so transfer cost is near zero — but parse and execute cost is not, and a bloated main chunk still slows cold boot. Code-split anyway.
32
+ - **One window is one renderer.** A second window (settings, about) is a second renderer with its own bundle and memory; share chunks through the build, and do not spawn windows the app does not need.
33
+
34
+ ## IPC Efficiency
35
+
36
+ The bridge is a serialization boundary: every `invoke` structured-clones its arguments and result across the process line. That cost is invisible per call and ruinous in a loop. Two rules keep it cheap:
37
+
38
+ - **Never call the bridge in a hot loop.** A per-row or per-frame `invoke` pays the clone cost every iteration. Fetch the collection in one call and iterate in the renderer.
39
+ - **Batch and coarsen the contract.** Design channels around the renderer's actual unit of work — `items:list` returning a page, not `item:get` called N times. A coarse channel is one clone; a chatty one is N (`references/ipc-contracts.md`).
40
+
41
+ Push channels (main → renderer) carry coarse events too: a file-watcher that fires per-keystroke should coalesce before it `webContents.send`s, so the renderer invalidates once, not a hundred times (`references/ipc-contracts.md`).
42
+
43
+ ## Memory Across Long-Lived Windows
44
+
45
+ A desktop window lives for hours or days, so a leak that a page reload would have swept never gets swept. The discipline is lifecycle hygiene at the boundaries:
46
+
47
+ - **Every subscription returns its unsubscribe, and the renderer calls it.** A bridge push subscription returns a remover; an effect that registers one must return it for cleanup, or the listener and its closure outlive the component (`references/ipc-contracts.md`).
48
+ - **Bound caches.** TanStack Query's cache is bounded by its garbage-collection time; an ad-hoc `Map` accumulating per-result entries is not — it is the unbounded queue the performance canon rejects, in client form.
49
+ - **Tear down `utilityProcess` workers** when their work is done. A spawned worker that is never killed is retained memory and a retained handle.
50
+
51
+ ## Cold Boot
52
+
53
+ Time-to-first-window is the desktop app's first impression. Keep main's startup to the four things it must do — register the protocol, apply the security policy, register handlers, create the window — and defer everything else until after the window is visible (`references/process-model.md`). Show the window with a skeleton and let data arrive into it over IPC; do not block window creation on a gateway call or a heavy index. Build the index in a `utilityProcess` after the first frame, not before it.
54
+
55
+ ## Reliability of the IPC Layer
56
+
57
+ Reliability is designed in, not hoped for, and for the renderer the IPC seam is the dependency that fails (`docs/principles/quality/reliability.md`). TanStack Query is the renderer's resilience layer over that seam, exactly as it would be over HTTP: its `queryFn`s call the typed bridge, and its caching, retry, and invalidation give the renderer bounded retries with backoff and a served-from-cache fallback for free (`references/ipc-contracts.md`). Configure retry to back off and to retry only transient failures — a rejected privileged call from a validation failure is a bug or an attack, not a state to retry into (`references/ipc-contracts.md`). A failed `invoke` rejects the query, and the component renders that error state rather than letting the rejection escape.
58
+
59
+ ## A Backend That Is Unreachable
60
+
61
+ When the workspace has a hosted core, main holds the HTTP client and the renderer reaches the gateway only through main (`references/ipc-contracts.md`). That places the gateway's reliability in main, and the discipline is the one the resilience patterns describe at any client edge:
62
+
63
+ - **Timeout and bounded retry on main's HTTP client.** Every outbound call to the gateway has a timeout and a jittered, bounded retry for transient failures — a hung gateway connection otherwise stalls the IPC call that is waiting on it.
64
+ - **Map unreachable to a domain result.** Main returns a typed "unreachable" result the renderer can render, not a raw thrown error — the gateway being down is an expected state with a designed UI, decided at design time alongside the happy path (`docs/principles/quality/reliability.md`).
65
+ - **Degrade, do not blank.** A feature whose gateway data is unavailable serves cached data or an explicit unavailable state while the rest of the app works; the window stays usable when one capability is down.
66
+
67
+ ## What Lives in the Core, Not Here
68
+
69
+ Server reliability patterns belong to the capability core and its services, not the desktop shell (`docs/principles/quality/reliability.md`). **SLOs and error budgets** are defined and measured server-side. **Load shedding** protects the server from overload regardless of how clients behave — a backstop the server owns, not something a client implements for it. **Server-side circuit breakers** are earned against slow downstreams and tuned against real traffic in the core. The client's share is the right amount of resilience at the edge: timeout, bounded retry, a cache fallback, and a designed degraded state. The business rules about a failure — recoverability, retry budget, what a result means — are proven in the core, and the renderer renders the result.
70
+
71
+ ## Anti-Patterns
72
+
73
+ - **Blocking the main process.** A synchronous parse or hash freezes every window — `utilityProcess` it.
74
+ - **`sendSync`.** Blocks the renderer event loop for the round trip; always async.
75
+ - **IPC in a hot loop.** Per-row or per-frame `invoke` pays the clone cost every iteration — fetch once, iterate locally.
76
+ - **Chatty fine-grained channels.** N calls where one coarse channel would do; design channels around the renderer's unit of work.
77
+ - **Leaked subscriptions.** A push listener registered without its unsubscribe outlives the component across a multi-day session.
78
+ - **Unbounded ad-hoc caches.** A `Map` that only grows is the latency bomb in client form; let TanStack Query bound it.
79
+ - **Blank on unreachable.** No designed state for a down gateway ships a frozen or empty window.
80
+ - **Reimplementing server reliability in the shell.** Load shedding, SLOs, and reflexive circuit breakers live in the core.
@@ -0,0 +1,94 @@
1
+ # Process Model
2
+
3
+ ## Table of Contents
4
+ - [The Three Processes](#the-three-processes)
5
+ - [Main Is an Orchestrator](#main-is-an-orchestrator)
6
+ - [The Enforced Folder Boundary](#the-enforced-folder-boundary)
7
+ - [Per-Process Compiler Contexts](#per-process-compiler-contexts)
8
+ - [utilityProcess for Heavy Work](#utilityprocess-for-heavy-work)
9
+ - [Shared Code Crosses as Types Only](#shared-code-crosses-as-types-only)
10
+ - [Adding a Window](#adding-a-window)
11
+
12
+ ---
13
+
14
+ ## The Three Processes
15
+
16
+ | Process | Runs | May import | Job |
17
+ |---|---|---|---|
18
+ | **main** (`src/main/`) | Node + Electron main APIs | anything | Orchestration: windows, security policy, IPC handlers, OS integration |
19
+ | **preload** (`src/preload/`) | sandboxed bridge context | `electron` (bridge subset) + shared types | Expose the narrow `window.api`; nothing else |
20
+ | **renderer** (`src/renderer/`) | Chromium, sandboxed, Node-free | web code + shared types | The UI — a normal Vite + React web app |
21
+
22
+ `src/shared/` is not a process: it is the contract-type module all three import (types only — see below).
23
+
24
+ This is the VS Code / Slack / Signal shape. It exists because a renderer with Node access turns any XSS into machine compromise, and a busy main process freezes every window at once.
25
+
26
+ ## Main Is an Orchestrator
27
+
28
+ `src/main/index.ts` does four things: registers the bundle protocol, applies the security policy, registers IPC handlers, creates windows. Everything else is delegation.
29
+
30
+ The test for new main-process code: **can this take longer than a frame?** Parsing a large file, hashing, indexing, image work — yes, so it goes to a `utilityProcess`. Reading a config file, showing a dialog, registering a handler — no, main is fine.
31
+
32
+ Keep main's modules pure where possible: `src/main/policy.ts` holds the security rules with **no Electron imports**, which is why `policy.test.ts` runs in plain Node. When adding privileged logic, split it the same way — decision (pure module, unit-tested) from wiring (thin Electron glue in `index.ts`/`ipc.ts`).
33
+
34
+ ## The Enforced Folder Boundary
35
+
36
+ ```
37
+ src/
38
+ main/ # privileged orchestration
39
+ preload/ # the bridge — contextBridge only
40
+ renderer/ # the web app — no Node, no Electron
41
+ shared/ # IPC contract types — types only
42
+ ```
43
+
44
+ The split is physical and lint-enforced (the Slack pattern): `eslint.config.mjs` carries `no-restricted-imports` blocks that fail the build when `src/renderer/` or `src/shared/` imports `electron` or a Node built-in. The rule exists because the boundary erodes one convenient import at a time, and each erosion is invisible until it is a sandbox hole.
45
+
46
+ Never suppress the rule. If the renderer "needs" a Node capability, that is a new IPC channel (`references/ipc-contracts.md`), not an exemption.
47
+
48
+ ## Per-Process Compiler Contexts
49
+
50
+ Two tsconfigs police the boundary alongside the lint:
51
+
52
+ - `tsconfig.node.json` — main, preload, shared, configs, smoke tests. `types: ["node"]`, **no DOM lib**.
53
+ - `tsconfig.web.json` — renderer + shared. DOM lib, `jsx: react-jsx`, **no Node types**.
54
+
55
+ `npm run typecheck` (the `typecheck` Nx target) runs both. A renderer file that touches `process` or a main file that touches `document` is a compile error, not a code-review catch. When adding files, make sure they land in the right include set — a file checked by neither tsconfig is unverified code.
56
+
57
+ ## utilityProcess for Heavy Work
58
+
59
+ `utilityProcess` is the documented home for CPU-intensive tasks, untrusted services, and crash-prone components — a `child_process.fork` equivalent launched through Chromium's Services API, with Node enabled and MessagePort support.
60
+
61
+ The pattern (VS Code's extension host is the reference):
62
+
63
+ ```ts
64
+ // main: spawn and wire ports renderer↔utility DIRECTLY
65
+ import { utilityProcess, MessageChannelMain } from 'electron';
66
+
67
+ const worker = utilityProcess.fork(
68
+ new URL('./indexer.js?modulePath', import.meta.url).pathname,
69
+ );
70
+ const { port1, port2 } = new MessageChannelMain();
71
+ worker.postMessage({ type: 'port' }, [port1]);
72
+ window.webContents.postMessage('indexer:port', null, [port2]);
73
+ ```
74
+
75
+ The direct port wiring matters: heavy traffic never transits — or blocks — main. electron-vite builds utility workers first-class via the `?modulePath` import suffix.
76
+
77
+ Use `utilityProcess`, not `child_process.fork`, for anything that talks to a renderer: fork has no port wiring and no Services API integration. Plugin-style or untrusted code never runs in the renderer — a utility process contains its crash or compromise.
78
+
79
+ ## Shared Code Crosses as Types Only
80
+
81
+ `src/shared/ipc.ts` carries the channel map and payload types both sides import. It must contain **no runtime behaviour** — a "utils" module imported by main and renderer drags Node-flavoured code toward the sandbox and couples both sides' upgrade paths. The lint boundary enforces the import side; review enforces the no-runtime side: if a shared file gains a function body that does more than type-level work, move it.
82
+
83
+ Constants are the one nuance: a string-literal channel name in the contract type is fine; a shared object of behaviourful helpers is not.
84
+
85
+ ## Adding a Window
86
+
87
+ Every window — main, settings, about, anything — gets the identical hardened construction:
88
+
89
+ 1. Build it in `src/main/index.ts` (or a sibling module main imports) with the full `webPreferences` quartet and the shared preload.
90
+ 2. Load content only from the bundle protocol or the dev server; never a remote URL, never `file://`.
91
+ 3. The global policy (`applySecurityPolicy`) already covers it — permission denial and navigation restriction hook `web-contents-created`, so they apply to new windows automatically. Do not bypass that path with per-window overrides.
92
+ 4. If the window needs new capabilities, they arrive as IPC channels, not as loosened `webPreferences`.
93
+
94
+ A second renderer entry point goes in `electron.vite.config.ts`'s renderer `rollupOptions.input` map, with its own HTML file carrying the same CSP.
@@ -0,0 +1,107 @@
1
+ # Security
2
+
3
+ ## Table of Contents
4
+ - [The Posture](#the-posture)
5
+ - [The Hardened Quartet](#the-hardened-quartet)
6
+ - [Permissions: Denied by Default](#permissions-denied-by-default)
7
+ - [Navigation and window.open](#navigation-and-windowopen)
8
+ - [shell.openExternal Allowlist](#shellopenexternal-allowlist)
9
+ - [The Custom Protocol](#the-custom-protocol)
10
+ - [Content-Security-Policy](#content-security-policy)
11
+ - [Fuses](#fuses)
12
+ - [The Currency Window](#the-currency-window)
13
+ - [Security Review Checklist](#security-review-checklist)
14
+
15
+ ---
16
+
17
+ ## The Posture
18
+
19
+ An Electron app is a browser with a privileged process attached: every web vulnerability becomes a local-machine vulnerability the moment a boundary control is loosened. The generated app ships with the full baseline **enforced in code** — `src/main/index.ts` (wiring), `src/main/policy.ts` (rules, pure and unit-tested), `forge.config.ts` (fuses). This reference explains each control so changes preserve it; the canonical statement is `docs/principles/stack/electron/security.md`.
20
+
21
+ The controls fail **as a set**: enabling `nodeIntegration` silently disables the sandbox for that renderer. There is no safe partial loosening.
22
+
23
+ ## The Hardened Quartet
24
+
25
+ ```ts
26
+ webPreferences: {
27
+ contextIsolation: true, // never off
28
+ sandbox: true, // never off
29
+ nodeIntegration: false, // never on
30
+ webSecurity: true, // never off — not even "temporarily for dev"
31
+ },
32
+ ```
33
+
34
+ These are Electron's own defaults, restated explicitly so no upgrade, flag, or debugging session changes them silently. They apply to **every** window (`references/process-model.md` → Adding a Window). The framework's generation tests assert the generated main never contains a loosened value — treat the same assertion as a review rule for hand-written changes.
35
+
36
+ `webSecurity: false` and `allowRunningInsecureContent` as debugging crutches are how production apps ship with the front door open. Fix the content.
37
+
38
+ ## Permissions: Denied by Default
39
+
40
+ ```ts
41
+ session.defaultSession.setPermissionRequestHandler((_wc, _permission, callback) => {
42
+ callback(false);
43
+ });
44
+ ```
45
+
46
+ Electron's default **grants** permissions (camera, microphone, geolocation) to any content that asks; in a desktop app, content that asks unexpectedly is the attack. Granting a permission is a product decision: extend the handler with an explicit `permission === '...'` allowlist and a comment recording why — never remove the handler.
47
+
48
+ ## Navigation and window.open
49
+
50
+ Two hooks in `applySecurityPolicy`, registered on `web-contents-created` so they cover every window automatically:
51
+
52
+ - **`will-navigate`** blocks navigation unless `isTrustedNavigationTarget` allows it — the bundle protocol always, the dev-server origin only while developing. A renderer that can reach an attacker's page hands the attacker a privileged-adjacent context.
53
+ - **`setWindowOpenHandler`** returns `{ action: 'deny' }` unconditionally; allowlisted https links are handed to `shell.openExternal` (the OS browser) instead of becoming Electron windows.
54
+
55
+ New in-app routes need no changes (the SPA never navigates the top frame). A legitimate new navigation target (e.g. an OAuth window) is a change to `policy.ts` with a test in `policy.test.ts`, not an inline exemption.
56
+
57
+ ## shell.openExternal Allowlist
58
+
59
+ `shell.openExternal` launches whatever the OS associates with the input — `file:`, `smb:`, custom scheme handlers, anything. It is therefore only ever called on URLs that pass `isAllowedExternalUrl` (https-only baseline). Widening the allowlist is a recorded decision in `policy.ts` + test, per scheme, never a pass-through. The renderer can request it through the validated `shell:open-external` channel; it cannot reach `shell` any other way.
60
+
61
+ ## The Custom Protocol
62
+
63
+ Packaged app content is served over `app://` (`registerBundleProtocol`), never `file://` — `file://` grants origin-level access to the filesystem namespace and breaks standard web security semantics. The handler resolves requests against the built renderer directory and rejects anything failing the `isContainedPath` traversal check.
64
+
65
+ In dev, electron-vite serves the renderer over `ELECTRON_RENDERER_URL`; the policy treats that origin as trusted only when the env var exists (i.e. never in a packaged build).
66
+
67
+ ## Content-Security-Policy
68
+
69
+ `src/renderer/index.html` ships a strict CSP via `<meta http-equiv>` (the right mechanism for custom-protocol content):
70
+
71
+ ```
72
+ default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:
73
+ ```
74
+
75
+ This strictness is achievable because **all privileged data flows over IPC, not fetch** — the renderer has no business calling the network. Keep it that way: a feature that "needs" `connect-src` should route through main (`references/ipc-contracts.md` → Core Access). A CSP containing `*` is no CSP. `style-src 'unsafe-inline'` carries Vite's dev-mode style injection; scripts stay `'self'`-only in every mode.
76
+
77
+ ## Fuses
78
+
79
+ Fuses are build-time switches baked into the binary — runtime config cannot re-enable what a fuse removed. They are flipped inside the Forge packaging step (`forge.config.ts`), so an unfused binary cannot reach a release channel:
80
+
81
+ | Fuse | Setting | Why |
82
+ |---|---|---|
83
+ | `RunAsNode` | **off** | The shipped binary must not double as a general-purpose Node executable |
84
+ | `EnableNodeOptionsEnvironmentVariable` | **off** | Blocks `NODE_OPTIONS` injection |
85
+ | `EnableCookieEncryption` | **on** | At-rest cookie protection |
86
+ | `EnableEmbeddedAsarIntegrityValidation` | **on** | CVE-2025-55305: heap-snapshot tampering backdoored Signal/Slack/1Password past code-integrity checks; ASAR integrity is the fix |
87
+ | `OnlyLoadAppFromAsar` | **on** | Companion to integrity validation — no side-loaded app directory |
88
+ | `nodeCliInspect` | **on, deliberately** | Flipping it off breaks Playwright's `_electron` launch; the agent-closable smoke loop outranks the marginal hardening |
89
+
90
+ Post-CVE-2025-55305, shipping without ASAR integrity is called out as a defect, not a hardening opportunity. Do not move fuse flipping out of the packaging pipeline into a checklist.
91
+
92
+ ## The Currency Window
93
+
94
+ Only the latest **three** Electron majors receive security patches, and a new major ships every 8 weeks — Chromium CVEs land in the shipped app on Chromium's schedule, not the team's. An app more than three majors behind is running known-exploitable browser bugs. Treat the upgrade as scheduled work with dependency-CVE priority; verify the Playwright driver pairing in CI when bumping (driver/Electron launch regressions have happened — e.g. the 36.x launch failure fixed in 37).
95
+
96
+ ## Security Review Checklist
97
+
98
+ For any PR touching `src/main/`, `src/preload/`, `forge.config.ts`, or `index.html`:
99
+
100
+ - [ ] Quartet untouched in every `BrowserWindow`
101
+ - [ ] No new `ipcMain.handle` without sender validation; zod on non-trivial payloads
102
+ - [ ] Preload still exposes only purpose-named methods — no `ipcRenderer`, no generic passthrough
103
+ - [ ] Navigation/permission/external-URL changes live in `policy.ts` with tests
104
+ - [ ] CSP not weakened; no new `connect-src`
105
+ - [ ] Content still served over `app://`
106
+ - [ ] Fuse config unchanged (or the change is a recorded decision)
107
+ - [ ] No renderer/shared import of Electron or Node (lint must stay green without suppressions)
@@ -0,0 +1,129 @@
1
+ # Testing & Smoke
2
+
3
+ ## Table of Contents
4
+ - [The Three Tiers](#the-three-tiers)
5
+ - [Unit: Node Project (Main Policy)](#unit-node-project-main-policy)
6
+ - [Unit: Renderer Project (Fake the Bridge)](#unit-renderer-project-fake-the-bridge)
7
+ - [The Playwright _electron Smoke](#the-playwright-_electron-smoke)
8
+ - [_electron Patterns](#_electron-patterns)
9
+ - [CI: xvfb and Skip-with-Reason](#ci-xvfb-and-skip-with-reason)
10
+ - [Keeping the Smoke Thin](#keeping-the-smoke-thin)
11
+ - [Test Commands](#test-commands)
12
+
13
+ ---
14
+
15
+ ## The Three Tiers
16
+
17
+ | Tier | Tool | Environment | Proves |
18
+ |---|---|---|---|
19
+ | Unit (main) | vitest, `main` project | plain Node | The pure security/policy rules |
20
+ | Unit (renderer) | vitest, `renderer` project | jsdom, bridge faked | Components against the bridge contract |
21
+ | Smoke (boot) | Playwright `_electron` | the real built app | Boot, rendering, IPC wiring, theme push |
22
+
23
+ This maps onto the multi-surface verification contract: generation (snapshot, framework-side), compilation (`tsc` + lint), boot (the smoke). Business rules are **not** on this list — they are proven once at the capability core's contract; surface tests assert wiring and rendering only.
24
+
25
+ These tiers are the Electron idiom of the framework testing canon (`docs/principles/foundations/testing.md`): the renderer and main unit tests are the fat middle the canon's honeycomb puts the weight on, and the boot smoke is the thin top — a fat smoke is the fat-integration-suite antipattern wearing a desktop coat. When this file and the canon disagree, the canon wins and this file is the one to fix.
26
+
27
+ `vitest.config.ts` defines the two unit projects with per-process environments. Test placement follows the process split: `src/main/**/*.test.ts` runs in Node, `src/renderer/**/*.test.tsx` runs in jsdom. A test that needs the wrong environment is in the wrong process.
28
+
29
+ ## Unit: Node Project (Main Policy)
30
+
31
+ Main's testable logic lives in pure modules (`policy.ts` — no Electron imports), so it runs in plain Node with zero mocking:
32
+
33
+ ```ts
34
+ it.each(['http://example.com', 'file:///etc/passwd', 'javascript:alert(1)'])(
35
+ 'rejects %s', (url) => expect(isAllowedExternalUrl(url)).toBe(false),
36
+ );
37
+ ```
38
+
39
+ When adding privileged logic, keep this shape: decision in a pure module + test; wiring in the thin Electron glue, proven by the smoke. Do not import `electron` in a vitest file — in plain Node the module resolves to the binary path string, not the API, and mocking the whole surface buys nothing the pure-module split doesn't buy better.
40
+
41
+ ## Unit: Renderer Project (Fake the Bridge)
42
+
43
+ The renderer's platform surface is `window.api`, so tests fake exactly that seam:
44
+
45
+ ```tsx
46
+ const fakeApi: RendererApi = {
47
+ getStatus: async () => ({ status: 'ok', version: '0.1.0-test', platform: 'test' }),
48
+ openExternal: async () => ({ opened: false }),
49
+ onThemeChanged: () => () => undefined,
50
+ };
51
+ beforeEach(() => {
52
+ Object.defineProperty(window, 'api', { value: fakeApi, configurable: true });
53
+ });
54
+ ```
55
+
56
+ Typing the fake as `RendererApi` keeps it honest: a contract change breaks the fake at compile time. Async UI rule: query-backed components render their pending state first — `await screen.findByText(...)` past it; asserting on the container immediately races the resolution.
57
+
58
+ Everything else about component testing — Testing Library idiom, what to assert, accessibility queries — is the web stack's, unchanged: `groundwork-nextjs-engineer/references/testing.md`.
59
+
60
+ ## The Playwright _electron Smoke
61
+
62
+ Playwright's Electron support is officially "experimental" but is the de-facto standard (VS Code tests with it); it is the reason GroundWork picked this stack — the strongest agent-closable loop of any desktop option. The driver needs **no browser downloads** (`playwright install` is unnecessary): it launches the app's own Electron binary.
63
+
64
+ The generated smoke (`tests/smoke/app.spec.ts`) is the canonical shape: launch the **built** app, first window, title + rendered heading, one IPC round-trip, the theme push channel, one main-process assertion.
65
+
66
+ ## _electron Patterns
67
+
68
+ ```ts
69
+ import { _electron as electron } from 'playwright';
70
+
71
+ const app = await electron.launch({ args: ['out/main/index.js'] });
72
+ const page = await app.firstWindow(); // a normal Playwright Page
73
+ ```
74
+
75
+ - **Renderer assertions** — everything Playwright can do to a web page: `expect(page).toHaveTitle(...)`, `getByRole`, `getByTestId`, screenshots.
76
+ - **Bridge round-trips** — `page.evaluate(() => globalThis.api.foo())` exercises preload + sender validation + handler end-to-end. (Cast `globalThis`; the smoke compiles under the node tsconfig, which has no DOM types.)
77
+ - **Main-process assertions** — `app.evaluate(({ app, nativeTheme }) => ...)` runs **inside main** with the electron module injected: assert on windows, theme state, app metadata. This hook is unique to Electron among desktop options.
78
+ - **Push-channel proof** — assert the DOM consequence, e.g. `toHaveAttribute('data-theme', /^(light|dark)$/)` after main's initial broadcast.
79
+ - **Always `await app.close()`** in a `finally` — a leaked Electron process wedges CI workers.
80
+ - Launching a **packaged** binary instead of the dev build: `electron.launch({ executablePath })` — worth one lane before releases; the day-to-day smoke uses the built output for speed.
81
+ - Driver/runtime pairings can regress across Electron majors (the 36.x `Process failed to launch!` Linux regression, fixed in 37) — when a major bump breaks launch, check the pairing before debugging the app.
82
+
83
+ ## CI: xvfb and Skip-with-Reason
84
+
85
+ Electron is never truly headless — Linux CI needs a display server. The `smoke` target routes through `tool/electron_exec.sh`, which:
86
+
87
+ 1. Verifies `node_modules` and the Electron binary exist (bootstrap state) — else **"tier skipped"** with the bootstrap command.
88
+ 2. On Linux with no `DISPLAY`/`WAYLAND_DISPLAY`: wraps the run in `xvfb-run --auto-servernum` when available — else **"smoke tier skipped"** naming xvfb.
89
+ 3. Builds, then runs `playwright test`.
90
+
91
+ The contract is *skipped-with-reason, never silently green*: a missing toolchain degrades exactly the way a missing Docker daemon degrades `./dev`. CI installs `xvfb` to run the lane for real; macOS/Windows runners and desktop sessions need no wrapper. Artifacts on failure (screenshot, trace) are configured in `playwright.config.ts`.
92
+
93
+ ## Keeping the Smoke Thin
94
+
95
+ Boot minutes are this stack's expensive test currency. The smoke proves the app **boots and is wired** — it is not an E2E suite:
96
+
97
+ - One spec, happy path, serial (`workers: 1`).
98
+ - New IPC channels get unit tests (policy + renderer fake) by default; extend the smoke only when a channel's *wiring* is novel (new push mechanism, new window).
99
+ - Feature behaviour belongs in renderer unit tests; business rules belong at the core's contract. A fat smoke is the fat-integration-suite antipattern wearing a desktop coat.
100
+
101
+ ## Mutation Testing — the assertion-quality read-out
102
+
103
+ The main-process policy modules (`policy.ts` — URL allow-listing, sender validation, IPC guards) are dense security logic, exactly where a covered-but-unasserted line is a real risk. **StrykerJS** is the read-out that proves those tests bite: it mutates the rule and confirms a test fails. Treat it as a **signal, never a gate**, run it incrementally on changed code (`stryker run --incremental`), and point it at the pure policy modules first — a surviving mutant on a security rule is the missing assertion to add. The renderer's pure logic earns the same spot check; the Electron glue and the smoke do not (they prove wiring, not branches).
104
+
105
+ ## Generate the Inputs You Can't Enumerate
106
+
107
+ The same pure policy modules are the prime target for property-based testing (canon principle 7). A hand-written `it.each` list of malicious URLs checks the cases you thought of; an allow-list rule that ingests untrusted strings is exactly where the dangerous input is the one you didn't enumerate. Drive `isAllowedExternalUrl` and sender-validation guards with **`fast-check`** generators — arbitrary URLs, schemes, and host shapes — and assert the security invariant holds (`file:`/`javascript:`/credential-bearing URLs always rejected; only the allow-listed origins pass). One property closes a class of bypass the example list never reaches. The renderer's pure logic earns the same treatment; the Electron glue and the boot smoke do not — they prove wiring, not branches. Service-boundary tools (Schemathesis, coverage-guided fuzzing) belong at the capability core's contract, not the desktop shell.
108
+
109
+ ## Naming Tests by Behaviour
110
+
111
+ A policy test name must state the rule and the condition from the failure log alone — `rejects file:// URLs` and `rejects credential-bearing hosts`, not `policy test 3`. The generated `it.each('rejects %s', ...)` shape already encodes this; keep it. Renderer component naming follows the web stack idiom (`groundwork-nextjs-engineer/references/testing.md`), unchanged.
112
+
113
+ ## Test Commands
114
+
115
+ ```bash
116
+ npx nx run <app>:test # both vitest projects (node + jsdom)
117
+ npx nx run <app>:test -- --project renderer # one project
118
+ npx nx run <app>:smoke # build + Playwright _electron (display-guarded)
119
+ npx nx run <app>:typecheck # tsc, both process tsconfigs
120
+ npx nx run <app>:lint # eslint incl. process-boundary rules
121
+ ```
122
+
123
+ ## Bet Slice Rollout — the permanent tests a slice owes
124
+
125
+ When a bet slice's progress tests go green, the slice rolls out permanent coverage before it closes (bet workflow, Delivery). The bet-progress tests prove the capability once and are archived; these stay. Test placement follows the process split, and surface tests assert wiring and rendering only — never a business rule the capability core already owns.
126
+
127
+ - **Main policy unit tests (when the slice added privileged logic).** Every new security or policy decision the slice introduced gets a pure-module test in the `main` project, with the rejection cases exercised, not just the allow case — this is the densest risk surface in the stack.
128
+ - **Renderer unit tests (when the slice added a component or state).** Components the slice introduced with conditional rendering, async pending states, or error handling get jsdom tests against the faked `window.api` bridge; the typed fake keeps the bridge contract honest.
129
+ - **Smoke extension (only when wiring is novel).** A new IPC channel gets unit tests by default; extend the boot smoke only when the channel's *wiring* is genuinely new — a new push mechanism or window — never for feature behaviour. Trace assertions do not apply — an Electron app emits no OpenTelemetry traces, so there is no span surface to assert on.
@@ -0,0 +1,74 @@
1
+ # Theming & Tokens — the Desktop Delta
2
+
3
+ This reference covers **only what the desktop shell adds** to theming. Tailwind composition rules, styling discipline, visual language, and accessibility are the web stack's, unchanged: `groundwork-nextjs-engineer/references/tailwind-and-styling.md` and `groundwork-nextjs-engineer/references/visual-language.md` (or `docs/principles/stack/typescript/frontend.md` when no web surface is installed).
4
+
5
+ ## Table of Contents
6
+ - [The Projection Chain](#the-projection-chain)
7
+ - [The Generated brand.css](#the-generated-brandcss)
8
+ - [The @theme Mapping](#the-theme-mapping)
9
+ - [nativeTheme Sync (the Desktop Dark Mode)](#nativetheme-sync-the-desktop-dark-mode)
10
+ - [Evolving the Brand](#evolving-the-brand)
11
+
12
+ ---
13
+
14
+ ## The Projection Chain
15
+
16
+ The theme is **generated from the design system's brand tokens**, not authored in the app:
17
+
18
+ ```
19
+ docs/design-system.md → .groundwork/config/brand-tokens.json (visual block)
20
+ → src/renderer/src/assets/brand.css (GENERATED)
21
+ → @theme inline mapping in main.css (static)
22
+ → Tailwind utilities in components
23
+ ```
24
+
25
+ The same tokens drive every surface of the product (web, CLI, mobile, desktop), so cross-surface visual consistency is a build artifact, not a review hope. A hex literal in a component is a review finding — it forks the design system silently.
26
+
27
+ ## The Generated brand.css
28
+
29
+ `brand.css` carries the projected values as CSS custom properties and is regenerated, never hand-edited:
30
+
31
+ - Palette roles in both themes: `--gw-primary`, `--gw-accent`, `--gw-surface`, `--gw-surface-alt`, `--gw-text-body`, `--gw-success`, `--gw-error`, `--gw-warning`, `--gw-info` — light values on `:root`, dark values on `:root[data-theme='dark']`.
32
+ - Typography: `--gw-font-display`/`--gw-font-body` (+ weights). Families render once they are bundled or system-available.
33
+ - Shape: `--gw-radius-base`.
34
+
35
+ Unlike the Dart projection (which resolves OKLCH at generation time), the renderer is CSS — token values pass through verbatim and Chromium resolves OKLCH natively. The file header records the projection source (`visual-block`, `identity-only`, or `default` — the three-tier fallback every token consumer implements).
36
+
37
+ ## The @theme Mapping
38
+
39
+ `main.css` maps the custom properties into Tailwind v4 theme tokens once:
40
+
41
+ ```css
42
+ @theme inline {
43
+ --color-primary: var(--gw-primary);
44
+ --color-surface: var(--gw-surface);
45
+ --color-foreground: var(--gw-text-body);
46
+ --font-display: var(--gw-font-display);
47
+ --radius-base: var(--gw-radius-base);
48
+ /* ... */
49
+ }
50
+ ```
51
+
52
+ Components consume the utilities these tokens create (`bg-surface`, `text-primary`, `font-display`, `rounded-base`) and **never read `--gw-*` variables directly** — the mapping is the API, the variables are the projection artifact. Tailwind v4 is CSS-first: there is no `tailwind.config.js`; the plugin loads in the **renderer section** of `electron.vite.config.ts` and applies to the renderer only (main and preload have no styling surface). Needing a new semantic token means extending the `@theme` mapping from a `--gw-*` value — and if no token expresses the need, that is a design-system gap to raise, not a license to inline a value.
53
+
54
+ ## nativeTheme Sync (the Desktop Dark Mode)
55
+
56
+ On desktop, the OS owns dark mode and **main is the source of truth** — this is the structural difference from the web stack's `next-themes` approach:
57
+
58
+ 1. Main broadcasts `nativeTheme.shouldUseDarkColors` on the `theme:changed` push channel — once after `did-finish-load`, and on every `nativeTheme.on('updated')`.
59
+ 2. The renderer's entry point subscribes via the bridge and mirrors the value onto `<html data-theme="dark|light">`.
60
+ 3. `brand.css` resolves every `--gw-*` per theme from that attribute; utilities update without component involvement.
61
+
62
+ Implementation rules:
63
+
64
+ - Components never branch on theme to pick values — the custom properties already resolved per-theme. (Conditional *structure* via a `data-theme` selector is fine; conditional *colours* is the antipattern.)
65
+ - Every role carries light **and** dark values — a design-system commitment, not an option; verify visual changes in both themes (flip the OS setting, or `app.evaluate(({ nativeTheme }) => { nativeTheme.themeSource = 'dark'; })` in a smoke-side check).
66
+ - A user-facing theme override (light/dark/system menu) is implemented by setting `nativeTheme.themeSource` in main via an IPC channel — keeping main the single source of truth — never by writing `data-theme` directly from a component.
67
+
68
+ ## Evolving the Brand
69
+
70
+ 1. The design-system run updates `brand-tokens.json`.
71
+ 2. Regenerate (or mechanically update) `brand.css` to match — the header marks it generated; keep the `:root` / `:root[data-theme='dark']` structure intact.
72
+ 3. The `@theme` mapping and all components pick the change up for free. New palette roles need one new mapping line in `main.css`.
73
+
74
+ If a visual change cannot be expressed through tokens → brand.css → @theme → utilities, raise the design-system gap; do not hand-edit the projection.
@@ -0,0 +1,22 @@
1
+ # Sync Anchor
2
+
3
+ This file pins the principle files this skill embeds — both the per-stack
4
+ Electron / TypeScript idiom docs and the cross-cutting central canon this skill
5
+ distils. When any listed file changes, this skill must be reviewed in the same
6
+ commit (and the matching per-stack idiom doc reconciled to the canon). CI
7
+ verifies the hashes match.
8
+
9
+ | Principle file | SHA-256 | Last reviewed |
10
+ |---|---|---|
11
+ | src/generators/electron-app/docs/principles/stack/electron/index.md | e80808eecbda59c97cd5b7870d621fc07b77ec4a4a0d1b812f4990de02be2675 | 2026-06-27 |
12
+ | src/generators/electron-app/docs/principles/stack/electron/process-model.md | d510797d59a06786fb6bd35f537566ee7f1024ce35a8985c9c94d305e3de5c43 | 2026-06-12 |
13
+ | src/generators/electron-app/docs/principles/stack/electron/ipc-contracts.md | 11d728db5d33c0c9cb3a082a58a55c96d6195f61558ca38fae91806db72da9e3 | 2026-06-12 |
14
+ | src/generators/electron-app/docs/principles/stack/electron/security.md | 316c118dcfb6de110d3d62b8a4c95ca79b58f5368e1b41881cd842628b3902f8 | 2026-06-12 |
15
+ | src/generators/electron-app/docs/principles/stack/electron/packaging-and-updates.md | b5f91ed102290dd73e52890fd389bce5be825a3d76a0f0353673cfe32ae09871 | 2026-06-12 |
16
+ | src/generators/electron-app/docs/principles/stack/typescript/frontend.md | 98232d067ad03c08d6c1ca5f2caec30e7c3400da55c3afb7754482bc121d7554 | 2026-06-12 |
17
+ | src/docs/principles/foundations/testing.md | 205ac40d4c643e7b61cf1e4295df8a7b8b46dcd7c81b857aa8c642ea353f62ef | 2026-06-27 |
18
+ | src/docs/principles/quality/observability.md | 8aa60e213ba03e989c93263153e3a1ac10b2336f6d0360c394f473660d565a0b | 2026-06-26 |
19
+ | src/docs/principles/quality/security.md | 61157d97677142737ec537954dc5aaad7a04012cc8a3dcc855e2d324287fdc64 | 2026-06-26 |
20
+ | src/docs/principles/quality/performance.md | 18b6d3391c57d97342068f9f1da732b24de4221489d0459bb6ad8900fac0a02e | 2026-06-26 |
21
+ | src/docs/principles/quality/reliability.md | 9c9788504e0963458667d2727c3fc2359776108be593a2efc6603f6470002252 | 2026-06-26 |
22
+ | src/docs/principles/foundations/documentation.md | 8b576072eaf4970f1251b560781e3e755c864a7920faa599b2834c921cbb8734 | 2026-06-26 |