@kaddo/cli 2.7.0 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +1 -0
  2. package/dist/index.js +741 -3
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -429,6 +429,7 @@ create --from roadmap → owners → guard → explain`.
429
429
  | v2.6 | Central template registry (23 templates, five categories) |
430
430
  | v2.6 | Demo example repositories, prompt flows and a diagram-first Visual Guide (docs) |
431
431
  | v2.7 | Multirepo hardening: module artifacts from the template registry, module-aware `context`/`explain`, opt-in `guard --workspace` |
432
+ | v2.8 | `kaddo bootstrap` for new projects (Business → Architecture → Codebase → Development); business templates + bootstrap agents |
432
433
 
433
434
  **Optional modules (installed with `kaddo add`):**
434
435
 
package/dist/index.js CHANGED
@@ -2304,6 +2304,171 @@ Save as \`architecture/modules/<module-name>/module-design.md\`.
2304
2304
  - Diagrams are suggested, not generated.
2305
2305
  - Assumptions and risks are explicit.
2306
2306
  `;
2307
+ var BUSINESS_AGENT = `# Business Agent
2308
+
2309
+ ## Role
2310
+
2311
+ You are the Kaddo Business Agent. You help turn an initial idea into a clear business
2312
+ definition for a new project. You do not write code and you do not invent facts \u2014 you ask
2313
+ for missing information and mark unknowns.
2314
+
2315
+ ## When to Use
2316
+
2317
+ Use this agent after \`kaddo bootstrap\`, when refining the artifacts under
2318
+ \`architecture/business/\`.
2319
+
2320
+ ## Input Required
2321
+
2322
+ Provide \`.kaddo/context-pack.md\` (if available) and the founder/team's notes about the
2323
+ idea: problem, intended users, value, constraints.
2324
+
2325
+ ## Expected Output
2326
+
2327
+ Refined Markdown for \`architecture/business/*.md\`: product brief, problem statement,
2328
+ users/personas, value proposition, business rules, constraints and glossary.
2329
+
2330
+ ## Instructions
2331
+
2332
+ 1. Clarify the problem without assuming the solution.
2333
+ 2. Identify primary and secondary users with goals.
2334
+ 3. State the value proposition specifically.
2335
+ 4. Capture business rules as testable statements.
2336
+ 5. List real constraints (business, regulatory, resources).
2337
+ 6. Build a shared glossary.
2338
+ 7. Mark every uncertainty as an assumption or open question.
2339
+
2340
+ ## Constraints
2341
+
2342
+ - Do not invent business facts; ask instead.
2343
+ - Do not write code or choose a stack.
2344
+ - Keep each artifact lightweight and high-value.
2345
+ - Mark assumptions and open questions explicitly.
2346
+
2347
+ ## Output Format
2348
+
2349
+ One Markdown section per \`architecture/business/*.md\` artifact, keeping the template
2350
+ headings.
2351
+
2352
+ ## Where to Save the Result
2353
+
2354
+ Save into \`architecture/business/\` (product-brief.md, problem.md, users.md,
2355
+ value-proposition.md, business-rules.md, constraints.md, glossary.md).
2356
+
2357
+ ## Quality Checklist
2358
+
2359
+ - The problem is stated without assuming the solution.
2360
+ - Users have goals, not just labels.
2361
+ - Rules are testable and free of implementation detail.
2362
+ - Assumptions and open questions are explicit.
2363
+ `;
2364
+ var BOOTSTRAP_AGENT = `# Bootstrap Agent
2365
+
2366
+ ## Role
2367
+
2368
+ You are the Kaddo Bootstrap Agent. You guide the transition from business definition to an
2369
+ initial architecture direction, quality attributes, a roadmap and first Work Items for a
2370
+ new project. You propose; the human decides.
2371
+
2372
+ ## When to Use
2373
+
2374
+ Use this agent after \`kaddo bootstrap\` and after the business artifacts are drafted.
2375
+
2376
+ ## Input Required
2377
+
2378
+ Provide \`.kaddo/context-pack.md\` and the \`architecture/business/*.md\` artifacts.
2379
+
2380
+ ## Expected Output
2381
+
2382
+ Refined Markdown for \`architecture/bootstrap-summary.md\`, \`architecture/capabilities.md\`,
2383
+ \`architecture/quality-attributes.md\` and \`architecture/roadmap.md\`, plus candidate Work
2384
+ Items.
2385
+
2386
+ ## Instructions
2387
+
2388
+ 1. Derive candidate capabilities from the business definition.
2389
+ 2. Propose prioritized quality attributes and accepted trade-offs.
2390
+ 3. Outline an initial architecture direction (no final decisions \u2014 list candidates).
2391
+ 4. Propose a prioritized roadmap of candidate Work Items with suggested Knowledge Levels.
2392
+ 5. Keep a clear next step and open questions.
2393
+
2394
+ ## Constraints
2395
+
2396
+ - Do not call any external service; you run in the human's chat.
2397
+ - Do not decide architecture unilaterally \u2014 mark decisions as candidates (ADR later).
2398
+ - Do not write production code.
2399
+ - Do not invent business facts.
2400
+
2401
+ ## Output Format
2402
+
2403
+ Markdown matching the bootstrap-summary, capabilities, quality-attributes and roadmap
2404
+ templates.
2405
+
2406
+ ## Where to Save the Result
2407
+
2408
+ Save to \`architecture/bootstrap-summary.md\`, \`architecture/capabilities.md\`,
2409
+ \`architecture/quality-attributes.md\` and \`architecture/roadmap.md\`.
2410
+
2411
+ ## Quality Checklist
2412
+
2413
+ - Capabilities trace back to the business definition.
2414
+ - Quality attributes are prioritized, not all "high".
2415
+ - Roadmap candidates are compatible with \`kaddo create --from roadmap\`.
2416
+ - Open questions and assumptions are explicit.
2417
+ `;
2418
+ var CODEBASE_FOUNDATION_AGENT = `# Codebase Foundation Agent
2419
+
2420
+ ## Role
2421
+
2422
+ You are the Kaddo Codebase Foundation Agent. You propose a coherent codebase foundation \u2014
2423
+ structure, modules, boundaries and conventions \u2014 aligned with the business, the initial
2424
+ architecture and the candidate stack. You do **not** write production code.
2425
+
2426
+ ## When to Use
2427
+
2428
+ Use this agent after the business and initial architecture artifacts exist, when refining
2429
+ \`architecture/codebase-foundation.md\`.
2430
+
2431
+ ## Input Required
2432
+
2433
+ Provide \`.kaddo/context-pack.md\`, \`architecture/business/*.md\`,
2434
+ \`architecture/capabilities.md\`, \`architecture/quality-attributes.md\` and
2435
+ \`architecture/stack.md\`.
2436
+
2437
+ ## Expected Output
2438
+
2439
+ Refined Markdown for \`architecture/codebase-foundation.md\`.
2440
+
2441
+ ## Instructions
2442
+
2443
+ 1. Propose a suggested folder/module structure that follows the domain, not a framework
2444
+ default.
2445
+ 2. Define initial boundaries between modules.
2446
+ 3. Recommend conventions (naming, layering, testing expectations).
2447
+ 4. State minimum criteria to start development.
2448
+ 5. Reference the Git strategy rather than restating it.
2449
+
2450
+ ## Constraints
2451
+
2452
+ - Do not write production code or create implementation files.
2453
+ - Do not install or assume a specific framework's scaffolding.
2454
+ - Keep it a foundation, not a full design.
2455
+ - Mark assumptions and open questions explicitly.
2456
+
2457
+ ## Output Format
2458
+
2459
+ Markdown matching the codebase-foundation template headings.
2460
+
2461
+ ## Where to Save the Result
2462
+
2463
+ Save as \`architecture/codebase-foundation.md\`.
2464
+
2465
+ ## Quality Checklist
2466
+
2467
+ - Structure follows business and architecture, not a framework default.
2468
+ - No production code is described.
2469
+ - Minimum criteria to start development are explicit.
2470
+ - Assumptions and open questions are listed.
2471
+ `;
2307
2472
  var AGENT_PROMPTS = [
2308
2473
  { fileName: "capability-agent.md", content: CAPABILITY_AGENT },
2309
2474
  { fileName: "architecture-agent.md", content: ARCHITECTURE_AGENT },
@@ -2315,7 +2480,11 @@ var AGENT_PROMPTS = [
2315
2480
  { fileName: "security-agent.md", content: SECURITY_AGENT },
2316
2481
  { fileName: "standards-agent.md", content: STANDARDS_AGENT },
2317
2482
  { fileName: "stack-agent.md", content: STACK_AGENT },
2318
- { fileName: "module-design-agent.md", content: MODULE_DESIGN_AGENT }
2483
+ { fileName: "module-design-agent.md", content: MODULE_DESIGN_AGENT },
2484
+ // Bootstrap agents (new projects)
2485
+ { fileName: "business-agent.md", content: BUSINESS_AGENT },
2486
+ { fileName: "bootstrap-agent.md", content: BOOTSTRAP_AGENT },
2487
+ { fileName: "codebase-foundation-agent.md", content: CODEBASE_FOUNDATION_AGENT }
2319
2488
  ];
2320
2489
 
2321
2490
  // src/modules/agents.ts
@@ -2338,12 +2507,18 @@ var agentReadme = {
2338
2507
  "",
2339
2508
  "## Recommended order by project state",
2340
2509
  "",
2341
- "- **new** \u2192 roadmap-agent \u2192 architecture-agent",
2510
+ "- **new** \u2192 business-agent \u2192 bootstrap-agent \u2192 codebase-foundation-agent \u2192 roadmap-agent",
2342
2511
  "- **pre-ai** \u2192 capability-agent \u2192 architecture-agent \u2192 roadmap-agent",
2343
2512
  "- **legacy** \u2192 legacy-agent \u2192 architecture-agent \u2192 capability-agent \u2192 roadmap-agent",
2344
2513
  "",
2345
2514
  "## Installed agents",
2346
2515
  "",
2516
+ "### Bootstrap agents (new projects)",
2517
+ "",
2518
+ "- `business-agent.md` \u2014 turn an idea into a business definition.",
2519
+ "- `bootstrap-agent.md` \u2014 go from business to capabilities, quality attributes and roadmap.",
2520
+ "- `codebase-foundation-agent.md` \u2014 propose a codebase foundation (no code).",
2521
+ "",
2347
2522
  "### Understanding agents",
2348
2523
  "",
2349
2524
  "- `capability-agent.md` \u2014 extract/propose system capabilities.",
@@ -6414,6 +6589,356 @@ ${QUALITY}
6414
6589
  - [ ] Candidates state value and risk.
6415
6590
  - [ ] Marked as candidates, not decisions.
6416
6591
  `;
6592
+ var BUSINESS_PRODUCT_BRIEF = `---
6593
+ type: product-brief
6594
+ status: draft
6595
+ ---
6596
+
6597
+ # Product Brief
6598
+
6599
+ > Created by \`kaddo bootstrap\`. Refine with the business-agent. Mark unknowns as TBD.
6600
+
6601
+ ## What is this product?
6602
+
6603
+ TBD
6604
+
6605
+ ## Problem it solves
6606
+
6607
+ TBD
6608
+
6609
+ ## Target users
6610
+
6611
+ TBD
6612
+
6613
+ ## Value proposition
6614
+
6615
+ TBD
6616
+
6617
+ ## Out of scope (for the MVP)
6618
+
6619
+ - TBD
6620
+
6621
+ ## Assumptions
6622
+
6623
+ - ...
6624
+
6625
+ ## Open questions
6626
+
6627
+ - ...
6628
+
6629
+ ${QUALITY}
6630
+
6631
+ - [ ] The product can be described in one paragraph.
6632
+ - [ ] The MVP boundary is explicit.
6633
+ `;
6634
+ var BUSINESS_PROBLEM = `---
6635
+ type: problem
6636
+ status: draft
6637
+ ---
6638
+
6639
+ # Problem Statement
6640
+
6641
+ > Refine with the business-agent. Do not invent facts.
6642
+
6643
+ ## Problem
6644
+
6645
+ TBD
6646
+
6647
+ ## Who has it
6648
+
6649
+ TBD
6650
+
6651
+ ## Why it matters now
6652
+
6653
+ TBD
6654
+
6655
+ ## Current alternatives
6656
+
6657
+ - TBD
6658
+
6659
+ ## Assumptions
6660
+
6661
+ - ...
6662
+
6663
+ ## Open questions
6664
+
6665
+ - ...
6666
+
6667
+ ${QUALITY}
6668
+
6669
+ - [ ] The problem is stated without assuming the solution.
6670
+ - [ ] The affected users are named.
6671
+ `;
6672
+ var BUSINESS_USERS = `---
6673
+ type: users
6674
+ status: draft
6675
+ ---
6676
+
6677
+ # Users & Personas
6678
+
6679
+ > Refine with the business-agent.
6680
+
6681
+ ## Primary users
6682
+
6683
+ - TBD
6684
+
6685
+ ## Secondary users
6686
+
6687
+ - TBD
6688
+
6689
+ ## Needs & goals
6690
+
6691
+ - TBD
6692
+
6693
+ ## Assumptions
6694
+
6695
+ - ...
6696
+
6697
+ ## Open questions
6698
+
6699
+ - ...
6700
+
6701
+ ${QUALITY}
6702
+
6703
+ - [ ] Each persona has a goal, not just a label.
6704
+ - [ ] Primary vs secondary users are distinguished.
6705
+ `;
6706
+ var BUSINESS_VALUE_PROPOSITION = `---
6707
+ type: value-proposition
6708
+ status: draft
6709
+ ---
6710
+
6711
+ # Value Proposition
6712
+
6713
+ > Refine with the business-agent.
6714
+
6715
+ ## For whom
6716
+
6717
+ TBD
6718
+
6719
+ ## What we offer
6720
+
6721
+ TBD
6722
+
6723
+ ## Why it is better / different
6724
+
6725
+ TBD
6726
+
6727
+ ## Assumptions
6728
+
6729
+ - ...
6730
+
6731
+ ## Open questions
6732
+
6733
+ - ...
6734
+
6735
+ ${QUALITY}
6736
+
6737
+ - [ ] The value is specific, not generic.
6738
+ - [ ] It maps to a real user need.
6739
+ `;
6740
+ var BUSINESS_RULES = `---
6741
+ type: business-rules
6742
+ status: draft
6743
+ ---
6744
+
6745
+ # Business Rules
6746
+
6747
+ > Refine with the business-agent. These are product rules, not implementation details.
6748
+
6749
+ ## Core rules
6750
+
6751
+ - TBD
6752
+
6753
+ ## Edge cases
6754
+
6755
+ - TBD
6756
+
6757
+ ## Assumptions
6758
+
6759
+ - ...
6760
+
6761
+ ## Open questions
6762
+
6763
+ - ...
6764
+
6765
+ ${QUALITY}
6766
+
6767
+ - [ ] Rules are testable statements.
6768
+ - [ ] No implementation detail leaks in.
6769
+ `;
6770
+ var BUSINESS_CONSTRAINTS = `---
6771
+ type: constraints
6772
+ status: draft
6773
+ ---
6774
+
6775
+ # Constraints
6776
+
6777
+ > Refine with the business-agent.
6778
+
6779
+ ## Business constraints
6780
+
6781
+ - TBD
6782
+
6783
+ ## Regulatory / compliance
6784
+
6785
+ - TBD
6786
+
6787
+ ## Time / budget / team
6788
+
6789
+ - TBD
6790
+
6791
+ ## Assumptions
6792
+
6793
+ - ...
6794
+
6795
+ ## Open questions
6796
+
6797
+ - ...
6798
+
6799
+ ${QUALITY}
6800
+
6801
+ - [ ] Constraints are real, not aspirational.
6802
+ - [ ] Hard limits are separated from preferences.
6803
+ `;
6804
+ var BUSINESS_GLOSSARY = `---
6805
+ type: glossary
6806
+ status: draft
6807
+ ---
6808
+
6809
+ # Glossary
6810
+
6811
+ > Refine with the business-agent. One shared vocabulary avoids ambiguity.
6812
+
6813
+ | Term | Definition |
6814
+ |---|---|
6815
+ | TBD | TBD |
6816
+
6817
+ ## Open questions
6818
+
6819
+ - ...
6820
+
6821
+ ${QUALITY}
6822
+
6823
+ - [ ] Each term has a single agreed definition.
6824
+ - [ ] Ambiguous terms are flagged.
6825
+ `;
6826
+ var QUALITY_ATTRIBUTES = `---
6827
+ type: quality-attributes
6828
+ status: draft
6829
+ ---
6830
+
6831
+ # Quality Attributes
6832
+
6833
+ > Created by \`kaddo bootstrap\`. Refine with the bootstrap-agent. Prioritize honestly.
6834
+
6835
+ ## What matters most
6836
+
6837
+ - TBD (e.g. reliability, performance, security, maintainability, cost)
6838
+
6839
+ ## Trade-offs accepted
6840
+
6841
+ - TBD
6842
+
6843
+ ## Measurable targets (if known)
6844
+
6845
+ - TBD
6846
+
6847
+ ## Assumptions
6848
+
6849
+ - ...
6850
+
6851
+ ## Open questions
6852
+
6853
+ - ...
6854
+
6855
+ ${QUALITY}
6856
+
6857
+ - [ ] Attributes are prioritized, not all "high".
6858
+ - [ ] Trade-offs are explicit.
6859
+ `;
6860
+ var CODEBASE_FOUNDATION = `---
6861
+ type: codebase-foundation
6862
+ status: draft
6863
+ ---
6864
+
6865
+ # Codebase Foundation
6866
+
6867
+ > Created by \`kaddo bootstrap\`. Refine with the codebase-foundation-agent.
6868
+ > This describes the intended base \u2014 it does **not** generate code.
6869
+
6870
+ ## Suggested structure
6871
+
6872
+ TBD
6873
+
6874
+ ## Initial modules / boundaries
6875
+
6876
+ - TBD
6877
+
6878
+ ## Conventions
6879
+
6880
+ - TBD
6881
+
6882
+ ## Git strategy
6883
+
6884
+ See \`architecture/git-strategy.md\`.
6885
+
6886
+ ## Minimum criteria to start development
6887
+
6888
+ - [ ] TBD
6889
+
6890
+ ## Assumptions
6891
+
6892
+ - ...
6893
+
6894
+ ## Open questions
6895
+
6896
+ - ...
6897
+
6898
+ ${QUALITY}
6899
+
6900
+ - [ ] Structure follows the business and architecture, not a framework default.
6901
+ - [ ] No production code is described here \u2014 only the foundation.
6902
+ `;
6903
+ var BOOTSTRAP_SUMMARY = `---
6904
+ type: bootstrap-summary
6905
+ status: draft
6906
+ ---
6907
+
6908
+ # Bootstrap Summary
6909
+
6910
+ > Created by \`kaddo bootstrap\`. Index of the initial knowledge base and next steps.
6911
+
6912
+ ## Layers
6913
+
6914
+ - **Business** \u2014 \`architecture/business/\`
6915
+ - **Architecture** \u2014 capabilities, quality-attributes, stack, current-state, decisions
6916
+ - **Codebase** \u2014 codebase-foundation, standards, git-strategy
6917
+ - **Development** \u2014 roadmap, work-items
6918
+
6919
+ ## Status
6920
+
6921
+ - [ ] Business defined
6922
+ - [ ] Initial architecture proposed
6923
+ - [ ] Codebase foundation drafted
6924
+ - [ ] Roadmap and first Work Items prepared
6925
+
6926
+ ## Next steps
6927
+
6928
+ 1. Run \`kaddo context\` and \`kaddo add agents\`.
6929
+ 2. Refine the artifacts with the business-agent, bootstrap-agent and
6930
+ codebase-foundation-agent in your LLM.
6931
+ 3. Run \`kaddo create --from roadmap\` to create the first Work Items.
6932
+
6933
+ ## Open questions
6934
+
6935
+ - ...
6936
+
6937
+ ${QUALITY}
6938
+
6939
+ - [ ] Every generated artifact is listed.
6940
+ - [ ] The next step is clear.
6941
+ `;
6417
6942
  var KADDO_TEMPLATES = [
6418
6943
  // core
6419
6944
  {
@@ -6458,6 +6983,84 @@ var KADDO_TEMPLATES = [
6458
6983
  relatedCommand: "kaddo init",
6459
6984
  content: KNOWLEDGE
6460
6985
  },
6986
+ // business (bootstrap)
6987
+ {
6988
+ id: "business-product-brief",
6989
+ name: "Product Brief",
6990
+ category: "business",
6991
+ outputPath: "architecture/business/product-brief.md",
6992
+ description: "The product in one page: problem, users, value, MVP boundary.",
6993
+ whenToUse: "At the start of a new project (kaddo bootstrap).",
6994
+ relatedCommand: "kaddo bootstrap",
6995
+ relatedAgent: "business-agent",
6996
+ content: BUSINESS_PRODUCT_BRIEF
6997
+ },
6998
+ {
6999
+ id: "business-problem",
7000
+ name: "Problem Statement",
7001
+ category: "business",
7002
+ outputPath: "architecture/business/problem.md",
7003
+ description: "The problem the product solves, without assuming the solution.",
7004
+ whenToUse: "When defining a new project (kaddo bootstrap).",
7005
+ relatedCommand: "kaddo bootstrap",
7006
+ relatedAgent: "business-agent",
7007
+ content: BUSINESS_PROBLEM
7008
+ },
7009
+ {
7010
+ id: "business-users",
7011
+ name: "Users & Personas",
7012
+ category: "business",
7013
+ outputPath: "architecture/business/users.md",
7014
+ description: "Primary and secondary users with goals.",
7015
+ whenToUse: "When defining a new project (kaddo bootstrap).",
7016
+ relatedCommand: "kaddo bootstrap",
7017
+ relatedAgent: "business-agent",
7018
+ content: BUSINESS_USERS
7019
+ },
7020
+ {
7021
+ id: "business-value-proposition",
7022
+ name: "Value Proposition",
7023
+ category: "business",
7024
+ outputPath: "architecture/business/value-proposition.md",
7025
+ description: "For whom, what we offer and why it is better.",
7026
+ whenToUse: "When defining a new project (kaddo bootstrap).",
7027
+ relatedCommand: "kaddo bootstrap",
7028
+ relatedAgent: "business-agent",
7029
+ content: BUSINESS_VALUE_PROPOSITION
7030
+ },
7031
+ {
7032
+ id: "business-rules",
7033
+ name: "Business Rules",
7034
+ category: "business",
7035
+ outputPath: "architecture/business/business-rules.md",
7036
+ description: "Product rules as testable statements.",
7037
+ whenToUse: "When defining a new project (kaddo bootstrap).",
7038
+ relatedCommand: "kaddo bootstrap",
7039
+ relatedAgent: "business-agent",
7040
+ content: BUSINESS_RULES
7041
+ },
7042
+ {
7043
+ id: "business-constraints",
7044
+ name: "Business Constraints",
7045
+ category: "business",
7046
+ outputPath: "architecture/business/constraints.md",
7047
+ description: "Business, regulatory and resource constraints.",
7048
+ whenToUse: "When defining a new project (kaddo bootstrap).",
7049
+ relatedCommand: "kaddo bootstrap",
7050
+ relatedAgent: "business-agent",
7051
+ content: BUSINESS_CONSTRAINTS
7052
+ },
7053
+ {
7054
+ id: "business-glossary",
7055
+ name: "Glossary",
7056
+ category: "business",
7057
+ outputPath: "architecture/business/glossary.md",
7058
+ description: "Shared vocabulary for the project.",
7059
+ whenToUse: "When defining a new project (kaddo bootstrap).",
7060
+ relatedCommand: "kaddo bootstrap",
7061
+ relatedAgent: "business-agent",
7062
+ content: BUSINESS_GLOSSARY
7063
+ },
6461
7064
  // architecture
6462
7065
  {
6463
7066
  id: "current-state",
@@ -6488,6 +7091,39 @@ var KADDO_TEMPLATES = [
6488
7091
  relatedAgent: "adr-agent",
6489
7092
  content: DECISION_CANDIDATES
6490
7093
  },
7094
+ {
7095
+ id: "quality-attributes",
7096
+ name: "Quality Attributes",
7097
+ category: "architecture",
7098
+ outputPath: "architecture/quality-attributes.md",
7099
+ description: "Prioritized quality attributes and accepted trade-offs.",
7100
+ whenToUse: "During bootstrap, to record what matters most technically.",
7101
+ relatedCommand: "kaddo bootstrap",
7102
+ relatedAgent: "bootstrap-agent",
7103
+ content: QUALITY_ATTRIBUTES
7104
+ },
7105
+ {
7106
+ id: "codebase-foundation",
7107
+ name: "Codebase Foundation",
7108
+ category: "architecture",
7109
+ outputPath: "architecture/codebase-foundation.md",
7110
+ description: "Intended codebase structure and conventions (no source code).",
7111
+ whenToUse: "During bootstrap, before writing code.",
7112
+ relatedCommand: "kaddo bootstrap",
7113
+ relatedAgent: "codebase-foundation-agent",
7114
+ content: CODEBASE_FOUNDATION
7115
+ },
7116
+ {
7117
+ id: "bootstrap-summary",
7118
+ name: "Bootstrap Summary",
7119
+ category: "architecture",
7120
+ outputPath: "architecture/bootstrap-summary.md",
7121
+ description: "Index of the initial knowledge base and next steps.",
7122
+ whenToUse: "Generated by kaddo bootstrap.",
7123
+ relatedCommand: "kaddo bootstrap",
7124
+ relatedAgent: "bootstrap-agent",
7125
+ content: BOOTSTRAP_SUMMARY
7126
+ },
6491
7127
  {
6492
7128
  id: "adr",
6493
7129
  name: "ADR",
@@ -6872,15 +7508,117 @@ function runModulesList(dir = cwd()) {
6872
7508
  console.log("");
6873
7509
  }
6874
7510
 
7511
+ // src/commands/bootstrap.ts
7512
+ var CONFIG_PATH8 = ".kaddo/config.yml";
7513
+ var TARGETS = [
7514
+ // Business
7515
+ { layer: "Business", path: "architecture/business/product-brief.md", templateId: "business-product-brief" },
7516
+ { layer: "Business", path: "architecture/business/problem.md", templateId: "business-problem" },
7517
+ { layer: "Business", path: "architecture/business/users.md", templateId: "business-users" },
7518
+ { layer: "Business", path: "architecture/business/value-proposition.md", templateId: "business-value-proposition" },
7519
+ { layer: "Business", path: "architecture/business/business-rules.md", templateId: "business-rules" },
7520
+ { layer: "Business", path: "architecture/business/constraints.md", templateId: "business-constraints" },
7521
+ { layer: "Business", path: "architecture/business/glossary.md", templateId: "business-glossary" },
7522
+ // Architecture
7523
+ { layer: "Architecture", path: "architecture/capabilities.md", templateId: "capabilities" },
7524
+ { layer: "Architecture", path: "architecture/quality-attributes.md", templateId: "quality-attributes" },
7525
+ { layer: "Architecture", path: "architecture/stack.md", templateId: "stack" },
7526
+ { layer: "Architecture", path: "architecture/current-state.md", templateId: "current-state" },
7527
+ { layer: "Architecture", path: "architecture/decision-candidates.md", templateId: "decision-candidates" },
7528
+ { layer: "Architecture", path: "architecture/adrs/ADR-0001-initial-architecture.md", templateId: "adr" },
7529
+ // Codebase
7530
+ { layer: "Codebase", path: "architecture/codebase-foundation.md", templateId: "codebase-foundation" },
7531
+ { layer: "Codebase", path: "architecture/standards.md", templateId: "standards" },
7532
+ { layer: "Codebase", path: "architecture/git-strategy.md", templateId: "git-strategy" },
7533
+ // Development
7534
+ { layer: "Development", path: "architecture/roadmap.md", templateId: "roadmap" },
7535
+ { layer: "Development", path: "architecture/bootstrap-summary.md", templateId: "bootstrap-summary" }
7536
+ ];
7537
+ var BOOTSTRAP_LAYERS = ["Business", "Architecture", "Codebase", "Development"];
7538
+ function bootstrap(dir) {
7539
+ const written = [];
7540
+ const skipped = [];
7541
+ for (const target of TARGETS) {
7542
+ const full = join(dir, target.path);
7543
+ if (exists(full)) {
7544
+ skipped.push(target.path);
7545
+ continue;
7546
+ }
7547
+ const tpl = getTemplate(target.templateId);
7548
+ const content = tpl ? tpl.content : "";
7549
+ writeFile(full, content.endsWith("\n") ? content : `${content}
7550
+ `);
7551
+ written.push(target.path);
7552
+ }
7553
+ const workItems = join(dir, "architecture/work-items");
7554
+ if (!exists(workItems)) {
7555
+ ensureDir(workItems);
7556
+ const keep = join(workItems, ".gitkeep");
7557
+ if (!exists(keep)) {
7558
+ writeFile(keep, "");
7559
+ written.push("architecture/work-items/.gitkeep");
7560
+ }
7561
+ }
7562
+ return { written, skipped, layers: BOOTSTRAP_LAYERS };
7563
+ }
7564
+ async function runBootstrap(dir = cwd()) {
7565
+ intro2("kaddo bootstrap");
7566
+ if (!exists(join(dir, CONFIG_PATH8))) {
7567
+ console.error("Kaddo is not initialized in this project.");
7568
+ console.error("Run `kaddo init` first.");
7569
+ process.exit(1);
7570
+ }
7571
+ let state = "unknown";
7572
+ try {
7573
+ const config = loadConfig(dir);
7574
+ state = config?.project.state ?? "unknown";
7575
+ } catch (err) {
7576
+ const message = err instanceof ConfigError ? err.message : String(err);
7577
+ console.error(message);
7578
+ process.exit(1);
7579
+ }
7580
+ log2.info(`Project state: ${state}`);
7581
+ log2.info("Base layers: Business \u2192 Architecture \u2192 Codebase \u2192 Development");
7582
+ if (state !== "new") {
7583
+ log2.warn("This project is not marked as new. Bootstrap is designed for new projects.");
7584
+ const ok = await confirm2({ message: "Continue anyway?", initialValue: false });
7585
+ if (!ok) {
7586
+ outro2("Bootstrap cancelled.");
7587
+ return;
7588
+ }
7589
+ }
7590
+ const result = bootstrap(dir);
7591
+ console.log("");
7592
+ console.log("Bootstrap layers:");
7593
+ for (const layer of result.layers) console.log(` \u2713 ${layer}`);
7594
+ console.log("");
7595
+ if (result.written.length > 0) {
7596
+ console.log("Created:");
7597
+ for (const p2 of result.written) console.log(` - ${p2}`);
7598
+ }
7599
+ if (result.skipped.length > 0) {
7600
+ console.log("");
7601
+ console.log("Kept existing (skipped):");
7602
+ for (const p2 of result.skipped) console.log(` - ${p2}`);
7603
+ }
7604
+ console.log("");
7605
+ outro2(
7606
+ "Knowledge base ready. Run `kaddo context` and `kaddo add agents`, then refine these artifacts with the business-agent, bootstrap-agent and codebase-foundation-agent in your LLM."
7607
+ );
7608
+ }
7609
+
6875
7610
  // src/index.ts
6876
7611
  var program = new Command();
6877
- program.name("kaddo").description("Knowledge Driven Development toolkit").version("2.7.0");
7612
+ program.name("kaddo").description("Knowledge Driven Development toolkit").version("2.8.0");
6878
7613
  program.command("init").description("Initialize Kaddo in the current project").action(async () => {
6879
7614
  await runInit();
6880
7615
  });
6881
7616
  program.command("scan").description("Detect project stack and suggest domains").action(async () => {
6882
7617
  await runScan();
6883
7618
  });
7619
+ program.command("bootstrap").description("Build the initial knowledge base for a new project (Business \u2192 Architecture \u2192 Codebase \u2192 Development)").action(async () => {
7620
+ await runBootstrap();
7621
+ });
6884
7622
  program.command("create [type]").description("Create a work item (feature, bugfix, hotfix, spike). Use --from roadmap to create from a roadmap candidate.").option("--from <source>", "Create from a source artifact (currently: roadmap)").action(async (type, opts) => {
6885
7623
  await runCreate(type ?? "", opts);
6886
7624
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaddo/cli",
3
- "version": "2.7.0",
3
+ "version": "2.8.0",
4
4
  "description": "Knowledge Driven Development toolkit",
5
5
  "license": "MIT",
6
6
  "repository": {