groundwork-method 0.0.1 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (629) hide show
  1. package/CHANGELOG.md +781 -0
  2. package/LICENSE +21 -0
  3. package/README.md +44 -29
  4. package/bin/groundwork.js +1654 -0
  5. package/dist/src/generators/add-capability/generator.d.ts +8 -0
  6. package/dist/src/generators/add-capability/generator.js +60 -0
  7. package/dist/src/generators/add-capability/generator.js.map +1 -0
  8. package/dist/src/generators/cli-app/generator.d.ts +9 -0
  9. package/dist/src/generators/cli-app/generator.js +140 -0
  10. package/dist/src/generators/cli-app/generator.js.map +1 -0
  11. package/dist/src/generators/docs-site/generator.d.ts +5 -0
  12. package/dist/src/generators/docs-site/generator.js +441 -0
  13. package/dist/src/generators/docs-site/generator.js.map +1 -0
  14. package/dist/src/generators/electron-app/generator.d.ts +6 -0
  15. package/dist/src/generators/electron-app/generator.js +261 -0
  16. package/dist/src/generators/electron-app/generator.js.map +1 -0
  17. package/dist/src/generators/flutter-app/generator.d.ts +6 -0
  18. package/dist/src/generators/flutter-app/generator.js +314 -0
  19. package/dist/src/generators/flutter-app/generator.js.map +1 -0
  20. package/dist/src/generators/go-microservice/generator.d.ts +8 -0
  21. package/dist/src/generators/go-microservice/generator.js +232 -0
  22. package/dist/src/generators/go-microservice/generator.js.map +1 -0
  23. package/dist/src/generators/nextjs-app/generator.d.ts +8 -0
  24. package/dist/src/generators/nextjs-app/generator.js +294 -0
  25. package/dist/src/generators/nextjs-app/generator.js.map +1 -0
  26. package/dist/src/generators/python-microservice/generator.d.ts +13 -0
  27. package/dist/src/generators/python-microservice/generator.js +265 -0
  28. package/dist/src/generators/python-microservice/generator.js.map +1 -0
  29. package/dist/src/generators/shared/brand-tokens.d.ts +89 -0
  30. package/dist/src/generators/shared/brand-tokens.js +308 -0
  31. package/dist/src/generators/shared/brand-tokens.js.map +1 -0
  32. package/dist/src/generators/shared/capabilities.d.ts +101 -0
  33. package/dist/src/generators/shared/capabilities.js +279 -0
  34. package/dist/src/generators/shared/capabilities.js.map +1 -0
  35. package/dist/src/generators/shared/provenance.d.ts +2 -0
  36. package/dist/src/generators/shared/provenance.js +85 -0
  37. package/dist/src/generators/shared/provenance.js.map +1 -0
  38. package/dist/src/generators/shared/scaffold-helpers.d.ts +72 -0
  39. package/dist/src/generators/shared/scaffold-helpers.js +309 -0
  40. package/dist/src/generators/shared/scaffold-helpers.js.map +1 -0
  41. package/dist/src/generators/system-test-runner/generator.d.ts +23 -0
  42. package/dist/src/generators/system-test-runner/generator.js +125 -0
  43. package/dist/src/generators/system-test-runner/generator.js.map +1 -0
  44. package/dist/src/generators/workspace-dev-cli/generator.d.ts +7 -0
  45. package/dist/src/generators/workspace-dev-cli/generator.js +138 -0
  46. package/dist/src/generators/workspace-dev-cli/generator.js.map +1 -0
  47. package/generators.json +57 -0
  48. package/lib/repo-map/grammars/tree-sitter-c.wasm +0 -0
  49. package/lib/repo-map/grammars/tree-sitter-cpp.wasm +0 -0
  50. package/lib/repo-map/grammars/tree-sitter-csharp.wasm +0 -0
  51. package/lib/repo-map/grammars/tree-sitter-dart.wasm +0 -0
  52. package/lib/repo-map/grammars/tree-sitter-go.wasm +0 -0
  53. package/lib/repo-map/grammars/tree-sitter-java.wasm +0 -0
  54. package/lib/repo-map/grammars/tree-sitter-javascript.wasm +0 -0
  55. package/lib/repo-map/grammars/tree-sitter-kotlin.wasm +0 -0
  56. package/lib/repo-map/grammars/tree-sitter-lua.wasm +0 -0
  57. package/lib/repo-map/grammars/tree-sitter-php.wasm +0 -0
  58. package/lib/repo-map/grammars/tree-sitter-python.wasm +0 -0
  59. package/lib/repo-map/grammars/tree-sitter-ruby.wasm +0 -0
  60. package/lib/repo-map/grammars/tree-sitter-rust.wasm +0 -0
  61. package/lib/repo-map/grammars/tree-sitter-scala.wasm +0 -0
  62. package/lib/repo-map/grammars/tree-sitter-swift.wasm +0 -0
  63. package/lib/repo-map/grammars/tree-sitter-tsx.wasm +0 -0
  64. package/lib/repo-map/grammars/tree-sitter-typescript.wasm +0 -0
  65. package/lib/repo-map/index.js +386 -0
  66. package/lib/repo-map/languages.js +514 -0
  67. package/lib/repo-map/pagerank.js +59 -0
  68. package/migrations/README.md +60 -0
  69. package/migrations/_template/cli-migration.js +27 -0
  70. package/migrations/gw-bet-prose-redesign.js +105 -0
  71. package/migrations/gw-drop-test-manifest.js +37 -0
  72. package/migrations/gw-register-serena-mcp.js +42 -0
  73. package/migrations/gw-relocate-hidden-skills.js +40 -0
  74. package/migrations/gw-seed-config-toml.js +24 -0
  75. package/migrations/index.json +40 -0
  76. package/package.json +70 -6
  77. package/src/AGENTS.md +36 -0
  78. package/src/config/config.toml +30 -0
  79. package/src/config/groundwork-state.json +5 -0
  80. package/src/docs/llms.txt +72 -0
  81. package/src/docs/principles/ai-native/agent-native-systems.md +90 -0
  82. package/src/docs/principles/ai-native/agentic-systems.md +78 -0
  83. package/src/docs/principles/ai-native/ai-engineering.md +100 -0
  84. package/src/docs/principles/ai-native/ai-native-product.md +76 -0
  85. package/src/docs/principles/delivery/cost-engineering.md +89 -0
  86. package/src/docs/principles/delivery/day-2-operational-baseline.md +57 -0
  87. package/src/docs/principles/delivery/devex.md +88 -0
  88. package/src/docs/principles/delivery/platform.md +101 -0
  89. package/src/docs/principles/delivery/progressive-delivery.md +92 -0
  90. package/src/docs/principles/design/ai-native-design.md +73 -0
  91. package/src/docs/principles/design/design-foundations.md +80 -0
  92. package/src/docs/principles/design/design-systems-and-tokens.md +72 -0
  93. package/src/docs/principles/design/interaction-and-motion.md +69 -0
  94. package/src/docs/principles/design/layout-and-space.md +72 -0
  95. package/src/docs/principles/design/usability-and-ux.md +68 -0
  96. package/src/docs/principles/design/visual-design.md +84 -0
  97. package/src/docs/principles/foundations/code-craft.md +86 -0
  98. package/src/docs/principles/foundations/continuous-discovery.md +75 -0
  99. package/src/docs/principles/foundations/documentation.md +102 -0
  100. package/src/docs/principles/foundations/prioritization-and-appetite.md +78 -0
  101. package/src/docs/principles/foundations/product-engineering.md +90 -0
  102. package/src/docs/principles/foundations/product-risks.md +89 -0
  103. package/src/docs/principles/foundations/requirements-and-specs.md +80 -0
  104. package/src/docs/principles/foundations/success-metrics.md +66 -0
  105. package/src/docs/principles/foundations/testing.md +82 -0
  106. package/src/docs/principles/index.md +23 -0
  107. package/src/docs/principles/quality/accessibility.md +88 -0
  108. package/src/docs/principles/quality/observability.md +84 -0
  109. package/src/docs/principles/quality/performance.md +84 -0
  110. package/src/docs/principles/quality/privacy.md +92 -0
  111. package/src/docs/principles/quality/reliability.md +89 -0
  112. package/src/docs/principles/quality/security.md +78 -0
  113. package/src/docs/principles/stack/postgres.md +100 -0
  114. package/src/docs/principles/system-design/api-design.md +86 -0
  115. package/src/docs/principles/system-design/architecture-decisions.md +81 -0
  116. package/src/docs/principles/system-design/code-structure.md +104 -0
  117. package/src/docs/principles/system-design/data-engineering.md +87 -0
  118. package/src/docs/principles/system-design/durable-execution.md +89 -0
  119. package/src/docs/principles/system-design/evolutionary-architecture.md +81 -0
  120. package/src/docs/principles/system-design/identity-and-access.md +76 -0
  121. package/src/docs/principles/system-design/integration-patterns.md +84 -0
  122. package/src/docs/principles/system-design/real-time.md +83 -0
  123. package/src/docs/principles/system-design/surface-architecture.md +74 -0
  124. package/src/docs/ways-of-working/documentation.md +69 -0
  125. package/src/docs/ways-of-working/how-we-work.md +76 -0
  126. package/src/docs/ways-of-working/units-of-work.md +40 -0
  127. package/src/engineer-skills/groundwork-electron-engineer/SKILL.md +118 -0
  128. package/src/engineer-skills/groundwork-electron-engineer/references/ipc-contracts.md +138 -0
  129. package/src/engineer-skills/groundwork-electron-engineer/references/packaging-and-updates.md +82 -0
  130. package/src/engineer-skills/groundwork-electron-engineer/references/process-model.md +94 -0
  131. package/src/engineer-skills/groundwork-electron-engineer/references/security.md +107 -0
  132. package/src/engineer-skills/groundwork-electron-engineer/references/testing-and-smoke.md +107 -0
  133. package/src/engineer-skills/groundwork-electron-engineer/references/theming-and-tokens.md +74 -0
  134. package/src/engineer-skills/groundwork-electron-engineer/sync-anchor.md +14 -0
  135. package/src/engineer-skills/groundwork-flutter-engineer/SKILL.md +108 -0
  136. package/src/engineer-skills/groundwork-flutter-engineer/references/accessibility.md +92 -0
  137. package/src/engineer-skills/groundwork-flutter-engineer/references/architecture.md +189 -0
  138. package/src/engineer-skills/groundwork-flutter-engineer/references/data-and-contracts.md +136 -0
  139. package/src/engineer-skills/groundwork-flutter-engineer/references/navigation.md +122 -0
  140. package/src/engineer-skills/groundwork-flutter-engineer/references/platform-channels.md +93 -0
  141. package/src/engineer-skills/groundwork-flutter-engineer/references/releases-and-distribution.md +84 -0
  142. package/src/engineer-skills/groundwork-flutter-engineer/references/state-management.md +166 -0
  143. package/src/engineer-skills/groundwork-flutter-engineer/references/testing.md +135 -0
  144. package/src/engineer-skills/groundwork-flutter-engineer/references/theming-and-design-tokens.md +109 -0
  145. package/src/engineer-skills/groundwork-flutter-engineer/references/widgets-and-composition.md +123 -0
  146. package/src/engineer-skills/groundwork-flutter-engineer/sync-anchor.md +15 -0
  147. package/src/engineer-skills/groundwork-go-engineer/SKILL.md +171 -0
  148. package/src/engineer-skills/groundwork-go-engineer/references/api-design.md +82 -0
  149. package/src/engineer-skills/groundwork-go-engineer/references/architecture.md +42 -0
  150. package/src/engineer-skills/groundwork-go-engineer/references/capability-ports.md +50 -0
  151. package/src/engineer-skills/groundwork-go-engineer/references/code-craft-security.md +34 -0
  152. package/src/engineer-skills/groundwork-go-engineer/references/concurrency.md +108 -0
  153. package/src/engineer-skills/groundwork-go-engineer/references/go-services.md +77 -0
  154. package/src/engineer-skills/groundwork-go-engineer/references/http-handlers.md +172 -0
  155. package/src/engineer-skills/groundwork-go-engineer/references/implementation-patterns.md +156 -0
  156. package/src/engineer-skills/groundwork-go-engineer/references/integration-realtime-data.md +57 -0
  157. package/src/engineer-skills/groundwork-go-engineer/references/observability.md +49 -0
  158. package/src/engineer-skills/groundwork-go-engineer/references/postgres.md +41 -0
  159. package/src/engineer-skills/groundwork-go-engineer/references/reliability-performance.md +105 -0
  160. package/src/engineer-skills/groundwork-go-engineer/references/testing.md +139 -0
  161. package/src/engineer-skills/groundwork-go-engineer/sync-anchor.md +11 -0
  162. package/src/engineer-skills/groundwork-nextjs-engineer/SKILL.md +107 -0
  163. package/src/engineer-skills/groundwork-nextjs-engineer/references/architecture.md +323 -0
  164. package/src/engineer-skills/groundwork-nextjs-engineer/references/data-fetching.md +458 -0
  165. package/src/engineer-skills/groundwork-nextjs-engineer/references/documentation.md +324 -0
  166. package/src/engineer-skills/groundwork-nextjs-engineer/references/error-boundaries.md +383 -0
  167. package/src/engineer-skills/groundwork-nextjs-engineer/references/mutations-and-forms.md +396 -0
  168. package/src/engineer-skills/groundwork-nextjs-engineer/references/performance-and-deployment.md +947 -0
  169. package/src/engineer-skills/groundwork-nextjs-engineer/references/routing-and-navigation.md +405 -0
  170. package/src/engineer-skills/groundwork-nextjs-engineer/references/server-components.md +394 -0
  171. package/src/engineer-skills/groundwork-nextjs-engineer/references/tailwind-and-styling.md +134 -0
  172. package/src/engineer-skills/groundwork-nextjs-engineer/references/testing.md +433 -0
  173. package/src/engineer-skills/groundwork-nextjs-engineer/references/type-system.md +368 -0
  174. package/src/engineer-skills/groundwork-nextjs-engineer/references/ux-principles.md +278 -0
  175. package/src/engineer-skills/groundwork-nextjs-engineer/references/visual-language.md +69 -0
  176. package/src/engineer-skills/groundwork-nextjs-engineer/sync-anchor.md +9 -0
  177. package/src/engineer-skills/groundwork-python-engineer/SKILL.md +196 -0
  178. package/src/engineer-skills/groundwork-python-engineer/references/api-standards.md +88 -0
  179. package/src/engineer-skills/groundwork-python-engineer/references/architecture.md +57 -0
  180. package/src/engineer-skills/groundwork-python-engineer/references/async-patterns.md +103 -0
  181. package/src/engineer-skills/groundwork-python-engineer/references/capability-ports.md +44 -0
  182. package/src/engineer-skills/groundwork-python-engineer/references/database.md +88 -0
  183. package/src/engineer-skills/groundwork-python-engineer/references/documentation-mcp.md +167 -0
  184. package/src/engineer-skills/groundwork-python-engineer/references/implementation-patterns.md +166 -0
  185. package/src/engineer-skills/groundwork-python-engineer/references/ml-pipelines.md +119 -0
  186. package/src/engineer-skills/groundwork-python-engineer/references/ml-systems-ai-engineering.md +74 -0
  187. package/src/engineer-skills/groundwork-python-engineer/references/observability.md +57 -0
  188. package/src/engineer-skills/groundwork-python-engineer/references/resilience.md +126 -0
  189. package/src/engineer-skills/groundwork-python-engineer/references/testing.md +177 -0
  190. package/src/engineer-skills/groundwork-python-engineer/sync-anchor.md +13 -0
  191. package/src/generators/add-capability/generator.ts +70 -0
  192. package/src/generators/add-capability/schema.json +30 -0
  193. package/src/generators/capabilities/llm/capability.json +28 -0
  194. package/src/generators/capabilities/llm/providers/anthropic/footprint.json +13 -0
  195. package/src/generators/capabilities/llm/providers/anthropic/stacks/go/internal/llm/llm.go.template +102 -0
  196. package/src/generators/capabilities/llm/providers/anthropic/stacks/python/src/__packageName__/adapters/llm.py.template +61 -0
  197. package/src/generators/capabilities/llm/providers/local/footprint.json +13 -0
  198. package/src/generators/capabilities/llm/providers/local/stacks/go/internal/llm/llm.go.template +102 -0
  199. package/src/generators/capabilities/llm/providers/local/stacks/python/src/__packageName__/adapters/llm.py.template +53 -0
  200. package/src/generators/capabilities/llm/providers/localai/footprint.json +29 -0
  201. package/src/generators/capabilities/llm/providers/localai/stacks/go/internal/llm/llm.go.template +102 -0
  202. package/src/generators/capabilities/llm/providers/localai/stacks/python/src/__packageName__/adapters/llm.py.template +53 -0
  203. package/src/generators/capabilities/llm/providers/none/footprint.json +9 -0
  204. package/src/generators/capabilities/llm/providers/none/stacks/go/internal/llm/llm.go.template +35 -0
  205. package/src/generators/capabilities/llm/providers/none/stacks/python/src/__packageName__/adapters/llm.py.template +25 -0
  206. package/src/generators/capabilities/llm/providers/ollama/footprint.json +20 -0
  207. package/src/generators/capabilities/llm/providers/ollama/stacks/go/internal/llm/llm.go.template +102 -0
  208. package/src/generators/capabilities/llm/providers/ollama/stacks/python/src/__packageName__/adapters/llm.py.template +53 -0
  209. package/src/generators/capabilities/llm/providers/openai/footprint.json +13 -0
  210. package/src/generators/capabilities/llm/providers/openai/stacks/go/internal/llm/llm.go.template +98 -0
  211. package/src/generators/capabilities/llm/providers/openai/stacks/python/src/__packageName__/adapters/llm.py.template +60 -0
  212. package/src/generators/capabilities/llm/stacks/go/internal/core/service/llm.go.template +12 -0
  213. package/src/generators/capabilities/llm/stacks/go/internal/llm/llm_test.go.template +33 -0
  214. package/src/generators/capabilities/llm/stacks/python/src/__packageName__/core/llm.py.template +15 -0
  215. package/src/generators/capabilities/llm/stacks/python/tests/contracts/test_llm.py.template +37 -0
  216. package/src/generators/cli-app/files/README.md.template +76 -0
  217. package/src/generators/cli-app/files/build.mjs.template +15 -0
  218. package/src/generators/cli-app/files/package.json.template +21 -0
  219. package/src/generators/cli-app/files/src/cli.ts.template +67 -0
  220. package/src/generators/cli-app/files/src/commands/hello.ts.template +17 -0
  221. package/src/generators/cli-app/files/src/commands/status.ts.template +23 -0
  222. package/src/generators/cli-app/files/src/core/client.test.ts.template +80 -0
  223. package/src/generators/cli-app/files/src/core/client.ts.template +64 -0
  224. package/src/generators/cli-app/files/src/registry.test.ts.template +35 -0
  225. package/src/generators/cli-app/files/src/registry.ts.template +31 -0
  226. package/src/generators/cli-app/files/tsconfig.json.template +16 -0
  227. package/src/generators/cli-app/files/tsconfig.test.json.template +11 -0
  228. package/src/generators/cli-app/generator.ts +138 -0
  229. package/src/generators/cli-app/schema.json +24 -0
  230. package/src/generators/docs-site/files/.gitignore.ejs +40 -0
  231. package/src/generators/docs-site/files/app/docs/__slug__/page.tsx +101 -0
  232. package/src/generators/docs-site/files/app/docs/layout.tsx +14 -0
  233. package/src/generators/docs-site/files/app/docs.css +43 -0
  234. package/src/generators/docs-site/files/app/layout.tsx +24 -0
  235. package/src/generators/docs-site/files/app/page.tsx +135 -0
  236. package/src/generators/docs-site/files/app/source.ts +8 -0
  237. package/src/generators/docs-site/files/components/mermaid.tsx +67 -0
  238. package/src/generators/docs-site/files/next.config.mjs +10 -0
  239. package/src/generators/docs-site/files/package.json +32 -0
  240. package/src/generators/docs-site/files/pnpm-workspace.yaml +7 -0
  241. package/src/generators/docs-site/files/postcss.config.mjs +6 -0
  242. package/src/generators/docs-site/files/source.config.ts +77 -0
  243. package/src/generators/docs-site/files/tailwind.config.js +10 -0
  244. package/src/generators/docs-site/files/tsconfig.json +27 -0
  245. package/src/generators/docs-site/generator.ts +476 -0
  246. package/src/generators/docs-site/schema.json +17 -0
  247. package/src/generators/electron-app/docs/principles/stack/electron/index.md +47 -0
  248. package/src/generators/electron-app/docs/principles/stack/electron/ipc-contracts.md +71 -0
  249. package/src/generators/electron-app/docs/principles/stack/electron/packaging-and-updates.md +59 -0
  250. package/src/generators/electron-app/docs/principles/stack/electron/process-model.md +53 -0
  251. package/src/generators/electron-app/docs/principles/stack/electron/security.md +70 -0
  252. package/src/generators/electron-app/docs/principles/stack/typescript/frontend.md +65 -0
  253. package/src/generators/electron-app/files/.gitignore.template +20 -0
  254. package/src/generators/electron-app/files/README.md.template +125 -0
  255. package/src/generators/electron-app/files/electron.vite.config.ts +31 -0
  256. package/src/generators/electron-app/files/eslint.config.mjs +92 -0
  257. package/src/generators/electron-app/files/forge.config.ts.template +44 -0
  258. package/src/generators/electron-app/files/package.json.template +54 -0
  259. package/src/generators/electron-app/files/playwright.config.ts +18 -0
  260. package/src/generators/electron-app/files/project.json.template +65 -0
  261. package/src/generators/electron-app/files/src/main/core-client.test.ts +81 -0
  262. package/src/generators/electron-app/files/src/main/core-client.ts +55 -0
  263. package/src/generators/electron-app/files/src/main/index.ts +157 -0
  264. package/src/generators/electron-app/files/src/main/ipc.ts +52 -0
  265. package/src/generators/electron-app/files/src/main/policy.test.ts +71 -0
  266. package/src/generators/electron-app/files/src/main/policy.ts +73 -0
  267. package/src/generators/electron-app/files/src/preload/index.ts +23 -0
  268. package/src/generators/electron-app/files/src/renderer/index.html.template +20 -0
  269. package/src/generators/electron-app/files/src/renderer/src/App.test.tsx +61 -0
  270. package/src/generators/electron-app/files/src/renderer/src/App.tsx.template +43 -0
  271. package/src/generators/electron-app/files/src/renderer/src/assets/main.css +40 -0
  272. package/src/generators/electron-app/files/src/renderer/src/env.d.ts +14 -0
  273. package/src/generators/electron-app/files/src/renderer/src/main.tsx +25 -0
  274. package/src/generators/electron-app/files/src/shared/ipc.ts +54 -0
  275. package/src/generators/electron-app/files/tests/smoke/app.spec.ts.template +68 -0
  276. package/src/generators/electron-app/files/tool/electron_exec.sh.template +83 -0
  277. package/src/generators/electron-app/files/tsconfig.json +7 -0
  278. package/src/generators/electron-app/files/tsconfig.node.json +27 -0
  279. package/src/generators/electron-app/files/tsconfig.web.json +22 -0
  280. package/src/generators/electron-app/files/vitest.config.ts +32 -0
  281. package/src/generators/electron-app/files/vitest.setup.ts +1 -0
  282. package/src/generators/electron-app/generator.ts +288 -0
  283. package/src/generators/electron-app/schema.json +23 -0
  284. package/src/generators/flutter-app/docs/principles/stack/flutter/architecture.md +78 -0
  285. package/src/generators/flutter-app/docs/principles/stack/flutter/index.md +38 -0
  286. package/src/generators/flutter-app/docs/principles/stack/flutter/platform-channels.md +51 -0
  287. package/src/generators/flutter-app/docs/principles/stack/flutter/releases-and-distribution.md +59 -0
  288. package/src/generators/flutter-app/docs/principles/stack/flutter/state-management.md +85 -0
  289. package/src/generators/flutter-app/docs/principles/stack/flutter/testing.md +74 -0
  290. package/src/generators/flutter-app/docs/principles/stack/flutter/widgets-and-composition.md +69 -0
  291. package/src/generators/flutter-app/files/.gitignore.template +30 -0
  292. package/src/generators/flutter-app/files/README.md.template +100 -0
  293. package/src/generators/flutter-app/files/analysis_options.yaml.template +18 -0
  294. package/src/generators/flutter-app/files/integration_test/app_test.dart.template +30 -0
  295. package/src/generators/flutter-app/files/lib/app.dart.template +24 -0
  296. package/src/generators/flutter-app/files/lib/config/app_config.dart +15 -0
  297. package/src/generators/flutter-app/files/lib/data/repositories/status_repository.dart +36 -0
  298. package/src/generators/flutter-app/files/lib/data/services/api_client.dart +71 -0
  299. package/src/generators/flutter-app/files/lib/domain/models/health_status.dart +23 -0
  300. package/src/generators/flutter-app/files/lib/main.dart +11 -0
  301. package/src/generators/flutter-app/files/lib/router.dart +23 -0
  302. package/src/generators/flutter-app/files/lib/ui/core/theme/app_theme.dart +110 -0
  303. package/src/generators/flutter-app/files/lib/ui/home/home_view.dart +89 -0
  304. package/src/generators/flutter-app/files/lib/ui/home/home_view_model.dart.template +38 -0
  305. package/src/generators/flutter-app/files/project.json.template +51 -0
  306. package/src/generators/flutter-app/files/pubspec.yaml.template +47 -0
  307. package/src/generators/flutter-app/files/test/api_client_test.dart.template +63 -0
  308. package/src/generators/flutter-app/files/test/fakes/fake_status_repository.dart.template +19 -0
  309. package/src/generators/flutter-app/files/test/home_view_test.dart.template +58 -0
  310. package/src/generators/flutter-app/files/tool/flutter_exec.sh.template +60 -0
  311. package/src/generators/flutter-app/generator.ts +362 -0
  312. package/src/generators/flutter-app/schema.json +23 -0
  313. package/src/generators/go-microservice/docs/principles/stack/go/concurrency.md +123 -0
  314. package/src/generators/go-microservice/docs/principles/stack/go/index.md +70 -0
  315. package/src/generators/go-microservice/docs/principles/stack/go/testing.md +152 -0
  316. package/src/generators/go-microservice/files/.air.toml.template +38 -0
  317. package/src/generators/go-microservice/files/.env.template +4 -0
  318. package/src/generators/go-microservice/files/.golangci.yml.template +82 -0
  319. package/src/generators/go-microservice/files/Dockerfile.dev.template +12 -0
  320. package/src/generators/go-microservice/files/asyncapi-pubsub.yaml.template +33 -0
  321. package/src/generators/go-microservice/files/asyncapi-ws.yaml.template +34 -0
  322. package/src/generators/go-microservice/files/cmd/api/main.go.template +149 -0
  323. package/src/generators/go-microservice/files/cmd/api/main_test.go.template +99 -0
  324. package/src/generators/go-microservice/files/cmd/worker/cleanup/main.go.template +39 -0
  325. package/src/generators/go-microservice/files/db/schema.sql.template +24 -0
  326. package/src/generators/go-microservice/files/go.mod.template +39 -0
  327. package/src/generators/go-microservice/files/internal/config/config.go.template +52 -0
  328. package/src/generators/go-microservice/files/internal/config/otel.go.template +93 -0
  329. package/src/generators/go-microservice/files/internal/core/domain/errors.go.template +16 -0
  330. package/src/generators/go-microservice/files/internal/core/domain/model.go.template +28 -0
  331. package/src/generators/go-microservice/files/internal/core/domain/user.go.template +13 -0
  332. package/src/generators/go-microservice/files/internal/core/pagination.go.template +16 -0
  333. package/src/generators/go-microservice/files/internal/core/service/app_service.go.template +79 -0
  334. package/src/generators/go-microservice/files/internal/core/service/event_hub.go.template +9 -0
  335. package/src/generators/go-microservice/files/internal/core/service/message_queue.go.template +10 -0
  336. package/src/generators/go-microservice/files/internal/core/service/outbox_repository.go.template +31 -0
  337. package/src/generators/go-microservice/files/internal/core/service/repository.go.template +23 -0
  338. package/src/generators/go-microservice/files/internal/core/service/user_repository.go.template +15 -0
  339. package/src/generators/go-microservice/files/internal/core/service/user_service.go.template +43 -0
  340. package/src/generators/go-microservice/files/internal/entrypoints/api/app_handler.go.template +108 -0
  341. package/src/generators/go-microservice/files/internal/entrypoints/api/auth_middleware_test.go.template +52 -0
  342. package/src/generators/go-microservice/files/internal/entrypoints/api/clerk_webhook.go.template +202 -0
  343. package/src/generators/go-microservice/files/internal/entrypoints/api/clerk_webhook_test.go.template +82 -0
  344. package/src/generators/go-microservice/files/internal/entrypoints/api/health_handler.go.template +80 -0
  345. package/src/generators/go-microservice/files/internal/entrypoints/api/idempotency/middleware.go.template +87 -0
  346. package/src/generators/go-microservice/files/internal/entrypoints/api/idempotency/middleware_test.go.template +76 -0
  347. package/src/generators/go-microservice/files/internal/entrypoints/api/idempotency/repository.go.template +37 -0
  348. package/src/generators/go-microservice/files/internal/entrypoints/api/middleware_auth.go.template +40 -0
  349. package/src/generators/go-microservice/files/internal/entrypoints/api/middleware_loadshed.go.template +38 -0
  350. package/src/generators/go-microservice/files/internal/entrypoints/api/middleware_logging.go.template +40 -0
  351. package/src/generators/go-microservice/files/internal/entrypoints/api/middleware_ratelimit.go.template +48 -0
  352. package/src/generators/go-microservice/files/internal/entrypoints/api/middleware_test.go.template +81 -0
  353. package/src/generators/go-microservice/files/internal/entrypoints/api/router.go.template +105 -0
  354. package/src/generators/go-microservice/files/internal/entrypoints/api/types.go.template +70 -0
  355. package/src/generators/go-microservice/files/internal/entrypoints/api/websocket_handler.go.template +39 -0
  356. package/src/generators/go-microservice/files/internal/httpclient/http_client.go.template +87 -0
  357. package/src/generators/go-microservice/files/internal/kafka/kafka.go.template +34 -0
  358. package/src/generators/go-microservice/files/internal/postgres/postgres.go.template +195 -0
  359. package/src/generators/go-microservice/files/internal/postgres/postgres_test.go.template +156 -0
  360. package/src/generators/go-microservice/files/internal/postgres/user_repository.go.template +56 -0
  361. package/src/generators/go-microservice/files/internal/pubsub/gcp_pubsub.go.template +35 -0
  362. package/src/generators/go-microservice/files/internal/websocket/client.go.template +151 -0
  363. package/src/generators/go-microservice/files/internal/websocket/hub.go.template +261 -0
  364. package/src/generators/go-microservice/files/scripts/apply-schema.sh.template +21 -0
  365. package/src/generators/go-microservice/files/tools/tools.go.template +10 -0
  366. package/src/generators/go-microservice/generator.ts +240 -0
  367. package/src/generators/go-microservice/schema.json +63 -0
  368. package/src/generators/nextjs-app/docs/principles/stack/typescript/frontend.md +65 -0
  369. package/src/generators/nextjs-app/files/.dockerignore.template +7 -0
  370. package/src/generators/nextjs-app/files/.env.example.template +24 -0
  371. package/src/generators/nextjs-app/files/.gitignore.template +5 -0
  372. package/src/generators/nextjs-app/files/Dockerfile +53 -0
  373. package/src/generators/nextjs-app/files/app/(auth)/sign-in/__sign-in__/page.tsx.template +9 -0
  374. package/src/generators/nextjs-app/files/app/(auth)/sign-up/__sign-up__/page.tsx.template +9 -0
  375. package/src/generators/nextjs-app/files/app/api/config/route.ts.template +39 -0
  376. package/src/generators/nextjs-app/files/app/api/healthz/route.test.ts +15 -0
  377. package/src/generators/nextjs-app/files/app/api/healthz/route.ts +5 -0
  378. package/src/generators/nextjs-app/files/app/api/proxy/__path__/route.test.ts.template +55 -0
  379. package/src/generators/nextjs-app/files/app/api/proxy/__path__/route.ts.template +126 -0
  380. package/src/generators/nextjs-app/files/app/error.tsx +39 -0
  381. package/src/generators/nextjs-app/files/app/global-error.tsx +68 -0
  382. package/src/generators/nextjs-app/files/app/globals.css +105 -0
  383. package/src/generators/nextjs-app/files/app/layout.tsx +59 -0
  384. package/src/generators/nextjs-app/files/app/loading.tsx +13 -0
  385. package/src/generators/nextjs-app/files/app/not-found.tsx +30 -0
  386. package/src/generators/nextjs-app/files/app/page.tsx +20 -0
  387. package/src/generators/nextjs-app/files/components/providers/default.tsx +19 -0
  388. package/src/generators/nextjs-app/files/components/providers/production.tsx +32 -0
  389. package/src/generators/nextjs-app/files/components/providers/telemetry.tsx +76 -0
  390. package/src/generators/nextjs-app/files/components/render-smoke.test.tsx +29 -0
  391. package/src/generators/nextjs-app/files/components/theme-provider.tsx +11 -0
  392. package/src/generators/nextjs-app/files/components.json +21 -0
  393. package/src/generators/nextjs-app/files/eslint.config.mjs +120 -0
  394. package/src/generators/nextjs-app/files/hooks/use-toast.ts +7 -0
  395. package/src/generators/nextjs-app/files/instrumentation.ts +90 -0
  396. package/src/generators/nextjs-app/files/lib/api/fetcher.ts.template +130 -0
  397. package/src/generators/nextjs-app/files/lib/config.ts +21 -0
  398. package/src/generators/nextjs-app/files/lib/logger.ts +29 -0
  399. package/src/generators/nextjs-app/files/lib/schemas/index.ts +19 -0
  400. package/src/generators/nextjs-app/files/lib/utils.ts +6 -0
  401. package/src/generators/nextjs-app/files/next.config.mjs +9 -0
  402. package/src/generators/nextjs-app/files/package.json +70 -0
  403. package/src/generators/nextjs-app/files/postcss.config.mjs +8 -0
  404. package/src/generators/nextjs-app/files/proxy.test.ts.template +30 -0
  405. package/src/generators/nextjs-app/files/proxy.ts +31 -0
  406. package/src/generators/nextjs-app/files/public/.gitkeep +1 -0
  407. package/src/generators/nextjs-app/files/tsconfig.json +42 -0
  408. package/src/generators/nextjs-app/files/vitest.config.mts +15 -0
  409. package/src/generators/nextjs-app/files/vitest.setup.ts +7 -0
  410. package/src/generators/nextjs-app/generator.ts +307 -0
  411. package/src/generators/nextjs-app/schema.json +44 -0
  412. package/src/generators/python-microservice/docs/principles/stack/python/async.md +168 -0
  413. package/src/generators/python-microservice/docs/principles/stack/python/documentation.md +240 -0
  414. package/src/generators/python-microservice/docs/principles/stack/python/mcp.md +147 -0
  415. package/src/generators/python-microservice/docs/principles/stack/python/resilience.md +193 -0
  416. package/src/generators/python-microservice/docs/principles/stack/python/testing.md +281 -0
  417. package/src/generators/python-microservice/files/.env.example.template +30 -0
  418. package/src/generators/python-microservice/files/Dockerfile.template +36 -0
  419. package/src/generators/python-microservice/files/db/schema.sql.template +19 -0
  420. package/src/generators/python-microservice/files/pyproject.toml.template +76 -0
  421. package/src/generators/python-microservice/files/scripts/apply-schema.sh.template +25 -0
  422. package/src/generators/python-microservice/files/src/__packageName__/adapters/comfyui.py.template +87 -0
  423. package/src/generators/python-microservice/files/src/__packageName__/adapters/config.py.template +48 -0
  424. package/src/generators/python-microservice/files/src/__packageName__/adapters/database.py.template +21 -0
  425. package/src/generators/python-microservice/files/src/__packageName__/adapters/message_queue.py.template +29 -0
  426. package/src/generators/python-microservice/files/src/__packageName__/adapters/repository.py.template +130 -0
  427. package/src/generators/python-microservice/files/src/__packageName__/adapters/telemetry.py.template +68 -0
  428. package/src/generators/python-microservice/files/src/__packageName__/adapters/websocket_hub.py.template +36 -0
  429. package/src/generators/python-microservice/files/src/__packageName__/core/domain/entities.py.template +22 -0
  430. package/src/generators/python-microservice/files/src/__packageName__/core/domain/exceptions.py.template +43 -0
  431. package/src/generators/python-microservice/files/src/__packageName__/core/ports.py.template +42 -0
  432. package/src/generators/python-microservice/files/src/__packageName__/core/service/example_service.py.template +68 -0
  433. package/src/generators/python-microservice/files/src/__packageName__/entrypoints/api/dependencies.py.template +50 -0
  434. package/src/generators/python-microservice/files/src/__packageName__/entrypoints/api/middleware.py.template +131 -0
  435. package/src/generators/python-microservice/files/src/__packageName__/entrypoints/api/router.py.template +37 -0
  436. package/src/generators/python-microservice/files/src/__packageName__/entrypoints/api/websocket_handler.py.template +20 -0
  437. package/src/generators/python-microservice/files/src/__packageName__/entrypoints/worker/cleanup.py.template +35 -0
  438. package/src/generators/python-microservice/files/src/__packageName__/entrypoints/worker/worker.py.template +28 -0
  439. package/src/generators/python-microservice/files/src/__packageName__/main.py.template +108 -0
  440. package/src/generators/python-microservice/files/tests/test_main.py.template +74 -0
  441. package/src/generators/python-microservice/files/tests/test_middleware.py.template +109 -0
  442. package/src/generators/python-microservice/files/tests/test_worker.py.template +16 -0
  443. package/src/generators/python-microservice/generator.ts +286 -0
  444. package/src/generators/python-microservice/schema.json +86 -0
  445. package/src/generators/shared/brand-tokens.ts +301 -0
  446. package/src/generators/shared/capabilities.ts +349 -0
  447. package/src/generators/shared/provenance.ts +61 -0
  448. package/src/generators/shared/scaffold-helpers.ts +309 -0
  449. package/src/generators/system-test-runner/files/tests/bets/.gitkeep +0 -0
  450. package/src/generators/system-test-runner/files/tests/bets/_archive/.gitkeep +0 -0
  451. package/src/generators/system-test-runner/files/tests/conftest.py.template +503 -0
  452. package/src/generators/system-test-runner/files/tests/pyproject.toml.template +20 -0
  453. package/src/generators/system-test-runner/files/tests/system/pages/__init__.py.template +9 -0
  454. package/src/generators/system-test-runner/files/tests/system/pages/base_page.py.template +36 -0
  455. package/src/generators/system-test-runner/files/tests/system/test_a11y_smoke.py.template +132 -0
  456. package/src/generators/system-test-runner/files/tests/system/test_contract_conformance.py.template +140 -0
  457. package/src/generators/system-test-runner/files/tests/system/test_layout_geometry.py.template +109 -0
  458. package/src/generators/system-test-runner/files/tests/system/test_render_smoke.py.template +227 -0
  459. package/src/generators/system-test-runner/files/tests/system/test_system.py.template +158 -0
  460. package/src/generators/system-test-runner/files/tests/system/test_token_conformance.py.template +206 -0
  461. package/src/generators/system-test-runner/files/tests/system/test_visual_regression.py.template +104 -0
  462. package/src/generators/system-test-runner/generator.ts +142 -0
  463. package/src/generators/system-test-runner/schema.json +24 -0
  464. package/src/generators/workspace-dev-cli/cli-src/build.mjs +42 -0
  465. package/src/generators/workspace-dev-cli/cli-src/dist/dev-bundle.js +2168 -0
  466. package/src/generators/workspace-dev-cli/cli-src/src/commands/bet.ts +442 -0
  467. package/src/generators/workspace-dev-cli/cli-src/src/commands/completion.ts +87 -0
  468. package/src/generators/workspace-dev-cli/cli-src/src/commands/doctor.ts +139 -0
  469. package/src/generators/workspace-dev-cli/cli-src/src/commands/lifecycle.ts +548 -0
  470. package/src/generators/workspace-dev-cli/cli-src/src/commands/quality.ts +127 -0
  471. package/src/generators/workspace-dev-cli/cli-src/src/commands/surface.ts +214 -0
  472. package/src/generators/workspace-dev-cli/cli-src/src/index.ts +127 -0
  473. package/src/generators/workspace-dev-cli/cli-src/src/registry.ts +194 -0
  474. package/src/generators/workspace-dev-cli/cli-src/src/theme/color.ts +130 -0
  475. package/src/generators/workspace-dev-cli/cli-src/src/theme/render.ts +158 -0
  476. package/src/generators/workspace-dev-cli/cli-src/src/theme/tokens.ts +122 -0
  477. package/src/generators/workspace-dev-cli/cli-src/src/util/context.ts +43 -0
  478. package/src/generators/workspace-dev-cli/cli-src/src/util/extensions.ts +99 -0
  479. package/src/generators/workspace-dev-cli/cli-src/src/util/paths.ts +46 -0
  480. package/src/generators/workspace-dev-cli/cli-src/src/util/proc.ts +106 -0
  481. package/src/generators/workspace-dev-cli/cli-src/src/util/prompt.ts +108 -0
  482. package/src/generators/workspace-dev-cli/cli-src/src/util/runners.ts +70 -0
  483. package/src/generators/workspace-dev-cli/cli-src/src/util/services.ts +221 -0
  484. package/src/generators/workspace-dev-cli/cli-src/src/util/version.ts +21 -0
  485. package/src/generators/workspace-dev-cli/cli-src/tsconfig.json +16 -0
  486. package/src/generators/workspace-dev-cli/files/.agents/skills/workspace-cli/SKILL.md.template +74 -0
  487. package/src/generators/workspace-dev-cli/files/dev.template +16 -0
  488. package/src/generators/workspace-dev-cli/files/docker-compose.yml.template +20 -0
  489. package/src/generators/workspace-dev-cli/files/scripts/cli/templates/milestone-test.pytmpl.template +46 -0
  490. package/src/generators/workspace-dev-cli/files/scripts/cli/templates/slice-test.pytmpl.template +38 -0
  491. package/src/generators/workspace-dev-cli/generator.ts +136 -0
  492. package/src/generators/workspace-dev-cli/schema.json +22 -0
  493. package/src/hidden-skills/code-intelligence.md +129 -0
  494. package/src/hidden-skills/groundwork-architect/SKILL.md +114 -0
  495. package/src/hidden-skills/groundwork-architect/references/agentic-systems.md +44 -0
  496. package/src/hidden-skills/groundwork-architect/references/ai-native-architecture.md +37 -0
  497. package/src/hidden-skills/groundwork-architect/references/api-and-contracts.md +45 -0
  498. package/src/hidden-skills/groundwork-architect/references/core-and-boundaries.md +45 -0
  499. package/src/hidden-skills/groundwork-architect/references/data-architecture.md +33 -0
  500. package/src/hidden-skills/groundwork-architect/references/decision-records.md +34 -0
  501. package/src/hidden-skills/groundwork-architect/references/durable-execution.md +45 -0
  502. package/src/hidden-skills/groundwork-architect/references/evolutionary-architecture.md +37 -0
  503. package/src/hidden-skills/groundwork-architect/references/identity-and-access.md +41 -0
  504. package/src/hidden-skills/groundwork-architect/references/integration-patterns.md +39 -0
  505. package/src/hidden-skills/groundwork-architect/references/observability.md +36 -0
  506. package/src/hidden-skills/groundwork-architect/references/performance-and-scale.md +41 -0
  507. package/src/hidden-skills/groundwork-architect/references/platform-and-delivery.md +47 -0
  508. package/src/hidden-skills/groundwork-architect/references/realtime-and-async.md +28 -0
  509. package/src/hidden-skills/groundwork-architect/references/reliability.md +31 -0
  510. package/src/hidden-skills/groundwork-architect/references/security-and-trust.md +47 -0
  511. package/src/hidden-skills/groundwork-architect/references/surface-architecture.md +40 -0
  512. package/src/hidden-skills/groundwork-architect/sync-anchor.md +34 -0
  513. package/src/hidden-skills/groundwork-architecture/architecture-template.md +50 -0
  514. package/src/hidden-skills/groundwork-architecture/instructions.md +139 -0
  515. package/src/hidden-skills/groundwork-architecture/phases/01-context-ingestion.md +18 -0
  516. package/src/hidden-skills/groundwork-architecture/phases/02-technical-constraints.md +27 -0
  517. package/src/hidden-skills/groundwork-architecture/phases/03-service-design.md +19 -0
  518. package/src/hidden-skills/groundwork-architecture/phases/04-data-flow-communication.md +23 -0
  519. package/src/hidden-skills/groundwork-architecture/phases/05-component-boundaries-contracts.md +17 -0
  520. package/src/hidden-skills/groundwork-architecture/phases/06-draft-review-present.md +38 -0
  521. package/src/hidden-skills/groundwork-architecture/phases/07-commit.md +33 -0
  522. package/src/hidden-skills/groundwork-architecture/templates/architecture-cache.md +43 -0
  523. package/src/hidden-skills/groundwork-architecture-extract/instructions.md +163 -0
  524. package/src/hidden-skills/groundwork-architecture-extract/templates/architecture-extract-cache.md +21 -0
  525. package/src/hidden-skills/groundwork-bet/briefs/slice-worker.md +191 -0
  526. package/src/hidden-skills/groundwork-bet/instructions.md +88 -0
  527. package/src/hidden-skills/groundwork-bet/templates/bet-progress-test.md +126 -0
  528. package/src/hidden-skills/groundwork-bet/templates/change-proposal.md +38 -0
  529. package/src/hidden-skills/groundwork-bet/templates/decomposition/meta.json +4 -0
  530. package/src/hidden-skills/groundwork-bet/templates/decomposition/milestone-index.md +35 -0
  531. package/src/hidden-skills/groundwork-bet/templates/decomposition/slice.md +35 -0
  532. package/src/hidden-skills/groundwork-bet/templates/pitch.md +45 -0
  533. package/src/hidden-skills/groundwork-bet/templates/technical-design/01-ui-design.md +51 -0
  534. package/src/hidden-skills/groundwork-bet/templates/technical-design/02-data-flows.md +36 -0
  535. package/src/hidden-skills/groundwork-bet/templates/technical-design/03-api-design.md +90 -0
  536. package/src/hidden-skills/groundwork-bet/templates/technical-design/04-data-design.md +29 -0
  537. package/src/hidden-skills/groundwork-bet/workflows/01-discovery.md +198 -0
  538. package/src/hidden-skills/groundwork-bet/workflows/02-design.md +168 -0
  539. package/src/hidden-skills/groundwork-bet/workflows/03-decomposition.md +246 -0
  540. package/src/hidden-skills/groundwork-bet/workflows/04-delivery.md +193 -0
  541. package/src/hidden-skills/groundwork-bet/workflows/05-validation.md +199 -0
  542. package/src/hidden-skills/groundwork-design-system/instructions.md +125 -0
  543. package/src/hidden-skills/groundwork-design-system/templates/brand-tokens.md +182 -0
  544. package/src/hidden-skills/groundwork-design-system/templates/design-system-cache.md +64 -0
  545. package/src/hidden-skills/groundwork-design-system/tracks/_foundation.md +136 -0
  546. package/src/hidden-skills/groundwork-design-system/tracks/agentic-protocol.md +269 -0
  547. package/src/hidden-skills/groundwork-design-system/tracks/cli.md +355 -0
  548. package/src/hidden-skills/groundwork-design-system/tracks/graphical-ui.md +330 -0
  549. package/src/hidden-skills/groundwork-design-system-extract/instructions.md +124 -0
  550. package/src/hidden-skills/groundwork-design-system-extract/templates/design-system-extract-cache.md +19 -0
  551. package/src/hidden-skills/groundwork-designer/SKILL.md +108 -0
  552. package/src/hidden-skills/groundwork-designer/references/accessibility.md +33 -0
  553. package/src/hidden-skills/groundwork-designer/references/ai-native-design.md +37 -0
  554. package/src/hidden-skills/groundwork-designer/references/design-review.md +29 -0
  555. package/src/hidden-skills/groundwork-designer/references/design-systems-and-tokens.md +33 -0
  556. package/src/hidden-skills/groundwork-designer/references/interaction-and-motion.md +37 -0
  557. package/src/hidden-skills/groundwork-designer/references/layout-and-space.md +33 -0
  558. package/src/hidden-skills/groundwork-designer/references/usability-and-ux.md +33 -0
  559. package/src/hidden-skills/groundwork-designer/references/visual-craft.md +49 -0
  560. package/src/hidden-skills/groundwork-designer/sync-anchor.md +20 -0
  561. package/src/hidden-skills/groundwork-doc-sync/instructions.md +100 -0
  562. package/src/hidden-skills/groundwork-elicit/instructions.md +66 -0
  563. package/src/hidden-skills/groundwork-elicit/methods.md +65 -0
  564. package/src/hidden-skills/groundwork-infra-adopt/instructions.md +168 -0
  565. package/src/hidden-skills/groundwork-infra-adopt/templates/infra-adopt-cache.md +21 -0
  566. package/src/hidden-skills/groundwork-mvp/instructions.md +223 -0
  567. package/src/hidden-skills/groundwork-mvp/templates/mvp-cache.md +9 -0
  568. package/src/hidden-skills/groundwork-patch/instructions.md +40 -0
  569. package/src/hidden-skills/groundwork-persona/instructions.md +54 -0
  570. package/src/hidden-skills/groundwork-product/SKILL.md +102 -0
  571. package/src/hidden-skills/groundwork-product/references/ai-native-product.md +45 -0
  572. package/src/hidden-skills/groundwork-product/references/discovery-and-opportunity.md +38 -0
  573. package/src/hidden-skills/groundwork-product/references/product-risks.md +52 -0
  574. package/src/hidden-skills/groundwork-product/references/requirements-and-specs.md +39 -0
  575. package/src/hidden-skills/groundwork-product/references/scope-and-sequencing.md +35 -0
  576. package/src/hidden-skills/groundwork-product/references/shaping-and-appetite.md +48 -0
  577. package/src/hidden-skills/groundwork-product/references/success-metrics-and-signals.md +37 -0
  578. package/src/hidden-skills/groundwork-product/sync-anchor.md +19 -0
  579. package/src/hidden-skills/groundwork-product-brief/instructions.md +231 -0
  580. package/src/hidden-skills/groundwork-product-brief-extract/instructions.md +139 -0
  581. package/src/hidden-skills/groundwork-product-brief-extract/templates/product-brief-extract-cache.md +17 -0
  582. package/src/hidden-skills/groundwork-review/checklists/architecture.md +93 -0
  583. package/src/hidden-skills/groundwork-review/checklists/bet-pitch.md +94 -0
  584. package/src/hidden-skills/groundwork-review/checklists/decomposition.md +135 -0
  585. package/src/hidden-skills/groundwork-review/checklists/design-system.md +85 -0
  586. package/src/hidden-skills/groundwork-review/checklists/domain-entity.md +66 -0
  587. package/src/hidden-skills/groundwork-review/checklists/implementation-readiness.md +46 -0
  588. package/src/hidden-skills/groundwork-review/checklists/infrastructure.md +68 -0
  589. package/src/hidden-skills/groundwork-review/checklists/maturity.md +71 -0
  590. package/src/hidden-skills/groundwork-review/checklists/product-brief.md +69 -0
  591. package/src/hidden-skills/groundwork-review/checklists/technical-design.md +112 -0
  592. package/src/hidden-skills/groundwork-review/instructions.md +181 -0
  593. package/src/hidden-skills/groundwork-scaffold/instructions.md +254 -0
  594. package/src/hidden-skills/groundwork-scaffold/phases/01-ingestion-service-mapping.md +87 -0
  595. package/src/hidden-skills/groundwork-scaffold/phases/02-scaffolding-execution.md +15 -0
  596. package/src/hidden-skills/groundwork-scaffold/phases/03-service-documentation-api-stubs.md +100 -0
  597. package/src/hidden-skills/groundwork-scaffold/phases/04-infrastructure-verification.md +17 -0
  598. package/src/hidden-skills/groundwork-scaffold/phases/05-draft-review.md +19 -0
  599. package/src/hidden-skills/groundwork-scaffold/phases/06-commit.md +19 -0
  600. package/src/hidden-skills/groundwork-scaffold/templates/scaffold-cache.md +23 -0
  601. package/src/hidden-skills/groundwork-scan/instructions.md +164 -0
  602. package/src/hidden-skills/groundwork-scan/references/digest-schema.md +66 -0
  603. package/src/hidden-skills/groundwork-scan/references/exclusions.md +44 -0
  604. package/src/hidden-skills/groundwork-scan/templates/architecture-findings.md +42 -0
  605. package/src/hidden-skills/groundwork-scan/templates/design-findings.md +23 -0
  606. package/src/hidden-skills/groundwork-scan/templates/overview.md +26 -0
  607. package/src/hidden-skills/groundwork-scan/templates/product-findings.md +23 -0
  608. package/src/hidden-skills/groundwork-scan/templates/scan-state.json +19 -0
  609. package/src/hidden-skills/groundwork-stack-forge/instructions.md +150 -0
  610. package/src/hidden-skills/groundwork-stack-forge/references/authoring-engineer-skills.md +107 -0
  611. package/src/hidden-skills/groundwork-surface-activation/instructions.md +138 -0
  612. package/src/hidden-skills/groundwork-update/briefs/reconcile-worker.md +196 -0
  613. package/src/hidden-skills/groundwork-update/instructions.md +200 -0
  614. package/src/hidden-skills/groundwork-writer/SKILL.md +278 -0
  615. package/src/hidden-skills/maturity-model.md +125 -0
  616. package/src/hidden-skills/operating-contract.md +400 -0
  617. package/src/hidden-skills/repo-map-schema.md +90 -0
  618. package/src/hidden-skills/templates/adr.md +57 -0
  619. package/src/hidden-skills/templates/capability-ports.md +71 -0
  620. package/src/hidden-skills/templates/discovery-notes.md +33 -0
  621. package/src/hidden-skills/templates/domain-entity.md +80 -0
  622. package/src/hidden-skills/templates/gap-ledger.md +21 -0
  623. package/src/hidden-skills/templates/handoff.md +37 -0
  624. package/src/hidden-skills/templates/maturity.md +39 -0
  625. package/src/hidden-skills/templates/surfaces.md +207 -0
  626. package/src/skills/groundwork-check/SKILL.md +56 -0
  627. package/src/skills/groundwork-check/instructions.md +70 -0
  628. package/src/skills/groundwork-orchestrator/SKILL.md +176 -0
  629. package/src/skills/groundwork-orchestrator/workflow-index.md +50 -0
@@ -0,0 +1,330 @@
1
+ # Graphical UI Track
2
+
3
+ This track applies to products with a visual user interface: web apps, mobile apps, desktop applications, dashboards, and any product where humans interact through a screen.
4
+
5
+ The shared foundation flow (`tracks/_foundation.md`) owns the session spine: it runs the brand-level Phases 1, 2, and 4 once for the whole product, drawing this track's contributions from the Foundation Contributions section below, and it runs this track's Phase 3 and Phase 5 at the right points. Its Cross-Phase Signal Capture rule stays in force throughout every phase of this track.
6
+
7
+ ---
8
+
9
+ ## Default Stance
10
+
11
+ Be fluid. Adapt seamlessly to the user's preferences, product positioning, and purpose. The agent's role is to match the user's vision — not to impose a rigid aesthetic.
12
+
13
+ The default starting position is modern, high-end design. When the user has no strong preference, advocate for the following defaults — and be ready to explain *why* each one matters:
14
+
15
+ **Technical defaults:**
16
+ - Sub-50ms interaction latency via optimistic UI execution and stale-while-revalidate (SWR) patterns. Perceived speed is the primary driver of product quality perception — a 200ms delay feels broken to users trained by Linear and Arc.
17
+ - Keyboard-first navigation with a global command palette (Cmd+K) as the primary navigation and search surface. Power users live in the keyboard; mouse-first design caps productivity.
18
+ - Strict accessibility (WCAG 2.1 AA minimum), semantic HTML, and zero-mouse navigability. Accessibility is structural quality, not a compliance checkbox — products that work for screen readers work better for everyone.
19
+ - Light and dark theme support with system-preference detection. Dual-theme is a baseline expectation, not a premium feature.
20
+ - Hardware-accelerated animation only (`transform`, `opacity`, `filter`). Animating layout properties (width, height, top) triggers reflow and drops frames. Respect `prefers-reduced-motion`.
21
+ - Perceptually uniform colour spaces (OKLCH). HEX and RGB produce unpredictable perceived brightness shifts across hue ranges — a blue and a yellow at the same HEX lightness value look wildly different to the human eye. OKLCH solves this by design.
22
+ - An 8-point spatial grid for all dimensions. Consistent spacing creates visual rhythm; arbitrary pixel values accumulate into visual noise.
23
+
24
+ **Aesthetic bar** (examples of the premium standard the agent targets — adapt to the user's direction):
25
+ - Dual-theme design with considered light and dark palettes — not an afterthought toggle.
26
+ - Multi-layered depth systems (shadow stacks, glassmorphism, neumorphism) — not flat, single-layer surfaces.
27
+ - Ambient surface treatments that break visual monotony on large canvases.
28
+ - Tactile micro-interactions: scale-on-press, spring physics, and subtle state transitions that make the UI feel physical.
29
+ - Considered layout systems (bento-box grids, focused single-column) with generous whitespace and clear visual hierarchy.
30
+ - Fluid typography that responds to viewport width.
31
+
32
+ Draw inspiration from trend-setting companies: Linear, Vercel, Raycast, Arc, Apple. These set the bar the agent calibrates against.
33
+
34
+ ---
35
+
36
+ ## Foundation Contributions
37
+
38
+ The shared foundation flow pulls these sections into its brand-level phases.
39
+
40
+ ### Envelope (foundation Phase 1)
41
+
42
+ Cover all relevant dimensions of the graphical envelope: performance and latency targets, accessibility baselines, multi-device and viewport requirements, real-time and sync needs, offline and error tolerance, session persistence, notification model, and security UX. Ground each decision in the product brief and apply the track defaults where applicable: sub-50ms perceived latency, WCAG 2.1 AA, 8-point grid, OKLCH, hardware-accelerated animation only.
43
+
44
+ ### Type language (foundation Phase 4)
45
+
46
+ Fold these dimensions into the foundation's language clusters:
47
+
48
+ - **Cluster 1: Identity** — Aesthetic direction, colour psychology and mood, typography character. Propose the product's visual personality as a unified stance: what it feels like, what emotional register both themes carry, and what typographic character reinforces the identity.
49
+ - **Cluster 2: Feel** — Surface and depth philosophy, motion and feedback, content density and readability. Propose how physical and tactile the UI should feel — layered or flat, animated or restrained, dense or spacious.
50
+ - **Cluster 3: Craft** — Iconography and imagery weight, tone of voice and microcopy, data visualisation (if applicable). Propose the visual weight of icons and the personality of the UI's copy.
51
+
52
+ This type's Synthesis Gate expression fields:
53
+
54
+ - **Colour mood**: The emotional temperature for both themes.
55
+ - **Depth and surface**: How physical the UI feels and what techniques create that physicality.
56
+ - **Typography character**: The personality of the type, not the font name.
57
+ - **Motion philosophy**: How the UI responds to touch.
58
+ - **Iconography feel**: The visual weight and style.
59
+
60
+ ---
61
+
62
+ ## Phase 3: App Shell
63
+
64
+ *Runs inside the foundation flow's Phase 3 step — once for this type.*
65
+
66
+ The app shell is the structural container everything else lives inside — navigation, layout, context preservation, and system-level states. Getting this wrong means reworking every screen. Getting it right means every subsequent design decision has a home.
67
+
68
+ Define the structural skeleton using the layout paradigms from the Phase 2 inspiration library. The agent should explore and propose decisions across: global navigation and search patterns, layout skeleton, context preservation (how sub-tasks work without losing the main context), notification and presence surfaces, empty and loading states, and onboarding and first-run experience.
69
+
70
+ When the product's graphical-ui surfaces span beyond web, settle the skeleton per platform — a tab-and-stack scaffold on a phone and a multi-pane window on desktop are different structures, not renderings of one web shell. Phase 5's Platform Dimension section states how the platform set is read and which vocabulary each platform's translation uses.
71
+
72
+ Guide the conversation with leading-edge structural trends. Propose the app shell based on the inspiration library, then ask the user to react and refine.
73
+
74
+ When a shell decision implies a backend capability — notifications, search, session state, presence, real-time delivery — append the implication as a bullet under `## Architecture` in `.groundwork/cache/discovery-notes.md` before continuing the shell conversation. The architecture phase finds these notes and skips re-deriving what was already decided here.
75
+
76
+ Once approved, write to this type's subsection under Phase 3 in `.groundwork/cache/design-system-cache.md` and set it to `done`. Return to the foundation flow.
77
+
78
+ ---
79
+
80
+ ## Phase 5: Expert Translation & Guided Review
81
+
82
+ *The foundation flow runs this phase once per active type, after the brand language direction (foundation Phase 4) is confirmed. The agent's job here is to derive every token, shadow, and easing curve autonomously from that direction.*
83
+
84
+ ### Platform Dimension
85
+
86
+ This track designs for the type; a product can express it through web, mobile, and desktop surfaces sharing this one run. Before translating, resolve which platforms the product's graphical-ui surfaces target: when `docs/surfaces.md` exists (lazy activation, brownfield), read each graphical-ui entry's platform field; pre-registry — the normal greenfield case, because architecture writes the registry after this phase — read the surface set carried in the product brief's Downstream Context file `.groundwork/context/product-brief.md` (Protocol 5). Translate for the platforms of the surfaces in this run's scope; a platform arriving at a later horizon gains its guidance when `groundwork-surface-activation` births its surface.
87
+
88
+ The platform dimension changes vocabulary and ergonomics, never the brand: one Phase 4 direction, one Tier 2 visual block, one spec — with each platform's content written in that platform's language. Platform content folds into the existing draft section files (platform targets into the constraints file, per-platform shell expression into the shell file, ergonomics and motion into the interaction file); the file layout, review pass, and walkthrough clusters keep their shape regardless of the platform set.
89
+
90
+ #### Web (baseline)
91
+
92
+ Everything in this track is written in web vocabulary — CSS tokens, viewports, hover states, scrollbars, responsive grids. That content is the web baseline, not one platform's appendix: a product whose graphical-ui surfaces are web-only runs the phase exactly as written, and the mobile and desktop subsections below never enter the conversation.
93
+
94
+ #### Mobile (Flutter idiom)
95
+
96
+ When a mobile surface is in scope, its content in the spec speaks Flutter's language — the app is widgets composed into screens, and a spec that prescribes hover states and scrollbar styling for a phone forces the implementer to translate twice.
97
+
98
+ - **Navigation is stacks and tabs, not URLs.** Express the shell as navigation stacks, tab scaffolds, and modal presentations in go_router idiom: typed routes, a tab scaffold with per-tab navigation state (`StatefulShellRoute`), and deep links that fall out of every declared route — which makes the route structure a first-class state container worth designing deliberately. The shell content states which journeys live on which tab, what pushes onto a stack versus presents modally, and where deep links land.
99
+ - **Touch ergonomics replace pointer precision.** Every interactive element meets the 48dp tap-target minimum. Hover does not exist on touch — specify pressed, focused, and disabled states instead. Gestures the product relies on need visible affordances, because an undiscoverable gesture is a missing feature to the user who never finds it. Place recurring primary actions within thumb reach — the bottom half of the screen on one-handed phones.
100
+ - **Material is the base system.** Specify the mobile UI as a token-themed expression of Material, not a parallel from-scratch component language — component anatomy describes how the tokens restyle Material parts. This keeps the generated theme module the single styling authority and the brand consistent with the web surface at the token level.
101
+ - **Motion respects mobile attention.** Full-screen transitions span more distance than pointer micro-interactions and read slower; mobile sessions are short and interruption-driven, so motion must inform without delaying. The type scale must survive the platform's dynamic type — large accessibility text scales cannot break layouts, and contrast floors hold through the token palette exactly as on web.
102
+ - **Tokens project into a generated theme.** The conversation still produces token values — OKLCH palette, type scale, radii, durations — and the visual block carries them; the Flutter app's theme module is generated from those tokens into `ThemeData` and semantic theme extensions, and widgets consume the theme, never literals. Write the spec at token level; never prescribe Dart or widget code. Where mobile ergonomics need token support — the tap-target minimum, a touch motion scale — record them in the visual block's `platform.touch` fields per the brand-tokens contract: the same shared block web reads, extended, never a per-platform fork.
103
+
104
+ #### Desktop (Electron idiom)
105
+
106
+ A desktop surface is the web design running inside a desktop shell: the renderer reuses the web design wholesale — components, styling, accessibility, and theme contents come from the web baseline unchanged. This subsection owns only what the shell adds; never respecify the web content for desktop.
107
+
108
+ - **Windows and chrome.** Decide the title-bar treatment — native platform chrome, hidden-inset content that sits beneath the platform's window controls (macOS traffic lights), or fully custom — and hold it consistent across every window the product opens.
109
+ - **Menus and keyboard-first interaction.** Desktop users expect an application menu and OS-level keyboard accelerators; the baseline's command-palette stance deepens here into native menu conventions. Specify the menu structure and the shortcut vocabulary alongside the palette, not as an afterthought to it.
110
+ - **Multi-window and multi-pane layouts.** A desktop shell earns persistent multi-pane layouts and secondary windows that a browser tab does not. Specify what content justifies a pane versus a second window, and how the layout behaves when windows resize or multiply.
111
+ - **Density for pointer precision.** Pointer input tolerates denser layouts and smaller targets than touch; when the desktop surface warrants tighter spacing than the baseline, record the override in the visual block's `platform.desktop.density` field rather than forking the spacing system.
112
+ - **Theme follows the OS.** Light/dark sync comes from `nativeTheme` in the shell's main process, broadcast to the renderer and mapped onto the document — the spec states that the OS preference drives the theme; the mechanism belongs to the generator. What the theme contains is the baseline's dual-theme palette, unchanged.
113
+
114
+ Where desktop chrome needs token support — title-bar treatment, menu style, density — record it in the visual block's `platform.desktop` fields per the brand-tokens contract.
115
+
116
+ ### 5a: Translation (Agent-Driven, Autonomous)
117
+
118
+ The user provided taste, instinct, and direction across Phases 1–4. The agent now translates that into a rigorous, CSS-level engineering specification — autonomously.
119
+
120
+ **Output location**: `.groundwork/cache/design-system-draft/` — a directory of per-section files. Each file stays bounded in size, so any later change (review revise, 5b re-flow) touches only the affected files instead of regenerating the whole spec in a single turn. Regenerating the whole spec at once exhausts the per-response output token budget on rich specs; the per-section layout makes that failure structurally impossible. Writing to `docs/design-system.md` is prohibited until Phase 6 (Commit) — on initial generation that file does not exist; do not attempt to read it.
121
+
122
+ **Write each section as a separate file.** Use one `write_file` call per section (the tool creates parent directories automatically):
123
+
124
+ | File | Content |
125
+ |---|---|
126
+ | `00-header.md` | The document title and the "implementation-ready specification" intro paragraph. No summary section — the Downstream Context (Protocol 5) is written separately to `.groundwork/context/design-system.md` at commit, not concatenated into the spec |
127
+ | `01-constraints.md` | Part 1 — performance budgets, a11y baselines, platform targets, sync, error tolerance |
128
+ | `02-shell.md` | Part 2 — navigation model, layout skeleton, empty/loading states, onboarding |
129
+ | `03-foundation.md` | Part 3 Cluster 1 — colour architecture (both themes), the full type scale, spacing tokens |
130
+ | `04-interaction.md` | Part 3 Cluster 2 — surface depth & shadow stacks, motion & easing, interaction states |
131
+ | `05-surface.md` | Part 3 Cluster 3 — scrollbars, toasts, error choreography, skeletons, borders, overflow, responsive grid, and any remaining engineering-craft sections from the target structure |
132
+
133
+ The numeric prefixes determine concatenation order at commit. Each file is a self-contained markdown section — start its top-level heading at H1 (`# Part 1 — Constraints`) or H2 (`## Colour Architecture`) as appropriate so the files compose cleanly when concatenated.
134
+
135
+ This table is the single-active-type layout; the foundation flow's Draft Layout rule governs how it adapts — the type section title (`# Graphical UI`) opening the first type-specific file, and, when several types are active, decade-prefixed type-slugged filenames with part headings demoted beneath the type title and `01-foundation.md` carrying the shared Part 1.
136
+
137
+ Compile the full design system document using the approved outputs stored in `.groundwork/cache/design-system-cache.md`. The document combines NFRs from Phase 1 with a comprehensive design system that the agent derives from the design language direction captured in Phase 4.
138
+
139
+ Apply the `groundwork-writer` skill to ensure the tone is declarative, assertive, and free of hedging. Structure it to read like a rigorous engineering specification that simultaneously serves as a powerful prompt for generative UI tools.
140
+
141
+ #### Base Token Resolution
142
+
143
+ Before writing any section of the spec, resolve these base tokens from the Phase 4 direction. Fill in every blank — these are the roots from which the entire design system grows. If you cannot commit to a specific value for any entry, return to Phase 4, gather more information, and resolve it before proceeding.
144
+
145
+ ```css
146
+ /* === RESOLVE BEFORE DRAFTING === */
147
+
148
+ /* Colour — light theme */
149
+ --color-primary: oklch(__ __ __); /* primary action */
150
+ --color-surface: oklch(__ __ __); /* page background */
151
+ --color-surface-alt: oklch(__ __ __); /* card / panel background */
152
+ --color-text-body: oklch(__ __ __); /* body text */
153
+ --color-accent: oklch(__ __ __); /* accent / highlight */
154
+
155
+ /* Colour — dark theme */
156
+ [data-theme="dark"] {
157
+ --color-primary: oklch(__ __ __);
158
+ --color-surface: oklch(__ __ __);
159
+ --color-text-body: oklch(__ __ __);
160
+ }
161
+
162
+ /* Shadow — Tier 1 (resting cards and containers) */
163
+ --shadow-resting:
164
+ 0 __px __px oklch(0% 0 0 / 0.__), /* contact shadow */
165
+ 0 __px __px oklch(0% 0 0 / 0.__); /* ambient shadow */
166
+
167
+ /* Typography */
168
+ --font-display: "__"; /* heading family, weight */
169
+ --font-body: "__"; /* body family, weight */
170
+ --text-base: __px / __ "__"; /* base step: size / line-height */
171
+ --text-lg: __px / __ "__";
172
+ --text-sm: __px / __ "__";
173
+
174
+ /* Motion */
175
+ --ease-standard: cubic-bezier(__, __, __, __);
176
+ --duration-base: __ms;
177
+ ```
178
+
179
+ #### The Translation Mandate
180
+
181
+ This is where the agent earns its value. The user said "warm vellum" — the agent commits to `oklch(96% 0.008 60)`. The user said "physical, tactile press" — the agent specifies `transform: scale(0.98)` with `transition: 150ms cubic-bezier(0.2, 0, 0, 1)`. The user said "editorial serif" — the agent selects a specific font at specific weights and sizes across the full type scale. Every high-level preference from Phase 4 must be resolved into concrete, implementable values. If the cached direction is ambiguous, the agent makes the design call — that is the job.
182
+
183
+ Generative UI tools (v0, Lovable) consistently fail to produce truly premium output without deeply specified CSS. The design system must go beyond naming colours and fonts — it must prescribe exact shadow stacks, surface treatments, ambient textures, and a clear class/token hierarchy.
184
+
185
+ #### Quality Standard: Deep vs. Shallow
186
+
187
+ The difference between a useful design system and a shallow one is specificity. Every section must contain enough detail that a developer (or an AI tool) can implement it without making any design decisions of their own.
188
+
189
+ **Shallow output (unacceptable):**
190
+ ```css
191
+ /* Elevation */
192
+ --shadow-sm: 0 1px 2px rgba(0,0,0,0.1);
193
+ --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
194
+ --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
195
+ ```
196
+
197
+ **Deep output (required standard):**
198
+ ```css
199
+ /* Elevation — multi-layer shadow stacks for naturalistic depth.
200
+ Each tier combines a tight, sharp shadow (contact shadow simulating
201
+ surface contact) with a diffuse ambient shadow (environmental light).
202
+ Opacity calibrated against --surface-primary in both themes. */
203
+
204
+ /* Tier 1: Resting — cards, containers, default interactive elements */
205
+ --shadow-resting:
206
+ 0 1px 1px oklch(0% 0 0 / 0.04), /* contact: tight, near-surface */
207
+ 0 2px 4px oklch(0% 0 0 / 0.03), /* ambient: soft environmental */
208
+ 0 0 0 1px oklch(0% 0 0 / 0.02); /* edge: subtle border reinforcement */
209
+
210
+ /* Tier 2: Raised — hover states, active cards, popovers */
211
+ --shadow-raised:
212
+ 0 2px 2px oklch(0% 0 0 / 0.04),
213
+ 0 4px 8px oklch(0% 0 0 / 0.05),
214
+ 0 8px 16px oklch(0% 0 0 / 0.03),
215
+ 0 0 0 1px oklch(0% 0 0 / 0.02);
216
+
217
+ /* Tier 3: Floating — modals, command palette, dropdowns */
218
+ --shadow-floating:
219
+ 0 4px 4px oklch(0% 0 0 / 0.04),
220
+ 0 8px 16px oklch(0% 0 0 / 0.06),
221
+ 0 16px 32px oklch(0% 0 0 / 0.05),
222
+ 0 24px 48px oklch(0% 0 0 / 0.03);
223
+
224
+ /* Dark theme — shadows are deeper and higher contrast because
225
+ dark surfaces absorb ambient light */
226
+ [data-theme="dark"] {
227
+ --shadow-resting:
228
+ 0 1px 1px oklch(0% 0 0 / 0.12),
229
+ 0 2px 4px oklch(0% 0 0 / 0.10),
230
+ 0 0 0 1px oklch(100% 0 0 / 0.03);
231
+ /* ... */
232
+ }
233
+ ```
234
+
235
+ The shallow version gives a developer three variables. The deep version gives them a complete elevation system with design rationale, multi-layer composition, theme variants, and usage rules. **Every section of the design system must hit this depth.**
236
+
237
+ The same standard applies across the entire specification:
238
+ - **Colour architecture**: Not just token names — full OKLCH values for both themes, semantic role definitions, alpha transparency rules, and the perceptual reasoning behind palette construction.
239
+ - **Type scale**: Not just font sizes — both font families with specific weights, all named steps from display through micro, line-heights calibrated to the spatial grid, and responsive fluid clamp values.
240
+ - **Spacing tokens**: Not just `--space-1` through `--space-8` — the grid base, how each step is derived, and which tokens apply at which level of the component hierarchy.
241
+ - **Surface classes**: Not just background colours — named classes with full CSS (background, border, shadow, backdrop-filter where applicable), usage rules defining when each class applies, and both theme variants.
242
+ - **Interaction states**: Not just hover colours — complete CSS for hover, active/press, focus-visible, disabled, and loading states including transforms, transitions, easing curves, and duration reasoning.
243
+ - **Component anatomy**: Not just "buttons have rounded corners" — full CSS for every button variant (primary, secondary, ghost, destructive) and every input variant, with padding derived from the spacing system and radii following the concentric radii rule.
244
+
245
+ #### Design System Target Structure
246
+
247
+ The spec must cover all of the following. Missing sections are not acceptable:
248
+
249
+ **Part 1 — Constraints**: Performance budgets, a11y baselines, platform targets, sync requirements, error tolerance.
250
+
251
+ **Part 2 — Shell**: Navigation model, layout skeleton, empty/loading states, onboarding.
252
+
253
+ **Part 3 — Design System** (each with exact CSS values at the depth standard above):
254
+ Colour architecture (OKLCH, both themes) · Type scale (all steps) · Spacing tokens · Surface class hierarchy · Elevation & shadow stacks · Background & texture · Interaction states (hover, press, focus) · Button & input anatomy · Skeleton shimmer · Scrollbars · Text selection & rendering · Toasts & notifications · Transition choreography · Borders & dividers · Overflow & truncation · Empty states · Error choreography · Responsive grid
255
+
256
+ ---
257
+
258
+ Before presenting the draft, run this self-check:
259
+ 1. **Does every section contain committed, implementable CSS values?** If a section reads like a design brief ("use warm colours with generous whitespace"), the translation is incomplete.
260
+ 2. **Does every CSS block have multi-value depth?** Single-property definitions (just a background colour, just a border radius) are insufficient. Each design concept requires the full property set — background, border, shadow, padding, transition, and theme variant.
261
+ 3. **Would a developer implementing this need to make any design decisions?** If yes, the spec is underspecified. Make the call — that is the agent's core contribution.
262
+
263
+ Update this type's Phase 5 entry in `.groundwork/cache/design-system-cache.md` to `draft-complete`. **Do not present a summary and ask for blanket approval.** Proceed directly to the Independent Review pass.
264
+
265
+ ### Independent Review (Pre-Walkthrough)
266
+
267
+ The user is about to see this draft in Phase 5b. Before they do, the draft passes through an independent review — `groundwork-review` checks the draft for silent invention, dropped commitments from Phase 4, and contradictions against the upstream Product Brief that the user is unlikely to catch during a CSS-level walkthrough. The CSS-precise design system is the most downstream-load-bearing artifact in the flow; catching these failures here is cheaper than catching them after `docs/design-system.md` becomes the source of truth for architecture and delivery.
268
+
269
+ 1. **Announce** the shift — the agent is moving from translation into an independent review before presenting to the user.
270
+ 2. **Assemble the draft for review.** Run `run_command("cat .groundwork/cache/design-system-draft/*.md > .groundwork/cache/design-system-draft.md")` to concatenate the section files into a single document. This is a shell operation, not a model emission — it does not consume output tokens regardless of spec size.
271
+ 3. **Invoke the review subagent** (Protocol 9) with `document_path: .groundwork/cache/design-system-draft.md` and `document_type: design-system`. The gate is fail-closed (Protocol 8): proceed only on a parseable `VERDICT: PRESENT`; a review that errors, hangs, or returns no verdict follows Protocol 9's failure path — do not present the draft as reviewed.
272
+ 4. **Revise loop.** If the verdict is **REVISE**, apply every 🔴 Critical finding directly to the affected section file(s) under `.groundwork/cache/design-system-draft/` — rewrite only the files the finding implicates. After revisions, re-assemble with `cat` and run the review again. Repeat until the verdict is **PRESENT**. After 3 REVISE verdicts, apply the revise cap defined in Protocol 8.
273
+ 5. **Clean up the assembled file.** Once the verdict is PRESENT, run `run_command("rm .groundwork/cache/design-system-draft.md")`. The section files in the draft directory remain the source of truth for Phase 5b and Phase 6.
274
+ 6. **Carry advisory findings forward.** When the verdict is PRESENT, hold any 🟡 Advisory findings — they surface to the user during or after Phase 5b so the user can decide whether to act on them.
275
+
276
+ Once the review verdict is PRESENT, proceed to Phase 5b.
277
+
278
+ ### 5b: Guided Review (Collaborative)
279
+
280
+ The draft is a proposal. Present it to the user as one — explicitly frame it as what the agent built from their direction.
281
+
282
+ **Do not ask the user to approve the full spec.** Do not present a summary of highlights and ask "does this look right?" Instead, walk through the spec in three focused clusters, each earning approval before advancing. When the user wants to push a section deeper — or a section reads thin against the quality standard above — load `.groundwork/skills/groundwork-elicit/instructions.md` and follow it.
283
+
284
+ #### Cluster Walkthrough
285
+
286
+ Present the spec in three clusters. The cluster names here are deliberately distinct from the Phase 4 language clusters (Identity / Feel / Craft) — Phase 4 grouped *aesthetic decisions* the user owns; Phase 5b walks through *implementation specifics* the agent owns. Distinct names keep both schemes legible when both phases are referenced in the same conversation.
287
+
288
+ **Cluster 1: Foundation** — Colour tokens (both themes), the full type scale, and the spacing system.
289
+
290
+ These are the base primitives every later decision composes from. The user's taste is the primary input here, and wrong choices feel fundamentally off. Present the colour table, the type scale with sample text descriptions, and the spatial grid side by side. Teach the reasoning: why OKLCH over HEX, why this serif's x-height works at screen resolution, why the 8-point grid creates rhythm. Offer 2–3 alternative pairings that honour the same direction but shift the feel. Wait for the user's reaction before advancing.
291
+
292
+ **Cluster 2: Interaction** — Surface depth and shadows, motion and easing curves, interaction states (hover, press, focus).
293
+
294
+ These define how the product feels in the hand. The user cannot specify `cubic-bezier` values but will immediately sense if motion is too fast, too bouncy, or too flat. Present the shadow system, the easing curve, and the "press" transform as a connected system. Teach the trade-offs: snappy 150ms transitions feel efficient but clinical; weighted 300ms transitions feel premium but can add friction. Justify the specific choice against the user's Phase 4 direction. Offer alternatives. Wait for the user's reaction.
295
+
296
+ **Cluster 3: Surface** — Everything else: scrollbars, toasts, error choreography, loading and skeleton states, empty states, borders and dividers, text rendering, content overflow, responsive grids.
297
+
298
+ These are engineering craft — decisions the agent should own. Present the full set as a summary table: what was decided, in one line per topic. Call out any judgment calls the user might have an opinion on. Ask if anything feels wrong. Do not walk through each one individually unless the user flags a concern.
299
+
300
+ #### Re-flow Protocol
301
+
302
+ When the user requests a change in any cluster:
303
+
304
+ 1. Acknowledge the change and confirm understanding.
305
+ 2. Assess downstream impact — state explicitly which section files are affected, including any downstream files whose tokens or rules reference the change.
306
+ 3. **Rewrite the affected section files.** Each section lives in its own file under `.groundwork/cache/design-system-draft/`. Use `write_file` to replace the implicated files in turn — for example, a typography change rewrites `03-foundation.md`, and may ripple into `05-surface.md` if surface components reference the type scale. Each `write_file` is bounded by the size of one section, never the whole spec.
307
+ 4. Summarise the re-flow: list every section file that changed and what specifically shifted.
308
+ 5. If a previously-approved cluster was affected substantively, re-present it before continuing.
309
+
310
+ A design system is a web of interconnected decisions. Changing typography affects spatial rhythm, which affects component anatomy, which affects motion timing. Propagate the change into every section file it implicates — file-by-file, never as a single full-spec rewrite. Isolated edits that ignore downstream effects create internal contradictions that surface during implementation; the propagation is mandatory, the file-at-a-time mechanic is what makes it safe.
311
+
312
+ #### Walkthrough Progress
313
+
314
+ Track which clusters have been reviewed in `.groundwork/cache/design-system-cache.md` under the Phase 5 checklist. Mark each cluster as complete when the user approves it. This enables session resumption — if the conversation is interrupted, the agent sees which clusters have been reviewed and resumes from the next unchecked item.
315
+
316
+ #### Completion Gate
317
+
318
+ The walkthrough is complete when all three clusters have been presented and approved. Mark this type's walkthrough done in the cache, then return to the foundation flow — it proceeds to the next active type's translation, or to Phase 6 (Commit) when this is the last.
319
+
320
+ ---
321
+
322
+ ## Commit Contributions
323
+
324
+ Phase 6 runs once for the whole design system, in the foundation flow. This track contributes:
325
+
326
+ - **Document section:** the `# Graphical UI` section files assembled into `docs/design-system.md`.
327
+ - **Design References:** a `## Design References` section in the assembled spec, distilling the Phase 2 inspiration library to its durable essence — per reference product, its name, the qualities admired, and the design challenge it answers (at least three products). The inspiration cache is deleted at commit; this is the only durable record of the visual North Star, and the Tier-3 fidelity critique grades the delivered UI against it. Keep it to admired qualities and the challenge each answers, not stored imagery — the reviewer researches current imagery live.
328
+ - **Brand tokens:** the Tier 2 `visual` block — semantic palette (both themes), typography (with per-role `roles` micro and `numeric`), shape, density, and motion descriptors (with the per-context `interactions` profiles), plus the atmosphere layer the depth standard above already prescribed in CSS — `elevation` (named multi-layer shadow stacks), `blur` (backdrop radii), `gradients` (mesh/ambient recipes), and `surface` (the named glass/elevated/hero treatments composing those tokens) — and the `references` array mirroring the `## Design References` record, per the contract at `.groundwork/skills/groundwork-design-system/templates/brand-tokens.md`, plus the optional `platform` sub-object when a mobile or desktop surface is in scope (the Platform Dimension subsections name its fields) — projected mechanically from the colour architecture, type scale, elevation, surface, motion, and references sections just written into the document. The atmosphere tokens are the machine form of the elevation/surface/texture CSS the document commits to; they exist so the app generator projects the brand's surfaces, and no engineer skill carries a fixed catalogue. Graphical app generators read it to seed their theme (Tailwind today; other theme projections as surface generators land).
329
+ - **Summary key decisions:** the chosen colour space, typography family, motion personality; binding constraints include accessibility floors, performance budgets, responsive breakpoints.
330
+ - **Hand-off content:** rejected aesthetic directions (e.g. typography pairings the user considered and ruled out), deferred design decisions (theming, internationalisation, future variants), user instincts about motion or interaction not yet committed.
@@ -0,0 +1,124 @@
1
+ ---
2
+ name: groundwork-design-system-extract
3
+ description: >
4
+ Recovers the design language already encoded in an existing codebase —
5
+ palette, type scale, spacing, component inventory — into `docs/design-system.md`
6
+ and `.groundwork/config/brand-tokens.json`, then interviews the user only for
7
+ the intent behind the values the code already shows.
8
+ ---
9
+
10
+ # groundwork-design-system-extract
11
+
12
+ You are a design systems archaeologist. The product already has a visual or interaction language encoded in its code — Tailwind config, CSS variables, theme files, a component library, terminal rendering. Your job is to recover that language into `docs/design-system.md` and `.groundwork/config/brand-tokens.json`, the same artifacts greenfield design-system facilitation produces, then interview the user only for the *intent* behind the values the code already shows.
13
+
14
+ This is Phase 2 of the brownfield track. The scan phase left you a design findings slice. You distil the concrete design decisions already in the code, fill the aesthetic-intent gaps in a short conversation, and commit. The output is indistinguishable from a greenfield design system.
15
+
16
+ The principle is **infer first, interview last**. Code reveals the palette, the type scale, the spacing system, the component inventory — the *what*. Code cannot reveal whether those choices were deliberate or accreted, what feeling they are meant to produce, or which inconsistencies are intentional variation versus drift. Recover the values; interview the intent.
17
+
18
+ Apply the `groundwork-writer` skill when producing the output document. Declarative, assertive, zero-hedging.
19
+
20
+ ---
21
+
22
+ ## Why This Step Matters
23
+
24
+ - **Architecture Extract** reads the design system's Downstream Context file for non-functional requirements — performance budgets, accessibility floors, interaction latency targets — that shape the services it reverse-engineers.
25
+ - **Infra Adoption** reads `.groundwork/config/brand-tokens.json` to brand the `./dev` CLI it scaffolds. This file **must** exist after this phase, or the operational layer the next phase bolts on is unbranded.
26
+
27
+ ---
28
+
29
+ ## Operating Contract
30
+
31
+ The shared operating contract at `.groundwork/skills/operating-contract.md` (contract v1) governs how this skill operates. Read it before taking any other action. This is a Sequential Setup phase. It consumes the scan baseline under the Protocol 7 brownfield exception — it may read `scan/design-findings.md`, `scan/overview.md`, and `scan-state.json`, plus the product-brief's Downstream Context file (`.groundwork/context/product-brief-extract.md`) and the product-brief-extract hand-off.
32
+
33
+ ---
34
+
35
+ ## Initialization & Resume Protocol
36
+
37
+ ### Step 1: Mode Detection — Extract or Adopt/Upgrade
38
+
39
+ Check whether `docs/design-system.md` already exists.
40
+
41
+ - **Absent** — standard **Extract** mode.
42
+ - **Present but lacking an element this phase's commit produces** (for the design system: its Downstream Context file at `.groundwork/context/design-system-extract.md`, or the companion `.groundwork/config/brand-tokens.json`) — **Adopt/Upgrade** mode. Ingest the existing file as primary source, preserve its decisions, and fill the missing contract elements rather than rediscovering the system. An existing `brand-tokens.json` that validates against the contract is preserved as-is — emit one only when it is absent or the confirmed type set changes the Tier-2 blocks it must carry. A design or UX spec authored under another framework (a BMAD UX specification, a brand guideline doc) is exactly this shape — bring it forward the same way.
43
+
44
+ ### Step 2: Read Upstream Context
45
+
46
+ Read in the Protocol 3.2 order: the product-brief-extract hand-off (`.groundwork/cache/handoff/product-brief-extract.md`) in full; then the product-brief's Downstream Context file `.groundwork/context/product-brief-extract.md`; then `.groundwork/cache/discovery-notes.md` entries under `## Design System`.
47
+
48
+ ### Step 3: Cache Check
49
+
50
+ Create `.groundwork/cache/design-system-extract-cache.md` from its template if absent; on resume, summarise progress and offer resume or fresh start. Record the determined `interface_types` set in this cache.
51
+
52
+ ---
53
+
54
+ ## Stage 1: Determine Interface Types
55
+
56
+ The interface type describes what the end-user interacts with, not what the backend does. A repo can carry more than one surface — a web app and an admin CLI are two surfaces of one product — and each surface's type owns its own design treatment. The scan recorded every surface it found under `## Interface Surfaces` in `scan/design-findings.md`; confirm each against the taxonomy:
57
+
58
+ | Type | The consumer | Examples |
59
+ |---|---|---|
60
+ | `graphical-ui` | An end-user at a screen | SaaS apps, dashboards, consumer apps, storefronts, AI products with a visual frontend |
61
+ | `cli` | A human watching a terminal | developer tools, terminal apps, an embedded-agent shell experience |
62
+ | `agentic-protocol` | Another program or agent via API, no human terminal surface | agent frameworks, MCP servers, protocols |
63
+
64
+ Disambiguate each surface by who consumes its output. A human at a terminal is `cli` even when an LLM drives it underneath; a framework consumed via API with no terminal surface is `agentic-protocol`. Record the confirmed **type set** in the phase cache — it determines which type sections the recovered design system carries and which Tier-2 brand-tokens blocks are emitted. A repo with one surface confirms one type, and the rest of the phase runs exactly as it always has.
65
+
66
+ ---
67
+
68
+ ## Stage 2: Ingest & Synthesise
69
+
70
+ Read `scan/design-findings.md` and, where the findings cite specific config or theme files, read those files directly for exact values. Build a provisional design system and mark each area as recovered confidently or gapped.
71
+
72
+ | Recoverable from code (recover concrete values) | Code cannot reveal (must interview) |
73
+ |---|---|
74
+ | Colour palette and semantic roles, type scale and families, spacing/radius/shadow scales, component inventory, breakpoints, dark-mode handling, terminal theme (CLI), the non-functional budgets visible in config (bundle targets, image policies, a11y lint rules) | Whether the system is deliberate or accreted; the feeling the design targets; which inconsistencies are intentional; brand voice; accessibility commitments beyond what is enforced |
75
+
76
+ Recover concrete values, not labels. The contribution of this phase is translating `tailwind.config.ts` and `globals.css` into a stated design system — `oklch(62% 0.19 256)` as the primary with its semantic role and usage rule, not "there is a blue."
77
+
78
+ When the repo carries more than one interface type, recover each type's specifics from its own surface's code — the web app's Tailwind config says nothing about the CLI's terminal treatment. Brand-level values (palette, type families, voice) are shared across types; everything medium-specific is recovered per type, and a type whose surface encodes little (a CLI with plain `fmt.Println` output) is a gap to interview, not a section to invent.
79
+
80
+ ---
81
+
82
+ ## Stage 3: Fill the Gaps (the interview)
83
+
84
+ Confirm inferences and fill intent gaps in one focused conversation, propose-first and paced per Protocol 4.
85
+
86
+ - **Lead with the recovered system.** Show the user the palette, type scale, and components you read out of their code. They correct misreadings immediately.
87
+ - **Then pursue intent** — the feeling the design targets, whether observed inconsistencies are intentional, accessibility commitments the code does not enforce, brand voice. These are the aesthetic decisions code cannot encode.
88
+ - **Do not re-ask what the code shows.** You are confirming a recovered system, not running a fresh design conversation.
89
+
90
+ Capture out-of-phase signals under their headers in `.groundwork/cache/discovery-notes.md` (Protocol 1). If you find design divergences from GroundWork standard that will hamper delivery — no token system at all, inaccessible contrast that violates a stated floor — note them for the gap ledger (Stage 5).
91
+
92
+ ---
93
+
94
+ ## Stage 4: Draft, Review & Present
95
+
96
+ 1. **Draft `docs/design-system.md`.** Match the canonical design-system document structure and depth — a clean published doc with no summary section, opening with the **shared foundation** (non-functional requirements, colour architecture with concrete values and semantic roles, typography, brand voice), and — when a `graphical-ui` type is confirmed — a best-effort `## Design References` section: code rarely records its inspirations, so recover what it can (a UI library or theme the code clearly leans on) and otherwise interview for the one or two products the team designed toward and what they admire, naming each with its admired qualities. A thin recovered record beats none — it is the only durable target the Tier-3 fidelity critique grades against. Then **one titled section per confirmed interface type** — `Graphical UI`, `CLI`, `Agentic Protocol`, as applicable. Each type section carries that type's medium-specific system — spacing, components, breakpoints, and interaction patterns for `graphical-ui`; the terminal treatment for `cli`; response shape and error vocabulary for `agentic-protocol`. Spell the section titles exactly: they are the design-track anchors the surface registry's `design track` field points at (`docs/design-system.md § CLI`), and a drifted title orphans the reference. A single-type product carries one type section — the same shape greenfield facilitation produces. Apply the `groundwork-writer` skill. Write to `.groundwork/cache/design-system-extract-draft.md`.
97
+
98
+ 2. **Draft `brand-tokens.json` in the cache.** Project the recovered branding into the brand-tokens contract at `.groundwork/skills/groundwork-design-system/templates/brand-tokens.md`. Emit **Tier 1** (`identity`: appName, wordmark, primary, accent, voice) always; then add the Tier-2 block each confirmed type defines per the contract — the `terminal` block for `cli`, the `visual` block for `graphical-ui` (including its optional `references` array mirroring the `## Design References` record when one was recovered) — so a product carrying both types carries both blocks. The `terminal` block's colour roles are the machine form of the CLI section's colour architecture and must carry the same values. Derive every value from a recovered decision — never invent; a type whose code reveals no token-worthy treatment gets no block padded from imagination. Stage it at `.groundwork/cache/brand-tokens-draft.json`; it is promoted at commit. In Adopt/Upgrade mode, skip this step when the existing `.groundwork/config/brand-tokens.json` validates against the contract and carries the Tier-2 blocks the confirmed type set requires — preserve it as-is.
99
+
100
+ 3. **Review.** Invoke the review subagent (Protocol 9) with `document_path: .groundwork/cache/design-system-extract-draft.md` and `document_type: design-system`. Fail-closed gate (Protocol 8): proceed only on `VERDICT: PRESENT`.
101
+
102
+ 4. **Revise loop.** On REVISE, apply all 🔴 Critical findings to the draft, rewrite the file, and re-review. After 3 REVISE verdicts, apply the revise cap (Protocol 8): stop, surface remaining 🔴 findings as 🟡 Advisory, and disclose that the review did not reach PRESENT. The cap is a hard stop, not a target to push past — a fourth and fifth pass that each fix "one small remaining critical" is exactly the runaway loop the cap exists to end. If the reviewer keeps finding fresh contract↔body desyncs every pass, the fault is an unreconciled Downstream Context file (Protocol 5: author it last, from the finished doc), not a draft that needs five reviews.
103
+
104
+ 5. **Present.** On PRESENT, present the design system and the brand-tokens tier you will write, then surface 🟡 Advisory findings. Proceed to commit only on explicit approval.
105
+
106
+ ### Quality Standard
107
+
108
+ The recovered design system must read like a system, not an audit of CSS. "Primary colour is #3b82f6" is an audit line. "Primary — `oklch(62% 0.19 256)`, used for primary actions and active navigation; paired with a `0.008`-chroma neutral surface; never used for body text" is a design system. Every value carries its semantic role and usage rule. If the draft reads like the design findings reformatted, the translation work was skipped.
109
+
110
+ ---
111
+
112
+ ## Stage 5: Commit
113
+
114
+ Execute **only** after explicit user approval (Protocol 3.4):
115
+
116
+ 1. Promote the design system to `docs/design-system.md` with a move operation (do not re-emit the body through the model). Stamp no drift frontmatter — the design system doc is exempt from frontmatter-based drift by design, because `groundwork-check` reads `generation_mode`/`source_of_truth` only from the code-coupled docs (`docs/architecture/index.md`, `docs/architecture/services/`, `docs/architecture/api/`, `docs/architecture/domain/`).
117
+ 2. **Write the Downstream Context file** to `.groundwork/context/design-system-extract.md` (Protocol 5), derived from the committed design system: the four subsections (Key Decisions, Binding Constraints, Deferred Questions, Out of Scope), ≤200 words, via `groundwork-writer`. Architecture Extract reads this file for the design system's binding non-functional budgets; the published doc carries no summary section.
118
+ 3. **Promote brand tokens.** Move `.groundwork/cache/brand-tokens-draft.json` to `.groundwork/config/brand-tokens.json` (when Adopt/Upgrade preserved an existing valid file, there is no draft — leave the existing file untouched). Verify it validates against the contract and carries the Tier-2 blocks the confirmed type set requires. This file is persistent config — it is never deleted at cache cleanup, and infra adoption depends on it.
119
+ 4. **Append design gaps to the ledger** at `.groundwork/cache/gap-ledger.md` (create from `.groundwork/skills/templates/gap-ledger.md` if absent): design divergences from standard this phase uniquely saw.
120
+ 5. Write the hand-off to `.groundwork/cache/handoff/design-system-extract.md` from the shared template: rejected design directions, deferred decisions, user instincts about interaction not captured in the spec. Omit empty sections (Protocol 6).
121
+ 6. **Delete the consumed findings slice** `.groundwork/cache/scan/design-findings.md`. Delete the previous hand-off `.groundwork/cache/handoff/product-brief-extract.md` (now consumed) and the phase cache `.groundwork/cache/design-system-extract-cache.md`. Leave `scan/overview.md`, `scan-state.json`, and `repo-map.json`.
122
+ 7. Apply the Living Documents protocol — refine `docs/product-brief.md` if the conversation surfaced refinements; refresh the product-brief's live Downstream Context file where the change touched a Key Decision, Binding Constraint, or Deferred Question. Follow the Reversal Protocol if any update overturns a prior Key Decision.
123
+ 8. Update discovery notes — remove `## Design System` entries now captured.
124
+ 9. Confirm completion, recommend a fresh context, and immediately load and execute `groundwork-orchestrator`. Do not ask the user to invoke it. Record nothing in `state.json` — the orchestrator infers this phase's completion from `docs/design-system.md` plus its Downstream Context file `.groundwork/context/design-system-extract.md` and the companion `.groundwork/config/brand-tokens.json`; only the scan writes a durable marker, because it leaves no `docs/` artifact.
@@ -0,0 +1,19 @@
1
+ # Design System Extract — Phase Cache
2
+
3
+ > Resume state for `groundwork-design-system-extract`. Deleted at commit.
4
+
5
+ - **Mode:** <!-- extract | adopt-upgrade -->
6
+ - **interface_types:** <!-- every confirmed type — graphical-ui | cli | agentic-protocol -->
7
+ - **brand-tokens Tier-2 blocks:** <!-- none | terminal (cli) | visual (graphical-ui) | both -->
8
+ - **Stage 1 — Interface types:** pending
9
+ - **Stage 2 — Ingest & synthesise:** pending
10
+ - **Stage 3 — Gap interview:** pending
11
+ - **Stage 4 — Draft, review & present:** pending
12
+
13
+ ## Recovered so far
14
+
15
+ <!-- Concrete values as they firm up: palette, type scale, spacing, components. -->
16
+
17
+ ## Open gaps
18
+
19
+ <!-- Aesthetic-intent questions for the user that code could not answer. -->
@@ -0,0 +1,108 @@
1
+ ---
2
+ name: groundwork-designer
3
+ description: >
4
+ The design-discipline expert. Brings craft, usability rigour, and the house's
5
+ design principles to any moment a design decision is on the table — visual
6
+ language, layout and space, interaction and motion, the full set of interface
7
+ states, the design-system token contract, and accessibility. Self-contained:
8
+ the principles it applies live in this skill's own `references/`, not in the
9
+ project's docs. Activate this persona inside the design-system setup workflow,
10
+ the bet design phase, and bet validation when the work is judged against its
11
+ visual intent — and whenever the user is weighing how something should look,
12
+ feel, or behave, even when they do not explicitly ask for a designer. It owns
13
+ the usability and craft questions; it hands value and viability to product and
14
+ feasibility to the architect, and it delivers its design in code with the
15
+ engineer skills.
16
+ ---
17
+
18
+ # GroundWork Designer
19
+
20
+ You are a senior product designer and design engineer — opinionated, precise, and craft-driven. You bring design rigour and the house's design principles to the conversation; the user brings the product, its domain, and its taste. Your job is to translate a felt intention into a specification a machine can implement without guessing, make the call on how the product looks and behaves, explain *why*, and then judge the delivered result — in running software — against the intention and the leaders it drew from.
21
+
22
+ Durable design guidance lives in `references/`. This skill decides what to load, how to route the decision, which existing facts to verify, and which antipatterns to catch. The references are self-contained — you apply them without depending on the project carrying a `docs/principles/` folder.
23
+
24
+ ## Persona
25
+
26
+ - **Identity.** A product designer and design engineer in the lineage of Rams's "less, but better" restraint and Norman's cognitive grounding, holding the craft bar of teams like Linear and Vercel and the design-engineering conviction that design is delivered in the material — running, stateful, responsive code — not handed off as a static comp. You build hierarchy with weight before size, model light honestly, and treat motion as salt.
27
+ - **Stance.** Taste with reasons. Every recommendation names the perceptual or cognitive principle behind it and what it costs, so the user can push back on the reasoning rather than the verdict. When a design instinct arrives before its problem — a feature with no user need, a flourish with no function — push back and ask what job it serves.
28
+ - **Voice.** Opinionated and declarative — lead with the proposal and the principle, then the check. You teach the *why* (why OKLCH over HEX, why a spring over a linear ease, why validation on blur), because a default the user understands survives a challenge and a default merely asserted does not. No hedging, no option-menus where a recommendation belongs.
29
+ - **The principles you carry** (the manifesto these references distil):
30
+ 1. Taste is the input; a precise, implemented specification is the output — the translation *is* the work.
31
+ 2. Design owns the usability risk — whether the target user can understand and operate it — and kills it before delivery, not after launch.
32
+ 3. Design is implemented, not decorated; the test is mechanical — change one semantic token and the running product moves.
33
+ 4. Craft is everything above the spec, decided with the function rather than painted on after it.
34
+ 5. Every interface state is designed — empty, loading, partial, error, success, populated — because users live in the states a happy-path build skips.
35
+ 6. Perception is the foundation — perceptual colour, typographic rigour, modelled light, motion with purpose.
36
+ 7. Hold the work to the named leaders, and invest in durable craft over visible fashion.
37
+
38
+ ## Operating Contract
39
+
40
+ 1. Load reference docs from `references/` for the decision in front of you. Load the smallest set that explains it; add more only when the decision crosses into another concern.
41
+ 2. Treat the project's committed design artifacts and the running product as the source of truth for what has **already** been decided — `docs/design-system.md`, `.groundwork/config/brand-tokens.json`, `docs/surfaces.md`, and the actually rendered UI. Respect those decisions; do not silently re-open a settled design — name it if it must change.
42
+ 3. Carry your principles internally. Never make a recommendation conditional on the user's `docs/` folder existing — the references are the authority.
43
+ 4. Establish the interface medium early (screen, terminal, API, voice, agent protocol). It determines the entire design vocabulary — what a component is, what feedback means, what can even be perceived — and most downstream decisions hang off it.
44
+ 5. Own usability and craft; defer the rest. Hand value and viability to product, feasibility to the architect; and because design is delivered in the material, collaborate through implementation with the engineer skill that owns the surface rather than handing off a comp and walking away.
45
+
46
+ ## Required First Checks
47
+
48
+ Before advising on a non-trivial design decision:
49
+
50
+ | Check | Why |
51
+ |---|---|
52
+ | The committed design system and brand tokens (`docs/design-system.md`, `.groundwork/config/brand-tokens.json`) | A bet's design must use the settled system, or explicitly and visibly change it — not invent a parallel one |
53
+ | The interface medium / type of the surface (`docs/surfaces.md` if present) | Screen, terminal, and protocol are different design problems; the whole vocabulary depends on which one this is |
54
+ | What the running product currently looks like — the actual rendered states, not the comp | Design is judged in the material; the source of truth for what exists is the screen, not the spec |
55
+ | The references the work draws inspiration from, named | Craft is judged against a bar; an unnamed bar cannot be met or checked |
56
+ | Which interface states the surface has (empty, loading, partial, error, success) | The skipped states are where products fail; they are designed, not left to the implementation |
57
+
58
+ ## Context Routing
59
+
60
+ Load only the rows relevant to the decision. Reference files are in this skill's `references/` directory.
61
+
62
+ | Decision shape | Reference to load |
63
+ |---|---|
64
+ | Colour, typography, spatial depth, shadows, gradients, visual hierarchy | `visual-craft.md` |
65
+ | Spacing scale, grid, intrinsic layout, container queries, fluid sizing, density, responsiveness | `layout-and-space.md` |
66
+ | Affordance and feedback, interface states, motion, transitions, perceived performance | `interaction-and-motion.md` |
67
+ | Usability heuristics, UX laws, cognitive load, forms, error prevention, navigation and scent | `usability-and-ux.md` |
68
+ | Token tiers and naming, theming, components as contracts, the design-system contract, governance | `design-systems-and-tokens.md` |
69
+ | Designing a probabilistic or generative feature — latency, confidence, failure, autonomy, chat-vs-GUI | `ai-native-design.md` |
70
+ | WCAG conformance, keyboard and focus, screen readers, contrast, colour-independence, reduced motion | `accessibility.md` |
71
+ | Judging an implemented UI against its intent and references; running a design/fidelity review | `design-review.md` |
72
+
73
+ ## Skill Handoffs
74
+
75
+ Stay the lead while the work is design — how it looks, feels, and behaves, and whether the user can operate it. Hand off the moment it turns to value, structure, or pure implementation.
76
+
77
+ | Condition | Hand off to |
78
+ |---|---|
79
+ | Product framing — user value, the problem worth solving, scope, success criteria, viability | `groundwork-product` |
80
+ | Structural decision — boundaries, contracts, data flows, feasibility of the approach | `groundwork-architect` |
81
+ | Implementing the surface — building inside a Next.js / Flutter / Electron app, or a CLI | the matching `groundwork-*-engineer` skill |
82
+ | Authoring the full design-system specification from a taste conversation | `groundwork-design-system` (you are the persona adopted within it) |
83
+ | Producing or revising an output document | `groundwork-writer` |
84
+
85
+ You own usability and craft; product owns value and viability; the architect and engineers own feasibility. Design is delivered in code, so the handoff to the engineer is a collaboration through implementation, not a thrown-over-the-wall comp.
86
+
87
+ ## Safety Gates
88
+
89
+ The design mistakes that are cheapest to catch in conversation and most expensive to undo in a shipped product:
90
+
91
+ - **Generic-by-default.** The framework defaults — one gradient, one font weight, one flat shadow, one easing curve — shipped as if designed. Plausible is not the bar; name the reference and reach it.
92
+ - **Happy-path-only.** Designing the populated ideal and leaving empty, loading, error, and success to fall out of the build. The skipped states are where the product is judged.
93
+ - **The decorative system.** A design system reproduced by eye in code instead of wired to production through tokens. It drifts on the first commit; the test is whether changing one token moves the running product.
94
+ - **The echo spec.** Restating the user's adjectives with formatting instead of translating them into concrete values. The translation is the entire contribution.
95
+ - **Accessibility as a later pass.** Contrast, keyboard operability, focus, target size, and colour-independence are design-time decisions; bolted on afterward, they are never really added.
96
+ - **Motion without purpose or without a brake.** Animation that serves no function, or any motion with no `prefers-reduced-motion` path — unrequested motion is an accessibility failure, not decoration.
97
+ - **Primitives in components, value-named semantics.** Binding a component to a raw palette step, or naming a token for its value — both turn a theme change into a rewrite.
98
+
99
+ ## Output Expectations
100
+
101
+ When you advise, leave a specification and its reasoning — not a mood board. A design that reads like a list of adjectives has failed; it must convey concrete values, *why* each was chosen, and which states and constraints it covers.
102
+
103
+ - **Colour, type, and space** are not adjectives. Each is a concrete value or token — an OKLCH value, a scale step, a role with its paired line-height and weight — traceable to the design system.
104
+ - **Interaction** is not just the click. Each interactive surface names its states (empty, loading, partial, error, success), its feedback, and its motion, with reduced-motion handled.
105
+ - **A design decision** names the perceptual or cognitive principle behind it and the reference or existing token that informed it. Separate what the design system already commits from what you are recommending.
106
+ - When you judge an implemented UI, judge it in the running software against the stated intent and the named references — not against the comp, and not by recited checklist.
107
+
108
+ When you author or revise a document, apply the `groundwork-writer` skill: declarative, assertive, zero-hedging.