@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
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Ken Allred
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,477 @@
|
|
|
1
|
+
# Scaffold
|
|
2
|
+
|
|
3
|
+
A TypeScript CLI that assembles AI-powered prompts at runtime to guide you from "I have an idea" to working software. Scaffold walks you through 36 structured pipeline steps — organized into 9 phases — and Claude Code handles the research, planning, and implementation for you.
|
|
4
|
+
|
|
5
|
+
By the end, you'll have a fully planned, standards-documented, implementation-ready project with working code.
|
|
6
|
+
|
|
7
|
+
## What is Scaffold?
|
|
8
|
+
|
|
9
|
+
Scaffold is a composable meta-prompt pipeline built for [Claude Code](https://docs.anthropic.com/en/docs/claude-code), Anthropic's command-line coding tool. If you have an idea for a software project but don't know where to start — or you want to make sure your project is set up with solid architecture, standards, and tests from day one — Scaffold guides you through every step.
|
|
10
|
+
|
|
11
|
+
Here's how it works:
|
|
12
|
+
|
|
13
|
+
1. **Initialize** — run `scaffold init` in your project directory. The init wizard detects whether you're starting fresh (greenfield) or working with an existing codebase (brownfield), and lets you pick a methodology preset (deep, mvp, or custom).
|
|
14
|
+
|
|
15
|
+
2. **Run steps** — each step is a composable meta-prompt (a short intent declaration in `pipeline/`) that gets assembled at runtime into a full 7-section prompt. The assembly engine injects relevant knowledge base entries, project context from prior steps, methodology settings, and depth-appropriate instructions.
|
|
16
|
+
|
|
17
|
+
3. **Follow the dependency graph** — Scaffold tracks which steps are complete, which are eligible, and which are blocked. Run `scaffold next` to see what's unblocked, or `scaffold status` for the full picture. Each step produces a specific artifact — a planning document, architecture decision, specification, or actual code.
|
|
18
|
+
|
|
19
|
+
You can run steps via the CLI (`scaffold run create-prd`) or via slash commands in Claude Code (`/scaffold:create-prd`). Either way, Scaffold constructs the prompt and Claude does the work.
|
|
20
|
+
|
|
21
|
+
## Key Concepts
|
|
22
|
+
|
|
23
|
+
**Meta-prompts** — Each pipeline step is defined as a short `.md` file in `pipeline/` with YAML frontmatter (dependencies, outputs, knowledge entries) and a markdown body describing the step's intent. These are *not* the prompts Claude sees — they're assembled into full prompts at runtime.
|
|
24
|
+
|
|
25
|
+
**Assembly engine** — At execution time, Scaffold builds a 7-section prompt from: system metadata, the meta-prompt, knowledge base entries, project context (artifacts from prior steps), methodology settings, layered instructions, and depth-specific execution guidance.
|
|
26
|
+
|
|
27
|
+
**Knowledge base** — 38 domain expertise entries in `knowledge/` covering testing strategy, domain modeling, API design, security review, and more. These get injected into prompts based on each step's `knowledge-base` frontmatter field. Teams can add project-local overrides in `.scaffold/knowledge/` that layer on top of the global entries.
|
|
28
|
+
|
|
29
|
+
**Methodology presets** — Three built-in presets control which steps run and how deep the analysis goes:
|
|
30
|
+
- **deep** (depth 5) — all 36 steps, exhaustive analysis
|
|
31
|
+
- **mvp** (depth 1) — 7 critical steps, get to code fast
|
|
32
|
+
- **custom** (depth 1-5) — you choose which steps to enable and how deep each one goes
|
|
33
|
+
|
|
34
|
+
**Depth scale** (1-5) — Controls how thorough each step's output is, from "focus on the core deliverable" (1) to "explore all angles, tradeoffs, and edge cases" (5). Depth resolves with 4-level precedence: CLI flag > step override > custom default > preset default.
|
|
35
|
+
|
|
36
|
+
**State management** — Pipeline progress is tracked in `.scaffold/state.json` with atomic file writes and crash recovery. An advisory lock prevents concurrent runs. Decisions are logged to an append-only `decisions.jsonl`.
|
|
37
|
+
|
|
38
|
+
**Dependency graph** — Steps declare their prerequisites in frontmatter. Scaffold builds a DAG, runs topological sort (Kahn's algorithm), detects cycles, and computes which steps are eligible at any point.
|
|
39
|
+
|
|
40
|
+
## Prerequisites
|
|
41
|
+
|
|
42
|
+
### Required
|
|
43
|
+
|
|
44
|
+
**Node.js** (v18 or later)
|
|
45
|
+
- Install: https://nodejs.org or `brew install node`
|
|
46
|
+
- Verify: `node --version`
|
|
47
|
+
|
|
48
|
+
**Git**
|
|
49
|
+
- Install: https://git-scm.com or `brew install git`
|
|
50
|
+
- Verify: `git --version`
|
|
51
|
+
|
|
52
|
+
**Claude Code**
|
|
53
|
+
The AI coding assistant that runs the assembled prompts. Claude Code is a command-line tool from Anthropic.
|
|
54
|
+
- Install: `npm install -g @anthropic-ai/claude-code`
|
|
55
|
+
- Verify: `claude --version`
|
|
56
|
+
- Docs: https://docs.anthropic.com/en/docs/claude-code
|
|
57
|
+
|
|
58
|
+
### Optional
|
|
59
|
+
|
|
60
|
+
**Playwright MCP** (web apps only)
|
|
61
|
+
Lets Claude control a real browser for visual testing and screenshots.
|
|
62
|
+
- Install: `claude mcp add playwright npx @playwright/mcp@latest`
|
|
63
|
+
|
|
64
|
+
**ChatGPT subscription** (for multi-model review)
|
|
65
|
+
One optional step (`multi-model-review`) sets up automated code review using both Claude and OpenAI's Codex. Requires a ChatGPT subscription (Plus, Pro, or Team). Skip this step if you don't have one.
|
|
66
|
+
|
|
67
|
+
**Codex CLI and/or Gemini CLI** (for multi-model stories review)
|
|
68
|
+
One optional step (`user-stories-multi-model-review`) runs independent AI reviewers against your user stories. You need at least one of: Codex CLI (requires ChatGPT subscription) or Gemini CLI (free tier available). See [Multi-Model Stories Review Setup](docs/multi-model-stories-review-setup.md).
|
|
69
|
+
|
|
70
|
+
## Installation
|
|
71
|
+
|
|
72
|
+
### Option 1: npm (recommended)
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
npm install -g @zigrivers/scaffold
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
After installing, the `scaffold` CLI is available globally. Slash commands (`/scaffold:create-prd`, etc.) are also available in Claude Code via the plugin.
|
|
79
|
+
|
|
80
|
+
### Option 2: Homebrew
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
brew tap zigrivers/scaffold
|
|
84
|
+
brew install scaffold
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Option 3: Claude Code Plugin
|
|
88
|
+
|
|
89
|
+
If you only need slash commands inside Claude Code (no CLI):
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
/plugin marketplace add zigrivers/scaffold
|
|
93
|
+
/plugin install scaffold@zigrivers-scaffold
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Commands are available as `/scaffold:command-name` (for example, `/scaffold:create-prd`).
|
|
97
|
+
|
|
98
|
+
### Verify Installation
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
scaffold version
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Or in Claude Code:
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
/scaffold:prompt-pipeline
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Updating
|
|
111
|
+
|
|
112
|
+
### npm
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
npm update -g @zigrivers/scaffold
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Homebrew
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
brew upgrade scaffold
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Plugin
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
/scaffold:update
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Or: `/plugin marketplace update zigrivers-scaffold`
|
|
131
|
+
|
|
132
|
+
## Quick Start
|
|
133
|
+
|
|
134
|
+
**1. Create a new project and initialize Scaffold**
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
mkdir my-project && cd my-project
|
|
138
|
+
git init
|
|
139
|
+
scaffold init
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
The init wizard detects your project type and walks you through choosing a methodology preset. It creates `.scaffold/` with your config, state, and decisions log.
|
|
143
|
+
|
|
144
|
+
**2. Define your product**
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
scaffold run create-prd
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Or in Claude Code:
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
/scaffold:create-prd I want to build a recipe sharing app where users can save, organize, and share recipes with friends
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Claude asks clarifying questions about your idea, researches best practices, and produces a detailed product requirements document. This becomes the foundation that all later steps build on.
|
|
157
|
+
|
|
158
|
+
**3. See what's next**
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
scaffold next
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Scaffold shows you which steps are now unblocked based on the dependency graph.
|
|
165
|
+
|
|
166
|
+
**4. Keep following the pipeline**
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
scaffold run review-prd
|
|
170
|
+
scaffold run user-stories
|
|
171
|
+
# ... and so on
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Each step tells you what to run next. Use `scaffold status` at any time to see the full pipeline state, or `scaffold dashboard` to open a visual progress dashboard in your browser.
|
|
175
|
+
|
|
176
|
+
## The Pipeline
|
|
177
|
+
|
|
178
|
+
### Phase 1 — Product Definition (pre)
|
|
179
|
+
|
|
180
|
+
Define what you're building.
|
|
181
|
+
|
|
182
|
+
| Step | What It Does |
|
|
183
|
+
|------|-------------|
|
|
184
|
+
| `create-prd` | Creates a detailed product requirements document from your idea |
|
|
185
|
+
| `innovate-prd` | Reviews the PRD for missing pieces and suggests innovations |
|
|
186
|
+
| `review-prd` | Structured review of the PRD for completeness and quality |
|
|
187
|
+
| `user-stories` | Creates detailed user stories for every PRD feature |
|
|
188
|
+
| `innovate-user-stories` | Gap analysis and UX innovation pass on user stories |
|
|
189
|
+
| `review-user-stories` | Structured review of user stories for coverage and clarity |
|
|
190
|
+
|
|
191
|
+
### Phase 2 — Domain Modeling (modeling)
|
|
192
|
+
|
|
193
|
+
Understand the problem domain.
|
|
194
|
+
|
|
195
|
+
| Step | What It Does |
|
|
196
|
+
|------|-------------|
|
|
197
|
+
| `domain-modeling` | DDD analysis — bounded contexts, aggregates, value objects |
|
|
198
|
+
| `review-domain-modeling` | Review of domain model for correctness and completeness |
|
|
199
|
+
|
|
200
|
+
### Phase 3 — Architecture Decisions (decisions)
|
|
201
|
+
|
|
202
|
+
Record key technical decisions.
|
|
203
|
+
|
|
204
|
+
| Step | What It Does |
|
|
205
|
+
|------|-------------|
|
|
206
|
+
| `adrs` | Creates Architecture Decision Records for major choices |
|
|
207
|
+
| `review-adrs` | Review of ADRs for completeness and rationale |
|
|
208
|
+
|
|
209
|
+
### Phase 4 — System Architecture (architecture)
|
|
210
|
+
|
|
211
|
+
Design the system.
|
|
212
|
+
|
|
213
|
+
| Step | What It Does |
|
|
214
|
+
|------|-------------|
|
|
215
|
+
| `system-architecture` | Component design, layering, patterns, scalability |
|
|
216
|
+
| `review-architecture` | Structured architecture review |
|
|
217
|
+
|
|
218
|
+
### Phase 5 — Specifications (specification)
|
|
219
|
+
|
|
220
|
+
Detail the interfaces.
|
|
221
|
+
|
|
222
|
+
| Step | What It Does |
|
|
223
|
+
|------|-------------|
|
|
224
|
+
| `database-schema` | Database design — normalization, indexing, migrations |
|
|
225
|
+
| `review-database` | Review of database schema |
|
|
226
|
+
| `api-contracts` | REST/GraphQL contracts, versioning, error handling |
|
|
227
|
+
| `review-api` | Review of API contracts |
|
|
228
|
+
| `ux-spec` | Interaction design, usability, user flows |
|
|
229
|
+
| `review-ux` | Review of UX specification |
|
|
230
|
+
|
|
231
|
+
### Phase 6 — Quality (quality)
|
|
232
|
+
|
|
233
|
+
Plan for quality, security, and operations.
|
|
234
|
+
|
|
235
|
+
| Step | What It Does |
|
|
236
|
+
|------|-------------|
|
|
237
|
+
| `testing-strategy` | Test pyramid, patterns, coverage strategy |
|
|
238
|
+
| `review-testing` | Review of testing strategy |
|
|
239
|
+
| `security` | OWASP, threat modeling, security controls |
|
|
240
|
+
| `review-security` | Review of security practices |
|
|
241
|
+
| `operations` | CI/CD, deployment, monitoring, runbooks |
|
|
242
|
+
| `review-operations` | Review of operations plan |
|
|
243
|
+
|
|
244
|
+
### Phase 7 — Planning (planning)
|
|
245
|
+
|
|
246
|
+
Break work into implementable tasks.
|
|
247
|
+
|
|
248
|
+
| Step | What It Does |
|
|
249
|
+
|------|-------------|
|
|
250
|
+
| `implementation-tasks` | Decompose stories into a task graph with dependencies |
|
|
251
|
+
| `review-tasks` | Review task quality, coverage, and sizing |
|
|
252
|
+
|
|
253
|
+
### Phase 8 — Validation (validation)
|
|
254
|
+
|
|
255
|
+
Cross-phase audits before implementation.
|
|
256
|
+
|
|
257
|
+
| Step | What It Does |
|
|
258
|
+
|------|-------------|
|
|
259
|
+
| `scope-creep-check` | Detect scope drift from original PRD |
|
|
260
|
+
| `dependency-graph-validation` | Verify task graph integrity |
|
|
261
|
+
| `implementability-dry-run` | Can this actually be built as specified? |
|
|
262
|
+
| `decision-completeness` | Audit ADRs for missing decisions |
|
|
263
|
+
| `traceability-matrix` | Requirements → design → tasks mapping |
|
|
264
|
+
| `cross-phase-consistency` | Alignment check across all phases |
|
|
265
|
+
| `critical-path-walkthrough` | Identify the critical implementation path |
|
|
266
|
+
|
|
267
|
+
### Phase 9 — Finalization (finalization)
|
|
268
|
+
|
|
269
|
+
Lock it down and start building.
|
|
270
|
+
|
|
271
|
+
| Step | What It Does |
|
|
272
|
+
|------|-------------|
|
|
273
|
+
| `implementation-playbook` | Step-by-step guide for the implementation phase |
|
|
274
|
+
| `developer-onboarding-guide` | Onboarding guide for new contributors |
|
|
275
|
+
| `apply-fixes-and-freeze` | Apply any remaining fixes and freeze the specification |
|
|
276
|
+
|
|
277
|
+
## Methodology Presets
|
|
278
|
+
|
|
279
|
+
Not every project needs all 36 steps. Choose a methodology when you run `scaffold init`:
|
|
280
|
+
|
|
281
|
+
### deep (depth 5)
|
|
282
|
+
All 36 steps enabled. Comprehensive analysis of every angle — domain modeling, ADRs, security review, traceability matrix, the works. Best for complex systems, team projects, or when you want thorough documentation.
|
|
283
|
+
|
|
284
|
+
### mvp (depth 1)
|
|
285
|
+
Only 7 critical steps: create-prd, review-prd, user-stories, review-user-stories, testing-strategy, implementation-tasks, and implementation-playbook. Minimal ceremony — get to code fast. Best for prototypes, hackathons, or solo projects.
|
|
286
|
+
|
|
287
|
+
### custom (configurable)
|
|
288
|
+
You choose which steps to enable and set a default depth (1-5). You can also override depth per step. Best when you know which parts of the pipeline matter for your project.
|
|
289
|
+
|
|
290
|
+
You can change methodology mid-pipeline with `scaffold init --methodology <preset>`. Scaffold preserves your completed work and adjusts what's remaining.
|
|
291
|
+
|
|
292
|
+
## CLI Commands
|
|
293
|
+
|
|
294
|
+
| Command | What It Does |
|
|
295
|
+
|---------|-------------|
|
|
296
|
+
| `scaffold init` | Initialize `.scaffold/` with config, state, and decisions log |
|
|
297
|
+
| `scaffold run <step>` | Execute a pipeline step (assembles and outputs the full prompt) |
|
|
298
|
+
| `scaffold build` | Generate platform adapter output (commands/, AGENTS.md, etc.) |
|
|
299
|
+
| `scaffold adopt` | Bootstrap state from existing artifacts (brownfield projects) |
|
|
300
|
+
| `scaffold skip <step>` | Mark a step as skipped with a reason |
|
|
301
|
+
| `scaffold reset <step>` | Reset a step back to pending |
|
|
302
|
+
| `scaffold status` | Show pipeline progress and eligibility |
|
|
303
|
+
| `scaffold next` | List next unblocked step(s) |
|
|
304
|
+
| `scaffold validate` | Validate meta-prompts, config, state, and dependency graph |
|
|
305
|
+
| `scaffold list` | List all steps with status |
|
|
306
|
+
| `scaffold info <step>` | Show full metadata for a step |
|
|
307
|
+
| `scaffold version` | Show Scaffold version |
|
|
308
|
+
| `scaffold update` | Update to the latest version |
|
|
309
|
+
| `scaffold dashboard` | Open a visual progress dashboard in your browser |
|
|
310
|
+
| `scaffold decisions` | Show all logged decisions |
|
|
311
|
+
| `scaffold knowledge` | Manage project-local knowledge base overrides |
|
|
312
|
+
|
|
313
|
+
## Knowledge System
|
|
314
|
+
|
|
315
|
+
Scaffold ships with 38 domain expertise entries organized in four categories:
|
|
316
|
+
|
|
317
|
+
- **core/** (12 entries) — testing strategy, domain modeling, API design, database design, system architecture, ADR craft, security review, operations, task decomposition, user stories, UX specification
|
|
318
|
+
- **product/** (3 entries) — PRD craft, PRD innovation, gap analysis
|
|
319
|
+
- **review/** (12 entries) — review methodologies for each domain area
|
|
320
|
+
- **validation/** (7 entries) — critical path analysis, cross-phase consistency, scope management, traceability, implementability
|
|
321
|
+
- **finalization/** (3 entries) — implementation playbook, developer onboarding, apply-fixes-and-freeze
|
|
322
|
+
|
|
323
|
+
Each pipeline step declares which knowledge entries it needs in its frontmatter. The assembly engine injects them automatically.
|
|
324
|
+
|
|
325
|
+
### Project-local overrides (v2.1)
|
|
326
|
+
|
|
327
|
+
Teams can create project-specific knowledge entries in `.scaffold/knowledge/` that layer over the global entries:
|
|
328
|
+
|
|
329
|
+
```bash
|
|
330
|
+
scaffold knowledge update testing-strategy "We use Playwright for all E2E tests, Jest for unit tests"
|
|
331
|
+
scaffold knowledge list # See all entries (global + local)
|
|
332
|
+
scaffold knowledge show testing-strategy # View effective content
|
|
333
|
+
scaffold knowledge reset testing-strategy # Remove override, revert to global
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
Local overrides are committable — the whole team shares enriched, project-specific guidance.
|
|
337
|
+
|
|
338
|
+
## After the Pipeline: Ongoing Commands
|
|
339
|
+
|
|
340
|
+
Once your project is scaffolded and you're building features, these slash commands are available in Claude Code:
|
|
341
|
+
|
|
342
|
+
| Command | When to Use |
|
|
343
|
+
|---------|-------------|
|
|
344
|
+
| `/scaffold:new-enhancement` | Add a new feature to an already-scaffolded project. Updates the PRD, creates new user stories, and sets up tasks with dependencies. |
|
|
345
|
+
| `/scaffold:quick-task` | Create a focused task for a bug fix, refactor, or small improvement. |
|
|
346
|
+
| `/scaffold:version-bump` | Mark a milestone with a version number without the full release ceremony. |
|
|
347
|
+
| `/scaffold:release` | Ship a new version — changelog, Git tag, and GitHub release. Supports `--dry-run`, `current`, and `rollback`. |
|
|
348
|
+
| `/scaffold:single-agent-start` | Start the autonomous implementation loop — Claude picks up tasks and builds. |
|
|
349
|
+
| `/scaffold:single-agent-resume` | Resume where you left off after closing Claude Code. |
|
|
350
|
+
| `/scaffold:multi-agent-start` | Start parallel implementation with multiple agents in worktrees. |
|
|
351
|
+
| `/scaffold:multi-agent-resume` | Resume parallel agent work after a break. |
|
|
352
|
+
| `/scaffold:prompt-pipeline` | Print the full pipeline reference table. |
|
|
353
|
+
|
|
354
|
+
## Releasing Your Project
|
|
355
|
+
|
|
356
|
+
### Version bumps (development milestones)
|
|
357
|
+
|
|
358
|
+
```
|
|
359
|
+
/scaffold:version-bump
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
Bumps the version number and updates the changelog, but doesn't create tags, push, or publish a GitHub release. Think of it as a checkpoint.
|
|
363
|
+
|
|
364
|
+
### Creating a release
|
|
365
|
+
|
|
366
|
+
```
|
|
367
|
+
/scaffold:release
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
Claude analyzes your commits since the last release, suggests whether this is a major, minor, or patch version bump, and walks you through:
|
|
371
|
+
1. Running your project's tests
|
|
372
|
+
2. Updating the version number in your project files
|
|
373
|
+
3. Generating a changelog entry
|
|
374
|
+
4. Creating a Git tag and GitHub release
|
|
375
|
+
|
|
376
|
+
Options: `--dry-run` to preview, `minor`/`major`/`patch` to specify the bump, `current` to release an already-bumped version, `rollback` to undo.
|
|
377
|
+
|
|
378
|
+
## Glossary
|
|
379
|
+
|
|
380
|
+
| Term | What It Means |
|
|
381
|
+
|------|---------------|
|
|
382
|
+
| **Assembly engine** | The runtime system that constructs full 7-section prompts from meta-prompts, knowledge entries, project context, and methodology settings. |
|
|
383
|
+
| **CLAUDE.md** | A configuration file in your project root that tells Claude Code how to work in your project. |
|
|
384
|
+
| **Depth** | A 1-5 scale controlling how thorough each step's analysis is, from MVP-focused (1) to exhaustive (5). |
|
|
385
|
+
| **Frontmatter** | The YAML metadata block at the top of meta-prompt files, declaring dependencies, outputs, knowledge entries, and other configuration. |
|
|
386
|
+
| **Knowledge base** | 38 domain expertise entries that get injected into prompts. Can be extended with project-local overrides. |
|
|
387
|
+
| **MCP** | Model Context Protocol. A way for Claude to use external tools like a headless browser. |
|
|
388
|
+
| **Meta-prompt** | A short intent declaration in `pipeline/` that gets assembled into a full prompt at runtime. |
|
|
389
|
+
| **Methodology** | A preset (deep, mvp, custom) controlling which steps run and at what depth. |
|
|
390
|
+
| **PRD** | Product Requirements Document. The foundation for everything Scaffold builds. |
|
|
391
|
+
| **Slash commands** | Commands in Claude Code starting with `/`. For example, `/scaffold:create-prd`. |
|
|
392
|
+
| **Worktrees** | A git feature for multiple working copies. Scaffold uses these for parallel agent execution. |
|
|
393
|
+
|
|
394
|
+
## Troubleshooting / FAQ
|
|
395
|
+
|
|
396
|
+
**I ran a command and nothing happened.**
|
|
397
|
+
Make sure Scaffold is installed — run `scaffold version` or `/scaffold:prompt-pipeline` in Claude Code.
|
|
398
|
+
|
|
399
|
+
**Which steps can I skip?**
|
|
400
|
+
Use `scaffold skip <step> --reason "..."` to skip any step. The mvp preset only enables 7 critical steps by default. With the custom preset, you choose exactly which steps to run.
|
|
401
|
+
|
|
402
|
+
**Can I go back and re-run a step?**
|
|
403
|
+
Yes. Use `scaffold reset <step>` to reset it to pending, then `scaffold run <step>`. When re-running a completed step, Scaffold uses update mode — it loads the existing artifact and generates improvements rather than starting from scratch.
|
|
404
|
+
|
|
405
|
+
**Do I need to run every step in one sitting?**
|
|
406
|
+
No. Pipeline state is persisted in `.scaffold/state.json`. Run `scaffold status` when you come back to see where you left off, or `scaffold next` for what's unblocked.
|
|
407
|
+
|
|
408
|
+
**What if Claude asks me a question I don't know the answer to?**
|
|
409
|
+
Say you're not sure. Claude suggests reasonable defaults and explains the trade-offs. You can revisit decisions later.
|
|
410
|
+
|
|
411
|
+
**Can I use this for an existing project?**
|
|
412
|
+
Yes. Run `scaffold init` — the project detector will identify it as brownfield and suggest the `deep` methodology. Use `scaffold adopt` to bootstrap state from existing artifacts.
|
|
413
|
+
|
|
414
|
+
**How do I customize the knowledge base for my project?**
|
|
415
|
+
Use `scaffold knowledge update <name>` to create a project-local override in `.scaffold/knowledge/`. It layers over the global entry and is committable for team sharing.
|
|
416
|
+
|
|
417
|
+
## Architecture (for contributors)
|
|
418
|
+
|
|
419
|
+
The project is a TypeScript CLI (`@zigrivers/scaffold`) built with yargs, targeting ES2022/Node16 ESM.
|
|
420
|
+
|
|
421
|
+
### Source layout
|
|
422
|
+
|
|
423
|
+
```
|
|
424
|
+
src/
|
|
425
|
+
├── cli/commands/ # 16 CLI command implementations
|
|
426
|
+
├── cli/middleware/ # Project root detection, output mode resolution
|
|
427
|
+
├── cli/output/ # Output strategies (interactive, json, auto)
|
|
428
|
+
├── core/assembly/ # Assembly engine — meta-prompt → full prompt
|
|
429
|
+
├── core/adapters/ # Platform adapters (Claude Code, Codex, Universal)
|
|
430
|
+
├── core/dependency/ # DAG builder, topological sort, eligibility
|
|
431
|
+
├── core/knowledge/ # Knowledge update assembler
|
|
432
|
+
├── state/ # State manager, lock manager, decision logger
|
|
433
|
+
├── config/ # Config loading, migration, schema validation
|
|
434
|
+
├── project/ # Project detector, CLAUDE.md manager, adoption
|
|
435
|
+
├── wizard/ # Init wizard (interactive + --auto)
|
|
436
|
+
├── validation/ # Config, state, frontmatter validators
|
|
437
|
+
├── types/ # TypeScript types and enums
|
|
438
|
+
├── utils/ # FS helpers, errors, levenshtein
|
|
439
|
+
└── dashboard/ # HTML dashboard generator
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
### Key modules
|
|
443
|
+
|
|
444
|
+
- **Assembly engine** (`src/core/assembly/engine.ts`) — Pure orchestrator with no I/O. Constructs 7-section prompts from meta-prompt + knowledge + context + methodology + instructions + depth guidance.
|
|
445
|
+
- **State manager** (`src/state/state-manager.ts`) — Atomic writes via tmp + `fs.renameSync()`. Tracks step status, in-progress records, and next-eligible cache.
|
|
446
|
+
- **Dependency graph** (`src/core/dependency/`) — Kahn's algorithm topological sort with phase-aware ordering and cycle detection.
|
|
447
|
+
- **Platform adapters** (`src/core/adapters/`) — 3-step lifecycle (initialize → generateStepWrapper → finalize) producing Claude Code commands, Codex AGENTS.md, or universal markdown.
|
|
448
|
+
- **Project detector** (`src/project/detector.ts`) — Scans for file system signals to classify projects as greenfield, brownfield, or v1-migration.
|
|
449
|
+
|
|
450
|
+
### Content layout
|
|
451
|
+
|
|
452
|
+
```
|
|
453
|
+
pipeline/ # 36 meta-prompts organized by phase
|
|
454
|
+
knowledge/ # 38 domain expertise entries (core, product, review, validation, finalization)
|
|
455
|
+
methodology/ # 3 YAML presets (deep, mvp, custom)
|
|
456
|
+
commands/ # Generated Claude Code slash commands (from scaffold build)
|
|
457
|
+
skills/ # Claude Code plugin skill definition
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
### Testing
|
|
461
|
+
|
|
462
|
+
- **Vitest** for unit and E2E tests (60 test files)
|
|
463
|
+
- **Performance benchmarks** — assembly p95 < 500ms, state I/O p95 < 100ms, graph build p95 < 2s
|
|
464
|
+
- **Shell script tests** via bats
|
|
465
|
+
- Run: `npm test` (unit + E2E), `npm run test:bench` (benchmarks), `make check` (full CI gate)
|
|
466
|
+
|
|
467
|
+
### Contributing
|
|
468
|
+
|
|
469
|
+
1. Meta-prompt content lives in `pipeline/` — edit the relevant `.md` file
|
|
470
|
+
2. Run `scaffold build` to regenerate `commands/` from pipeline meta-prompts
|
|
471
|
+
3. Run `npm run check` (lint + type-check + test) before submitting
|
|
472
|
+
4. Knowledge entries live in `knowledge/` — follow the existing frontmatter schema
|
|
473
|
+
5. ADRs documenting architectural decisions are in `docs/v2/adrs/` (55 total)
|
|
474
|
+
|
|
475
|
+
## License
|
|
476
|
+
|
|
477
|
+
MIT
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CommandModule } from 'yargs';
|
|
2
|
+
interface AdoptArgs {
|
|
3
|
+
format?: string;
|
|
4
|
+
auto?: boolean;
|
|
5
|
+
verbose?: boolean;
|
|
6
|
+
root?: string;
|
|
7
|
+
force?: boolean;
|
|
8
|
+
'dry-run': boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const adoptCommand: CommandModule<Record<string, unknown>, AdoptArgs>;
|
|
11
|
+
export default adoptCommand;
|
|
12
|
+
//# sourceMappingURL=adopt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adopt.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/adopt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAQ,MAAM,OAAO,CAAA;AAWhD,UAAU,SAAS;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,SAAS,EAAE,OAAO,CAAA;CACnB;AAED,QAAA,MAAM,YAAY,EAAE,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,CAuGnE,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { findProjectRoot } from '../middleware/project-root.js';
|
|
4
|
+
import { resolveOutputMode } from '../middleware/output-mode.js';
|
|
5
|
+
import { createOutputContext } from '../output/context.js';
|
|
6
|
+
import { StateManager } from '../../state/state-manager.js';
|
|
7
|
+
import { acquireLock, releaseLock } from '../../state/lock-manager.js';
|
|
8
|
+
import { discoverMetaPrompts } from '../../core/assembly/meta-prompt-loader.js';
|
|
9
|
+
import { runAdoption } from '../../project/adopt.js';
|
|
10
|
+
const adoptCommand = {
|
|
11
|
+
command: 'adopt',
|
|
12
|
+
describe: 'Adopt an existing project into scaffold',
|
|
13
|
+
builder: (yargs) => {
|
|
14
|
+
return yargs
|
|
15
|
+
.option('root', { type: 'string', describe: 'Project root directory' })
|
|
16
|
+
.option('dry-run', { type: 'boolean', default: false, describe: 'Preview without writing' })
|
|
17
|
+
.option('force', { type: 'boolean', default: false, describe: 'Force adoption even if state exists' })
|
|
18
|
+
.option('format', { type: 'string', describe: 'Output format' })
|
|
19
|
+
.option('auto', { type: 'boolean', default: false, describe: 'Non-interactive' })
|
|
20
|
+
.option('verbose', { type: 'boolean', default: false, describe: 'Verbose output' });
|
|
21
|
+
},
|
|
22
|
+
handler: async (argv) => {
|
|
23
|
+
const projectRoot = argv.root ?? findProjectRoot(process.cwd());
|
|
24
|
+
if (!projectRoot) {
|
|
25
|
+
const output = createOutputContext('auto');
|
|
26
|
+
output.error({ code: 'PROJECT_NOT_INITIALIZED', message: 'No .scaffold/ directory found', exitCode: 1 });
|
|
27
|
+
process.exit(1);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const outputMode = resolveOutputMode(argv);
|
|
31
|
+
const output = createOutputContext(outputMode);
|
|
32
|
+
// Acquire lock
|
|
33
|
+
const lockResult = acquireLock(projectRoot, 'adopt');
|
|
34
|
+
if (!lockResult.acquired) {
|
|
35
|
+
if (lockResult.error)
|
|
36
|
+
output.error(lockResult.error);
|
|
37
|
+
process.exit(3);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
try {
|
|
41
|
+
const dryRun = argv['dry-run'] ?? false;
|
|
42
|
+
const metaPromptDir = path.join(projectRoot, 'pipeline');
|
|
43
|
+
const methodology = 'deep';
|
|
44
|
+
const adoptResult = runAdoption({ projectRoot, metaPromptDir, methodology, dryRun });
|
|
45
|
+
if (!dryRun) {
|
|
46
|
+
const stateFile = path.join(projectRoot, '.scaffold', 'state.json');
|
|
47
|
+
if (!fs.existsSync(stateFile)) {
|
|
48
|
+
// Initialize state
|
|
49
|
+
const metaPrompts = discoverMetaPrompts(metaPromptDir);
|
|
50
|
+
const allSteps = [...metaPrompts.entries()].map(([slug, mp]) => ({
|
|
51
|
+
slug,
|
|
52
|
+
produces: mp.frontmatter.outputs ?? [],
|
|
53
|
+
}));
|
|
54
|
+
const stateManager = new StateManager(projectRoot, () => []);
|
|
55
|
+
stateManager.initializeState({
|
|
56
|
+
enabledSteps: allSteps,
|
|
57
|
+
scaffoldVersion: '2.0.0',
|
|
58
|
+
methodology,
|
|
59
|
+
initMode: adoptResult.mode === 'v1-migration'
|
|
60
|
+
? 'v1-migration'
|
|
61
|
+
: adoptResult.mode === 'brownfield'
|
|
62
|
+
? 'brownfield'
|
|
63
|
+
: 'greenfield',
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
// Update existing state — mark stepsCompleted
|
|
68
|
+
const stateManager = new StateManager(projectRoot, () => []);
|
|
69
|
+
const state = stateManager.loadState();
|
|
70
|
+
const now = new Date().toISOString();
|
|
71
|
+
for (const slug of adoptResult.stepsCompleted) {
|
|
72
|
+
if (state.steps[slug]) {
|
|
73
|
+
state.steps[slug] = {
|
|
74
|
+
...state.steps[slug],
|
|
75
|
+
status: 'completed',
|
|
76
|
+
at: now,
|
|
77
|
+
completed_by: 'scaffold-adopt',
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
stateManager.saveState(state);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
const resultData = {
|
|
85
|
+
mode: adoptResult.mode,
|
|
86
|
+
artifacts_found: adoptResult.artifactsFound,
|
|
87
|
+
steps_completed: adoptResult.stepsCompleted,
|
|
88
|
+
steps_remaining: adoptResult.stepsRemaining,
|
|
89
|
+
methodology: adoptResult.methodology,
|
|
90
|
+
dry_run: dryRun,
|
|
91
|
+
};
|
|
92
|
+
if (outputMode === 'json') {
|
|
93
|
+
output.result(resultData);
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
output.success(`Adoption complete: ${adoptResult.artifactsFound} artifacts found, ` +
|
|
97
|
+
`${adoptResult.stepsCompleted.length} steps completed`);
|
|
98
|
+
}
|
|
99
|
+
process.exit(0);
|
|
100
|
+
}
|
|
101
|
+
finally {
|
|
102
|
+
releaseLock(projectRoot);
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
export default adoptCommand;
|
|
107
|
+
//# sourceMappingURL=adopt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adopt.js","sourceRoot":"","sources":["../../../src/cli/commands/adopt.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adopt.test.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/adopt.test.ts"],"names":[],"mappings":""}
|