@zigrivers/scaffold 2.1.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/LICENSE +21 -0
- package/README.md +477 -0
- package/dist/cli/commands/adopt.d.ts +12 -0
- package/dist/cli/commands/adopt.d.ts.map +1 -0
- package/dist/cli/commands/adopt.js +107 -0
- package/dist/cli/commands/adopt.js.map +1 -0
- package/dist/cli/commands/adopt.test.d.ts +2 -0
- package/dist/cli/commands/adopt.test.d.ts.map +1 -0
- package/dist/cli/commands/adopt.test.js +277 -0
- package/dist/cli/commands/adopt.test.js.map +1 -0
- package/dist/cli/commands/build.d.ts +12 -0
- package/dist/cli/commands/build.d.ts.map +1 -0
- package/dist/cli/commands/build.js +105 -0
- package/dist/cli/commands/build.js.map +1 -0
- package/dist/cli/commands/build.test.d.ts +2 -0
- package/dist/cli/commands/build.test.d.ts.map +1 -0
- package/dist/cli/commands/build.test.js +272 -0
- package/dist/cli/commands/build.test.js.map +1 -0
- package/dist/cli/commands/dashboard.d.ts +14 -0
- package/dist/cli/commands/dashboard.d.ts.map +1 -0
- package/dist/cli/commands/dashboard.js +102 -0
- package/dist/cli/commands/dashboard.js.map +1 -0
- package/dist/cli/commands/dashboard.test.d.ts +2 -0
- package/dist/cli/commands/dashboard.test.d.ts.map +1 -0
- package/dist/cli/commands/dashboard.test.js +142 -0
- package/dist/cli/commands/dashboard.test.js.map +1 -0
- package/dist/cli/commands/decisions.d.ts +13 -0
- package/dist/cli/commands/decisions.d.ts.map +1 -0
- package/dist/cli/commands/decisions.js +62 -0
- package/dist/cli/commands/decisions.js.map +1 -0
- package/dist/cli/commands/decisions.test.d.ts +2 -0
- package/dist/cli/commands/decisions.test.d.ts.map +1 -0
- package/dist/cli/commands/decisions.test.js +154 -0
- package/dist/cli/commands/decisions.test.js.map +1 -0
- package/dist/cli/commands/info.d.ts +12 -0
- package/dist/cli/commands/info.d.ts.map +1 -0
- package/dist/cli/commands/info.js +110 -0
- package/dist/cli/commands/info.js.map +1 -0
- package/dist/cli/commands/info.test.d.ts +2 -0
- package/dist/cli/commands/info.test.d.ts.map +1 -0
- package/dist/cli/commands/info.test.js +392 -0
- package/dist/cli/commands/info.test.js.map +1 -0
- package/dist/cli/commands/init.d.ts +13 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +46 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/init.test.d.ts +2 -0
- package/dist/cli/commands/init.test.d.ts.map +1 -0
- package/dist/cli/commands/init.test.js +156 -0
- package/dist/cli/commands/init.test.js.map +1 -0
- package/dist/cli/commands/knowledge.d.ts +4 -0
- package/dist/cli/commands/knowledge.d.ts.map +1 -0
- package/dist/cli/commands/knowledge.js +346 -0
- package/dist/cli/commands/knowledge.js.map +1 -0
- package/dist/cli/commands/knowledge.test.d.ts +2 -0
- package/dist/cli/commands/knowledge.test.d.ts.map +1 -0
- package/dist/cli/commands/knowledge.test.js +293 -0
- package/dist/cli/commands/knowledge.test.js.map +1 -0
- package/dist/cli/commands/list.d.ts +12 -0
- package/dist/cli/commands/list.d.ts.map +1 -0
- package/dist/cli/commands/list.js +73 -0
- package/dist/cli/commands/list.js.map +1 -0
- package/dist/cli/commands/list.test.d.ts +2 -0
- package/dist/cli/commands/list.test.d.ts.map +1 -0
- package/dist/cli/commands/list.test.js +166 -0
- package/dist/cli/commands/list.test.js.map +1 -0
- package/dist/cli/commands/next.d.ts +12 -0
- package/dist/cli/commands/next.d.ts.map +1 -0
- package/dist/cli/commands/next.js +75 -0
- package/dist/cli/commands/next.js.map +1 -0
- package/dist/cli/commands/next.test.d.ts +2 -0
- package/dist/cli/commands/next.test.d.ts.map +1 -0
- package/dist/cli/commands/next.test.js +236 -0
- package/dist/cli/commands/next.test.js.map +1 -0
- package/dist/cli/commands/reset.d.ts +13 -0
- package/dist/cli/commands/reset.d.ts.map +1 -0
- package/dist/cli/commands/reset.js +105 -0
- package/dist/cli/commands/reset.js.map +1 -0
- package/dist/cli/commands/reset.test.d.ts +2 -0
- package/dist/cli/commands/reset.test.d.ts.map +1 -0
- package/dist/cli/commands/reset.test.js +211 -0
- package/dist/cli/commands/reset.test.js.map +1 -0
- package/dist/cli/commands/run.d.ts +14 -0
- package/dist/cli/commands/run.d.ts.map +1 -0
- package/dist/cli/commands/run.js +379 -0
- package/dist/cli/commands/run.js.map +1 -0
- package/dist/cli/commands/run.test.d.ts +2 -0
- package/dist/cli/commands/run.test.d.ts.map +1 -0
- package/dist/cli/commands/run.test.js +535 -0
- package/dist/cli/commands/run.test.js.map +1 -0
- package/dist/cli/commands/skip.d.ts +13 -0
- package/dist/cli/commands/skip.d.ts.map +1 -0
- package/dist/cli/commands/skip.js +123 -0
- package/dist/cli/commands/skip.js.map +1 -0
- package/dist/cli/commands/skip.test.d.ts +2 -0
- package/dist/cli/commands/skip.test.d.ts.map +1 -0
- package/dist/cli/commands/skip.test.js +339 -0
- package/dist/cli/commands/skip.test.js.map +1 -0
- package/dist/cli/commands/status.d.ts +12 -0
- package/dist/cli/commands/status.d.ts.map +1 -0
- package/dist/cli/commands/status.js +79 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/status.test.d.ts +2 -0
- package/dist/cli/commands/status.test.d.ts.map +1 -0
- package/dist/cli/commands/status.test.js +245 -0
- package/dist/cli/commands/status.test.js.map +1 -0
- package/dist/cli/commands/update.d.ts +11 -0
- package/dist/cli/commands/update.d.ts.map +1 -0
- package/dist/cli/commands/update.js +159 -0
- package/dist/cli/commands/update.js.map +1 -0
- package/dist/cli/commands/update.test.d.ts +2 -0
- package/dist/cli/commands/update.test.d.ts.map +1 -0
- package/dist/cli/commands/update.test.js +140 -0
- package/dist/cli/commands/update.test.js.map +1 -0
- package/dist/cli/commands/validate.d.ts +12 -0
- package/dist/cli/commands/validate.d.ts.map +1 -0
- package/dist/cli/commands/validate.js +65 -0
- package/dist/cli/commands/validate.js.map +1 -0
- package/dist/cli/commands/validate.test.d.ts +2 -0
- package/dist/cli/commands/validate.test.d.ts.map +1 -0
- package/dist/cli/commands/validate.test.js +159 -0
- package/dist/cli/commands/validate.test.js.map +1 -0
- package/dist/cli/commands/version.d.ts +13 -0
- package/dist/cli/commands/version.d.ts.map +1 -0
- package/dist/cli/commands/version.js +89 -0
- package/dist/cli/commands/version.js.map +1 -0
- package/dist/cli/commands/version.test.d.ts +2 -0
- package/dist/cli/commands/version.test.d.ts.map +1 -0
- package/dist/cli/commands/version.test.js +63 -0
- package/dist/cli/commands/version.test.js.map +1 -0
- package/dist/cli/index.d.ts +4 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +72 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/index.test.d.ts +2 -0
- package/dist/cli/index.test.d.ts.map +1 -0
- package/dist/cli/index.test.js +8 -0
- package/dist/cli/index.test.js.map +1 -0
- package/dist/cli/middleware/output-mode.d.ts +21 -0
- package/dist/cli/middleware/output-mode.d.ts.map +1 -0
- package/dist/cli/middleware/output-mode.js +27 -0
- package/dist/cli/middleware/output-mode.js.map +1 -0
- package/dist/cli/middleware/output-mode.test.d.ts +2 -0
- package/dist/cli/middleware/output-mode.test.d.ts.map +1 -0
- package/dist/cli/middleware/output-mode.test.js +41 -0
- package/dist/cli/middleware/output-mode.test.js.map +1 -0
- package/dist/cli/middleware/project-root.d.ts +21 -0
- package/dist/cli/middleware/project-root.d.ts.map +1 -0
- package/dist/cli/middleware/project-root.js +54 -0
- package/dist/cli/middleware/project-root.js.map +1 -0
- package/dist/cli/middleware/project-root.test.d.ts +2 -0
- package/dist/cli/middleware/project-root.test.d.ts.map +1 -0
- package/dist/cli/middleware/project-root.test.js +112 -0
- package/dist/cli/middleware/project-root.test.js.map +1 -0
- package/dist/cli/output/auto.d.ts +18 -0
- package/dist/cli/output/auto.d.ts.map +1 -0
- package/dist/cli/output/auto.js +43 -0
- package/dist/cli/output/auto.js.map +1 -0
- package/dist/cli/output/context.d.ts +19 -0
- package/dist/cli/output/context.d.ts.map +1 -0
- package/dist/cli/output/context.js +15 -0
- package/dist/cli/output/context.js.map +1 -0
- package/dist/cli/output/context.test.d.ts +2 -0
- package/dist/cli/output/context.test.d.ts.map +1 -0
- package/dist/cli/output/context.test.js +335 -0
- package/dist/cli/output/context.test.js.map +1 -0
- package/dist/cli/output/error-display.d.ts +31 -0
- package/dist/cli/output/error-display.d.ts.map +1 -0
- package/dist/cli/output/error-display.js +79 -0
- package/dist/cli/output/error-display.js.map +1 -0
- package/dist/cli/output/error-display.test.d.ts +2 -0
- package/dist/cli/output/error-display.test.d.ts.map +1 -0
- package/dist/cli/output/error-display.test.js +230 -0
- package/dist/cli/output/error-display.test.js.map +1 -0
- package/dist/cli/output/interactive.d.ts +22 -0
- package/dist/cli/output/interactive.d.ts.map +1 -0
- package/dist/cli/output/interactive.js +126 -0
- package/dist/cli/output/interactive.js.map +1 -0
- package/dist/cli/output/json.d.ts +17 -0
- package/dist/cli/output/json.d.ts.map +1 -0
- package/dist/cli/output/json.js +62 -0
- package/dist/cli/output/json.js.map +1 -0
- package/dist/cli/types.d.ts +11 -0
- package/dist/cli/types.d.ts.map +1 -0
- package/dist/cli/types.js +2 -0
- package/dist/cli/types.js.map +1 -0
- package/dist/config/loader.d.ts +22 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +159 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/loader.test.d.ts +2 -0
- package/dist/config/loader.test.d.ts.map +1 -0
- package/dist/config/loader.test.js +226 -0
- package/dist/config/loader.test.js.map +1 -0
- package/dist/config/migration.d.ts +15 -0
- package/dist/config/migration.d.ts.map +1 -0
- package/dist/config/migration.js +39 -0
- package/dist/config/migration.js.map +1 -0
- package/dist/config/migration.test.d.ts +2 -0
- package/dist/config/migration.test.d.ts.map +1 -0
- package/dist/config/migration.test.js +44 -0
- package/dist/config/migration.test.js.map +1 -0
- package/dist/config/schema.d.ts +121 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +22 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/config/schema.test.d.ts +2 -0
- package/dist/config/schema.test.d.ts.map +1 -0
- package/dist/config/schema.test.js +126 -0
- package/dist/config/schema.test.js.map +1 -0
- package/dist/core/adapters/adapter.d.ts +64 -0
- package/dist/core/adapters/adapter.d.ts.map +1 -0
- package/dist/core/adapters/adapter.js +25 -0
- package/dist/core/adapters/adapter.js.map +1 -0
- package/dist/core/adapters/adapter.test.d.ts +2 -0
- package/dist/core/adapters/adapter.test.d.ts.map +1 -0
- package/dist/core/adapters/adapter.test.js +175 -0
- package/dist/core/adapters/adapter.test.js.map +1 -0
- package/dist/core/adapters/claude-code.d.ts +9 -0
- package/dist/core/adapters/claude-code.d.ts.map +1 -0
- package/dist/core/adapters/claude-code.js +34 -0
- package/dist/core/adapters/claude-code.js.map +1 -0
- package/dist/core/adapters/claude-code.test.d.ts +2 -0
- package/dist/core/adapters/claude-code.test.d.ts.map +1 -0
- package/dist/core/adapters/claude-code.test.js +100 -0
- package/dist/core/adapters/claude-code.test.js.map +1 -0
- package/dist/core/adapters/codex.d.ts +10 -0
- package/dist/core/adapters/codex.d.ts.map +1 -0
- package/dist/core/adapters/codex.js +61 -0
- package/dist/core/adapters/codex.js.map +1 -0
- package/dist/core/adapters/codex.test.d.ts +2 -0
- package/dist/core/adapters/codex.test.d.ts.map +1 -0
- package/dist/core/adapters/codex.test.js +122 -0
- package/dist/core/adapters/codex.test.js.map +1 -0
- package/dist/core/adapters/universal.d.ts +10 -0
- package/dist/core/adapters/universal.d.ts.map +1 -0
- package/dist/core/adapters/universal.js +45 -0
- package/dist/core/adapters/universal.js.map +1 -0
- package/dist/core/adapters/universal.test.d.ts +2 -0
- package/dist/core/adapters/universal.test.d.ts.map +1 -0
- package/dist/core/adapters/universal.test.js +121 -0
- package/dist/core/adapters/universal.test.js.map +1 -0
- package/dist/core/assembly/context-gatherer.d.ts +17 -0
- package/dist/core/assembly/context-gatherer.d.ts.map +1 -0
- package/dist/core/assembly/context-gatherer.js +49 -0
- package/dist/core/assembly/context-gatherer.js.map +1 -0
- package/dist/core/assembly/context-gatherer.test.d.ts +2 -0
- package/dist/core/assembly/context-gatherer.test.d.ts.map +1 -0
- package/dist/core/assembly/context-gatherer.test.js +252 -0
- package/dist/core/assembly/context-gatherer.test.js.map +1 -0
- package/dist/core/assembly/depth-resolver.d.ts +11 -0
- package/dist/core/assembly/depth-resolver.d.ts.map +1 -0
- package/dist/core/assembly/depth-resolver.js +23 -0
- package/dist/core/assembly/depth-resolver.js.map +1 -0
- package/dist/core/assembly/depth-resolver.test.d.ts +2 -0
- package/dist/core/assembly/depth-resolver.test.d.ts.map +1 -0
- package/dist/core/assembly/depth-resolver.test.js +100 -0
- package/dist/core/assembly/depth-resolver.test.js.map +1 -0
- package/dist/core/assembly/engine.d.ts +22 -0
- package/dist/core/assembly/engine.d.ts.map +1 -0
- package/dist/core/assembly/engine.js +215 -0
- package/dist/core/assembly/engine.js.map +1 -0
- package/dist/core/assembly/engine.test.d.ts +2 -0
- package/dist/core/assembly/engine.test.d.ts.map +1 -0
- package/dist/core/assembly/engine.test.js +462 -0
- package/dist/core/assembly/engine.test.js.map +1 -0
- package/dist/core/assembly/instruction-loader.d.ts +16 -0
- package/dist/core/assembly/instruction-loader.d.ts.map +1 -0
- package/dist/core/assembly/instruction-loader.js +40 -0
- package/dist/core/assembly/instruction-loader.js.map +1 -0
- package/dist/core/assembly/instruction-loader.test.d.ts +2 -0
- package/dist/core/assembly/instruction-loader.test.d.ts.map +1 -0
- package/dist/core/assembly/instruction-loader.test.js +109 -0
- package/dist/core/assembly/instruction-loader.test.js.map +1 -0
- package/dist/core/assembly/knowledge-loader.d.ts +34 -0
- package/dist/core/assembly/knowledge-loader.d.ts.map +1 -0
- package/dist/core/assembly/knowledge-loader.js +204 -0
- package/dist/core/assembly/knowledge-loader.js.map +1 -0
- package/dist/core/assembly/knowledge-loader.test.d.ts +2 -0
- package/dist/core/assembly/knowledge-loader.test.d.ts.map +1 -0
- package/dist/core/assembly/knowledge-loader.test.js +205 -0
- package/dist/core/assembly/knowledge-loader.test.js.map +1 -0
- package/dist/core/assembly/meta-prompt-loader.d.ts +13 -0
- package/dist/core/assembly/meta-prompt-loader.d.ts.map +1 -0
- package/dist/core/assembly/meta-prompt-loader.js +91 -0
- package/dist/core/assembly/meta-prompt-loader.js.map +1 -0
- package/dist/core/assembly/meta-prompt-loader.test.d.ts +2 -0
- package/dist/core/assembly/meta-prompt-loader.test.d.ts.map +1 -0
- package/dist/core/assembly/meta-prompt-loader.test.js +232 -0
- package/dist/core/assembly/meta-prompt-loader.test.js.map +1 -0
- package/dist/core/assembly/methodology-change.d.ts +27 -0
- package/dist/core/assembly/methodology-change.d.ts.map +1 -0
- package/dist/core/assembly/methodology-change.js +41 -0
- package/dist/core/assembly/methodology-change.js.map +1 -0
- package/dist/core/assembly/methodology-change.test.d.ts +2 -0
- package/dist/core/assembly/methodology-change.test.d.ts.map +1 -0
- package/dist/core/assembly/methodology-change.test.js +145 -0
- package/dist/core/assembly/methodology-change.test.js.map +1 -0
- package/dist/core/assembly/methodology-resolver.d.ts +11 -0
- package/dist/core/assembly/methodology-resolver.d.ts.map +1 -0
- package/dist/core/assembly/methodology-resolver.js +19 -0
- package/dist/core/assembly/methodology-resolver.js.map +1 -0
- package/dist/core/assembly/methodology-resolver.test.d.ts +2 -0
- package/dist/core/assembly/methodology-resolver.test.d.ts.map +1 -0
- package/dist/core/assembly/methodology-resolver.test.js +87 -0
- package/dist/core/assembly/methodology-resolver.test.js.map +1 -0
- package/dist/core/assembly/preset-loader.d.ts +26 -0
- package/dist/core/assembly/preset-loader.d.ts.map +1 -0
- package/dist/core/assembly/preset-loader.js +146 -0
- package/dist/core/assembly/preset-loader.js.map +1 -0
- package/dist/core/assembly/preset-loader.test.d.ts +2 -0
- package/dist/core/assembly/preset-loader.test.d.ts.map +1 -0
- package/dist/core/assembly/preset-loader.test.js +107 -0
- package/dist/core/assembly/preset-loader.test.js.map +1 -0
- package/dist/core/assembly/update-mode.d.ts +25 -0
- package/dist/core/assembly/update-mode.d.ts.map +1 -0
- package/dist/core/assembly/update-mode.js +70 -0
- package/dist/core/assembly/update-mode.js.map +1 -0
- package/dist/core/assembly/update-mode.test.d.ts +2 -0
- package/dist/core/assembly/update-mode.test.d.ts.map +1 -0
- package/dist/core/assembly/update-mode.test.js +235 -0
- package/dist/core/assembly/update-mode.test.js.map +1 -0
- package/dist/core/dependency/dependency.d.ts +20 -0
- package/dist/core/dependency/dependency.d.ts.map +1 -0
- package/dist/core/dependency/dependency.js +104 -0
- package/dist/core/dependency/dependency.js.map +1 -0
- package/dist/core/dependency/dependency.test.d.ts +2 -0
- package/dist/core/dependency/dependency.test.d.ts.map +1 -0
- package/dist/core/dependency/dependency.test.js +166 -0
- package/dist/core/dependency/dependency.test.js.map +1 -0
- package/dist/core/dependency/eligibility.d.ts +17 -0
- package/dist/core/dependency/eligibility.d.ts.map +1 -0
- package/dist/core/dependency/eligibility.js +60 -0
- package/dist/core/dependency/eligibility.js.map +1 -0
- package/dist/core/dependency/eligibility.test.d.ts +2 -0
- package/dist/core/dependency/eligibility.test.d.ts.map +1 -0
- package/dist/core/dependency/eligibility.test.js +198 -0
- package/dist/core/dependency/eligibility.test.js.map +1 -0
- package/dist/core/dependency/graph.d.ts +12 -0
- package/dist/core/dependency/graph.d.ts.map +1 -0
- package/dist/core/dependency/graph.js +34 -0
- package/dist/core/dependency/graph.js.map +1 -0
- package/dist/core/knowledge/knowledge-update-assembler.d.ts +24 -0
- package/dist/core/knowledge/knowledge-update-assembler.d.ts.map +1 -0
- package/dist/core/knowledge/knowledge-update-assembler.js +46 -0
- package/dist/core/knowledge/knowledge-update-assembler.js.map +1 -0
- package/dist/core/knowledge/knowledge-update-assembler.test.d.ts +2 -0
- package/dist/core/knowledge/knowledge-update-assembler.test.d.ts.map +1 -0
- package/dist/core/knowledge/knowledge-update-assembler.test.js +93 -0
- package/dist/core/knowledge/knowledge-update-assembler.test.js.map +1 -0
- package/dist/core/knowledge/knowledge-update-template.md +55 -0
- package/dist/dashboard/generator.d.ts +37 -0
- package/dist/dashboard/generator.d.ts.map +1 -0
- package/dist/dashboard/generator.js +42 -0
- package/dist/dashboard/generator.js.map +1 -0
- package/dist/dashboard/generator.test.d.ts +2 -0
- package/dist/dashboard/generator.test.d.ts.map +1 -0
- package/dist/dashboard/generator.test.js +186 -0
- package/dist/dashboard/generator.test.js.map +1 -0
- package/dist/dashboard/template.d.ts +4 -0
- package/dist/dashboard/template.d.ts.map +1 -0
- package/dist/dashboard/template.js +190 -0
- package/dist/dashboard/template.js.map +1 -0
- package/dist/e2e/commands.test.d.ts +9 -0
- package/dist/e2e/commands.test.d.ts.map +1 -0
- package/dist/e2e/commands.test.js +499 -0
- package/dist/e2e/commands.test.js.map +1 -0
- package/dist/e2e/init.test.d.ts +10 -0
- package/dist/e2e/init.test.d.ts.map +1 -0
- package/dist/e2e/init.test.js +180 -0
- package/dist/e2e/init.test.js.map +1 -0
- package/dist/e2e/knowledge.test.d.ts +2 -0
- package/dist/e2e/knowledge.test.d.ts.map +1 -0
- package/dist/e2e/knowledge.test.js +103 -0
- package/dist/e2e/knowledge.test.js.map +1 -0
- package/dist/e2e/pipeline.test.d.ts +8 -0
- package/dist/e2e/pipeline.test.d.ts.map +1 -0
- package/dist/e2e/pipeline.test.js +295 -0
- package/dist/e2e/pipeline.test.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/project/adopt.d.ts +28 -0
- package/dist/project/adopt.d.ts.map +1 -0
- package/dist/project/adopt.js +49 -0
- package/dist/project/adopt.js.map +1 -0
- package/dist/project/adopt.test.d.ts +2 -0
- package/dist/project/adopt.test.d.ts.map +1 -0
- package/dist/project/adopt.test.js +220 -0
- package/dist/project/adopt.test.js.map +1 -0
- package/dist/project/claude-md.d.ts +33 -0
- package/dist/project/claude-md.d.ts.map +1 -0
- package/dist/project/claude-md.js +112 -0
- package/dist/project/claude-md.js.map +1 -0
- package/dist/project/claude-md.test.d.ts +2 -0
- package/dist/project/claude-md.test.d.ts.map +1 -0
- package/dist/project/claude-md.test.js +151 -0
- package/dist/project/claude-md.test.js.map +1 -0
- package/dist/project/detector.d.ts +7 -0
- package/dist/project/detector.d.ts.map +1 -0
- package/dist/project/detector.js +78 -0
- package/dist/project/detector.js.map +1 -0
- package/dist/project/detector.test.d.ts +2 -0
- package/dist/project/detector.test.d.ts.map +1 -0
- package/dist/project/detector.test.js +137 -0
- package/dist/project/detector.test.js.map +1 -0
- package/dist/project/frontmatter.d.ts +17 -0
- package/dist/project/frontmatter.d.ts.map +1 -0
- package/dist/project/frontmatter.js +236 -0
- package/dist/project/frontmatter.js.map +1 -0
- package/dist/project/frontmatter.test.d.ts +2 -0
- package/dist/project/frontmatter.test.d.ts.map +1 -0
- package/dist/project/frontmatter.test.js +218 -0
- package/dist/project/frontmatter.test.js.map +1 -0
- package/dist/project/signals.d.ts +12 -0
- package/dist/project/signals.d.ts.map +1 -0
- package/dist/project/signals.js +2 -0
- package/dist/project/signals.js.map +1 -0
- package/dist/state/completion.d.ts +22 -0
- package/dist/state/completion.d.ts.map +1 -0
- package/dist/state/completion.js +82 -0
- package/dist/state/completion.js.map +1 -0
- package/dist/state/completion.test.d.ts +2 -0
- package/dist/state/completion.test.d.ts.map +1 -0
- package/dist/state/completion.test.js +246 -0
- package/dist/state/completion.test.js.map +1 -0
- package/dist/state/decision-logger.d.ts +16 -0
- package/dist/state/decision-logger.d.ts.map +1 -0
- package/dist/state/decision-logger.js +80 -0
- package/dist/state/decision-logger.js.map +1 -0
- package/dist/state/decision-logger.test.d.ts +2 -0
- package/dist/state/decision-logger.test.d.ts.map +1 -0
- package/dist/state/decision-logger.test.js +182 -0
- package/dist/state/decision-logger.test.js.map +1 -0
- package/dist/state/lock-manager.d.ts +18 -0
- package/dist/state/lock-manager.d.ts.map +1 -0
- package/dist/state/lock-manager.js +134 -0
- package/dist/state/lock-manager.js.map +1 -0
- package/dist/state/lock-manager.test.d.ts +2 -0
- package/dist/state/lock-manager.test.d.ts.map +1 -0
- package/dist/state/lock-manager.test.js +190 -0
- package/dist/state/lock-manager.test.js.map +1 -0
- package/dist/state/state-manager.d.ts +37 -0
- package/dist/state/state-manager.d.ts.map +1 -0
- package/dist/state/state-manager.js +125 -0
- package/dist/state/state-manager.js.map +1 -0
- package/dist/state/state-manager.test.d.ts +2 -0
- package/dist/state/state-manager.test.d.ts.map +1 -0
- package/dist/state/state-manager.test.js +240 -0
- package/dist/state/state-manager.test.js.map +1 -0
- package/dist/types/adapter.d.ts +24 -0
- package/dist/types/adapter.d.ts.map +1 -0
- package/dist/types/adapter.js +2 -0
- package/dist/types/adapter.js.map +1 -0
- package/dist/types/assembly.d.ts +89 -0
- package/dist/types/assembly.d.ts.map +1 -0
- package/dist/types/assembly.js +2 -0
- package/dist/types/assembly.js.map +1 -0
- package/dist/types/claude-md.d.ts +11 -0
- package/dist/types/claude-md.d.ts.map +1 -0
- package/dist/types/claude-md.js +2 -0
- package/dist/types/claude-md.js.map +1 -0
- package/dist/types/cli.d.ts +15 -0
- package/dist/types/cli.d.ts.map +1 -0
- package/dist/types/cli.js +2 -0
- package/dist/types/cli.js.map +1 -0
- package/dist/types/config.d.ts +40 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +2 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/decision.d.ts +14 -0
- package/dist/types/decision.d.ts.map +1 -0
- package/dist/types/decision.js +2 -0
- package/dist/types/decision.js.map +1 -0
- package/dist/types/dependency.d.ts +12 -0
- package/dist/types/dependency.d.ts.map +1 -0
- package/dist/types/dependency.js +2 -0
- package/dist/types/dependency.js.map +1 -0
- package/dist/types/enums.d.ts +23 -0
- package/dist/types/enums.d.ts.map +1 -0
- package/dist/types/enums.js +11 -0
- package/dist/types/enums.js.map +1 -0
- package/dist/types/enums.test.d.ts +2 -0
- package/dist/types/enums.test.d.ts.map +1 -0
- package/dist/types/enums.test.js +13 -0
- package/dist/types/enums.test.js.map +1 -0
- package/dist/types/errors.d.ts +24 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/errors.js +2 -0
- package/dist/types/errors.js.map +1 -0
- package/dist/types/frontmatter.d.ts +43 -0
- package/dist/types/frontmatter.d.ts.map +1 -0
- package/dist/types/frontmatter.js +2 -0
- package/dist/types/frontmatter.js.map +1 -0
- package/dist/types/index.d.ts +14 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +14 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/lock.d.ts +10 -0
- package/dist/types/lock.d.ts.map +1 -0
- package/dist/types/lock.js +2 -0
- package/dist/types/lock.js.map +1 -0
- package/dist/types/state.d.ts +49 -0
- package/dist/types/state.d.ts.map +1 -0
- package/dist/types/state.js +2 -0
- package/dist/types/state.js.map +1 -0
- package/dist/types/wizard.d.ts +14 -0
- package/dist/types/wizard.d.ts.map +1 -0
- package/dist/types/wizard.js +2 -0
- package/dist/types/wizard.js.map +1 -0
- package/dist/utils/errors.d.ts +42 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +232 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/errors.test.d.ts +2 -0
- package/dist/utils/errors.test.d.ts.map +1 -0
- package/dist/utils/errors.test.js +91 -0
- package/dist/utils/errors.test.js.map +1 -0
- package/dist/utils/fs.d.ts +11 -0
- package/dist/utils/fs.d.ts.map +1 -0
- package/dist/utils/fs.js +20 -0
- package/dist/utils/fs.js.map +1 -0
- package/dist/utils/fs.test.d.ts +2 -0
- package/dist/utils/fs.test.d.ts.map +1 -0
- package/dist/utils/fs.test.js +93 -0
- package/dist/utils/fs.test.js.map +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +4 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/levenshtein.d.ts +11 -0
- package/dist/utils/levenshtein.d.ts.map +1 -0
- package/dist/utils/levenshtein.js +37 -0
- package/dist/utils/levenshtein.js.map +1 -0
- package/dist/utils/levenshtein.test.d.ts +2 -0
- package/dist/utils/levenshtein.test.d.ts.map +1 -0
- package/dist/utils/levenshtein.test.js +34 -0
- package/dist/utils/levenshtein.test.js.map +1 -0
- package/dist/validation/config-validator.d.ts +10 -0
- package/dist/validation/config-validator.d.ts.map +1 -0
- package/dist/validation/config-validator.js +11 -0
- package/dist/validation/config-validator.js.map +1 -0
- package/dist/validation/dependency-validator.d.ts +10 -0
- package/dist/validation/dependency-validator.d.ts.map +1 -0
- package/dist/validation/dependency-validator.js +34 -0
- package/dist/validation/dependency-validator.js.map +1 -0
- package/dist/validation/frontmatter-validator.d.ts +12 -0
- package/dist/validation/frontmatter-validator.d.ts.map +1 -0
- package/dist/validation/frontmatter-validator.js +50 -0
- package/dist/validation/frontmatter-validator.js.map +1 -0
- package/dist/validation/index.d.ts +19 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/validation/index.js +64 -0
- package/dist/validation/index.js.map +1 -0
- package/dist/validation/index.test.d.ts +2 -0
- package/dist/validation/index.test.d.ts.map +1 -0
- package/dist/validation/index.test.js +241 -0
- package/dist/validation/index.test.js.map +1 -0
- package/dist/validation/state-validator.d.ts +15 -0
- package/dist/validation/state-validator.d.ts.map +1 -0
- package/dist/validation/state-validator.js +104 -0
- package/dist/validation/state-validator.js.map +1 -0
- package/dist/wizard/questions.d.ts +18 -0
- package/dist/wizard/questions.d.ts.map +1 -0
- package/dist/wizard/questions.js +46 -0
- package/dist/wizard/questions.js.map +1 -0
- package/dist/wizard/suggestion.d.ts +10 -0
- package/dist/wizard/suggestion.d.ts.map +1 -0
- package/dist/wizard/suggestion.js +17 -0
- package/dist/wizard/suggestion.js.map +1 -0
- package/dist/wizard/wizard.d.ts +19 -0
- package/dist/wizard/wizard.d.ts.map +1 -0
- package/dist/wizard/wizard.js +104 -0
- package/dist/wizard/wizard.js.map +1 -0
- package/dist/wizard/wizard.test.d.ts +2 -0
- package/dist/wizard/wizard.test.d.ts.map +1 -0
- package/dist/wizard/wizard.test.js +167 -0
- package/dist/wizard/wizard.test.js.map +1 -0
- package/knowledge/core/adr-craft.md +281 -0
- package/knowledge/core/api-design.md +501 -0
- package/knowledge/core/database-design.md +380 -0
- package/knowledge/core/domain-modeling.md +317 -0
- package/knowledge/core/operations-runbook.md +513 -0
- package/knowledge/core/security-review.md +523 -0
- package/knowledge/core/system-architecture.md +402 -0
- package/knowledge/core/task-decomposition.md +372 -0
- package/knowledge/core/testing-strategy.md +409 -0
- package/knowledge/core/user-stories.md +337 -0
- package/knowledge/core/user-story-innovation.md +171 -0
- package/knowledge/core/ux-specification.md +380 -0
- package/knowledge/finalization/apply-fixes-and-freeze.md +93 -0
- package/knowledge/finalization/developer-onboarding.md +376 -0
- package/knowledge/finalization/implementation-playbook.md +404 -0
- package/knowledge/product/gap-analysis.md +305 -0
- package/knowledge/product/prd-craft.md +324 -0
- package/knowledge/product/prd-innovation.md +204 -0
- package/knowledge/review/review-adr.md +203 -0
- package/knowledge/review/review-api-contracts.md +233 -0
- package/knowledge/review/review-database-schema.md +229 -0
- package/knowledge/review/review-domain-modeling.md +288 -0
- package/knowledge/review/review-implementation-tasks.md +202 -0
- package/knowledge/review/review-methodology.md +215 -0
- package/knowledge/review/review-operations.md +212 -0
- package/knowledge/review/review-prd.md +235 -0
- package/knowledge/review/review-security.md +213 -0
- package/knowledge/review/review-system-architecture.md +296 -0
- package/knowledge/review/review-testing-strategy.md +176 -0
- package/knowledge/review/review-user-stories.md +172 -0
- package/knowledge/review/review-ux-spec.md +208 -0
- package/knowledge/validation/critical-path-analysis.md +203 -0
- package/knowledge/validation/cross-phase-consistency.md +181 -0
- package/knowledge/validation/decision-completeness.md +218 -0
- package/knowledge/validation/dependency-validation.md +233 -0
- package/knowledge/validation/implementability-review.md +252 -0
- package/knowledge/validation/scope-management.md +223 -0
- package/knowledge/validation/traceability.md +198 -0
- package/methodology/custom-defaults.yml +43 -0
- package/methodology/deep.yml +42 -0
- package/methodology/mvp.yml +42 -0
- package/package.json +58 -0
- package/pipeline/architecture/review-architecture.md +44 -0
- package/pipeline/architecture/system-architecture.md +45 -0
- package/pipeline/decisions/adrs.md +45 -0
- package/pipeline/decisions/review-adrs.md +39 -0
- package/pipeline/finalization/apply-fixes-and-freeze.md +39 -0
- package/pipeline/finalization/developer-onboarding-guide.md +36 -0
- package/pipeline/finalization/implementation-playbook.md +45 -0
- package/pipeline/modeling/domain-modeling.md +57 -0
- package/pipeline/modeling/review-domain-modeling.md +41 -0
- package/pipeline/planning/implementation-tasks.md +57 -0
- package/pipeline/planning/review-tasks.md +38 -0
- package/pipeline/pre/create-prd.md +45 -0
- package/pipeline/pre/innovate-prd.md +47 -0
- package/pipeline/pre/innovate-user-stories.md +47 -0
- package/pipeline/pre/review-prd.md +44 -0
- package/pipeline/pre/review-user-stories.md +43 -0
- package/pipeline/pre/user-stories.md +48 -0
- package/pipeline/quality/operations.md +42 -0
- package/pipeline/quality/review-operations.md +37 -0
- package/pipeline/quality/review-security.md +40 -0
- package/pipeline/quality/review-testing.md +39 -0
- package/pipeline/quality/security.md +44 -0
- package/pipeline/quality/testing-strategy.md +42 -0
- package/pipeline/specification/api-contracts.md +44 -0
- package/pipeline/specification/database-schema.md +41 -0
- package/pipeline/specification/review-api.md +40 -0
- package/pipeline/specification/review-database.md +39 -0
- package/pipeline/specification/review-ux.md +38 -0
- package/pipeline/specification/ux-spec.md +43 -0
- package/pipeline/validation/critical-path-walkthrough.md +37 -0
- package/pipeline/validation/cross-phase-consistency.md +35 -0
- package/pipeline/validation/decision-completeness.md +36 -0
- package/pipeline/validation/dependency-graph-validation.md +36 -0
- package/pipeline/validation/implementability-dry-run.md +36 -0
- package/pipeline/validation/scope-creep-check.md +38 -0
- package/pipeline/validation/traceability-matrix.md +36 -0
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: system-architecture
|
|
3
|
+
description: Architecture patterns, component design, and project structure
|
|
4
|
+
topics: [architecture, components, modules, data-flows, project-structure, state-management]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Architecture Patterns
|
|
8
|
+
|
|
9
|
+
### Layered Architecture
|
|
10
|
+
|
|
11
|
+
Organizes code into horizontal layers where each layer depends only on the layer directly below it. Common layers: presentation, application/business logic, domain, infrastructure/data access.
|
|
12
|
+
|
|
13
|
+
**When to use:** Simple CRUD applications, small teams, projects where the domain logic is straightforward. Good starting point when requirements are unclear.
|
|
14
|
+
|
|
15
|
+
**Trade-offs:**
|
|
16
|
+
- (+) Easy to understand and implement. Clear separation of concerns.
|
|
17
|
+
- (+) Well-represented in AI training data; AI generates correct layered code reliably.
|
|
18
|
+
- (-) Tends toward anemic domain models (logic drifts to service layers).
|
|
19
|
+
- (-) Changes to a feature often touch every layer (vertical changes cut across horizontal layers).
|
|
20
|
+
- (-) Can become a "big ball of mud" without discipline as layers accumulate cross-cutting dependencies.
|
|
21
|
+
|
|
22
|
+
### Hexagonal / Ports and Adapters
|
|
23
|
+
|
|
24
|
+
The domain logic sits at the center, surrounded by ports (interfaces defining how the domain interacts with the outside) and adapters (implementations of those interfaces). External concerns (databases, APIs, UIs) plug in via adapters.
|
|
25
|
+
|
|
26
|
+
**When to use:** Applications where the domain logic is the core value, where you want to test domain logic in isolation, or where you anticipate switching infrastructure components (database, message broker, external APIs).
|
|
27
|
+
|
|
28
|
+
**Trade-offs:**
|
|
29
|
+
- (+) Domain logic is testable without infrastructure. Swapping a database or API client requires only a new adapter.
|
|
30
|
+
- (+) Forces clean separation between domain and infrastructure.
|
|
31
|
+
- (-) More boilerplate: interfaces for every external dependency, adapter implementations, dependency injection wiring.
|
|
32
|
+
- (-) Over-engineering for simple CRUD. The ceremony doesn't pay off if the domain logic is trivial.
|
|
33
|
+
- (-) Less AI-familiar than layered architecture; AI may generate code that violates the port/adapter boundaries.
|
|
34
|
+
|
|
35
|
+
### Event-Driven Architecture
|
|
36
|
+
|
|
37
|
+
Components communicate by producing and consuming events rather than direct calls. An event represents something that happened. Producers don't know or care who consumes their events.
|
|
38
|
+
|
|
39
|
+
**When to use:** Systems with complex workflows, multiple consumers for the same business event, requirements for audit trails or event replay, systems that need to scale components independently.
|
|
40
|
+
|
|
41
|
+
**Trade-offs:**
|
|
42
|
+
- (+) Loose coupling between components. Adding a new consumer doesn't require changing the producer.
|
|
43
|
+
- (+) Natural fit for audit logs, analytics, and undo/redo.
|
|
44
|
+
- (-) Harder to reason about: the flow of control is distributed across event handlers.
|
|
45
|
+
- (-) Eventual consistency: events are processed asynchronously, so the system may be temporarily inconsistent.
|
|
46
|
+
- (-) Debugging is harder: you need to trace events across services to understand what happened.
|
|
47
|
+
|
|
48
|
+
### Microservices
|
|
49
|
+
|
|
50
|
+
Each bounded context or business capability is deployed as an independent service with its own data store, communicating via network calls (REST, gRPC, messaging).
|
|
51
|
+
|
|
52
|
+
**When to use:** Large teams that need independent deployment cycles, systems with dramatically different scaling requirements per component, organizations with multiple autonomous teams.
|
|
53
|
+
|
|
54
|
+
**Trade-offs:**
|
|
55
|
+
- (+) Independent deployment, scaling, and technology choices per service.
|
|
56
|
+
- (+) Failure isolation: one service going down doesn't take down the entire system.
|
|
57
|
+
- (-) Enormous operational complexity: service discovery, distributed tracing, network failure handling, data consistency across services, deployment coordination.
|
|
58
|
+
- (-) Over-engineering for most projects. If you can deploy a monolith, you should.
|
|
59
|
+
- (-) AI agents struggle with cross-service coordination, distributed debugging, and service mesh configuration.
|
|
60
|
+
|
|
61
|
+
### Modular Monolith
|
|
62
|
+
|
|
63
|
+
A single deployable unit internally organized into well-defined modules with explicit boundaries and interfaces. Modules communicate through defined interfaces, not arbitrary cross-module calls.
|
|
64
|
+
|
|
65
|
+
**When to use:** Most projects. Provides the organizational benefits of microservices (clean boundaries, independent development) without the operational complexity of distributed systems. Can be split into microservices later if genuinely needed.
|
|
66
|
+
|
|
67
|
+
**Trade-offs:**
|
|
68
|
+
- (+) Single deployment, single database, simple operations.
|
|
69
|
+
- (+) Clean module boundaries enable parallel development with low merge conflict risk.
|
|
70
|
+
- (+) Easy to refactor boundaries — moving code between modules is a code change, not a service migration.
|
|
71
|
+
- (-) Requires discipline to maintain module boundaries. Without enforcement, modules leak into each other.
|
|
72
|
+
- (-) Scaling is all-or-nothing (the whole monolith scales together).
|
|
73
|
+
|
|
74
|
+
### Choosing a Pattern
|
|
75
|
+
|
|
76
|
+
For most scaffold pipeline projects:
|
|
77
|
+
|
|
78
|
+
1. Start with **modular monolith** as the default. It gives you clean boundaries, testability, and low operational complexity.
|
|
79
|
+
2. Consider **hexagonal** if the domain logic is the primary value and you need infrastructure independence.
|
|
80
|
+
3. Consider **event-driven** if the domain naturally involves reactive workflows, audit requirements, or multiple consumers of business events.
|
|
81
|
+
4. Use **microservices** only if you have multiple teams that need independent deployment, or specific services with dramatically different scaling needs.
|
|
82
|
+
5. Avoid **layered** unless the application is genuinely simple (CRUD with minimal business logic).
|
|
83
|
+
|
|
84
|
+
## Component Design
|
|
85
|
+
|
|
86
|
+
### Identifying Components from Domain Models
|
|
87
|
+
|
|
88
|
+
Each bounded context from the domain model typically maps to a top-level component or module. Within each bounded context:
|
|
89
|
+
|
|
90
|
+
- Aggregates map to services or sub-modules
|
|
91
|
+
- Domain events define the interfaces between components
|
|
92
|
+
- Repositories define the data access boundaries
|
|
93
|
+
|
|
94
|
+
**Mapping rules:**
|
|
95
|
+
|
|
96
|
+
| Domain Concept | Architecture Component |
|
|
97
|
+
|----------------|----------------------|
|
|
98
|
+
| Bounded Context | Top-level module/package |
|
|
99
|
+
| Aggregate | Service class or sub-module |
|
|
100
|
+
| Domain Event | Event interface / message type |
|
|
101
|
+
| Repository | Data access interface |
|
|
102
|
+
| Domain Service | Application service |
|
|
103
|
+
| Value Object | Shared type/library within the module |
|
|
104
|
+
|
|
105
|
+
### Defining Interfaces Between Components
|
|
106
|
+
|
|
107
|
+
Every component exposes a public interface (its API) and hides its internals. The interface is the contract that other components depend on.
|
|
108
|
+
|
|
109
|
+
**Interface design principles:**
|
|
110
|
+
|
|
111
|
+
- **Explicit over implicit.** Document what a component provides and what it requires. No hidden dependencies.
|
|
112
|
+
- **Narrow interfaces.** Expose the minimum necessary. More surface area means more coupling.
|
|
113
|
+
- **Stable interfaces.** Interfaces should change less frequently than implementations. Design for extension without interface changes.
|
|
114
|
+
- **Domain-language interfaces.** Use domain terminology, not infrastructure terminology. `orderService.place(order)` not `orderManager.insertAndNotify(orderDTO)`.
|
|
115
|
+
|
|
116
|
+
### Dependency Management
|
|
117
|
+
|
|
118
|
+
**Dependency inversion:** High-level modules should not depend on low-level modules. Both should depend on abstractions. The domain module defines an interface for data access; the infrastructure module implements it.
|
|
119
|
+
|
|
120
|
+
**Dependency direction rules:**
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
Presentation -> Application -> Domain <- Infrastructure
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
- Domain has zero external dependencies.
|
|
127
|
+
- Application orchestrates domain objects and depends on domain interfaces.
|
|
128
|
+
- Infrastructure implements domain interfaces and depends on external libraries.
|
|
129
|
+
- Presentation depends on application services.
|
|
130
|
+
|
|
131
|
+
**Preventing circular dependencies:**
|
|
132
|
+
|
|
133
|
+
- Dependencies must be acyclic. If module A depends on module B and module B depends on module A, extract the shared concept into a new module C.
|
|
134
|
+
- Use dependency analysis tools (e.g., madge for JavaScript, import-linter for Python) in CI to enforce dependency rules.
|
|
135
|
+
- When two modules need to communicate bidirectionally, use events or callbacks instead of direct references.
|
|
136
|
+
|
|
137
|
+
## Data Flow Design
|
|
138
|
+
|
|
139
|
+
### Request/Response Flows
|
|
140
|
+
|
|
141
|
+
Document the path of a user request through the system:
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
Client Request
|
|
145
|
+
-> API Gateway / Router
|
|
146
|
+
-> Controller (input validation, auth check)
|
|
147
|
+
-> Application Service (orchestration, business rules)
|
|
148
|
+
-> Domain Model (invariant enforcement, state changes)
|
|
149
|
+
-> Repository (persistence)
|
|
150
|
+
<- Domain Events (side effects)
|
|
151
|
+
<- Response DTO (shape for client)
|
|
152
|
+
<- HTTP Response
|
|
153
|
+
<- Client Response
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
For each major user flow identified in the PRD, trace the request through every component it touches. This reveals:
|
|
157
|
+
- Missing components (the request needs something that doesn't exist)
|
|
158
|
+
- Unnecessary components (the request passes through components that add no value)
|
|
159
|
+
- Coupling points (where changes to the flow would ripple)
|
|
160
|
+
|
|
161
|
+
### Event Flows
|
|
162
|
+
|
|
163
|
+
For event-driven interactions, document:
|
|
164
|
+
|
|
165
|
+
```
|
|
166
|
+
Producer Aggregate
|
|
167
|
+
-> Event (OrderPlaced)
|
|
168
|
+
-> Event Bus / Queue
|
|
169
|
+
-> Consumer 1 (InventoryService.reserveStock)
|
|
170
|
+
-> Consumer 2 (NotificationService.sendConfirmation)
|
|
171
|
+
-> Consumer 3 (AnalyticsService.recordPurchase)
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Event flow documentation should include:
|
|
175
|
+
- The producing aggregate and triggering action
|
|
176
|
+
- The event name and payload schema
|
|
177
|
+
- All consumers and their resulting actions
|
|
178
|
+
- Error handling: what happens if a consumer fails?
|
|
179
|
+
- Ordering guarantees: must events be processed in order?
|
|
180
|
+
|
|
181
|
+
### Data Transformation Pipelines
|
|
182
|
+
|
|
183
|
+
When data moves between layers or components, it often changes shape:
|
|
184
|
+
|
|
185
|
+
```
|
|
186
|
+
HTTP Request Body (JSON)
|
|
187
|
+
-> Validated Input DTO (type-safe, validated)
|
|
188
|
+
-> Domain Command (domain language)
|
|
189
|
+
-> Domain Entity mutations
|
|
190
|
+
-> Domain Event (payload)
|
|
191
|
+
-> Persistence Model (database row)
|
|
192
|
+
-> Response DTO (client-facing shape)
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Document each transformation point and what changes. This prevents the common mistake of passing database models directly to the client or accepting raw JSON deep in the domain layer.
|
|
196
|
+
|
|
197
|
+
## Module Organization
|
|
198
|
+
|
|
199
|
+
### Project Directory Structure
|
|
200
|
+
|
|
201
|
+
Directory structure is part of the architecture. A well-organized directory structure makes the architecture visible in the file system.
|
|
202
|
+
|
|
203
|
+
**Feature-based (vertical slices):**
|
|
204
|
+
|
|
205
|
+
```
|
|
206
|
+
src/
|
|
207
|
+
features/
|
|
208
|
+
auth/
|
|
209
|
+
controllers/
|
|
210
|
+
services/
|
|
211
|
+
models/
|
|
212
|
+
repositories/
|
|
213
|
+
events/
|
|
214
|
+
tests/
|
|
215
|
+
orders/
|
|
216
|
+
controllers/
|
|
217
|
+
services/
|
|
218
|
+
models/
|
|
219
|
+
repositories/
|
|
220
|
+
events/
|
|
221
|
+
tests/
|
|
222
|
+
shared/
|
|
223
|
+
middleware/
|
|
224
|
+
utils/
|
|
225
|
+
types/
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
Best for: most projects, especially with parallel agents. Each feature is self-contained, reducing merge conflicts.
|
|
229
|
+
|
|
230
|
+
**Layer-based (horizontal slices):**
|
|
231
|
+
|
|
232
|
+
```
|
|
233
|
+
src/
|
|
234
|
+
controllers/
|
|
235
|
+
services/
|
|
236
|
+
models/
|
|
237
|
+
repositories/
|
|
238
|
+
middleware/
|
|
239
|
+
utils/
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
Best for: very small projects where the feature count is low and layered separation is the primary organizational concern.
|
|
243
|
+
|
|
244
|
+
**Hybrid (layers within features):**
|
|
245
|
+
|
|
246
|
+
```
|
|
247
|
+
src/
|
|
248
|
+
features/
|
|
249
|
+
auth/
|
|
250
|
+
auth.controller.ts
|
|
251
|
+
auth.service.ts
|
|
252
|
+
auth.model.ts
|
|
253
|
+
auth.repository.ts
|
|
254
|
+
auth.test.ts
|
|
255
|
+
orders/
|
|
256
|
+
...
|
|
257
|
+
shared/
|
|
258
|
+
middleware/
|
|
259
|
+
utils/
|
|
260
|
+
infrastructure/
|
|
261
|
+
database/
|
|
262
|
+
messaging/
|
|
263
|
+
external-apis/
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
Best for: projects that want feature isolation but also need clear infrastructure separation.
|
|
267
|
+
|
|
268
|
+
### File Naming Conventions
|
|
269
|
+
|
|
270
|
+
Consistency matters more than any specific convention. Pick one and enforce it:
|
|
271
|
+
|
|
272
|
+
- **kebab-case:** `user-profile.service.ts`, `order-item.model.ts` (most common in Node.js/TypeScript)
|
|
273
|
+
- **snake_case:** `user_profile_service.py`, `order_item_model.py` (standard in Python)
|
|
274
|
+
- **PascalCase:** `UserProfileService.java`, `OrderItemModel.java` (standard in Java/C#)
|
|
275
|
+
|
|
276
|
+
File names should include the component type as a suffix: `.controller`, `.service`, `.model`, `.repository`, `.test`, `.middleware`.
|
|
277
|
+
|
|
278
|
+
### Module Boundaries
|
|
279
|
+
|
|
280
|
+
Enforce that modules only interact through their public interfaces:
|
|
281
|
+
|
|
282
|
+
- Each module has an index/barrel file that exports only public API
|
|
283
|
+
- Internal files/classes are not exported
|
|
284
|
+
- Linter rules or import restrictions prevent reaching into another module's internals
|
|
285
|
+
- Module tests verify the public API; they don't test internals directly
|
|
286
|
+
|
|
287
|
+
### Import/Dependency Rules
|
|
288
|
+
|
|
289
|
+
Define a strict import ordering convention:
|
|
290
|
+
|
|
291
|
+
```
|
|
292
|
+
1. Standard library / Node.js built-ins
|
|
293
|
+
2. Third-party packages (npm/pip)
|
|
294
|
+
3. Internal shared modules (@shared/, @infrastructure/)
|
|
295
|
+
4. Feature-local modules (./relative paths)
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
Use path aliases to make imports readable: `@features/auth/service` instead of `../../../../features/auth/service`.
|
|
299
|
+
|
|
300
|
+
## State Management
|
|
301
|
+
|
|
302
|
+
### Where State Lives
|
|
303
|
+
|
|
304
|
+
State must have a clear, single owner. Distributed state with no clear owner leads to inconsistencies.
|
|
305
|
+
|
|
306
|
+
**Server-side state:**
|
|
307
|
+
- Database: persistent state (user data, orders, configuration)
|
|
308
|
+
- Cache (Redis, in-memory): derived or frequently-accessed state
|
|
309
|
+
- Session store: per-user session state
|
|
310
|
+
- Application memory: request-scoped transient state
|
|
311
|
+
|
|
312
|
+
**Client-side state (if applicable):**
|
|
313
|
+
- URL/query params: navigational state (current page, filters, sort order)
|
|
314
|
+
- Component state: UI-specific transient state (form inputs, open/closed toggles)
|
|
315
|
+
- Client-side store (Redux, Zustand, etc.): application state shared across components
|
|
316
|
+
- Local storage: persistent client state (preferences, draft saves)
|
|
317
|
+
|
|
318
|
+
### Consistency Strategies
|
|
319
|
+
|
|
320
|
+
- **Strong consistency** (single source of truth, synchronous reads): Use for data where correctness matters more than performance. Financial balances, inventory counts, access permissions.
|
|
321
|
+
- **Eventual consistency** (multiple sources, asynchronous sync): Acceptable for analytics, recommendations, activity feeds, notification counts.
|
|
322
|
+
- **Optimistic updates** (update UI immediately, reconcile with server): Good for user experience in low-conflict scenarios. Must handle conflicts gracefully.
|
|
323
|
+
|
|
324
|
+
### Caching
|
|
325
|
+
|
|
326
|
+
Add caching only when you have evidence of a performance problem, not speculatively.
|
|
327
|
+
|
|
328
|
+
When caching:
|
|
329
|
+
- Define the cache key scheme
|
|
330
|
+
- Define the invalidation strategy (TTL, event-based, write-through)
|
|
331
|
+
- Define what happens on cache miss (load from source, return stale data, error)
|
|
332
|
+
- Define maximum cache size and eviction policy (LRU, LFU, FIFO)
|
|
333
|
+
|
|
334
|
+
## Extension Points
|
|
335
|
+
|
|
336
|
+
Extension points allow the system to evolve without modifying core code. They must be designed, not just documented.
|
|
337
|
+
|
|
338
|
+
### Types of Extension Points
|
|
339
|
+
|
|
340
|
+
**Plugin systems:** Third-party or internal code hooks into defined interfaces. Example: a notification system with pluggable channels (email, SMS, push, Slack).
|
|
341
|
+
|
|
342
|
+
**Middleware/pipeline:** Processing steps that can be inserted, removed, or reordered. Example: request processing middleware (auth, logging, rate limiting, CORS).
|
|
343
|
+
|
|
344
|
+
**Configuration-driven behavior:** System behavior changes based on configuration without code changes. Example: feature flags, A/B tests, tenant-specific settings.
|
|
345
|
+
|
|
346
|
+
**Event hooks:** External code subscribes to events and reacts. Example: "after user creation, trigger welcome email" — the welcome email logic is decoupled from user creation.
|
|
347
|
+
|
|
348
|
+
### Design Rules
|
|
349
|
+
|
|
350
|
+
- Extension points must have a defined interface (not just "call any function")
|
|
351
|
+
- Document what extensions can and cannot do (security constraints, performance expectations)
|
|
352
|
+
- Provide default implementations for all extension points
|
|
353
|
+
- Test the extension mechanism itself, not just specific extensions
|
|
354
|
+
- Don't add extension points speculatively — add them when you have a concrete need for extensibility
|
|
355
|
+
|
|
356
|
+
## Cross-Cutting Concerns
|
|
357
|
+
|
|
358
|
+
### Logging
|
|
359
|
+
|
|
360
|
+
- **Structured logging** (JSON format) for machine parsability
|
|
361
|
+
- **Log levels:** DEBUG (verbose tracing), INFO (significant operations), WARN (recoverable issues), ERROR (failures requiring attention)
|
|
362
|
+
- **What to log:** Request/response metadata (not bodies), authentication events, business operations, errors with stack traces
|
|
363
|
+
- **What NEVER to log:** PII, passwords, tokens, credit card numbers, session cookies
|
|
364
|
+
- **Correlation IDs:** Every request gets a unique ID that propagates through all logs for that request, enabling end-to-end tracing
|
|
365
|
+
|
|
366
|
+
### Error Handling
|
|
367
|
+
|
|
368
|
+
- **Fail fast:** Detect errors as early as possible. Validate inputs at the boundary.
|
|
369
|
+
- **Error types:** Distinguish between client errors (bad input, 4xx), server errors (bugs, infrastructure failures, 5xx), and domain errors (business rule violations).
|
|
370
|
+
- **Error propagation:** Errors at lower layers should be translated to meaningful errors at higher layers. A "connection refused" database error becomes a "service unavailable" to the client.
|
|
371
|
+
- **Error recovery:** Define retry strategies for transient errors (with exponential backoff and jitter). Define circuit breakers for failing external services.
|
|
372
|
+
|
|
373
|
+
### Configuration Management
|
|
374
|
+
|
|
375
|
+
- **Environment-based:** Configuration varies by environment (dev, staging, production)
|
|
376
|
+
- **Hierarchical:** Default values < environment config < runtime overrides
|
|
377
|
+
- **Validated at startup:** All required configuration is checked at application start, not at first use
|
|
378
|
+
- **Typed:** Configuration values are parsed into proper types, not used as raw strings throughout the codebase
|
|
379
|
+
- **Secrets separated:** Sensitive values (API keys, database passwords) come from secure sources (environment variables, vault), never from config files committed to source control
|
|
380
|
+
|
|
381
|
+
### Feature Flags
|
|
382
|
+
|
|
383
|
+
- **Runtime toggles:** Enable/disable features without deployment
|
|
384
|
+
- **Scoped:** Feature flags apply globally, per-tenant, per-user, or per-percentage
|
|
385
|
+
- **Cleanup:** Feature flags are temporary. Set a removal date. Old feature flags become technical debt.
|
|
386
|
+
- **Testable:** Tests can exercise both flag-on and flag-off paths
|
|
387
|
+
|
|
388
|
+
## Common Pitfalls
|
|
389
|
+
|
|
390
|
+
**Over-architecting.** Microservices, event sourcing, CQRS, and distributed caching for a todo app with one user. Match architecture complexity to problem complexity. Start simple and add complexity only when the simpler approach demonstrably fails.
|
|
391
|
+
|
|
392
|
+
**Under-specifying interfaces.** "The auth module provides authentication" is not an interface specification. Specify the exact methods/endpoints, their parameters, their return types, and their error conditions. An AI agent implementing against a vague interface will guess wrong.
|
|
393
|
+
|
|
394
|
+
**Orphaned components.** A component that appears in the architecture diagram but in no data flow. If no request ever touches it, it either shouldn't exist or there's a missing data flow. Every component must appear in at least one data flow.
|
|
395
|
+
|
|
396
|
+
**Diagram/prose drift.** The architecture diagram shows three services but the prose describes four. Or the diagram shows a direct database connection but the prose describes a repository pattern. Keep diagrams and text synchronized. When one changes, update the other.
|
|
397
|
+
|
|
398
|
+
**Speculative generalization.** Adding layers of abstraction "in case we need it later" — an adapter for a database you'll never switch, a plugin system nobody will extend, a message queue for messages that could be function calls. Each abstraction has a maintenance cost. Add abstractions when you have a concrete need.
|
|
399
|
+
|
|
400
|
+
**Missing error paths in data flows.** Data flow diagrams that only show the happy path. What happens when the database is down? When the external API returns an error? When the message queue is full? Document error paths for every external dependency.
|
|
401
|
+
|
|
402
|
+
**Ignoring project structure.** Defining a beautiful hexagonal architecture but using a flat directory structure that doesn't reflect the architecture's boundaries. The file system should make the architecture visible. If modules can't be identified from the directory listing, the structure doesn't serve the architecture.
|