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.
- package/CHANGELOG.md +781 -0
- package/LICENSE +21 -0
- package/README.md +44 -29
- package/bin/groundwork.js +1654 -0
- package/dist/src/generators/add-capability/generator.d.ts +8 -0
- package/dist/src/generators/add-capability/generator.js +60 -0
- package/dist/src/generators/add-capability/generator.js.map +1 -0
- package/dist/src/generators/cli-app/generator.d.ts +9 -0
- package/dist/src/generators/cli-app/generator.js +140 -0
- package/dist/src/generators/cli-app/generator.js.map +1 -0
- package/dist/src/generators/docs-site/generator.d.ts +5 -0
- package/dist/src/generators/docs-site/generator.js +441 -0
- package/dist/src/generators/docs-site/generator.js.map +1 -0
- package/dist/src/generators/electron-app/generator.d.ts +6 -0
- package/dist/src/generators/electron-app/generator.js +261 -0
- package/dist/src/generators/electron-app/generator.js.map +1 -0
- package/dist/src/generators/flutter-app/generator.d.ts +6 -0
- package/dist/src/generators/flutter-app/generator.js +314 -0
- package/dist/src/generators/flutter-app/generator.js.map +1 -0
- package/dist/src/generators/go-microservice/generator.d.ts +8 -0
- package/dist/src/generators/go-microservice/generator.js +232 -0
- package/dist/src/generators/go-microservice/generator.js.map +1 -0
- package/dist/src/generators/nextjs-app/generator.d.ts +8 -0
- package/dist/src/generators/nextjs-app/generator.js +294 -0
- package/dist/src/generators/nextjs-app/generator.js.map +1 -0
- package/dist/src/generators/python-microservice/generator.d.ts +13 -0
- package/dist/src/generators/python-microservice/generator.js +265 -0
- package/dist/src/generators/python-microservice/generator.js.map +1 -0
- package/dist/src/generators/shared/brand-tokens.d.ts +89 -0
- package/dist/src/generators/shared/brand-tokens.js +308 -0
- package/dist/src/generators/shared/brand-tokens.js.map +1 -0
- package/dist/src/generators/shared/capabilities.d.ts +101 -0
- package/dist/src/generators/shared/capabilities.js +279 -0
- package/dist/src/generators/shared/capabilities.js.map +1 -0
- package/dist/src/generators/shared/provenance.d.ts +2 -0
- package/dist/src/generators/shared/provenance.js +85 -0
- package/dist/src/generators/shared/provenance.js.map +1 -0
- package/dist/src/generators/shared/scaffold-helpers.d.ts +72 -0
- package/dist/src/generators/shared/scaffold-helpers.js +309 -0
- package/dist/src/generators/shared/scaffold-helpers.js.map +1 -0
- package/dist/src/generators/system-test-runner/generator.d.ts +23 -0
- package/dist/src/generators/system-test-runner/generator.js +125 -0
- package/dist/src/generators/system-test-runner/generator.js.map +1 -0
- package/dist/src/generators/workspace-dev-cli/generator.d.ts +7 -0
- package/dist/src/generators/workspace-dev-cli/generator.js +138 -0
- package/dist/src/generators/workspace-dev-cli/generator.js.map +1 -0
- package/generators.json +57 -0
- package/lib/repo-map/grammars/tree-sitter-c.wasm +0 -0
- package/lib/repo-map/grammars/tree-sitter-cpp.wasm +0 -0
- package/lib/repo-map/grammars/tree-sitter-csharp.wasm +0 -0
- package/lib/repo-map/grammars/tree-sitter-dart.wasm +0 -0
- package/lib/repo-map/grammars/tree-sitter-go.wasm +0 -0
- package/lib/repo-map/grammars/tree-sitter-java.wasm +0 -0
- package/lib/repo-map/grammars/tree-sitter-javascript.wasm +0 -0
- package/lib/repo-map/grammars/tree-sitter-kotlin.wasm +0 -0
- package/lib/repo-map/grammars/tree-sitter-lua.wasm +0 -0
- package/lib/repo-map/grammars/tree-sitter-php.wasm +0 -0
- package/lib/repo-map/grammars/tree-sitter-python.wasm +0 -0
- package/lib/repo-map/grammars/tree-sitter-ruby.wasm +0 -0
- package/lib/repo-map/grammars/tree-sitter-rust.wasm +0 -0
- package/lib/repo-map/grammars/tree-sitter-scala.wasm +0 -0
- package/lib/repo-map/grammars/tree-sitter-swift.wasm +0 -0
- package/lib/repo-map/grammars/tree-sitter-tsx.wasm +0 -0
- package/lib/repo-map/grammars/tree-sitter-typescript.wasm +0 -0
- package/lib/repo-map/index.js +386 -0
- package/lib/repo-map/languages.js +514 -0
- package/lib/repo-map/pagerank.js +59 -0
- package/migrations/README.md +60 -0
- package/migrations/_template/cli-migration.js +27 -0
- package/migrations/gw-bet-prose-redesign.js +105 -0
- package/migrations/gw-drop-test-manifest.js +37 -0
- package/migrations/gw-register-serena-mcp.js +42 -0
- package/migrations/gw-relocate-hidden-skills.js +40 -0
- package/migrations/gw-seed-config-toml.js +24 -0
- package/migrations/index.json +40 -0
- package/package.json +70 -6
- package/src/AGENTS.md +36 -0
- package/src/config/config.toml +30 -0
- package/src/config/groundwork-state.json +5 -0
- package/src/docs/llms.txt +72 -0
- package/src/docs/principles/ai-native/agent-native-systems.md +90 -0
- package/src/docs/principles/ai-native/agentic-systems.md +78 -0
- package/src/docs/principles/ai-native/ai-engineering.md +100 -0
- package/src/docs/principles/ai-native/ai-native-product.md +76 -0
- package/src/docs/principles/delivery/cost-engineering.md +89 -0
- package/src/docs/principles/delivery/day-2-operational-baseline.md +57 -0
- package/src/docs/principles/delivery/devex.md +88 -0
- package/src/docs/principles/delivery/platform.md +101 -0
- package/src/docs/principles/delivery/progressive-delivery.md +92 -0
- package/src/docs/principles/design/ai-native-design.md +73 -0
- package/src/docs/principles/design/design-foundations.md +80 -0
- package/src/docs/principles/design/design-systems-and-tokens.md +72 -0
- package/src/docs/principles/design/interaction-and-motion.md +69 -0
- package/src/docs/principles/design/layout-and-space.md +72 -0
- package/src/docs/principles/design/usability-and-ux.md +68 -0
- package/src/docs/principles/design/visual-design.md +84 -0
- package/src/docs/principles/foundations/code-craft.md +86 -0
- package/src/docs/principles/foundations/continuous-discovery.md +75 -0
- package/src/docs/principles/foundations/documentation.md +102 -0
- package/src/docs/principles/foundations/prioritization-and-appetite.md +78 -0
- package/src/docs/principles/foundations/product-engineering.md +90 -0
- package/src/docs/principles/foundations/product-risks.md +89 -0
- package/src/docs/principles/foundations/requirements-and-specs.md +80 -0
- package/src/docs/principles/foundations/success-metrics.md +66 -0
- package/src/docs/principles/foundations/testing.md +82 -0
- package/src/docs/principles/index.md +23 -0
- package/src/docs/principles/quality/accessibility.md +88 -0
- package/src/docs/principles/quality/observability.md +84 -0
- package/src/docs/principles/quality/performance.md +84 -0
- package/src/docs/principles/quality/privacy.md +92 -0
- package/src/docs/principles/quality/reliability.md +89 -0
- package/src/docs/principles/quality/security.md +78 -0
- package/src/docs/principles/stack/postgres.md +100 -0
- package/src/docs/principles/system-design/api-design.md +86 -0
- package/src/docs/principles/system-design/architecture-decisions.md +81 -0
- package/src/docs/principles/system-design/code-structure.md +104 -0
- package/src/docs/principles/system-design/data-engineering.md +87 -0
- package/src/docs/principles/system-design/durable-execution.md +89 -0
- package/src/docs/principles/system-design/evolutionary-architecture.md +81 -0
- package/src/docs/principles/system-design/identity-and-access.md +76 -0
- package/src/docs/principles/system-design/integration-patterns.md +84 -0
- package/src/docs/principles/system-design/real-time.md +83 -0
- package/src/docs/principles/system-design/surface-architecture.md +74 -0
- package/src/docs/ways-of-working/documentation.md +69 -0
- package/src/docs/ways-of-working/how-we-work.md +76 -0
- package/src/docs/ways-of-working/units-of-work.md +40 -0
- package/src/engineer-skills/groundwork-electron-engineer/SKILL.md +118 -0
- package/src/engineer-skills/groundwork-electron-engineer/references/ipc-contracts.md +138 -0
- package/src/engineer-skills/groundwork-electron-engineer/references/packaging-and-updates.md +82 -0
- package/src/engineer-skills/groundwork-electron-engineer/references/process-model.md +94 -0
- package/src/engineer-skills/groundwork-electron-engineer/references/security.md +107 -0
- package/src/engineer-skills/groundwork-electron-engineer/references/testing-and-smoke.md +107 -0
- package/src/engineer-skills/groundwork-electron-engineer/references/theming-and-tokens.md +74 -0
- package/src/engineer-skills/groundwork-electron-engineer/sync-anchor.md +14 -0
- package/src/engineer-skills/groundwork-flutter-engineer/SKILL.md +108 -0
- package/src/engineer-skills/groundwork-flutter-engineer/references/accessibility.md +92 -0
- package/src/engineer-skills/groundwork-flutter-engineer/references/architecture.md +189 -0
- package/src/engineer-skills/groundwork-flutter-engineer/references/data-and-contracts.md +136 -0
- package/src/engineer-skills/groundwork-flutter-engineer/references/navigation.md +122 -0
- package/src/engineer-skills/groundwork-flutter-engineer/references/platform-channels.md +93 -0
- package/src/engineer-skills/groundwork-flutter-engineer/references/releases-and-distribution.md +84 -0
- package/src/engineer-skills/groundwork-flutter-engineer/references/state-management.md +166 -0
- package/src/engineer-skills/groundwork-flutter-engineer/references/testing.md +135 -0
- package/src/engineer-skills/groundwork-flutter-engineer/references/theming-and-design-tokens.md +109 -0
- package/src/engineer-skills/groundwork-flutter-engineer/references/widgets-and-composition.md +123 -0
- package/src/engineer-skills/groundwork-flutter-engineer/sync-anchor.md +15 -0
- package/src/engineer-skills/groundwork-go-engineer/SKILL.md +171 -0
- package/src/engineer-skills/groundwork-go-engineer/references/api-design.md +82 -0
- package/src/engineer-skills/groundwork-go-engineer/references/architecture.md +42 -0
- package/src/engineer-skills/groundwork-go-engineer/references/capability-ports.md +50 -0
- package/src/engineer-skills/groundwork-go-engineer/references/code-craft-security.md +34 -0
- package/src/engineer-skills/groundwork-go-engineer/references/concurrency.md +108 -0
- package/src/engineer-skills/groundwork-go-engineer/references/go-services.md +77 -0
- package/src/engineer-skills/groundwork-go-engineer/references/http-handlers.md +172 -0
- package/src/engineer-skills/groundwork-go-engineer/references/implementation-patterns.md +156 -0
- package/src/engineer-skills/groundwork-go-engineer/references/integration-realtime-data.md +57 -0
- package/src/engineer-skills/groundwork-go-engineer/references/observability.md +49 -0
- package/src/engineer-skills/groundwork-go-engineer/references/postgres.md +41 -0
- package/src/engineer-skills/groundwork-go-engineer/references/reliability-performance.md +105 -0
- package/src/engineer-skills/groundwork-go-engineer/references/testing.md +139 -0
- package/src/engineer-skills/groundwork-go-engineer/sync-anchor.md +11 -0
- package/src/engineer-skills/groundwork-nextjs-engineer/SKILL.md +107 -0
- package/src/engineer-skills/groundwork-nextjs-engineer/references/architecture.md +323 -0
- package/src/engineer-skills/groundwork-nextjs-engineer/references/data-fetching.md +458 -0
- package/src/engineer-skills/groundwork-nextjs-engineer/references/documentation.md +324 -0
- package/src/engineer-skills/groundwork-nextjs-engineer/references/error-boundaries.md +383 -0
- package/src/engineer-skills/groundwork-nextjs-engineer/references/mutations-and-forms.md +396 -0
- package/src/engineer-skills/groundwork-nextjs-engineer/references/performance-and-deployment.md +947 -0
- package/src/engineer-skills/groundwork-nextjs-engineer/references/routing-and-navigation.md +405 -0
- package/src/engineer-skills/groundwork-nextjs-engineer/references/server-components.md +394 -0
- package/src/engineer-skills/groundwork-nextjs-engineer/references/tailwind-and-styling.md +134 -0
- package/src/engineer-skills/groundwork-nextjs-engineer/references/testing.md +433 -0
- package/src/engineer-skills/groundwork-nextjs-engineer/references/type-system.md +368 -0
- package/src/engineer-skills/groundwork-nextjs-engineer/references/ux-principles.md +278 -0
- package/src/engineer-skills/groundwork-nextjs-engineer/references/visual-language.md +69 -0
- package/src/engineer-skills/groundwork-nextjs-engineer/sync-anchor.md +9 -0
- package/src/engineer-skills/groundwork-python-engineer/SKILL.md +196 -0
- package/src/engineer-skills/groundwork-python-engineer/references/api-standards.md +88 -0
- package/src/engineer-skills/groundwork-python-engineer/references/architecture.md +57 -0
- package/src/engineer-skills/groundwork-python-engineer/references/async-patterns.md +103 -0
- package/src/engineer-skills/groundwork-python-engineer/references/capability-ports.md +44 -0
- package/src/engineer-skills/groundwork-python-engineer/references/database.md +88 -0
- package/src/engineer-skills/groundwork-python-engineer/references/documentation-mcp.md +167 -0
- package/src/engineer-skills/groundwork-python-engineer/references/implementation-patterns.md +166 -0
- package/src/engineer-skills/groundwork-python-engineer/references/ml-pipelines.md +119 -0
- package/src/engineer-skills/groundwork-python-engineer/references/ml-systems-ai-engineering.md +74 -0
- package/src/engineer-skills/groundwork-python-engineer/references/observability.md +57 -0
- package/src/engineer-skills/groundwork-python-engineer/references/resilience.md +126 -0
- package/src/engineer-skills/groundwork-python-engineer/references/testing.md +177 -0
- package/src/engineer-skills/groundwork-python-engineer/sync-anchor.md +13 -0
- package/src/generators/add-capability/generator.ts +70 -0
- package/src/generators/add-capability/schema.json +30 -0
- package/src/generators/capabilities/llm/capability.json +28 -0
- package/src/generators/capabilities/llm/providers/anthropic/footprint.json +13 -0
- package/src/generators/capabilities/llm/providers/anthropic/stacks/go/internal/llm/llm.go.template +102 -0
- package/src/generators/capabilities/llm/providers/anthropic/stacks/python/src/__packageName__/adapters/llm.py.template +61 -0
- package/src/generators/capabilities/llm/providers/local/footprint.json +13 -0
- package/src/generators/capabilities/llm/providers/local/stacks/go/internal/llm/llm.go.template +102 -0
- package/src/generators/capabilities/llm/providers/local/stacks/python/src/__packageName__/adapters/llm.py.template +53 -0
- package/src/generators/capabilities/llm/providers/localai/footprint.json +29 -0
- package/src/generators/capabilities/llm/providers/localai/stacks/go/internal/llm/llm.go.template +102 -0
- package/src/generators/capabilities/llm/providers/localai/stacks/python/src/__packageName__/adapters/llm.py.template +53 -0
- package/src/generators/capabilities/llm/providers/none/footprint.json +9 -0
- package/src/generators/capabilities/llm/providers/none/stacks/go/internal/llm/llm.go.template +35 -0
- package/src/generators/capabilities/llm/providers/none/stacks/python/src/__packageName__/adapters/llm.py.template +25 -0
- package/src/generators/capabilities/llm/providers/ollama/footprint.json +20 -0
- package/src/generators/capabilities/llm/providers/ollama/stacks/go/internal/llm/llm.go.template +102 -0
- package/src/generators/capabilities/llm/providers/ollama/stacks/python/src/__packageName__/adapters/llm.py.template +53 -0
- package/src/generators/capabilities/llm/providers/openai/footprint.json +13 -0
- package/src/generators/capabilities/llm/providers/openai/stacks/go/internal/llm/llm.go.template +98 -0
- package/src/generators/capabilities/llm/providers/openai/stacks/python/src/__packageName__/adapters/llm.py.template +60 -0
- package/src/generators/capabilities/llm/stacks/go/internal/core/service/llm.go.template +12 -0
- package/src/generators/capabilities/llm/stacks/go/internal/llm/llm_test.go.template +33 -0
- package/src/generators/capabilities/llm/stacks/python/src/__packageName__/core/llm.py.template +15 -0
- package/src/generators/capabilities/llm/stacks/python/tests/contracts/test_llm.py.template +37 -0
- package/src/generators/cli-app/files/README.md.template +76 -0
- package/src/generators/cli-app/files/build.mjs.template +15 -0
- package/src/generators/cli-app/files/package.json.template +21 -0
- package/src/generators/cli-app/files/src/cli.ts.template +67 -0
- package/src/generators/cli-app/files/src/commands/hello.ts.template +17 -0
- package/src/generators/cli-app/files/src/commands/status.ts.template +23 -0
- package/src/generators/cli-app/files/src/core/client.test.ts.template +80 -0
- package/src/generators/cli-app/files/src/core/client.ts.template +64 -0
- package/src/generators/cli-app/files/src/registry.test.ts.template +35 -0
- package/src/generators/cli-app/files/src/registry.ts.template +31 -0
- package/src/generators/cli-app/files/tsconfig.json.template +16 -0
- package/src/generators/cli-app/files/tsconfig.test.json.template +11 -0
- package/src/generators/cli-app/generator.ts +138 -0
- package/src/generators/cli-app/schema.json +24 -0
- package/src/generators/docs-site/files/.gitignore.ejs +40 -0
- package/src/generators/docs-site/files/app/docs/__slug__/page.tsx +101 -0
- package/src/generators/docs-site/files/app/docs/layout.tsx +14 -0
- package/src/generators/docs-site/files/app/docs.css +43 -0
- package/src/generators/docs-site/files/app/layout.tsx +24 -0
- package/src/generators/docs-site/files/app/page.tsx +135 -0
- package/src/generators/docs-site/files/app/source.ts +8 -0
- package/src/generators/docs-site/files/components/mermaid.tsx +67 -0
- package/src/generators/docs-site/files/next.config.mjs +10 -0
- package/src/generators/docs-site/files/package.json +32 -0
- package/src/generators/docs-site/files/pnpm-workspace.yaml +7 -0
- package/src/generators/docs-site/files/postcss.config.mjs +6 -0
- package/src/generators/docs-site/files/source.config.ts +77 -0
- package/src/generators/docs-site/files/tailwind.config.js +10 -0
- package/src/generators/docs-site/files/tsconfig.json +27 -0
- package/src/generators/docs-site/generator.ts +476 -0
- package/src/generators/docs-site/schema.json +17 -0
- package/src/generators/electron-app/docs/principles/stack/electron/index.md +47 -0
- package/src/generators/electron-app/docs/principles/stack/electron/ipc-contracts.md +71 -0
- package/src/generators/electron-app/docs/principles/stack/electron/packaging-and-updates.md +59 -0
- package/src/generators/electron-app/docs/principles/stack/electron/process-model.md +53 -0
- package/src/generators/electron-app/docs/principles/stack/electron/security.md +70 -0
- package/src/generators/electron-app/docs/principles/stack/typescript/frontend.md +65 -0
- package/src/generators/electron-app/files/.gitignore.template +20 -0
- package/src/generators/electron-app/files/README.md.template +125 -0
- package/src/generators/electron-app/files/electron.vite.config.ts +31 -0
- package/src/generators/electron-app/files/eslint.config.mjs +92 -0
- package/src/generators/electron-app/files/forge.config.ts.template +44 -0
- package/src/generators/electron-app/files/package.json.template +54 -0
- package/src/generators/electron-app/files/playwright.config.ts +18 -0
- package/src/generators/electron-app/files/project.json.template +65 -0
- package/src/generators/electron-app/files/src/main/core-client.test.ts +81 -0
- package/src/generators/electron-app/files/src/main/core-client.ts +55 -0
- package/src/generators/electron-app/files/src/main/index.ts +157 -0
- package/src/generators/electron-app/files/src/main/ipc.ts +52 -0
- package/src/generators/electron-app/files/src/main/policy.test.ts +71 -0
- package/src/generators/electron-app/files/src/main/policy.ts +73 -0
- package/src/generators/electron-app/files/src/preload/index.ts +23 -0
- package/src/generators/electron-app/files/src/renderer/index.html.template +20 -0
- package/src/generators/electron-app/files/src/renderer/src/App.test.tsx +61 -0
- package/src/generators/electron-app/files/src/renderer/src/App.tsx.template +43 -0
- package/src/generators/electron-app/files/src/renderer/src/assets/main.css +40 -0
- package/src/generators/electron-app/files/src/renderer/src/env.d.ts +14 -0
- package/src/generators/electron-app/files/src/renderer/src/main.tsx +25 -0
- package/src/generators/electron-app/files/src/shared/ipc.ts +54 -0
- package/src/generators/electron-app/files/tests/smoke/app.spec.ts.template +68 -0
- package/src/generators/electron-app/files/tool/electron_exec.sh.template +83 -0
- package/src/generators/electron-app/files/tsconfig.json +7 -0
- package/src/generators/electron-app/files/tsconfig.node.json +27 -0
- package/src/generators/electron-app/files/tsconfig.web.json +22 -0
- package/src/generators/electron-app/files/vitest.config.ts +32 -0
- package/src/generators/electron-app/files/vitest.setup.ts +1 -0
- package/src/generators/electron-app/generator.ts +288 -0
- package/src/generators/electron-app/schema.json +23 -0
- package/src/generators/flutter-app/docs/principles/stack/flutter/architecture.md +78 -0
- package/src/generators/flutter-app/docs/principles/stack/flutter/index.md +38 -0
- package/src/generators/flutter-app/docs/principles/stack/flutter/platform-channels.md +51 -0
- package/src/generators/flutter-app/docs/principles/stack/flutter/releases-and-distribution.md +59 -0
- package/src/generators/flutter-app/docs/principles/stack/flutter/state-management.md +85 -0
- package/src/generators/flutter-app/docs/principles/stack/flutter/testing.md +74 -0
- package/src/generators/flutter-app/docs/principles/stack/flutter/widgets-and-composition.md +69 -0
- package/src/generators/flutter-app/files/.gitignore.template +30 -0
- package/src/generators/flutter-app/files/README.md.template +100 -0
- package/src/generators/flutter-app/files/analysis_options.yaml.template +18 -0
- package/src/generators/flutter-app/files/integration_test/app_test.dart.template +30 -0
- package/src/generators/flutter-app/files/lib/app.dart.template +24 -0
- package/src/generators/flutter-app/files/lib/config/app_config.dart +15 -0
- package/src/generators/flutter-app/files/lib/data/repositories/status_repository.dart +36 -0
- package/src/generators/flutter-app/files/lib/data/services/api_client.dart +71 -0
- package/src/generators/flutter-app/files/lib/domain/models/health_status.dart +23 -0
- package/src/generators/flutter-app/files/lib/main.dart +11 -0
- package/src/generators/flutter-app/files/lib/router.dart +23 -0
- package/src/generators/flutter-app/files/lib/ui/core/theme/app_theme.dart +110 -0
- package/src/generators/flutter-app/files/lib/ui/home/home_view.dart +89 -0
- package/src/generators/flutter-app/files/lib/ui/home/home_view_model.dart.template +38 -0
- package/src/generators/flutter-app/files/project.json.template +51 -0
- package/src/generators/flutter-app/files/pubspec.yaml.template +47 -0
- package/src/generators/flutter-app/files/test/api_client_test.dart.template +63 -0
- package/src/generators/flutter-app/files/test/fakes/fake_status_repository.dart.template +19 -0
- package/src/generators/flutter-app/files/test/home_view_test.dart.template +58 -0
- package/src/generators/flutter-app/files/tool/flutter_exec.sh.template +60 -0
- package/src/generators/flutter-app/generator.ts +362 -0
- package/src/generators/flutter-app/schema.json +23 -0
- package/src/generators/go-microservice/docs/principles/stack/go/concurrency.md +123 -0
- package/src/generators/go-microservice/docs/principles/stack/go/index.md +70 -0
- package/src/generators/go-microservice/docs/principles/stack/go/testing.md +152 -0
- package/src/generators/go-microservice/files/.air.toml.template +38 -0
- package/src/generators/go-microservice/files/.env.template +4 -0
- package/src/generators/go-microservice/files/.golangci.yml.template +82 -0
- package/src/generators/go-microservice/files/Dockerfile.dev.template +12 -0
- package/src/generators/go-microservice/files/asyncapi-pubsub.yaml.template +33 -0
- package/src/generators/go-microservice/files/asyncapi-ws.yaml.template +34 -0
- package/src/generators/go-microservice/files/cmd/api/main.go.template +149 -0
- package/src/generators/go-microservice/files/cmd/api/main_test.go.template +99 -0
- package/src/generators/go-microservice/files/cmd/worker/cleanup/main.go.template +39 -0
- package/src/generators/go-microservice/files/db/schema.sql.template +24 -0
- package/src/generators/go-microservice/files/go.mod.template +39 -0
- package/src/generators/go-microservice/files/internal/config/config.go.template +52 -0
- package/src/generators/go-microservice/files/internal/config/otel.go.template +93 -0
- package/src/generators/go-microservice/files/internal/core/domain/errors.go.template +16 -0
- package/src/generators/go-microservice/files/internal/core/domain/model.go.template +28 -0
- package/src/generators/go-microservice/files/internal/core/domain/user.go.template +13 -0
- package/src/generators/go-microservice/files/internal/core/pagination.go.template +16 -0
- package/src/generators/go-microservice/files/internal/core/service/app_service.go.template +79 -0
- package/src/generators/go-microservice/files/internal/core/service/event_hub.go.template +9 -0
- package/src/generators/go-microservice/files/internal/core/service/message_queue.go.template +10 -0
- package/src/generators/go-microservice/files/internal/core/service/outbox_repository.go.template +31 -0
- package/src/generators/go-microservice/files/internal/core/service/repository.go.template +23 -0
- package/src/generators/go-microservice/files/internal/core/service/user_repository.go.template +15 -0
- package/src/generators/go-microservice/files/internal/core/service/user_service.go.template +43 -0
- package/src/generators/go-microservice/files/internal/entrypoints/api/app_handler.go.template +108 -0
- package/src/generators/go-microservice/files/internal/entrypoints/api/auth_middleware_test.go.template +52 -0
- package/src/generators/go-microservice/files/internal/entrypoints/api/clerk_webhook.go.template +202 -0
- package/src/generators/go-microservice/files/internal/entrypoints/api/clerk_webhook_test.go.template +82 -0
- package/src/generators/go-microservice/files/internal/entrypoints/api/health_handler.go.template +80 -0
- package/src/generators/go-microservice/files/internal/entrypoints/api/idempotency/middleware.go.template +87 -0
- package/src/generators/go-microservice/files/internal/entrypoints/api/idempotency/middleware_test.go.template +76 -0
- package/src/generators/go-microservice/files/internal/entrypoints/api/idempotency/repository.go.template +37 -0
- package/src/generators/go-microservice/files/internal/entrypoints/api/middleware_auth.go.template +40 -0
- package/src/generators/go-microservice/files/internal/entrypoints/api/middleware_loadshed.go.template +38 -0
- package/src/generators/go-microservice/files/internal/entrypoints/api/middleware_logging.go.template +40 -0
- package/src/generators/go-microservice/files/internal/entrypoints/api/middleware_ratelimit.go.template +48 -0
- package/src/generators/go-microservice/files/internal/entrypoints/api/middleware_test.go.template +81 -0
- package/src/generators/go-microservice/files/internal/entrypoints/api/router.go.template +105 -0
- package/src/generators/go-microservice/files/internal/entrypoints/api/types.go.template +70 -0
- package/src/generators/go-microservice/files/internal/entrypoints/api/websocket_handler.go.template +39 -0
- package/src/generators/go-microservice/files/internal/httpclient/http_client.go.template +87 -0
- package/src/generators/go-microservice/files/internal/kafka/kafka.go.template +34 -0
- package/src/generators/go-microservice/files/internal/postgres/postgres.go.template +195 -0
- package/src/generators/go-microservice/files/internal/postgres/postgres_test.go.template +156 -0
- package/src/generators/go-microservice/files/internal/postgres/user_repository.go.template +56 -0
- package/src/generators/go-microservice/files/internal/pubsub/gcp_pubsub.go.template +35 -0
- package/src/generators/go-microservice/files/internal/websocket/client.go.template +151 -0
- package/src/generators/go-microservice/files/internal/websocket/hub.go.template +261 -0
- package/src/generators/go-microservice/files/scripts/apply-schema.sh.template +21 -0
- package/src/generators/go-microservice/files/tools/tools.go.template +10 -0
- package/src/generators/go-microservice/generator.ts +240 -0
- package/src/generators/go-microservice/schema.json +63 -0
- package/src/generators/nextjs-app/docs/principles/stack/typescript/frontend.md +65 -0
- package/src/generators/nextjs-app/files/.dockerignore.template +7 -0
- package/src/generators/nextjs-app/files/.env.example.template +24 -0
- package/src/generators/nextjs-app/files/.gitignore.template +5 -0
- package/src/generators/nextjs-app/files/Dockerfile +53 -0
- package/src/generators/nextjs-app/files/app/(auth)/sign-in/__sign-in__/page.tsx.template +9 -0
- package/src/generators/nextjs-app/files/app/(auth)/sign-up/__sign-up__/page.tsx.template +9 -0
- package/src/generators/nextjs-app/files/app/api/config/route.ts.template +39 -0
- package/src/generators/nextjs-app/files/app/api/healthz/route.test.ts +15 -0
- package/src/generators/nextjs-app/files/app/api/healthz/route.ts +5 -0
- package/src/generators/nextjs-app/files/app/api/proxy/__path__/route.test.ts.template +55 -0
- package/src/generators/nextjs-app/files/app/api/proxy/__path__/route.ts.template +126 -0
- package/src/generators/nextjs-app/files/app/error.tsx +39 -0
- package/src/generators/nextjs-app/files/app/global-error.tsx +68 -0
- package/src/generators/nextjs-app/files/app/globals.css +105 -0
- package/src/generators/nextjs-app/files/app/layout.tsx +59 -0
- package/src/generators/nextjs-app/files/app/loading.tsx +13 -0
- package/src/generators/nextjs-app/files/app/not-found.tsx +30 -0
- package/src/generators/nextjs-app/files/app/page.tsx +20 -0
- package/src/generators/nextjs-app/files/components/providers/default.tsx +19 -0
- package/src/generators/nextjs-app/files/components/providers/production.tsx +32 -0
- package/src/generators/nextjs-app/files/components/providers/telemetry.tsx +76 -0
- package/src/generators/nextjs-app/files/components/render-smoke.test.tsx +29 -0
- package/src/generators/nextjs-app/files/components/theme-provider.tsx +11 -0
- package/src/generators/nextjs-app/files/components.json +21 -0
- package/src/generators/nextjs-app/files/eslint.config.mjs +120 -0
- package/src/generators/nextjs-app/files/hooks/use-toast.ts +7 -0
- package/src/generators/nextjs-app/files/instrumentation.ts +90 -0
- package/src/generators/nextjs-app/files/lib/api/fetcher.ts.template +130 -0
- package/src/generators/nextjs-app/files/lib/config.ts +21 -0
- package/src/generators/nextjs-app/files/lib/logger.ts +29 -0
- package/src/generators/nextjs-app/files/lib/schemas/index.ts +19 -0
- package/src/generators/nextjs-app/files/lib/utils.ts +6 -0
- package/src/generators/nextjs-app/files/next.config.mjs +9 -0
- package/src/generators/nextjs-app/files/package.json +70 -0
- package/src/generators/nextjs-app/files/postcss.config.mjs +8 -0
- package/src/generators/nextjs-app/files/proxy.test.ts.template +30 -0
- package/src/generators/nextjs-app/files/proxy.ts +31 -0
- package/src/generators/nextjs-app/files/public/.gitkeep +1 -0
- package/src/generators/nextjs-app/files/tsconfig.json +42 -0
- package/src/generators/nextjs-app/files/vitest.config.mts +15 -0
- package/src/generators/nextjs-app/files/vitest.setup.ts +7 -0
- package/src/generators/nextjs-app/generator.ts +307 -0
- package/src/generators/nextjs-app/schema.json +44 -0
- package/src/generators/python-microservice/docs/principles/stack/python/async.md +168 -0
- package/src/generators/python-microservice/docs/principles/stack/python/documentation.md +240 -0
- package/src/generators/python-microservice/docs/principles/stack/python/mcp.md +147 -0
- package/src/generators/python-microservice/docs/principles/stack/python/resilience.md +193 -0
- package/src/generators/python-microservice/docs/principles/stack/python/testing.md +281 -0
- package/src/generators/python-microservice/files/.env.example.template +30 -0
- package/src/generators/python-microservice/files/Dockerfile.template +36 -0
- package/src/generators/python-microservice/files/db/schema.sql.template +19 -0
- package/src/generators/python-microservice/files/pyproject.toml.template +76 -0
- package/src/generators/python-microservice/files/scripts/apply-schema.sh.template +25 -0
- package/src/generators/python-microservice/files/src/__packageName__/adapters/comfyui.py.template +87 -0
- package/src/generators/python-microservice/files/src/__packageName__/adapters/config.py.template +48 -0
- package/src/generators/python-microservice/files/src/__packageName__/adapters/database.py.template +21 -0
- package/src/generators/python-microservice/files/src/__packageName__/adapters/message_queue.py.template +29 -0
- package/src/generators/python-microservice/files/src/__packageName__/adapters/repository.py.template +130 -0
- package/src/generators/python-microservice/files/src/__packageName__/adapters/telemetry.py.template +68 -0
- package/src/generators/python-microservice/files/src/__packageName__/adapters/websocket_hub.py.template +36 -0
- package/src/generators/python-microservice/files/src/__packageName__/core/domain/entities.py.template +22 -0
- package/src/generators/python-microservice/files/src/__packageName__/core/domain/exceptions.py.template +43 -0
- package/src/generators/python-microservice/files/src/__packageName__/core/ports.py.template +42 -0
- package/src/generators/python-microservice/files/src/__packageName__/core/service/example_service.py.template +68 -0
- package/src/generators/python-microservice/files/src/__packageName__/entrypoints/api/dependencies.py.template +50 -0
- package/src/generators/python-microservice/files/src/__packageName__/entrypoints/api/middleware.py.template +131 -0
- package/src/generators/python-microservice/files/src/__packageName__/entrypoints/api/router.py.template +37 -0
- package/src/generators/python-microservice/files/src/__packageName__/entrypoints/api/websocket_handler.py.template +20 -0
- package/src/generators/python-microservice/files/src/__packageName__/entrypoints/worker/cleanup.py.template +35 -0
- package/src/generators/python-microservice/files/src/__packageName__/entrypoints/worker/worker.py.template +28 -0
- package/src/generators/python-microservice/files/src/__packageName__/main.py.template +108 -0
- package/src/generators/python-microservice/files/tests/test_main.py.template +74 -0
- package/src/generators/python-microservice/files/tests/test_middleware.py.template +109 -0
- package/src/generators/python-microservice/files/tests/test_worker.py.template +16 -0
- package/src/generators/python-microservice/generator.ts +286 -0
- package/src/generators/python-microservice/schema.json +86 -0
- package/src/generators/shared/brand-tokens.ts +301 -0
- package/src/generators/shared/capabilities.ts +349 -0
- package/src/generators/shared/provenance.ts +61 -0
- package/src/generators/shared/scaffold-helpers.ts +309 -0
- package/src/generators/system-test-runner/files/tests/bets/.gitkeep +0 -0
- package/src/generators/system-test-runner/files/tests/bets/_archive/.gitkeep +0 -0
- package/src/generators/system-test-runner/files/tests/conftest.py.template +503 -0
- package/src/generators/system-test-runner/files/tests/pyproject.toml.template +20 -0
- package/src/generators/system-test-runner/files/tests/system/pages/__init__.py.template +9 -0
- package/src/generators/system-test-runner/files/tests/system/pages/base_page.py.template +36 -0
- package/src/generators/system-test-runner/files/tests/system/test_a11y_smoke.py.template +132 -0
- package/src/generators/system-test-runner/files/tests/system/test_contract_conformance.py.template +140 -0
- package/src/generators/system-test-runner/files/tests/system/test_layout_geometry.py.template +109 -0
- package/src/generators/system-test-runner/files/tests/system/test_render_smoke.py.template +227 -0
- package/src/generators/system-test-runner/files/tests/system/test_system.py.template +158 -0
- package/src/generators/system-test-runner/files/tests/system/test_token_conformance.py.template +206 -0
- package/src/generators/system-test-runner/files/tests/system/test_visual_regression.py.template +104 -0
- package/src/generators/system-test-runner/generator.ts +142 -0
- package/src/generators/system-test-runner/schema.json +24 -0
- package/src/generators/workspace-dev-cli/cli-src/build.mjs +42 -0
- package/src/generators/workspace-dev-cli/cli-src/dist/dev-bundle.js +2168 -0
- package/src/generators/workspace-dev-cli/cli-src/src/commands/bet.ts +442 -0
- package/src/generators/workspace-dev-cli/cli-src/src/commands/completion.ts +87 -0
- package/src/generators/workspace-dev-cli/cli-src/src/commands/doctor.ts +139 -0
- package/src/generators/workspace-dev-cli/cli-src/src/commands/lifecycle.ts +548 -0
- package/src/generators/workspace-dev-cli/cli-src/src/commands/quality.ts +127 -0
- package/src/generators/workspace-dev-cli/cli-src/src/commands/surface.ts +214 -0
- package/src/generators/workspace-dev-cli/cli-src/src/index.ts +127 -0
- package/src/generators/workspace-dev-cli/cli-src/src/registry.ts +194 -0
- package/src/generators/workspace-dev-cli/cli-src/src/theme/color.ts +130 -0
- package/src/generators/workspace-dev-cli/cli-src/src/theme/render.ts +158 -0
- package/src/generators/workspace-dev-cli/cli-src/src/theme/tokens.ts +122 -0
- package/src/generators/workspace-dev-cli/cli-src/src/util/context.ts +43 -0
- package/src/generators/workspace-dev-cli/cli-src/src/util/extensions.ts +99 -0
- package/src/generators/workspace-dev-cli/cli-src/src/util/paths.ts +46 -0
- package/src/generators/workspace-dev-cli/cli-src/src/util/proc.ts +106 -0
- package/src/generators/workspace-dev-cli/cli-src/src/util/prompt.ts +108 -0
- package/src/generators/workspace-dev-cli/cli-src/src/util/runners.ts +70 -0
- package/src/generators/workspace-dev-cli/cli-src/src/util/services.ts +221 -0
- package/src/generators/workspace-dev-cli/cli-src/src/util/version.ts +21 -0
- package/src/generators/workspace-dev-cli/cli-src/tsconfig.json +16 -0
- package/src/generators/workspace-dev-cli/files/.agents/skills/workspace-cli/SKILL.md.template +74 -0
- package/src/generators/workspace-dev-cli/files/dev.template +16 -0
- package/src/generators/workspace-dev-cli/files/docker-compose.yml.template +20 -0
- package/src/generators/workspace-dev-cli/files/scripts/cli/templates/milestone-test.pytmpl.template +46 -0
- package/src/generators/workspace-dev-cli/files/scripts/cli/templates/slice-test.pytmpl.template +38 -0
- package/src/generators/workspace-dev-cli/generator.ts +136 -0
- package/src/generators/workspace-dev-cli/schema.json +22 -0
- package/src/hidden-skills/code-intelligence.md +129 -0
- package/src/hidden-skills/groundwork-architect/SKILL.md +114 -0
- package/src/hidden-skills/groundwork-architect/references/agentic-systems.md +44 -0
- package/src/hidden-skills/groundwork-architect/references/ai-native-architecture.md +37 -0
- package/src/hidden-skills/groundwork-architect/references/api-and-contracts.md +45 -0
- package/src/hidden-skills/groundwork-architect/references/core-and-boundaries.md +45 -0
- package/src/hidden-skills/groundwork-architect/references/data-architecture.md +33 -0
- package/src/hidden-skills/groundwork-architect/references/decision-records.md +34 -0
- package/src/hidden-skills/groundwork-architect/references/durable-execution.md +45 -0
- package/src/hidden-skills/groundwork-architect/references/evolutionary-architecture.md +37 -0
- package/src/hidden-skills/groundwork-architect/references/identity-and-access.md +41 -0
- package/src/hidden-skills/groundwork-architect/references/integration-patterns.md +39 -0
- package/src/hidden-skills/groundwork-architect/references/observability.md +36 -0
- package/src/hidden-skills/groundwork-architect/references/performance-and-scale.md +41 -0
- package/src/hidden-skills/groundwork-architect/references/platform-and-delivery.md +47 -0
- package/src/hidden-skills/groundwork-architect/references/realtime-and-async.md +28 -0
- package/src/hidden-skills/groundwork-architect/references/reliability.md +31 -0
- package/src/hidden-skills/groundwork-architect/references/security-and-trust.md +47 -0
- package/src/hidden-skills/groundwork-architect/references/surface-architecture.md +40 -0
- package/src/hidden-skills/groundwork-architect/sync-anchor.md +34 -0
- package/src/hidden-skills/groundwork-architecture/architecture-template.md +50 -0
- package/src/hidden-skills/groundwork-architecture/instructions.md +139 -0
- package/src/hidden-skills/groundwork-architecture/phases/01-context-ingestion.md +18 -0
- package/src/hidden-skills/groundwork-architecture/phases/02-technical-constraints.md +27 -0
- package/src/hidden-skills/groundwork-architecture/phases/03-service-design.md +19 -0
- package/src/hidden-skills/groundwork-architecture/phases/04-data-flow-communication.md +23 -0
- package/src/hidden-skills/groundwork-architecture/phases/05-component-boundaries-contracts.md +17 -0
- package/src/hidden-skills/groundwork-architecture/phases/06-draft-review-present.md +38 -0
- package/src/hidden-skills/groundwork-architecture/phases/07-commit.md +33 -0
- package/src/hidden-skills/groundwork-architecture/templates/architecture-cache.md +43 -0
- package/src/hidden-skills/groundwork-architecture-extract/instructions.md +163 -0
- package/src/hidden-skills/groundwork-architecture-extract/templates/architecture-extract-cache.md +21 -0
- package/src/hidden-skills/groundwork-bet/briefs/slice-worker.md +191 -0
- package/src/hidden-skills/groundwork-bet/instructions.md +88 -0
- package/src/hidden-skills/groundwork-bet/templates/bet-progress-test.md +126 -0
- package/src/hidden-skills/groundwork-bet/templates/change-proposal.md +38 -0
- package/src/hidden-skills/groundwork-bet/templates/decomposition/meta.json +4 -0
- package/src/hidden-skills/groundwork-bet/templates/decomposition/milestone-index.md +35 -0
- package/src/hidden-skills/groundwork-bet/templates/decomposition/slice.md +35 -0
- package/src/hidden-skills/groundwork-bet/templates/pitch.md +45 -0
- package/src/hidden-skills/groundwork-bet/templates/technical-design/01-ui-design.md +51 -0
- package/src/hidden-skills/groundwork-bet/templates/technical-design/02-data-flows.md +36 -0
- package/src/hidden-skills/groundwork-bet/templates/technical-design/03-api-design.md +90 -0
- package/src/hidden-skills/groundwork-bet/templates/technical-design/04-data-design.md +29 -0
- package/src/hidden-skills/groundwork-bet/workflows/01-discovery.md +198 -0
- package/src/hidden-skills/groundwork-bet/workflows/02-design.md +168 -0
- package/src/hidden-skills/groundwork-bet/workflows/03-decomposition.md +246 -0
- package/src/hidden-skills/groundwork-bet/workflows/04-delivery.md +193 -0
- package/src/hidden-skills/groundwork-bet/workflows/05-validation.md +199 -0
- package/src/hidden-skills/groundwork-design-system/instructions.md +125 -0
- package/src/hidden-skills/groundwork-design-system/templates/brand-tokens.md +182 -0
- package/src/hidden-skills/groundwork-design-system/templates/design-system-cache.md +64 -0
- package/src/hidden-skills/groundwork-design-system/tracks/_foundation.md +136 -0
- package/src/hidden-skills/groundwork-design-system/tracks/agentic-protocol.md +269 -0
- package/src/hidden-skills/groundwork-design-system/tracks/cli.md +355 -0
- package/src/hidden-skills/groundwork-design-system/tracks/graphical-ui.md +330 -0
- package/src/hidden-skills/groundwork-design-system-extract/instructions.md +124 -0
- package/src/hidden-skills/groundwork-design-system-extract/templates/design-system-extract-cache.md +19 -0
- package/src/hidden-skills/groundwork-designer/SKILL.md +108 -0
- package/src/hidden-skills/groundwork-designer/references/accessibility.md +33 -0
- package/src/hidden-skills/groundwork-designer/references/ai-native-design.md +37 -0
- package/src/hidden-skills/groundwork-designer/references/design-review.md +29 -0
- package/src/hidden-skills/groundwork-designer/references/design-systems-and-tokens.md +33 -0
- package/src/hidden-skills/groundwork-designer/references/interaction-and-motion.md +37 -0
- package/src/hidden-skills/groundwork-designer/references/layout-and-space.md +33 -0
- package/src/hidden-skills/groundwork-designer/references/usability-and-ux.md +33 -0
- package/src/hidden-skills/groundwork-designer/references/visual-craft.md +49 -0
- package/src/hidden-skills/groundwork-designer/sync-anchor.md +20 -0
- package/src/hidden-skills/groundwork-doc-sync/instructions.md +100 -0
- package/src/hidden-skills/groundwork-elicit/instructions.md +66 -0
- package/src/hidden-skills/groundwork-elicit/methods.md +65 -0
- package/src/hidden-skills/groundwork-infra-adopt/instructions.md +168 -0
- package/src/hidden-skills/groundwork-infra-adopt/templates/infra-adopt-cache.md +21 -0
- package/src/hidden-skills/groundwork-mvp/instructions.md +223 -0
- package/src/hidden-skills/groundwork-mvp/templates/mvp-cache.md +9 -0
- package/src/hidden-skills/groundwork-patch/instructions.md +40 -0
- package/src/hidden-skills/groundwork-persona/instructions.md +54 -0
- package/src/hidden-skills/groundwork-product/SKILL.md +102 -0
- package/src/hidden-skills/groundwork-product/references/ai-native-product.md +45 -0
- package/src/hidden-skills/groundwork-product/references/discovery-and-opportunity.md +38 -0
- package/src/hidden-skills/groundwork-product/references/product-risks.md +52 -0
- package/src/hidden-skills/groundwork-product/references/requirements-and-specs.md +39 -0
- package/src/hidden-skills/groundwork-product/references/scope-and-sequencing.md +35 -0
- package/src/hidden-skills/groundwork-product/references/shaping-and-appetite.md +48 -0
- package/src/hidden-skills/groundwork-product/references/success-metrics-and-signals.md +37 -0
- package/src/hidden-skills/groundwork-product/sync-anchor.md +19 -0
- package/src/hidden-skills/groundwork-product-brief/instructions.md +231 -0
- package/src/hidden-skills/groundwork-product-brief-extract/instructions.md +139 -0
- package/src/hidden-skills/groundwork-product-brief-extract/templates/product-brief-extract-cache.md +17 -0
- package/src/hidden-skills/groundwork-review/checklists/architecture.md +93 -0
- package/src/hidden-skills/groundwork-review/checklists/bet-pitch.md +94 -0
- package/src/hidden-skills/groundwork-review/checklists/decomposition.md +135 -0
- package/src/hidden-skills/groundwork-review/checklists/design-system.md +85 -0
- package/src/hidden-skills/groundwork-review/checklists/domain-entity.md +66 -0
- package/src/hidden-skills/groundwork-review/checklists/implementation-readiness.md +46 -0
- package/src/hidden-skills/groundwork-review/checklists/infrastructure.md +68 -0
- package/src/hidden-skills/groundwork-review/checklists/maturity.md +71 -0
- package/src/hidden-skills/groundwork-review/checklists/product-brief.md +69 -0
- package/src/hidden-skills/groundwork-review/checklists/technical-design.md +112 -0
- package/src/hidden-skills/groundwork-review/instructions.md +181 -0
- package/src/hidden-skills/groundwork-scaffold/instructions.md +254 -0
- package/src/hidden-skills/groundwork-scaffold/phases/01-ingestion-service-mapping.md +87 -0
- package/src/hidden-skills/groundwork-scaffold/phases/02-scaffolding-execution.md +15 -0
- package/src/hidden-skills/groundwork-scaffold/phases/03-service-documentation-api-stubs.md +100 -0
- package/src/hidden-skills/groundwork-scaffold/phases/04-infrastructure-verification.md +17 -0
- package/src/hidden-skills/groundwork-scaffold/phases/05-draft-review.md +19 -0
- package/src/hidden-skills/groundwork-scaffold/phases/06-commit.md +19 -0
- package/src/hidden-skills/groundwork-scaffold/templates/scaffold-cache.md +23 -0
- package/src/hidden-skills/groundwork-scan/instructions.md +164 -0
- package/src/hidden-skills/groundwork-scan/references/digest-schema.md +66 -0
- package/src/hidden-skills/groundwork-scan/references/exclusions.md +44 -0
- package/src/hidden-skills/groundwork-scan/templates/architecture-findings.md +42 -0
- package/src/hidden-skills/groundwork-scan/templates/design-findings.md +23 -0
- package/src/hidden-skills/groundwork-scan/templates/overview.md +26 -0
- package/src/hidden-skills/groundwork-scan/templates/product-findings.md +23 -0
- package/src/hidden-skills/groundwork-scan/templates/scan-state.json +19 -0
- package/src/hidden-skills/groundwork-stack-forge/instructions.md +150 -0
- package/src/hidden-skills/groundwork-stack-forge/references/authoring-engineer-skills.md +107 -0
- package/src/hidden-skills/groundwork-surface-activation/instructions.md +138 -0
- package/src/hidden-skills/groundwork-update/briefs/reconcile-worker.md +196 -0
- package/src/hidden-skills/groundwork-update/instructions.md +200 -0
- package/src/hidden-skills/groundwork-writer/SKILL.md +278 -0
- package/src/hidden-skills/maturity-model.md +125 -0
- package/src/hidden-skills/operating-contract.md +400 -0
- package/src/hidden-skills/repo-map-schema.md +90 -0
- package/src/hidden-skills/templates/adr.md +57 -0
- package/src/hidden-skills/templates/capability-ports.md +71 -0
- package/src/hidden-skills/templates/discovery-notes.md +33 -0
- package/src/hidden-skills/templates/domain-entity.md +80 -0
- package/src/hidden-skills/templates/gap-ledger.md +21 -0
- package/src/hidden-skills/templates/handoff.md +37 -0
- package/src/hidden-skills/templates/maturity.md +39 -0
- package/src/hidden-skills/templates/surfaces.md +207 -0
- package/src/skills/groundwork-check/SKILL.md +56 -0
- package/src/skills/groundwork-check/instructions.md +70 -0
- package/src/skills/groundwork-orchestrator/SKILL.md +176 -0
- package/src/skills/groundwork-orchestrator/workflow-index.md +50 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Evolutionary Architecture
|
|
2
|
+
|
|
3
|
+
An architecture is a system that must change safely under constant pressure, not a blueprint delivered once. Two jobs at design time: make the structure cheap to change, and protect the characteristics you care about with **fitness functions** — automated checks that *assure* a property the way a test assures behaviour. A decision record documents what was chosen; a fitness function proves it still holds. A rule that lives only in prose or code review is already drifting.
|
|
4
|
+
|
|
5
|
+
## Design for change
|
|
6
|
+
|
|
7
|
+
Optimise for evolvability over speculative completeness. You cannot predict which requirements shift, so build to absorb change cheaply — clear boundaries, reversible decisions, replaceable parts — rather than guessing the future and building for it. **Reversibility is the property worth paying for**: the cost of a decision is dominated by how hard it is to undo. Prefer one-way doors made deliberately and visibly (and recorded — see [decision-records.md](decision-records.md)); an architecture full of irreversible choices cannot evolve.
|
|
8
|
+
|
|
9
|
+
## Fitness functions assure what decisions document
|
|
10
|
+
|
|
11
|
+
Every architectural characteristic you actually care about should get an automated check that fails when it is violated:
|
|
12
|
+
|
|
13
|
+
- **dependency direction / layering** — the inward-flow rule (the core imports nothing concrete; edges depend inward) is the archetype, automatable with `depguard` / `import-linter` / ArchUnit; this is what turns it from a style into a guarantee.
|
|
14
|
+
- **API conformance** — spec linting (Spectral) + contract tests with a `can-i-deploy` gate ([api-and-contracts.md](api-and-contracts.md)).
|
|
15
|
+
- **budgets** — latency, bundle size, allowed couplings — checked in CI against committed thresholds.
|
|
16
|
+
|
|
17
|
+
The architect's job is to **advise which characteristics deserve a fitness function and where the seam goes**; the engineer skills build them. A new service ships with its dependency-direction check from day one. When you record a load-bearing decision, ask: what check would catch its violation? — that check is the decision's other half.
|
|
18
|
+
|
|
19
|
+
## Evolve incrementally, guarded by checks
|
|
20
|
+
|
|
21
|
+
Change lands in small reversible steps, each guarded by the fitness functions, so a regression is caught the moment it lands and the system can be reshaped continually instead of in big-bang migrations. Atomic checks guard one characteristic; holistic checks guard interactions; both run continually, not as a periodic audit.
|
|
22
|
+
|
|
23
|
+
## Modernise with the strangler fig, not the rewrite
|
|
24
|
+
|
|
25
|
+
Evolve legacy systems; do not replace them wholesale. New capability grows around the old behind a **façade** that routes traffic to the new implementation as each slice is proven, until the old system is starved and removed. The big-bang rewrite has the highest failure rate of any modernization approach; incremental replacement keeps the system shippable the whole way across. (This is the same discipline a brownfield adoption applies — strangle, don't stop the world.)
|
|
26
|
+
|
|
27
|
+
## Governance is advisory, not a gate
|
|
28
|
+
|
|
29
|
+
Decentralise the decision, centralise the visibility. An **advice process** (the decider must seek advice from those affected and those with expertise, but keeps the decision), a lightweight RFC, or an architecture guild replaces the central review board teams route around. Let fitness functions do the gatekeeping that can be automated; spend human judgement where automation cannot reach. "Governed decisions" never means a person standing at a gate.
|
|
30
|
+
|
|
31
|
+
## Antipatterns to catch
|
|
32
|
+
|
|
33
|
+
- **ADR graveyard** — decisions documented, never enforced. Pair the load-bearing ones with a check.
|
|
34
|
+
- **Big-bang rewrite** — replacing a working system all at once. Strangle it.
|
|
35
|
+
- **Review board as veto** — a central gate that becomes a bottleneck. Advise and automate.
|
|
36
|
+
- **Convention-only rules** — an agreed boundary with nothing failing the build when it is crossed.
|
|
37
|
+
- **Speculative future-proofing** — building for imagined requirements instead of for change.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Identity & Access
|
|
2
|
+
|
|
3
|
+
Who may do what is an architectural decision made with the boundaries, not a middleware bolted on later — and the hardest thing to retrofit once authorization is scattered and the trust model is implicit. Decide three things with the boundaries: how each actor authenticates, how services prove identity to each other, and how authorization is modelled. In 2026 a fourth actor joined: agents, which need an identity the system can reason about.
|
|
4
|
+
|
|
5
|
+
## Authn vs authz — keep them distinct
|
|
6
|
+
|
|
7
|
+
Authentication establishes *who*; authorization decides *what they may do*. Design both deliberately. Conflating them, or letting either accrete in middleware, is how access control becomes unauditable.
|
|
8
|
+
|
|
9
|
+
## Human identity is boring and standard
|
|
10
|
+
|
|
11
|
+
Do not invent auth. Humans authenticate through a proven provider over **OIDC / OAuth 2.1**; sessions and tokens follow current OWASP guidance. Custom JWT handling, bespoke session cookies, and home-grown MFA are how teams learn auth vulnerabilities the hard way.
|
|
12
|
+
|
|
13
|
+
## Workload identity is the service perimeter
|
|
14
|
+
|
|
15
|
+
Services prove who they are with cryptographic **workload identity** — SPIFFE/SPIRE issuing short-lived, auto-rotating SVIDs, mTLS through the mesh with no secret in app code. "It came from inside the network" authenticates nothing; machine identity is the perimeter ([security-and-trust.md](security-and-trust.md)).
|
|
16
|
+
|
|
17
|
+
## Authorization is modelled, not scattered
|
|
18
|
+
|
|
19
|
+
Choose the model deliberately and enforce it through one path:
|
|
20
|
+
- **RBAC** for coarse role-based access.
|
|
21
|
+
- **ReBAC** (relationship-based, Zanzibar-style) for "can *this* user see *this* document".
|
|
22
|
+
- **ABAC / policy** where rules are dynamic.
|
|
23
|
+
|
|
24
|
+
Externalise complex or shared policy to a policy engine so the rules are inspectable and consistent. Per-endpoint permission checks copy-pasted across handlers are authorization that will be wrong somewhere.
|
|
25
|
+
|
|
26
|
+
## Agent & non-human identity is first-class
|
|
27
|
+
|
|
28
|
+
An automated actor — service account, CI job, AI agent — has its own identity, never a borrowed human one. In an agent-led system this is load-bearing: the agent carries an identity into every request, consequential tool calls are authorised **per-action**, and **delegation is explicit** (on-behalf-of token exchange) so authorization can reason about which agent acted on whose behalf. An agent with a shared admin key is excessive agency by another name ([agentic-systems.md](agentic-systems.md)).
|
|
29
|
+
|
|
30
|
+
## Least privilege, short-lived credentials, tenant as identity
|
|
31
|
+
|
|
32
|
+
Every identity starts minimal and widens only on evidence; credentials are short-lived and auto-rotated (a static long-lived secret is a breach with a long fuse). In a multi-tenant system the **tenant is part of every identity and every authorization decision**, enforced at the data boundary — never trusted from a client-supplied parameter. Cross-tenant access is the highest-severity failure class.
|
|
33
|
+
|
|
34
|
+
## Antipatterns to catch
|
|
35
|
+
|
|
36
|
+
- **Implicit network trust** — "internal, so authenticated." No.
|
|
37
|
+
- **Long-lived static secrets** — a shared service key with no rotation.
|
|
38
|
+
- **Scattered authorization** — per-endpoint checks that drift apart.
|
|
39
|
+
- **Borrowed identity for machines** — a bot acting as a human admin, no trace of who acted.
|
|
40
|
+
- **Invented auth** — custom JWT/session/MFA instead of the standard.
|
|
41
|
+
- **Tenant-by-query-param** — trusting a client-supplied tenant id.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Integration Patterns
|
|
2
|
+
|
|
3
|
+
Services integrate through a small set of well-understood patterns. Pick the pattern based on the **guarantee the integration needs**, not on whatever felt easy. Most production incidents trace back to an integration that chose the wrong consistency model — a sync call where async belonged, an event without idempotency, a fire-and-forget webhook that dropped on retry. The cost of getting it wrong is paid every day, forever, as an intermittent stream of weirdness.
|
|
4
|
+
|
|
5
|
+
## The decisions
|
|
6
|
+
|
|
7
|
+
1. **Default to async; upgrade to sync only when required.** Async events are the default for inter-service communication. Upgrade to synchronous RPC only when the response value is needed inline (most user-facing reads) or the caller needs the commit to have happened before proceeding (strict writes). Making sync the default couples services in ways invisible in code and disastrous at load.
|
|
8
|
+
2. **Outbox when a DB write and an event must agree.** When a state change needs both a database write and an event emission — both or neither — write the event to an `outbox` table inside the same transaction, then relay it to the broker. This is the only correct solution without distributed transactions. "Just emit after commit" leaks inconsistency every time the process dies between the two steps. It will.
|
|
9
|
+
3. **Every consumer is idempotent.** At-least-once is the only delivery guarantee you ever get. Every handler carries a de-duplication key or operates on keys that make replay safe (an `UPSERT` on a natural key, a version-guarded conditional update). Idempotent handling is the only response that works.
|
|
10
|
+
4. **Retries have policies, not defaults.** Every retry policy has an explicit maximum, an explicit backoff curve with jitter, and an explicit dead-letter destination. "Retry forever with 1-second backoff" is not a policy — it is how a transient failure becomes a thundering herd. The DLQ fires an alert; it is not a garbage bin.
|
|
11
|
+
5. **Webhooks verify, sign, and replay.** Inbound and outbound webhooks are authenticated with an HMAC signature over the payload, not a secret in the query string. Both sides support replay (store the signature, reject duplicates) and surface a retry history. An unsigned webhook is just an unauthenticated POST endpoint.
|
|
12
|
+
6. **Timeouts are end-to-end budgets.** Every sync call has a timeout allocated from a budget set by the outermost caller. A 2-second edge budget does not get to spend 1.5s on one downstream — that leaves no slack for retries or the next hop. Without budgeting, tail latencies compound unpredictably.
|
|
13
|
+
7. **Circuit breakers protect the system from itself.** When a downstream is failing, stop calling it. The breaker opens after a failure threshold, fast-fails the calls, and probes periodically for recovery — protecting both the recovering service and the upstream callers waiting on inevitable timeouts.
|
|
14
|
+
8. **Every integration has a contract test.** A test exercising the real signature verification, the real retry curve, the real idempotency behaviour, run in CI against an emulator. Happy-path-only coverage is an incident waiting for its trigger.
|
|
15
|
+
|
|
16
|
+
## The sync-vs-async call
|
|
17
|
+
|
|
18
|
+
| Choose sync when | Choose async when |
|
|
19
|
+
|---|---|
|
|
20
|
+
| The caller needs the response value inline | The work can complete after the caller returns |
|
|
21
|
+
| The caller must know the write committed before proceeding | Eventual consistency is acceptable |
|
|
22
|
+
| It is a user-facing read | It is fan-out, notification, or cross-service propagation |
|
|
23
|
+
|
|
24
|
+
When in doubt, async with an idempotent consumer is the more resilient default. Reserve sync for where the guarantee genuinely demands it.
|
|
25
|
+
|
|
26
|
+
## Dead letters, jitter, and when workflow-as-code takes over
|
|
27
|
+
|
|
28
|
+
- **Dead-letter handling is a named primitive.** A consumer that exhausts its retries routes the message to a DLQ that *alerts and is worked*, never a silent bin — poison messages are expected, not exceptional.
|
|
29
|
+
- **Backoff carries jitter.** Bounded exponential backoff **with jitter** is mandatory, not optional — synchronized retries without jitter are a retry storm (a self-inflicted DDoS).
|
|
30
|
+
- **Orchestration vs choreography is a step-count call.** Choreography (services react to events) for simple 2–4-step flows; orchestration for 5+ steps, branching, or when you need visibility. And when a flow is genuinely long-running, multi-step, or compensating, reach for **durable execution** (workflow-as-code) instead of hand-assembling outbox + idempotency + retry + sweeper — see [durable-execution.md](durable-execution.md).
|
|
31
|
+
- **Webhooks, current.** A stable event-id for idempotent dedup, a timestamp for a replay-window rejection, **rotating signing keys via JWKS** (not a long-lived shared HMAC secret), and a CloudEvents-shaped payload.
|
|
32
|
+
|
|
33
|
+
## Antipatterns to catch
|
|
34
|
+
|
|
35
|
+
- **Sync chains three deep** — A→B→C→D. Every failure mode in the chain becomes A's failure mode.
|
|
36
|
+
- **Fire-and-forget webhooks** — no signature, no retry, no idempotency. Works once; the next incident is unfixable from the outside.
|
|
37
|
+
- **Commit-then-publish without the outbox** — guaranteed inconsistency the first time a process dies mid-step.
|
|
38
|
+
- **Global retry policies** — "all HTTP calls retry 3× with 1s backoff" ignores the specific downstream's failure profile and the caller's budget.
|
|
39
|
+
- **Dead-letter queues as silent logs** — a DLQ quietly accumulating means integration is failing quietly. Alert and act.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Observability
|
|
2
|
+
|
|
3
|
+
Observability is a design property, not a monitoring bolt-on. The difference between a team that ships with confidence and one that cannot is, most of the time, a difference in what they can see. Observability buys three things: knowing whether the system is healthy, localising a fault when it is not, and explaining what happened after the fact. Decide instrumentation at design time — when a system behaves strangely and you cannot see why in your data, the instrumentation is the bug.
|
|
4
|
+
|
|
5
|
+
## The design decisions
|
|
6
|
+
|
|
7
|
+
1. **OpenTelemetry is the common language.** Every service emits traces, metrics, and logs through OTel SDKs to a single collector. Vendor lock-in lives at the collector boundary, not in application code — switching backends is a config change, not a rewrite.
|
|
8
|
+
2. **Traces are the primary signal.** Given the choice between a metric and a richer trace, enrich the trace. Traces preserve causality; metrics aggregate it away. When one user action crosses half a dozen services, causality is the difference between a diagnosable incident and a guessing game.
|
|
9
|
+
3. **The three pillars are one pillar.** Logs, metrics, and traces are projections of the same events: a log line carries its trace ID; a metric carries dimensions that pivot back to traces; an exemplar points at the trace that produced it. Three disconnected telemetry systems is no observability.
|
|
10
|
+
4. **Dashboards derive from SLOs.** Every dashboard starts with the user-journey SLO it supports, then fills in latency percentiles, error rates, saturation, and traffic. Dashboards assembled from "interesting-looking" graphs drift into uselessness.
|
|
11
|
+
5. **Trace-driven development.** Sketch the trace a feature should produce — what spans, what attributes, what parent-child relationships — *before* writing the handler. The instrumentation design shapes the code, making it nearly impossible to ship an unobservable feature.
|
|
12
|
+
6. **Assert on telemetry in tests.** System tests assert traces are unbroken end-to-end; a missing span is a test failure. The instrumentation is part of the contract, not optional decoration.
|
|
13
|
+
7. **Logs are structured, sampled, contextual.** Every line is JSON, carries its trace ID, and is emitted at an agreed severity. Sample aggressively at debug/info; never sample errors.
|
|
14
|
+
8. **Cardinality is a design choice.** High-cardinality attributes (per-user, per-tenant) are valuable on traces where they are queryable, expensive on metrics where they multiply by every time window. Runaway cardinality is one of the most expensive mistakes in observability — a deliberate call, not a default.
|
|
15
|
+
9. **Wide events over pre-aggregation ("observability 2.0").** Prefer emitting arbitrarily-wide, high-cardinality structured events you can slice after the fact over pre-deciding which metrics to aggregate. The query you need is rarely the one you anticipated.
|
|
16
|
+
10. **Auto-instrument with eBPF; profiling is a signal.** Kernel-level, zero-code instrumentation (OpenTelemetry OBI / eBPF) gives high-cardinality telemetry without touching application code; continuous profiling correlated to trace IDs is a first-class signal, not a special exercise. Reserve hand-instrumentation for the domain spans that auto-instrumentation cannot infer.
|
|
17
|
+
|
|
18
|
+
## AI/LLM observability
|
|
19
|
+
|
|
20
|
+
A model in the system needs telemetry classic APM does not capture, via the **OTel GenAI semantic conventions**:
|
|
21
|
+
|
|
22
|
+
- **Token usage** (`gen_ai.usage.input_tokens` / `output_tokens`) — because cost and latency correlate with *token* count, not request count. Telemetry that does not capture tokens cannot explain the bill.
|
|
23
|
+
- **Prompt/response capture and eval traces** — the inputs, outputs, and scored quality of model calls, plus agent-orchestration and **MCP tool-call** spans, all on the same trace.
|
|
24
|
+
- **Online evals** feeding the loop: failed production traces are promoted into the eval set so the suite grows from real behaviour ([agentic-systems.md](agentic-systems.md)).
|
|
25
|
+
|
|
26
|
+
## What this means at design time
|
|
27
|
+
|
|
28
|
+
When you set a boundary or a data flow, decide what it must emit. Observability is a downstream obligation of the contract: name the spans a flow must produce and the SLO a dashboard will track, so the instrumentation ships with the feature rather than chasing it.
|
|
29
|
+
|
|
30
|
+
## Antipatterns to catch
|
|
31
|
+
|
|
32
|
+
- **Pillar-at-a-time adoption** — "metrics now, traces later." You will not.
|
|
33
|
+
- **Vendor SDKs in application code** — application code imports OTel; the collector talks to the vendor.
|
|
34
|
+
- **Dashboards without SLOs** — pretty charts without a question they answer.
|
|
35
|
+
- **Logs-as-debugger** — `printf`-tracing a single bug instead of writing a test and adding a span.
|
|
36
|
+
- **Cardinality explosions** — a UUID in a Prometheus label. The bill and the query planner both remember.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Performance & Scale
|
|
2
|
+
|
|
3
|
+
Performance is not "fast enough" — it is a budget, spent deliberately across every hop of an interaction and enforced in CI. Users notice latency before almost anything else: a response at 800ms feels instant, at 3000ms feels broken. That gap is not four times the effort — it is the difference between treating latency as a design constraint and treating it as a post-hoc tuning problem. Performance handled as an afterthought is invariably more expensive than performance designed in.
|
|
4
|
+
|
|
5
|
+
## The design decisions
|
|
6
|
+
|
|
7
|
+
1. **Latency is a budget, allocated top-down.** Every user-facing operation starts with an edge budget (say 500ms) allocated to downstream hops. If one fetch takes 300ms and a join 150ms, the handler has 50ms of its own. When a hop overruns, someone else's budget is squeezed — the budgeting view makes the trade-off explicit.
|
|
8
|
+
2. **Measure tail latency, not average.** p50 is a marketing number; p95 and p99 are what users experience. Design for the tail and alert on it. A great median with a terrible p99 earns an awful reputation regardless of the dashboard.
|
|
9
|
+
3. **Pre-compute, cache, denormalise deliberately — across tiers.** Hot read → pre-compute. Stable computation → cache. Expensive join → denormalise. Caching is multi-tier (client, CDN/edge, service, datastore) with an explicit origin-offload/hit-ratio target, not a single layer. Each trades complexity for latency and must earn its keep with data, not intuition. Speculative caching is how cache-invalidation becomes the biggest source of data incidents.
|
|
10
|
+
4. **Backpressure is designed in, not hoped for.** Every producer has a bounded queue and a defined full-queue behaviour: shed, coalesce, block. "It works in load tests" is not a backpressure strategy.
|
|
11
|
+
5. **Load shedding protects the system from itself.** When saturated, serve fewer requests well rather than trying harder. Shed on clear criteria — low-priority first, new sessions before active ones, non-interactive before interactive. A designed degradation mode, not an accident.
|
|
12
|
+
6. **Profile before optimising.** The "obvious" bottleneck is almost always wrong; tuning a cold path is wasted effort. Profile in production-representative conditions — laptop profiles lie.
|
|
13
|
+
7. **Budgets are enforced in CI.** Bundle sizes, worst-case handler latencies, and the like are measured against committed thresholds; a regression requires a reviewed waiver. Regressions that slip in once slip in a hundred times — automation is cheaper than vigilance.
|
|
14
|
+
|
|
15
|
+
## Understand the demand shape before choosing infrastructure
|
|
16
|
+
|
|
17
|
+
Decide the scaling model from the shape of the demand, not from defaults:
|
|
18
|
+
- **Spiky and unpredictable** vs **stable and forecastable** demand call for fundamentally different approaches.
|
|
19
|
+
- For indie/hobby contexts, whether cost can reach near-zero during inactivity (**scale-to-zero**) is a legitimate architectural requirement that shapes every infrastructure choice after it.
|
|
20
|
+
- Fully managed services trade operational burden for higher spend and vendor dependency; self-managed trades convenience for control and cost.
|
|
21
|
+
|
|
22
|
+
Autoscaling is designed, not enabled: aggressive scaling on a bursty workload multiplies cost without improving experience; conservative scaling on a steady workload wastes headroom. Tune each policy to the production load profile. The 2026 default is **event-driven** autoscaling (KEDA on queue depth / lag / custom signals, Karpenter for nodes) with genuine **scale-to-zero** — which is what closes the idle-cost gap to serverless. CPU-only HPA is the dated reflex.
|
|
23
|
+
|
|
24
|
+
## Compute placement is a design axis
|
|
25
|
+
|
|
26
|
+
*Where* code runs is now a first-class decision, not just *how much* of it:
|
|
27
|
+
- **Edge** for latency-sensitive, cacheable, or geo-distributed work (auth, personalization, gateway logic) — proximity flattens tail latency; target a high edge hit ratio.
|
|
28
|
+
- **WebAssembly** is the edge/FaaS/plugin/multi-tenant-density compute unit (1–5ms cold start, sandboxed, polyglot) — production-ready for those, not yet a general microservice runtime.
|
|
29
|
+
- **Containers/serverless** for stateful or heavy work. Most teams blend all three; the placement decision trades latency, cost, and the edge's constraints (no raw TCP, limited CPU, no direct DB drivers).
|
|
30
|
+
|
|
31
|
+
## The AI-cost lever
|
|
32
|
+
|
|
33
|
+
For a model-in-the-loop feature, latency and cost track **tokens, not requests** (output ≈4× input). The architectural levers: **model routing** (small model for the easy majority, frontier for the hard minority — often a 100×+ delta), **semantic caching** (large savings on repetitive prompts), and an **AI gateway** that enforces budgets, routing, and fallback ([platform-and-delivery.md](platform-and-delivery.md)). A latency budget that ignores token count is incomplete for an AI path.
|
|
34
|
+
|
|
35
|
+
## Antipatterns to catch
|
|
36
|
+
|
|
37
|
+
- **Optimising on hunch** — no profile, no optimisation.
|
|
38
|
+
- **"Fast on my laptop"** — dev latency is not production latency.
|
|
39
|
+
- **Average-as-metric** — p50 is a lie; use percentiles.
|
|
40
|
+
- **Unbounded queues** — a queue without a max is a latency bomb.
|
|
41
|
+
- **"We'll fix performance later"** — ship slow and users remember slow.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Platform, Delivery & Cost
|
|
2
|
+
|
|
3
|
+
How the system is deployed, released, and paid for is an architectural concern, not an operational afterthought. The topology you choose constrains how fast the team can ship and what it costs to run — decide it with the boundaries, not after them.
|
|
4
|
+
|
|
5
|
+
## Platform: the substrate is a product
|
|
6
|
+
|
|
7
|
+
The platform is the substrate every team builds on — the local stack, the CI/CD pipeline, the observability collector, the secrets manager, the dev CLI fronting all of it. Treat it as a product with users, a backlog, and a quality bar. A good platform makes the right thing the easy thing.
|
|
8
|
+
|
|
9
|
+
1. **Self-service is the goal.** Spinning up a service, requesting a secret, adding a dashboard, flipping a flag — all self-service. When a team files a ticket and waits, the platform is the bottleneck.
|
|
10
|
+
2. **Golden paths over policy.** Pave the specific routes (create a service, deploy, observe) and make them the easiest path. Policy without a paved path produces compliance in shape, drift in substance.
|
|
11
|
+
3. **One paved-road pipeline per service type.** One pipeline definition for every service of a kind; deviation earns the cost of its own maintenance. This is how snowflake CI configurations are prevented.
|
|
12
|
+
4. **Observability is part of the platform.** One collector, one backend, one set of dashboards — telemetry set up independently by each team is broken in five different ways.
|
|
13
|
+
|
|
14
|
+
## Progressive delivery: decouple deploy from release
|
|
15
|
+
|
|
16
|
+
Deploying code and releasing a feature are different acts. Ship to production many times a day from one branch, but users see a change only when a flag opens, a canary routes, or a cohort is promoted. Deploys become small and boring; releases become observable, controllable, reversible.
|
|
17
|
+
|
|
18
|
+
1. **Trunk-based development, short-lived branches.** Every change lands on `main` when ready; branches measured in days, not weeks. Long-lived branches accumulate integration bugs quietly.
|
|
19
|
+
2. **Feature flags separate deploy from release.** New features deploy behind a flag defaulted off (use the vendor-neutral **OpenFeature** standard so the flag system is swappable). A bad feature is disabled without a redeploy; a risky one rolls to 1% before 100%. Every flag has an owner, a purpose, and an expiry — stale flags are removed in the normal course of work.
|
|
20
|
+
3. **Canary before promote, driven by GitOps.** Anything that could affect latency, reliability, or experience goes through a canary — a small traffic fraction for a bounded window — evaluated against SLO burn rates by automated comparison, not eyeballs. The progressive-delivery engine follows the GitOps tool (Argo Rollouts with ArgoCD, Flagger with Flux), which owns the traffic-weight and automated analysis.
|
|
21
|
+
4. **Release is reversible, cheaply.** Every release has a rollback any on-call engineer can execute in minutes: reversible migrations, flippable flags, re-routable canaries. "We can't roll that back" is a red flag on the release itself.
|
|
22
|
+
|
|
23
|
+
## Cost: a non-functional requirement with a dollar sign
|
|
24
|
+
|
|
25
|
+
Most teams discover cost too late — after a quarterly bill, when the decisions that drove it are already in production with consumers. Make the economic consequence visible at the point of the decision.
|
|
26
|
+
|
|
27
|
+
1. **Cost is a first-class metric.** Cost-per-call, cost-per-user, cost-per-feature, tracked alongside latency and error rate. A team that does not know what its features cost cannot reason about the trade-offs that matter.
|
|
28
|
+
2. **Budgets are set and defended.** Every significant service runs inside a cost budget set at design time; exceeding it triggers the same response as any SLO breach.
|
|
29
|
+
3. **Egress is expensive; plan for it.** Inter-region chatter, chatty logs, large frequent payloads add up. Place data where its consumers are; batch and compress where cheap.
|
|
30
|
+
4. **AI spend runs through a gateway.** Every model call has a measured cost and a caching strategy, mediated by an **AI gateway** — a token-aware control plane between apps/agents and providers that does model routing, semantic caching, fallback, per-key budgets, audit, and guardrails. "Pass the whole context to the largest model" is how an AI feature becomes a cost incident ([performance-and-scale.md](performance-and-scale.md)).
|
|
31
|
+
|
|
32
|
+
## Substrate choices
|
|
33
|
+
|
|
34
|
+
- **IaC is a real choice now, not a default.** Name it: **Terraform** (incumbent), **OpenTofu** (OSS-governed, diverging — it has state encryption Terraform lacks, and provider compatibility may drift, so it is no longer a silent drop-in), or **Pulumi** (real languages). Pick deliberately.
|
|
35
|
+
- **Buy-vs-build the IDP.** Backstage is the share leader but self-hosting it is a platform-team tax; under a couple hundred engineers, a managed portal usually wins. The platform is a product — including the build/buy decision.
|
|
36
|
+
|
|
37
|
+
## Carbon is a design input
|
|
38
|
+
|
|
39
|
+
Sustainable software has crossed into a first-class concern: measure with the Green Software Foundation's SCI, and shift demand for *carbon* the way you already shift it for cost — run deferrable/batch work when and where the grid is cleaner (carbon-aware scheduling). This extends the demand-shaping you already do; express it as a fitness function so it does not regress silently.
|
|
40
|
+
|
|
41
|
+
## Antipatterns to catch
|
|
42
|
+
|
|
43
|
+
- **Platform-as-gatekeeper** — a platform that says "no" more than "self-serve" is a bottleneck.
|
|
44
|
+
- **Release trains** — batching a month of changes into a Friday deploy that breaks unlocalisably.
|
|
45
|
+
- **Flags without expiry** — a year-old "temporary" flag is a permanent decision hidden in runtime config.
|
|
46
|
+
- **Canary-by-eyeball** — promoting because the graph "looks fine." Automate the comparison.
|
|
47
|
+
- **"Optimise cost later"** — later never comes; by then the architecture is what it is.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Real-Time & Streaming
|
|
2
|
+
|
|
3
|
+
Real-time features are long-lived bidirectional contracts between client and server, not request-response interactions. The difference between a live experience that feels smooth and one that feels broken is almost always how the implementers thought about failure modes — reconnection, duplicate messages, out-of-order delivery, backpressure. Design every real-time feature against the assumption that **the connection will drop mid-flight.**
|
|
4
|
+
|
|
5
|
+
## The design decisions
|
|
6
|
+
|
|
7
|
+
1. **Transport is a per-direction decision.** **SSE** is the default for server→client streaming — auto-reconnecting, CDN-friendly, no sticky sessions, plain HTTP — and it is the streaming substrate for AI (MCP and token delivery ride it). **WebSockets** are for genuinely bidirectional connections where the client also pushes frequently. Reaching for WebSockets to push a one-way stream is over-engineering; long-polling is rejected.
|
|
8
|
+
2. **Every message carries a sequence number.** A monotonic, per-session sequence lets the client detect gaps, the server detect duplicates, and the pair resynchronise after a reconnect without refetching everything.
|
|
9
|
+
3. **Reconnection is the normal case.** Clients reconnect with exponential backoff, jitter, and a resumption token telling the server where they left off. "Reconnected" is logged, not paged. A reconnection-rate spike is a signal about network or server health, not a client bug.
|
|
10
|
+
4. **Backpressure is explicit.** When the server produces faster than the client consumes, it **sheds** (drops non-critical messages, logs the shed rate), **coalesces** (merges consecutive updates), or **blocks** (flow control). What it never does is buffer unbounded — that is how a real-time service dies.
|
|
11
|
+
5. **Echo suppression is a design concern.** Where a client's own output may be re-ingested as an incoming event, the suppression mechanism — a sender ID on the stream, a per-session gateway filter, client-side gating — is part of the protocol, specified before the first line of code, not bolted on later.
|
|
12
|
+
6. **Idempotent handlers.** The client will reconnect and resend; the same sequence number processed twice has no additional effect. The HTTP idempotency principle applied to the streaming surface.
|
|
13
|
+
7. **Observability is unbroken across the socket.** A trace that enters via HTTP, opens a socket, streams many events, and closes belongs to one trace. Propagate trace context into the socket and carry it on every event.
|
|
14
|
+
8. **Client state is recoverable, not sacred.** Any client state that matters must be reconstructable from the server. Rejoining a session produces the same observable state — the server is the source of truth.
|
|
15
|
+
|
|
16
|
+
## LLM streaming, collaboration, and what not to ship yet
|
|
17
|
+
|
|
18
|
+
- **LLM streaming** is the canonical 2026 real-time pattern: **SSE for the token data-plane**, a WebSocket (or internal gRPC) for the **control-plane** (cancel, feedback injection). Its failure modes extend the ones above — slow first token, partial-response loss on a provider retry, backpressure stalls — so apply sequencing and backpressure to the token stream.
|
|
19
|
+
- **Collaborative / offline-first → CRDTs.** For multi-user editing and local-first apps, **CRDTs** (Yjs the ecosystem default, Automerge for Git-like history) make the local copy the source of truth with background sync — the principled answer where "echo suppression + recoverable client state" was gesturing. Don't hand-roll last-write-wins where a CRDT is the right tool.
|
|
20
|
+
- **WebTransport: prototype, don't ship.** QUIC/HTTP-3-based and promising for high-scale/low-latency, but with no Safari support in 2026 it is not production-ready — keep it to prototypes.
|
|
21
|
+
|
|
22
|
+
## Antipatterns to catch
|
|
23
|
+
|
|
24
|
+
- **Socket as a fire-and-forget event bus** — no sequence numbers, no resumption, no idempotency. Works in demos; breaks in production.
|
|
25
|
+
- **Per-connection unbounded buffers** — a slow client should not exhaust server memory. Shed, coalesce, or block.
|
|
26
|
+
- **Reconnect-then-refetch-everything** — if a full state refresh is the recovery strategy, the protocol is broken. Use resumption tokens.
|
|
27
|
+
- **Ad-hoc event schemas** — real-time events are contracts. They belong in AsyncAPI specs, versioned and generated, not invented per feature.
|
|
28
|
+
- **Client-side echo reconciliation as the design** — handle echoes at the gateway where the full context lives; client-side gating is a fallback, not the plan.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Reliability
|
|
2
|
+
|
|
3
|
+
Reliability is not a feature added after the system is built — it is a design property paid for up front, measured in error budgets, defended by graceful-degradation patterns, and rehearsed through deliberate failure injection. Users do not experience uptime percentages; they experience "the thing I needed did not work just now." In a real-time product unreliability compounds: a dropped request becomes a failed operation becomes a broken journey. The cost of a small reliability failure is rarely proportional to its scope.
|
|
4
|
+
|
|
5
|
+
## The design decisions
|
|
6
|
+
|
|
7
|
+
1. **SLOs, not uptime percentages.** Every significant service defines a Service Level Objective — a per-endpoint or per-journey target with latency and success-rate components over a rolling window. "99.9% uptime" is not an SLO; "p95 `POST /resource` < 300ms over 30 days, 99.5% success" is. The SLO is the measurement surface everything else hangs on.
|
|
8
|
+
2. **Error budgets govern velocity.** The budget implied by the SLO is a spendable resource. Below budget, ship riskier changes and run experiments; above budget, pause feature work and pay down reliability debt. Reliability as a gate on velocity, not a tax on top of it.
|
|
9
|
+
3. **Graceful degradation is a design, not a hope.** Every user-facing feature has a defined behaviour when its downstream fails — a view without synthesis data renders a "not yet ready" state; a pipeline without a model client enqueues and returns when it can. Decided at design time, implemented alongside the happy path.
|
|
10
|
+
4. **Timeouts, retries, and circuit breakers are defaults.** Every outbound call has a timeout, every retry a bounded policy with jitter, every client a breaker against its important downstreams. Set in a shared library so new services inherit them; opting out requires a written reason.
|
|
11
|
+
5. **Isolate blast radius — cells.** A single tenant, user, or noisy consumer must not degrade everyone else. Isolate by quota (per-tenant rate limits), by resource (dedicated queues for hot workloads), and by bulkhead (separate worker pools). At scale this generalises to **cell-based architecture** — partition the system into independent cells so a failure is contained to one cell's users. The design question is always "if this goes bad, who else is affected?" — and the target answer is "only the thing that went bad."
|
|
12
|
+
6. **Verify failure continuously, within a policy.** Inject failures — killed pods, degraded networks, slow databases — routinely in staging and carefully in production, as *continuous verification* bounded by an automated blast-radius policy (cap the fraction of traffic/pods, forbid touching critical paths in business hours), not an occasional unguarded game-day. The goal is to discover the reliability assumptions you are making without knowing it.
|
|
13
|
+
7. **Alert on user impact, not mechanism.** Page on SLO burn rate and journey error spikes, not on 80% CPU. Mechanism alerts without user impact teach on-call to ignore pages — which is how a real incident gets missed.
|
|
14
|
+
8. **Every incident teaches a specific lesson.** A blameless postmortem names the specific assumption the incident invalidated and the specific change that would have caught it. Not "be more careful," not "add more monitoring" — one concrete, closable ticket.
|
|
15
|
+
|
|
16
|
+
## SLOs are living, and AI fails differently
|
|
17
|
+
|
|
18
|
+
SLOs are hypotheses reviewed against burn, not set-and-forget contracts: alert on **multi-window, multi-burn-rate** signals; consistently under-burning means the target is too loose, a blown budget triggers a reliability project. And a model-in-the-loop changes the failure shape: a wrong answer returns **HTTP 200, valid JSON, within latency** — semantic failure, not an exception. So AI features carry **per-SLI budgets** (an accuracy/consistency budget distinct from the latency budget, burning independently), and the model provider is treated as your least-reliable dependency (rate limits and provider drift are first-class failure modes with their own degradation path).
|
|
19
|
+
|
|
20
|
+
## RTO / RPO drive the topology
|
|
21
|
+
|
|
22
|
+
When availability is a stated requirement, pin the two numbers that shape redundancy, replication, failover, and backup: **RTO** (acceptable recovery time if the system goes down) and **RPO** (tolerable data loss in a failure). A system that must be 99.99% available is architecturally different from one where an hour of downtime is acceptable — decide which you are building before the boundaries harden.
|
|
23
|
+
|
|
24
|
+
## Antipatterns to catch
|
|
25
|
+
|
|
26
|
+
- **"Five-nines" as a reflexive target** — reckless for a non-core service. Set an SLO the team can defend.
|
|
27
|
+
- **Retries without policies** — retry-forever is a self-inflicted DDoS.
|
|
28
|
+
- **Mechanism alerts** — paging on CPU/memory/disk untied to user impact. Noise.
|
|
29
|
+
- **"It hasn't failed yet"** — absence of a known failure mode is not evidence of its absence. Rehearse.
|
|
30
|
+
- **Postmortems that blame humans** — a system that depends on everyone being perfect will fail. Fix the system.
|
|
31
|
+
- **SLOs nobody tracks** — an SLO without a dashboard and a burn-rate alert is theatre.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Security & Trust
|
|
2
|
+
|
|
3
|
+
Security is every engineer's job, every day. Treat every service as untrusted, every dependency as a supply-chain risk, every input as hostile, and every secret as already-compromised unless proven otherwise. The goal is not zero risk — it is a system that stays standing when any single control fails. A system that is reliable but exploitable is not reliable.
|
|
4
|
+
|
|
5
|
+
The trust model is an architectural decision, decided with the boundaries — not an implementation detail discovered later.
|
|
6
|
+
|
|
7
|
+
## The design decisions
|
|
8
|
+
|
|
9
|
+
1. **Zero trust between services, on workload identity.** Services authenticate each other on every request; no "internal" network is implicitly trusted. The concrete 2026 mechanism is **workload identity** — SPIFFE/SPIRE issuing short-lived, auto-rotated SVIDs, mTLS established via the service mesh with no secret in app code. Machine identity is the new perimeter. If an attacker pivots into one service, they do not inherit the blast radius of the whole system.
|
|
10
|
+
2. **Threat model the change, not just the product.** Every significant change asks before sign-off: who could misuse this, and how? A new endpoint, field, or integration gets a five-minute threat conversation — cheap up front, and it catches most of what a pen test or production would otherwise find.
|
|
11
|
+
3. **Secrets are managed, rotated, audited.** No secret lives in source. Secrets live in a manager, are fetched at runtime, rotated on a schedule, and every access is audited — so a leak's damage window is hours, not years.
|
|
12
|
+
4. **Input is hostile; validate at the boundary.** Every input at a trust boundary is validated: request bodies, webhook payloads, queue events, model outputs. Inside the boundary, trust your own types. The discipline is that the boundary is explicit and every crossing is scrutinised.
|
|
13
|
+
5. **Supply chain is part of the attack surface.** Pin versions, review new dependencies before adoption, scan on every build. Move past SBOM-alone to **provenance**: sign artifacts (Sigstore/cosign) and emit signed build attestations as **SLSA build levels** — "an SBOM says what's inside; provenance proves where it came from." A dependency added without review is a back door added without review (npm carried 450k+ malicious packages in 2025).
|
|
14
|
+
6. **Least privilege by default.** Every service, database role, and cloud identity starts with the minimum it needs and is extended only on evidence. "Give it admin and fix later" has a lifetime of never.
|
|
15
|
+
7. **Auth is boring technology.** Do not invent auth. Proven providers handle user authentication; service-to-service uses short-lived tokens from a standard IdP; sessions follow OWASP guidance. Exotic auth is how a team learns about auth vulnerabilities the hard way.
|
|
16
|
+
8. **Detect and respond, not just prevent.** Assume prevention sometimes fails. Log security-relevant events, alert on suspicious patterns, rehearse incident response.
|
|
17
|
+
|
|
18
|
+
## AI & agent security
|
|
19
|
+
|
|
20
|
+
A model in the system widens the attack surface in ways classic AppSec misses:
|
|
21
|
+
|
|
22
|
+
- **Prompt injection is structural, and it leads OWASP's LLM risks** (LLM01). The model mixes instructions and data in one channel, and the injection arrives *indirectly* — through retrieved documents, tool outputs, and other agents (it propagates across co-running agents). Output validation alone is insufficient; scrutinise the inputs and constrain what a model-driven action can reach.
|
|
23
|
+
- **Excessive agency** is the architectural control: an agent gets least privilege and a bounded toolset, and consequential tool calls are authorised per-action, not granted wholesale ([agentic-systems.md](agentic-systems.md)).
|
|
24
|
+
- **Agent identity.** A non-human actor needs its own identity and delegation, carried into the request (SPIFFE-for-agents) so authorization can reason about *which* agent acted on whose behalf ([identity-and-access.md](identity-and-access.md)).
|
|
25
|
+
- **MCP/tool security.** A tool surface is an execution surface — tool poisoning and exec-capable tools are real; threat-model the tool catalogue, not just the API.
|
|
26
|
+
|
|
27
|
+
## Multi-tenancy is decided here
|
|
28
|
+
|
|
29
|
+
The tenancy isolation strategy — **shared database**, **schema-per-tenant**, or **database-per-tenant** — is an architectural decision made with the boundaries, because it shapes data models, query patterns, and compliance boundaries across every service. Decide it before the schema hardens; retrofitting isolation is brutal.
|
|
30
|
+
|
|
31
|
+
## Privacy is a design input
|
|
32
|
+
|
|
33
|
+
Regulated data shapes the architecture before procurement, not after:
|
|
34
|
+
- **Collect the minimum**, retain for a bounded time, scope and audit every access.
|
|
35
|
+
- **Data residency** (EU data on EU infrastructure for some purposes) is an input to storage and pipeline topology.
|
|
36
|
+
- **PII is handled distinctly from content** — shorter retention, tighter access, not co-located where avoidable, and never in logs.
|
|
37
|
+
- **Data-subject rights** (access, rectification, portability, deletion) are first-class features flowing through the same plumbing as retention expiry.
|
|
38
|
+
- Compliance frameworks that may apply — GDPR, HIPAA, PCI-DSS, SOC 2 — drive audit logging, access control, and encryption requirements beyond data location alone. Surface them while establishing constraints.
|
|
39
|
+
|
|
40
|
+
## Antipatterns to catch
|
|
41
|
+
|
|
42
|
+
- **"Internal network = trusted"** — the assumption every modern breach exploits.
|
|
43
|
+
- **Secrets in env vars committed to Git** — use the manager, always.
|
|
44
|
+
- **"It's internal, skip auth"** — internal tools are an attacker's favourite foothold.
|
|
45
|
+
- **Dependencies pulled on intuition** — a 12-star package with no maintainer is a supply-chain risk.
|
|
46
|
+
- **Exotic auth** — custom JWT/session/MFA handling. Use the battle-tested thing.
|
|
47
|
+
- **PII in logs** — trace and log data outlive the systems that produced them.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Surface Architecture
|
|
2
|
+
|
|
3
|
+
A surface — web, mobile, CLI, desktop, an agent UI — is an adapter over the capability core, not a home for business logic. The architect owns the **seam**: how the surface reaches the core, how a large surface decomposes, where rendering runs, and where the design-system contract sits. (UI implementation belongs to the surface-engineer skills; design language to the design-system skill — this reference decides where the line is, not how the button looks.)
|
|
4
|
+
|
|
5
|
+
## Surfaces are adapters over the core
|
|
6
|
+
|
|
7
|
+
A surface renders state and orchestrates calls to the core's contracts; it holds no domain rules. If a rule must hold on every surface, it lives in the core — a surface that re-implements pricing, validation, or a state machine is a drift waiting to happen. The core is designed headless and proven with no surface running.
|
|
8
|
+
|
|
9
|
+
## The backend-for-frontend shapes the contract per surface
|
|
10
|
+
|
|
11
|
+
Each surface gets a thin **BFF** that adapts the core's contracts to what that surface needs — aggregating, trimming, reshaping — so the client is not stitching six calls or over-fetching a viewport. React Server Components act as a built-in BFF for a web surface. Keep it an adapter: the moment business rules accrete in the BFF, it has become a shadow core.
|
|
12
|
+
|
|
13
|
+
## Render on the server / edge by default
|
|
14
|
+
|
|
15
|
+
Push rendering and data assembly server-side or to the edge; ship the client the least work it can do. Server-first flattens latency, shrinks the JS payload, and keeps data-fetching boundaries explicit. Reach for heavy client state only where genuine interactivity demands it ([performance-and-scale.md](performance-and-scale.md) on compute placement).
|
|
16
|
+
|
|
17
|
+
## Decompose a large surface by domain, right-sized
|
|
18
|
+
|
|
19
|
+
A surface decomposes like services do — by bounded domain, only when teams or load demand it. **Micro-frontends** / **islands** are for independent teams shipping parts of one surface autonomously; for most products a single well-structured surface is simpler and correct. The distributed-monolith failure mode has a front-end twin: many micro-frontends that must deploy in lock-step. Apply the same converging-signals discipline as [core-and-boundaries.md](core-and-boundaries.md).
|
|
20
|
+
|
|
21
|
+
## The design system is a contract
|
|
22
|
+
|
|
23
|
+
Tokens and components are a versioned contract across every surface, not decoration — the single source of visual and interaction truth a surface consumes rather than re-invents. Design-system-as-architecture is what keeps many screens and platforms feeling like one product.
|
|
24
|
+
|
|
25
|
+
## The contract presumes no surface
|
|
26
|
+
|
|
27
|
+
The core's contract serves every surface and presumes none — a session assumption in a response, markup where data belongs, viewport-sized pagination is the bug the next surface hits ([api-and-contracts.md](api-and-contracts.md)). An agent driving the interface via **AG-UI** is itself a surface type, and the most demanding test of a surface-neutral contract.
|
|
28
|
+
|
|
29
|
+
## Budgets are architectural
|
|
30
|
+
|
|
31
|
+
A surface ships against committed budgets — interaction latency, bundle size, accessibility floors — enforced in CI as a fitness function, because they are properties of the architecture, not end-of-project polish.
|
|
32
|
+
|
|
33
|
+
## Antipatterns to catch
|
|
34
|
+
|
|
35
|
+
- **Business logic in the surface** — a rule that will drift from the core.
|
|
36
|
+
- **The fat BFF** — a backend-for-frontend grown into a shadow core.
|
|
37
|
+
- **Micro-frontends by default** — distributing one surface across teams that don't need it, deployed in lock-step.
|
|
38
|
+
- **Re-invented design system** — each screen styling its own components.
|
|
39
|
+
- **Viewport-shaped contracts** — a response only the current layout can consume.
|
|
40
|
+
- **Client-heavy by reflex** — a megabyte of JS to render what the server could have sent.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Sync Anchor
|
|
2
|
+
|
|
3
|
+
This file pins the principle files this skill embeds. When any listed file
|
|
4
|
+
changes, this skill must be reviewed in the same commit. CI verifies the
|
|
5
|
+
hashes match (`scripts/check_sync_anchors.py`, run by `./dev test contracts`).
|
|
6
|
+
|
|
7
|
+
The `references/` in this skill are self-contained distillations of these
|
|
8
|
+
sources, written for the architect's decision-time lens. A source edit forces
|
|
9
|
+
a review of the matching reference so the distillation never drifts.
|
|
10
|
+
|
|
11
|
+
| Principle file | SHA-256 | Last reviewed |
|
|
12
|
+
|---|---|---|
|
|
13
|
+
| src/docs/principles/system-design/code-structure.md | e46fb0a5fc9c4ecee1ac840af9b43dcf00fa66cf9635ce55faabfd5d95bc2362 | 2026-06-19 |
|
|
14
|
+
| src/docs/principles/system-design/api-design.md | e892bd9a1e5edbb016d95fd7a6073076c0cbd1369c22ea6b489bb2fb54d2358f | 2026-06-19 |
|
|
15
|
+
| src/docs/principles/system-design/integration-patterns.md | c06186e2611f1cf393639fbbee46eb19851f83d0b68ec03c8e56df8db781d43c | 2026-06-19 |
|
|
16
|
+
| src/docs/principles/system-design/real-time.md | da420fd1c174b7baa1e9a71902a2384e62f561eb3801a531fdc9831ded72d8f3 | 2026-06-19 |
|
|
17
|
+
| src/docs/principles/system-design/data-engineering.md | fd0df432fc96d51c52e6ad87bd0159fa7eac7840e669fbb4174a2b6a68ae331d | 2026-06-19 |
|
|
18
|
+
| src/docs/principles/quality/reliability.md | 9c9788504e0963458667d2727c3fc2359776108be593a2efc6603f6470002252 | 2026-06-19 |
|
|
19
|
+
| src/docs/principles/quality/performance.md | 18b6d3391c57d97342068f9f1da732b24de4221489d0459bb6ad8900fac0a02e | 2026-06-19 |
|
|
20
|
+
| src/docs/principles/quality/observability.md | d38ac0eb660fdcebf2532f5955f371e10ada7030c6eda58e360f40e1b82b439c | 2026-06-19 |
|
|
21
|
+
| src/docs/principles/quality/security.md | 61157d97677142737ec537954dc5aaad7a04012cc8a3dcc855e2d324287fdc64 | 2026-06-19 |
|
|
22
|
+
| src/docs/principles/quality/privacy.md | d84f6bed50169b40daeb2a0ec7082dbd12d91d3abfa304b169cb9eb3fab494fb | 2026-06-19 |
|
|
23
|
+
| src/docs/principles/delivery/platform.md | 3cbf6c13298bf1c148278ae26acdbc2601a06615ff8d85cdb0de3b41c008c626 | 2026-06-19 |
|
|
24
|
+
| src/docs/principles/delivery/progressive-delivery.md | 002806b15448ea8c509edd0fdf050d35397ed9e39e77abf5b8fbb3943ab296d9 | 2026-06-19 |
|
|
25
|
+
| src/docs/principles/delivery/cost-engineering.md | b2e29328e8f704c6d385173247b7d3ccaf205b71b240b54f14193b8372befe58 | 2026-06-19 |
|
|
26
|
+
| src/docs/principles/ai-native/agent-native-systems.md | a59972f54655061a66e696b000fb484563f7e882a463d7d448fe848f6b1a6162 | 2026-06-19 |
|
|
27
|
+
| src/docs/principles/ai-native/ai-engineering.md | 79f8796d9ede943a3685ffc897e196c3ed081fd2861052df3003d34d3374e939 | 2026-06-19 |
|
|
28
|
+
| src/docs/principles/ai-native/agentic-systems.md | faf79028b59ccb6221c1e88ab2f67685c4e1b3626498a81e2bf5c7fc58298990 | 2026-06-19 |
|
|
29
|
+
| src/docs/principles/system-design/architecture-decisions.md | f02a30e5b490d2228ec1c06277e9e5967d40b9c3677e03c86a9b0683b119b874 | 2026-06-24 |
|
|
30
|
+
| src/docs/principles/system-design/evolutionary-architecture.md | 6b50d45c4c15b087160e37f1cc98934eb5ba1031319adae61aa838b930abd366 | 2026-06-19 |
|
|
31
|
+
| src/docs/principles/system-design/surface-architecture.md | 724e2183433b0db8d54466deffc0be877d847cdb6b61f0da9060491907151b91 | 2026-06-19 |
|
|
32
|
+
| src/docs/principles/system-design/identity-and-access.md | 18c99f755a37bec69de595a9784171c88639845c13c2f5a8497b55e40c3a5edf | 2026-06-19 |
|
|
33
|
+
| src/docs/principles/system-design/durable-execution.md | e4faad5864bcbecb80c79983be6a941fee652f2f78b38701dd8bd2dda47c3ec3 | 2026-06-19 |
|
|
34
|
+
| src/docs/principles/index.md | 768a6702488641666b785e1aaa694414b4544d97ee098488d447c3c59b20b096 | 2026-06-19 |
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Architecture Foundation
|
|
2
|
+
|
|
3
|
+
This document defines the physical and logical boundaries of the system required to deliver the MVP.
|
|
4
|
+
|
|
5
|
+
## 1. Constraints & Budgets
|
|
6
|
+
|
|
7
|
+
## 2. Top-Level Topology
|
|
8
|
+
|
|
9
|
+
A `graph` diagram is **required** here — it is the reader's first mental model of the system. Show every service and the external dependencies (datastores, brokers, third-party APIs) and the connections between them; label each edge with what flows along it. The prose names what each node owns; the diagram carries the shape.
|
|
10
|
+
|
|
11
|
+
```mermaid
|
|
12
|
+
graph TD
|
|
13
|
+
client[Client] --> api[Core API]
|
|
14
|
+
api --> db[(Postgres)]
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## 3. Key Capabilities & Technical Decisions
|
|
18
|
+
|
|
19
|
+
### Capability Ports & Providers
|
|
20
|
+
|
|
21
|
+
Each technical capability the system depends on — LLM inference, a relational or vector store, messaging, telemetry, object storage, email, payments — is an **interface** the system depends on, satisfied by exactly one chosen **provider**: the implementation that fulfils it, wired in at the edge and swappable. Record the capability, the provider, and the provider's **operational footprint** (exactly one of `env` · `compose-service` · `runner` · `none`), with a one-line rationale. `none` is a first-class choice: a **bare interface** — the capability plus a failing contract test, no provider yet — to be built later as a bet. There are no default providers; infrastructure (a database, a tracing backend) appears *because* a provider's footprint requires it, never as a guess.
|
|
22
|
+
|
|
23
|
+
> Distinct from the **capability ledger** in `docs/surfaces.md`, which tracks user-facing *features* across surfaces. This table is about *technical capabilities* and the providers that satisfy them.
|
|
24
|
+
|
|
25
|
+
| Capability | Provider | Footprint | Rationale |
|
|
26
|
+
|---|---|---|---|
|
|
27
|
+
|
|
28
|
+
## 4. Component Boundaries & Contracts
|
|
29
|
+
|
|
30
|
+
## 5. Communication & Integration Patterns
|
|
31
|
+
|
|
32
|
+
For each non-trivial flow across services — a request that fans out, an event chain, an async path — draw a `sequenceDiagram` so timing and ordering are legible. The prose explains the failure modes and the design decisions the diagram cannot show. Skip trivial single-hop calls.
|
|
33
|
+
|
|
34
|
+
```mermaid
|
|
35
|
+
sequenceDiagram
|
|
36
|
+
participant C as Client
|
|
37
|
+
participant A as Core API
|
|
38
|
+
participant W as Worker
|
|
39
|
+
C->>A: submit job
|
|
40
|
+
A->>W: enqueue
|
|
41
|
+
W-->>A: result
|
|
42
|
+
A-->>C: 200 + job id
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## 6. Service-Level Requirements
|
|
46
|
+
|
|
47
|
+
| Requirement | Originates From | Applies To |
|
|
48
|
+
|---|---|---|
|
|
49
|
+
|
|
50
|
+
## 7. Surfaces & Capability Core
|