@kaddo/cli 2.8.0 → 3.0.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/README.md +20 -18
- package/dist/index.js +285 -242
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -79,7 +79,7 @@ async function multiselect2(opts) {
|
|
|
79
79
|
|
|
80
80
|
// src/commands/init.ts
|
|
81
81
|
var KADDO_DIR = ".kaddo";
|
|
82
|
-
var ARCH_DIR = "
|
|
82
|
+
var ARCH_DIR = "knowledge";
|
|
83
83
|
function inferProjectName(dir) {
|
|
84
84
|
const pkgPath = join(dir, "package.json");
|
|
85
85
|
if (exists(pkgPath)) {
|
|
@@ -217,13 +217,13 @@ async function runInit() {
|
|
|
217
217
|
};
|
|
218
218
|
const kaddoConfigPath = join(dir, KADDO_DIR, "config.yml");
|
|
219
219
|
writeFile(kaddoConfigPath, buildConfig(meta));
|
|
220
|
-
ensureDir(join(dir, ARCH_DIR, "work-items"));
|
|
220
|
+
ensureDir(join(dir, ARCH_DIR, "delivery", "work-items"));
|
|
221
221
|
writeFile(join(dir, ARCH_DIR, "knowledge.md"), buildKnowledge(projectName.trim()));
|
|
222
|
-
writeFile(join(dir, ARCH_DIR, "roadmap.md"), buildRoadmap(projectName.trim()));
|
|
222
|
+
writeFile(join(dir, ARCH_DIR, "delivery", "roadmap.md"), buildRoadmap(projectName.trim()));
|
|
223
223
|
log2.success("Created .kaddo/config.yml");
|
|
224
|
-
log2.success("Created
|
|
225
|
-
log2.success("Created
|
|
226
|
-
log2.success("Created
|
|
224
|
+
log2.success("Created knowledge/knowledge.md");
|
|
225
|
+
log2.success("Created knowledge/delivery/roadmap.md");
|
|
226
|
+
log2.success("Created knowledge/delivery/work-items/");
|
|
227
227
|
log2.info("Next: run `kaddo scan` to detect your stack.");
|
|
228
228
|
outro2("Kaddo initialized.");
|
|
229
229
|
}
|
|
@@ -669,20 +669,20 @@ async function writeBaselineArtifacts(dir, result) {
|
|
|
669
669
|
const scanJsonPath = join(dir, ".kaddo", "scan.json");
|
|
670
670
|
writeFile(scanJsonPath, serializeBaseline(baseline));
|
|
671
671
|
log2.success("Wrote .kaddo/scan.json");
|
|
672
|
-
const inventoryPath = join(dir, "
|
|
672
|
+
const inventoryPath = join(dir, "knowledge", "inventory.md");
|
|
673
673
|
const inventoryExists = exists(inventoryPath);
|
|
674
674
|
let writeInventory = true;
|
|
675
675
|
if (inventoryExists) {
|
|
676
676
|
writeInventory = await confirm2({
|
|
677
|
-
message: "
|
|
677
|
+
message: "knowledge/inventory.md already exists. Overwrite it?",
|
|
678
678
|
initialValue: true
|
|
679
679
|
});
|
|
680
680
|
}
|
|
681
681
|
if (writeInventory) {
|
|
682
682
|
writeFile(inventoryPath, renderInventory(baseline));
|
|
683
|
-
log2.success(`${inventoryExists ? "Updated" : "Wrote"}
|
|
683
|
+
log2.success(`${inventoryExists ? "Updated" : "Wrote"} knowledge/inventory.md`);
|
|
684
684
|
} else {
|
|
685
|
-
log2.info("Kept existing
|
|
685
|
+
log2.info("Kept existing knowledge/inventory.md.");
|
|
686
686
|
}
|
|
687
687
|
}
|
|
688
688
|
function printStateAwareNextStep(dir) {
|
|
@@ -895,10 +895,10 @@ var adrModule = {
|
|
|
895
895
|
name: "adr",
|
|
896
896
|
description: "Architectural Decision Records \u2014 document decisions when risk justifies it",
|
|
897
897
|
configKey: "module_adr",
|
|
898
|
-
dirs: ["
|
|
898
|
+
dirs: ["knowledge/tech/decisions"],
|
|
899
899
|
files: [
|
|
900
900
|
{
|
|
901
|
-
path: "
|
|
901
|
+
path: "knowledge/tech/decisions/.gitkeep",
|
|
902
902
|
content: ""
|
|
903
903
|
}
|
|
904
904
|
],
|
|
@@ -956,10 +956,10 @@ var incidentModule = {
|
|
|
956
956
|
name: "incident",
|
|
957
957
|
description: "Incident records \u2014 document incidents, learnings, and preventive actions",
|
|
958
958
|
configKey: "module_incident",
|
|
959
|
-
dirs: ["
|
|
959
|
+
dirs: ["knowledge/incidents"],
|
|
960
960
|
files: [
|
|
961
961
|
{
|
|
962
|
-
path: "
|
|
962
|
+
path: "knowledge/incidents/.gitkeep",
|
|
963
963
|
content: ""
|
|
964
964
|
}
|
|
965
965
|
],
|
|
@@ -1018,10 +1018,10 @@ var rfcModule = {
|
|
|
1018
1018
|
name: "rfc",
|
|
1019
1019
|
description: "Request for Comments \u2014 explore relevant changes before building them",
|
|
1020
1020
|
configKey: "module_rfc",
|
|
1021
|
-
dirs: ["
|
|
1021
|
+
dirs: ["knowledge/rfcs"],
|
|
1022
1022
|
files: [
|
|
1023
1023
|
{
|
|
1024
|
-
path: "
|
|
1024
|
+
path: "knowledge/rfcs/.gitkeep",
|
|
1025
1025
|
content: ""
|
|
1026
1026
|
}
|
|
1027
1027
|
],
|
|
@@ -1071,10 +1071,10 @@ var migrationModule = {
|
|
|
1071
1071
|
name: "migration",
|
|
1072
1072
|
description: "Migration records \u2014 data, infra, or technology changes with more rigor",
|
|
1073
1073
|
configKey: "module_migration",
|
|
1074
|
-
dirs: ["
|
|
1074
|
+
dirs: ["knowledge/migrations"],
|
|
1075
1075
|
files: [
|
|
1076
1076
|
{
|
|
1077
|
-
path: "
|
|
1077
|
+
path: "knowledge/migrations/.gitkeep",
|
|
1078
1078
|
content: ""
|
|
1079
1079
|
}
|
|
1080
1080
|
],
|
|
@@ -1132,10 +1132,10 @@ var legacyModule = {
|
|
|
1132
1132
|
name: "legacy",
|
|
1133
1133
|
description: "Legacy records \u2014 document systems with technical debt before modifying them",
|
|
1134
1134
|
configKey: "module_legacy",
|
|
1135
|
-
dirs: ["
|
|
1135
|
+
dirs: ["knowledge/legacy"],
|
|
1136
1136
|
files: [
|
|
1137
1137
|
{
|
|
1138
|
-
path: "
|
|
1138
|
+
path: "knowledge/legacy/.gitkeep",
|
|
1139
1139
|
content: ""
|
|
1140
1140
|
}
|
|
1141
1141
|
],
|
|
@@ -1185,10 +1185,10 @@ var contractsModule = {
|
|
|
1185
1185
|
name: "contracts",
|
|
1186
1186
|
description: "API, event, and integration contracts \u2014 document shared interfaces before changing them",
|
|
1187
1187
|
configKey: "module_contracts",
|
|
1188
|
-
dirs: ["
|
|
1188
|
+
dirs: ["knowledge/contracts"],
|
|
1189
1189
|
files: [
|
|
1190
1190
|
{
|
|
1191
|
-
path: "
|
|
1191
|
+
path: "knowledge/contracts/.gitkeep",
|
|
1192
1192
|
content: ""
|
|
1193
1193
|
}
|
|
1194
1194
|
],
|
|
@@ -1247,10 +1247,10 @@ var capabilitiesModule = {
|
|
|
1247
1247
|
name: "capabilities",
|
|
1248
1248
|
description: "Product capabilities \u2014 map what the product can do and link it to domains and decisions",
|
|
1249
1249
|
configKey: "module_capabilities",
|
|
1250
|
-
dirs: ["
|
|
1250
|
+
dirs: ["knowledge/product/capabilities"],
|
|
1251
1251
|
files: [
|
|
1252
1252
|
{
|
|
1253
|
-
path: "
|
|
1253
|
+
path: "knowledge/product/capabilities/.gitkeep",
|
|
1254
1254
|
content: ""
|
|
1255
1255
|
}
|
|
1256
1256
|
],
|
|
@@ -1301,10 +1301,10 @@ var guardAdvancedModule = {
|
|
|
1301
1301
|
name: "guard-advanced",
|
|
1302
1302
|
description: "Advanced guard rules \u2014 CI blocking, critical artifact protection, domain-level thresholds",
|
|
1303
1303
|
configKey: "module_guard_advanced",
|
|
1304
|
-
dirs: ["
|
|
1304
|
+
dirs: ["knowledge/guard-rules"],
|
|
1305
1305
|
files: [
|
|
1306
1306
|
{
|
|
1307
|
-
path: "
|
|
1307
|
+
path: "knowledge/guard-rules/rules.yml",
|
|
1308
1308
|
content: [
|
|
1309
1309
|
"# Kaddo Guard Advanced \u2014 rules configuration",
|
|
1310
1310
|
"# Uncomment and configure the rules you want to enforce.",
|
|
@@ -1405,7 +1405,7 @@ Optionally provide: README, existing docs, product notes, screenshots, API docum
|
|
|
1405
1405
|
|
|
1406
1406
|
## Expected Output
|
|
1407
1407
|
|
|
1408
|
-
A Markdown artifact intended to be saved as \`
|
|
1408
|
+
A Markdown artifact intended to be saved as \`knowledge/product/capabilities.md\`.
|
|
1409
1409
|
|
|
1410
1410
|
## Instructions
|
|
1411
1411
|
|
|
@@ -1472,7 +1472,7 @@ Generated from Kaddo Context Pack.
|
|
|
1472
1472
|
|
|
1473
1473
|
## Where to Save the Result
|
|
1474
1474
|
|
|
1475
|
-
Save the output as \`
|
|
1475
|
+
Save the output as \`knowledge/product/capabilities.md\`.
|
|
1476
1476
|
|
|
1477
1477
|
## Quality Checklist
|
|
1478
1478
|
|
|
@@ -1507,9 +1507,9 @@ Optionally provide: existing diagrams, infra config, README, dependency manifest
|
|
|
1507
1507
|
|
|
1508
1508
|
Markdown artifacts intended to be saved as:
|
|
1509
1509
|
|
|
1510
|
-
- \`
|
|
1511
|
-
- \`
|
|
1512
|
-
- \`
|
|
1510
|
+
- \`knowledge/tech/current-state.md\`
|
|
1511
|
+
- \`knowledge/tech/architecture-notes.md\`
|
|
1512
|
+
- \`knowledge/tech/decision-candidates.md\`
|
|
1513
1513
|
|
|
1514
1514
|
## Instructions
|
|
1515
1515
|
|
|
@@ -1555,9 +1555,9 @@ Generated from Kaddo Context Pack.
|
|
|
1555
1555
|
|
|
1556
1556
|
## Where to Save the Result
|
|
1557
1557
|
|
|
1558
|
-
Save the architecture overview as \`
|
|
1559
|
-
\`
|
|
1560
|
-
\`
|
|
1558
|
+
Save the architecture overview as \`knowledge/tech/current-state.md\`, supporting notes as
|
|
1559
|
+
\`knowledge/tech/architecture-notes.md\`, and decision candidates as
|
|
1560
|
+
\`knowledge/tech/decision-candidates.md\`.
|
|
1561
1561
|
|
|
1562
1562
|
## Quality Checklist
|
|
1563
1563
|
|
|
@@ -1589,17 +1589,17 @@ Provide \`.kaddo/context-pack.md\` as the primary input.
|
|
|
1589
1589
|
Optionally provide (use whatever is available; mark anything missing as an assumption or
|
|
1590
1590
|
open question):
|
|
1591
1591
|
|
|
1592
|
-
- \`
|
|
1593
|
-
- \`
|
|
1594
|
-
- \`
|
|
1595
|
-
- \`
|
|
1596
|
-
- \`
|
|
1597
|
-
- \`
|
|
1592
|
+
- \`knowledge/product/capabilities.md\`
|
|
1593
|
+
- \`knowledge/tech/current-state.md\`
|
|
1594
|
+
- \`knowledge/legacy/risks.md\`
|
|
1595
|
+
- \`knowledge/legacy/unknowns.md\`
|
|
1596
|
+
- \`knowledge/tech/decision-candidates.md\`
|
|
1597
|
+
- \`knowledge/knowledge.md\`
|
|
1598
1598
|
- business priorities
|
|
1599
1599
|
|
|
1600
1600
|
## Expected Output
|
|
1601
1601
|
|
|
1602
|
-
A single Markdown artifact intended to be saved as \`
|
|
1602
|
+
A single Markdown artifact intended to be saved as \`knowledge/delivery/roadmap.md\`.
|
|
1603
1603
|
|
|
1604
1604
|
This roadmap is the bridge between understanding and execution. It must be structured enough
|
|
1605
1605
|
that a future \`kaddo create --from roadmap\` command can read its candidate work items.
|
|
@@ -1706,7 +1706,7 @@ human review \u2014 not final commitments.
|
|
|
1706
1706
|
|
|
1707
1707
|
## Where to Save the Result
|
|
1708
1708
|
|
|
1709
|
-
Save the output as \`
|
|
1709
|
+
Save the output as \`knowledge/delivery/roadmap.md\`.
|
|
1710
1710
|
|
|
1711
1711
|
## Quality Checklist
|
|
1712
1712
|
|
|
@@ -1744,9 +1744,9 @@ Optionally provide: incident history, known pain points, dependency manifests.
|
|
|
1744
1744
|
|
|
1745
1745
|
Markdown artifacts intended to be saved as:
|
|
1746
1746
|
|
|
1747
|
-
- \`
|
|
1748
|
-
- \`
|
|
1749
|
-
- \`
|
|
1747
|
+
- \`knowledge/legacy/risks.md\`
|
|
1748
|
+
- \`knowledge/legacy/unknowns.md\`
|
|
1749
|
+
- \`knowledge/legacy/modernization-candidates.md\`
|
|
1750
1750
|
|
|
1751
1751
|
## Instructions
|
|
1752
1752
|
|
|
@@ -1796,9 +1796,9 @@ Generated from Kaddo Context Pack.
|
|
|
1796
1796
|
|
|
1797
1797
|
## Where to Save the Result
|
|
1798
1798
|
|
|
1799
|
-
Save risks as \`
|
|
1800
|
-
\`
|
|
1801
|
-
\`
|
|
1799
|
+
Save risks as \`knowledge/legacy/risks.md\`, unknowns as
|
|
1800
|
+
\`knowledge/legacy/unknowns.md\`, and modernization candidates as
|
|
1801
|
+
\`knowledge/legacy/modernization-candidates.md\`.
|
|
1802
1802
|
|
|
1803
1803
|
## Quality Checklist
|
|
1804
1804
|
|
|
@@ -1826,11 +1826,11 @@ to capture decisions that are implicit in the system.
|
|
|
1826
1826
|
|
|
1827
1827
|
Provide \`.kaddo/context-pack.md\` as the primary input.
|
|
1828
1828
|
|
|
1829
|
-
Optionally provide: \`
|
|
1829
|
+
Optionally provide: \`knowledge/tech/current-state.md\`, \`knowledge/tech/architecture-notes.md\`.
|
|
1830
1830
|
|
|
1831
1831
|
## Expected Output
|
|
1832
1832
|
|
|
1833
|
-
A Markdown artifact intended to be saved as \`
|
|
1833
|
+
A Markdown artifact intended to be saved as \`knowledge/tech/decision-candidates.md\`.
|
|
1834
1834
|
|
|
1835
1835
|
## Instructions
|
|
1836
1836
|
|
|
@@ -1876,7 +1876,7 @@ Generated from Kaddo Context Pack.
|
|
|
1876
1876
|
|
|
1877
1877
|
## Where to Save the Result
|
|
1878
1878
|
|
|
1879
|
-
Save the output as \`
|
|
1879
|
+
Save the output as \`knowledge/tech/decision-candidates.md\`.
|
|
1880
1880
|
|
|
1881
1881
|
## Quality Checklist
|
|
1882
1882
|
|
|
@@ -1897,7 +1897,7 @@ Work Item actionable for a human.
|
|
|
1897
1897
|
|
|
1898
1898
|
## When to Use
|
|
1899
1899
|
|
|
1900
|
-
Use this agent after a roadmap exists (\`
|
|
1900
|
+
Use this agent after a roadmap exists (\`knowledge/delivery/roadmap.md\`) or when an existing Work
|
|
1901
1901
|
Item is vague, too large, or missing acceptance criteria.
|
|
1902
1902
|
|
|
1903
1903
|
## Input Required
|
|
@@ -1907,7 +1907,7 @@ existing Work Item file to refine.
|
|
|
1907
1907
|
|
|
1908
1908
|
## Expected Output
|
|
1909
1909
|
|
|
1910
|
-
A refined Work Item intended to be saved as \`
|
|
1910
|
+
A refined Work Item intended to be saved as \`knowledge/delivery/work-items/*.md\`.
|
|
1911
1911
|
|
|
1912
1912
|
## Instructions
|
|
1913
1913
|
|
|
@@ -1948,7 +1948,7 @@ A refined Work Item intended to be saved as \`architecture/work-items/*.md\`.
|
|
|
1948
1948
|
|
|
1949
1949
|
## Where to Save the Result
|
|
1950
1950
|
|
|
1951
|
-
Save the output as a file under \`
|
|
1951
|
+
Save the output as a file under \`knowledge/delivery/work-items/\`.
|
|
1952
1952
|
|
|
1953
1953
|
## Quality Checklist
|
|
1954
1954
|
|
|
@@ -1979,7 +1979,7 @@ structure (from \`.kaddo/config.yml\`) are especially relevant.
|
|
|
1979
1979
|
|
|
1980
1980
|
## Expected Output
|
|
1981
1981
|
|
|
1982
|
-
A Markdown artifact intended to be saved as \`
|
|
1982
|
+
A Markdown artifact intended to be saved as \`knowledge/tech/git-strategy.md\`.
|
|
1983
1983
|
|
|
1984
1984
|
## Instructions
|
|
1985
1985
|
|
|
@@ -2019,7 +2019,7 @@ GitHub Flow + Conventional Commits + SemVer
|
|
|
2019
2019
|
|
|
2020
2020
|
## Where to Save the Result
|
|
2021
2021
|
|
|
2022
|
-
Save the output as \`
|
|
2022
|
+
Save the output as \`knowledge/tech/git-strategy.md\`. Optionally record machine config in
|
|
2023
2023
|
\`.kaddo/git.yml\`.
|
|
2024
2024
|
|
|
2025
2025
|
## Quality Checklist
|
|
@@ -2051,8 +2051,8 @@ module's \`module-design.md\` if it exists.
|
|
|
2051
2051
|
|
|
2052
2052
|
## Expected Output
|
|
2053
2053
|
|
|
2054
|
-
A Markdown artifact intended to be saved as \`
|
|
2055
|
-
\`
|
|
2054
|
+
A Markdown artifact intended to be saved as \`knowledge/tech/security.md\` or
|
|
2055
|
+
\`knowledge/tech/modules/<module-name>/security.md\`.
|
|
2056
2056
|
|
|
2057
2057
|
## Instructions
|
|
2058
2058
|
|
|
@@ -2090,8 +2090,8 @@ A Markdown artifact intended to be saved as \`architecture/security.md\` or
|
|
|
2090
2090
|
|
|
2091
2091
|
## Where to Save the Result
|
|
2092
2092
|
|
|
2093
|
-
Save as \`
|
|
2094
|
-
\`
|
|
2093
|
+
Save as \`knowledge/tech/security.md\` (global) or
|
|
2094
|
+
\`knowledge/tech/modules/<module-name>/security.md\` (per module).
|
|
2095
2095
|
|
|
2096
2096
|
## Quality Checklist
|
|
2097
2097
|
|
|
@@ -2119,8 +2119,8 @@ Provide \`.kaddo/context-pack.md\` as the primary input.
|
|
|
2119
2119
|
|
|
2120
2120
|
## Expected Output
|
|
2121
2121
|
|
|
2122
|
-
A Markdown artifact intended to be saved as \`
|
|
2123
|
-
\`
|
|
2122
|
+
A Markdown artifact intended to be saved as \`knowledge/tech/standards.md\` or
|
|
2123
|
+
\`knowledge/tech/modules/<module-name>/standards.md\`.
|
|
2124
2124
|
|
|
2125
2125
|
## Instructions
|
|
2126
2126
|
|
|
@@ -2152,8 +2152,8 @@ A Markdown artifact intended to be saved as \`architecture/standards.md\` or
|
|
|
2152
2152
|
|
|
2153
2153
|
## Where to Save the Result
|
|
2154
2154
|
|
|
2155
|
-
Save as \`
|
|
2156
|
-
\`
|
|
2155
|
+
Save as \`knowledge/tech/standards.md\` (global) or
|
|
2156
|
+
\`knowledge/tech/modules/<module-name>/standards.md\` (per module).
|
|
2157
2157
|
|
|
2158
2158
|
## Quality Checklist
|
|
2159
2159
|
|
|
@@ -2183,8 +2183,8 @@ especially relevant.
|
|
|
2183
2183
|
|
|
2184
2184
|
## Expected Output
|
|
2185
2185
|
|
|
2186
|
-
A Markdown artifact intended to be saved as \`
|
|
2187
|
-
\`
|
|
2186
|
+
A Markdown artifact intended to be saved as \`knowledge/tech/stack.md\` or
|
|
2187
|
+
\`knowledge/tech/modules/<module-name>/stack.md\`.
|
|
2188
2188
|
|
|
2189
2189
|
## Instructions
|
|
2190
2190
|
|
|
@@ -2220,8 +2220,8 @@ A Markdown artifact intended to be saved as \`architecture/stack.md\` or
|
|
|
2220
2220
|
|
|
2221
2221
|
## Where to Save the Result
|
|
2222
2222
|
|
|
2223
|
-
Save as \`
|
|
2224
|
-
\`
|
|
2223
|
+
Save as \`knowledge/tech/stack.md\` (global) or
|
|
2224
|
+
\`knowledge/tech/modules/<module-name>/stack.md\` (per module).
|
|
2225
2225
|
|
|
2226
2226
|
## Quality Checklist
|
|
2227
2227
|
|
|
@@ -2242,7 +2242,7 @@ mark assumptions.
|
|
|
2242
2242
|
## When to Use
|
|
2243
2243
|
|
|
2244
2244
|
Use this agent after \`kaddo modules map\`, to fill in the generated
|
|
2245
|
-
\`
|
|
2245
|
+
\`knowledge/tech/modules/<module-name>/module-design.md\`.
|
|
2246
2246
|
|
|
2247
2247
|
## Input Required
|
|
2248
2248
|
|
|
@@ -2252,7 +2252,7 @@ Provide \`.kaddo/context-pack.md\` as the primary input, plus the module entry i
|
|
|
2252
2252
|
## Expected Output
|
|
2253
2253
|
|
|
2254
2254
|
A Markdown artifact intended to be saved as
|
|
2255
|
-
\`
|
|
2255
|
+
\`knowledge/tech/modules/<module-name>/module-design.md\`.
|
|
2256
2256
|
|
|
2257
2257
|
## Instructions
|
|
2258
2258
|
|
|
@@ -2295,7 +2295,7 @@ A Markdown artifact intended to be saved as
|
|
|
2295
2295
|
|
|
2296
2296
|
## Where to Save the Result
|
|
2297
2297
|
|
|
2298
|
-
Save as \`
|
|
2298
|
+
Save as \`knowledge/tech/modules/<module-name>/module-design.md\`.
|
|
2299
2299
|
|
|
2300
2300
|
## Quality Checklist
|
|
2301
2301
|
|
|
@@ -2315,7 +2315,7 @@ for missing information and mark unknowns.
|
|
|
2315
2315
|
## When to Use
|
|
2316
2316
|
|
|
2317
2317
|
Use this agent after \`kaddo bootstrap\`, when refining the artifacts under
|
|
2318
|
-
\`
|
|
2318
|
+
\`knowledge/business/\`.
|
|
2319
2319
|
|
|
2320
2320
|
## Input Required
|
|
2321
2321
|
|
|
@@ -2324,7 +2324,7 @@ idea: problem, intended users, value, constraints.
|
|
|
2324
2324
|
|
|
2325
2325
|
## Expected Output
|
|
2326
2326
|
|
|
2327
|
-
Refined Markdown for \`
|
|
2327
|
+
Refined Markdown for \`knowledge/business/*.md\`: product brief, problem statement,
|
|
2328
2328
|
users/personas, value proposition, business rules, constraints and glossary.
|
|
2329
2329
|
|
|
2330
2330
|
## Instructions
|
|
@@ -2346,12 +2346,12 @@ users/personas, value proposition, business rules, constraints and glossary.
|
|
|
2346
2346
|
|
|
2347
2347
|
## Output Format
|
|
2348
2348
|
|
|
2349
|
-
One Markdown section per \`
|
|
2349
|
+
One Markdown section per \`knowledge/business/*.md\` artifact, keeping the template
|
|
2350
2350
|
headings.
|
|
2351
2351
|
|
|
2352
2352
|
## Where to Save the Result
|
|
2353
2353
|
|
|
2354
|
-
Save into \`
|
|
2354
|
+
Save into \`knowledge/business/\` (product-brief.md, problem.md, users.md,
|
|
2355
2355
|
value-proposition.md, business-rules.md, constraints.md, glossary.md).
|
|
2356
2356
|
|
|
2357
2357
|
## Quality Checklist
|
|
@@ -2375,12 +2375,12 @@ Use this agent after \`kaddo bootstrap\` and after the business artifacts are dr
|
|
|
2375
2375
|
|
|
2376
2376
|
## Input Required
|
|
2377
2377
|
|
|
2378
|
-
Provide \`.kaddo/context-pack.md\` and the \`
|
|
2378
|
+
Provide \`.kaddo/context-pack.md\` and the \`knowledge/business/*.md\` artifacts.
|
|
2379
2379
|
|
|
2380
2380
|
## Expected Output
|
|
2381
2381
|
|
|
2382
|
-
Refined Markdown for \`
|
|
2383
|
-
\`
|
|
2382
|
+
Refined Markdown for \`knowledge/bootstrap-summary.md\`, \`knowledge/product/capabilities.md\`,
|
|
2383
|
+
\`knowledge/tech/quality-attributes.md\` and \`knowledge/delivery/roadmap.md\`, plus candidate Work
|
|
2384
2384
|
Items.
|
|
2385
2385
|
|
|
2386
2386
|
## Instructions
|
|
@@ -2405,8 +2405,8 @@ templates.
|
|
|
2405
2405
|
|
|
2406
2406
|
## Where to Save the Result
|
|
2407
2407
|
|
|
2408
|
-
Save to \`
|
|
2409
|
-
\`
|
|
2408
|
+
Save to \`knowledge/bootstrap-summary.md\`, \`knowledge/product/capabilities.md\`,
|
|
2409
|
+
\`knowledge/tech/quality-attributes.md\` and \`knowledge/delivery/roadmap.md\`.
|
|
2410
2410
|
|
|
2411
2411
|
## Quality Checklist
|
|
2412
2412
|
|
|
@@ -2426,17 +2426,17 @@ architecture and the candidate stack. You do **not** write production code.
|
|
|
2426
2426
|
## When to Use
|
|
2427
2427
|
|
|
2428
2428
|
Use this agent after the business and initial architecture artifacts exist, when refining
|
|
2429
|
-
\`
|
|
2429
|
+
\`knowledge/tech/codebase.md\`.
|
|
2430
2430
|
|
|
2431
2431
|
## Input Required
|
|
2432
2432
|
|
|
2433
|
-
Provide \`.kaddo/context-pack.md\`, \`
|
|
2434
|
-
\`
|
|
2435
|
-
\`
|
|
2433
|
+
Provide \`.kaddo/context-pack.md\`, \`knowledge/business/*.md\`,
|
|
2434
|
+
\`knowledge/product/capabilities.md\`, \`knowledge/tech/quality-attributes.md\` and
|
|
2435
|
+
\`knowledge/tech/stack.md\`.
|
|
2436
2436
|
|
|
2437
2437
|
## Expected Output
|
|
2438
2438
|
|
|
2439
|
-
Refined Markdown for \`
|
|
2439
|
+
Refined Markdown for \`knowledge/tech/codebase.md\`.
|
|
2440
2440
|
|
|
2441
2441
|
## Instructions
|
|
2442
2442
|
|
|
@@ -2460,7 +2460,7 @@ Markdown matching the codebase-foundation template headings.
|
|
|
2460
2460
|
|
|
2461
2461
|
## Where to Save the Result
|
|
2462
2462
|
|
|
2463
|
-
Save as \`
|
|
2463
|
+
Save as \`knowledge/tech/codebase.md\`.
|
|
2464
2464
|
|
|
2465
2465
|
## Quality Checklist
|
|
2466
2466
|
|
|
@@ -2484,12 +2484,12 @@ var AGENT_PROMPTS = [
|
|
|
2484
2484
|
// Bootstrap agents (new projects)
|
|
2485
2485
|
{ fileName: "business-agent.md", content: BUSINESS_AGENT },
|
|
2486
2486
|
{ fileName: "bootstrap-agent.md", content: BOOTSTRAP_AGENT },
|
|
2487
|
-
{ fileName: "codebase-
|
|
2487
|
+
{ fileName: "codebase-agent.md", content: CODEBASE_FOUNDATION_AGENT }
|
|
2488
2488
|
];
|
|
2489
2489
|
|
|
2490
2490
|
// src/modules/agents.ts
|
|
2491
2491
|
var agentReadme = {
|
|
2492
|
-
path: "
|
|
2492
|
+
path: "knowledge/agents/README.md",
|
|
2493
2493
|
content: [
|
|
2494
2494
|
"# Agents",
|
|
2495
2495
|
"",
|
|
@@ -2507,7 +2507,7 @@ var agentReadme = {
|
|
|
2507
2507
|
"",
|
|
2508
2508
|
"## Recommended order by project state",
|
|
2509
2509
|
"",
|
|
2510
|
-
"- **new** \u2192 business-agent \u2192 bootstrap-agent \u2192 codebase-
|
|
2510
|
+
"- **new** \u2192 business-agent \u2192 bootstrap-agent \u2192 codebase-agent \u2192 roadmap-agent",
|
|
2511
2511
|
"- **pre-ai** \u2192 capability-agent \u2192 architecture-agent \u2192 roadmap-agent",
|
|
2512
2512
|
"- **legacy** \u2192 legacy-agent \u2192 architecture-agent \u2192 capability-agent \u2192 roadmap-agent",
|
|
2513
2513
|
"",
|
|
@@ -2517,7 +2517,7 @@ var agentReadme = {
|
|
|
2517
2517
|
"",
|
|
2518
2518
|
"- `business-agent.md` \u2014 turn an idea into a business definition.",
|
|
2519
2519
|
"- `bootstrap-agent.md` \u2014 go from business to capabilities, quality attributes and roadmap.",
|
|
2520
|
-
"- `codebase-
|
|
2520
|
+
"- `codebase-agent.md` \u2014 propose a codebase foundation (no code).",
|
|
2521
2521
|
"",
|
|
2522
2522
|
"### Understanding agents",
|
|
2523
2523
|
"",
|
|
@@ -2538,14 +2538,14 @@ var agentReadme = {
|
|
|
2538
2538
|
].join("\n")
|
|
2539
2539
|
};
|
|
2540
2540
|
var agentFiles = AGENT_PROMPTS.map((a) => ({
|
|
2541
|
-
path: `
|
|
2541
|
+
path: `knowledge/agents/${a.fileName}`,
|
|
2542
2542
|
content: a.content
|
|
2543
2543
|
}));
|
|
2544
2544
|
var agentsModule = {
|
|
2545
2545
|
name: "agents",
|
|
2546
2546
|
description: "Agent prompt packs \u2014 Markdown prompts to turn context packs into knowledge in your LLM",
|
|
2547
2547
|
configKey: "module_agents",
|
|
2548
|
-
dirs: ["
|
|
2548
|
+
dirs: ["knowledge/agents"],
|
|
2549
2549
|
files: [agentReadme, ...agentFiles],
|
|
2550
2550
|
workItemTypes: [
|
|
2551
2551
|
{
|
|
@@ -2594,14 +2594,14 @@ var skillsModule = {
|
|
|
2594
2594
|
name: "skills",
|
|
2595
2595
|
description: "Reusable skills \u2014 capabilities shared across agents, teams, or projects",
|
|
2596
2596
|
configKey: "module_skills",
|
|
2597
|
-
dirs: ["
|
|
2597
|
+
dirs: ["knowledge/skills"],
|
|
2598
2598
|
files: [
|
|
2599
2599
|
{
|
|
2600
|
-
path: "
|
|
2600
|
+
path: "knowledge/skills/.gitkeep",
|
|
2601
2601
|
content: ""
|
|
2602
2602
|
},
|
|
2603
2603
|
{
|
|
2604
|
-
path: "
|
|
2604
|
+
path: "knowledge/skills/README.md",
|
|
2605
2605
|
content: [
|
|
2606
2606
|
"# Skills",
|
|
2607
2607
|
"",
|
|
@@ -2814,33 +2814,33 @@ var standardsModule = {
|
|
|
2814
2814
|
name: "standards",
|
|
2815
2815
|
description: "Global standards starter \u2014 lightweight coding, docs and testing conventions",
|
|
2816
2816
|
configKey: "module_standards",
|
|
2817
|
-
dirs: ["
|
|
2818
|
-
files: [{ path: "
|
|
2817
|
+
dirs: ["knowledge"],
|
|
2818
|
+
files: [{ path: "knowledge/tech/standards.md", content: standardsTemplate }],
|
|
2819
2819
|
workItemTypes: []
|
|
2820
2820
|
};
|
|
2821
2821
|
var securityModule = {
|
|
2822
2822
|
name: "security",
|
|
2823
2823
|
description: "Global security starter \u2014 document security considerations (no scanning)",
|
|
2824
2824
|
configKey: "module_security",
|
|
2825
|
-
dirs: ["
|
|
2826
|
-
files: [{ path: "
|
|
2825
|
+
dirs: ["knowledge"],
|
|
2826
|
+
files: [{ path: "knowledge/tech/security.md", content: securityTemplate }],
|
|
2827
2827
|
workItemTypes: []
|
|
2828
2828
|
};
|
|
2829
2829
|
var stackModule = {
|
|
2830
2830
|
name: "stack",
|
|
2831
2831
|
description: "Global stack starter \u2014 document technologies and stack decisions",
|
|
2832
2832
|
configKey: "module_stack",
|
|
2833
|
-
dirs: ["
|
|
2834
|
-
files: [{ path: "
|
|
2833
|
+
dirs: ["knowledge"],
|
|
2834
|
+
files: [{ path: "knowledge/tech/stack.md", content: stackTemplate }],
|
|
2835
2835
|
workItemTypes: []
|
|
2836
2836
|
};
|
|
2837
2837
|
var gitStrategyModule = {
|
|
2838
2838
|
name: "git-strategy",
|
|
2839
2839
|
description: "Git strategy starter \u2014 default GitHub Flow + Conventional Commits + SemVer",
|
|
2840
2840
|
configKey: "module_git_strategy",
|
|
2841
|
-
dirs: ["
|
|
2841
|
+
dirs: ["knowledge"],
|
|
2842
2842
|
files: [
|
|
2843
|
-
{ path: "
|
|
2843
|
+
{ path: "knowledge/tech/git-strategy.md", content: gitStrategyTemplate },
|
|
2844
2844
|
{ path: ".kaddo/git.yml", content: gitYml }
|
|
2845
2845
|
],
|
|
2846
2846
|
workItemTypes: []
|
|
@@ -2996,8 +2996,8 @@ function parseRoadmapCandidates(markdown) {
|
|
|
2996
2996
|
}
|
|
2997
2997
|
|
|
2998
2998
|
// src/commands/create.ts
|
|
2999
|
-
var WORK_ITEMS_DIR = "
|
|
3000
|
-
var ROADMAP_PATH = "
|
|
2999
|
+
var WORK_ITEMS_DIR = "knowledge/delivery/work-items";
|
|
3000
|
+
var ROADMAP_PATH = "knowledge/delivery/roadmap.md";
|
|
3001
3001
|
function printStateGuidance(dir) {
|
|
3002
3002
|
let config;
|
|
3003
3003
|
try {
|
|
@@ -3618,7 +3618,7 @@ function toStringArray(value) {
|
|
|
3618
3618
|
return Array.isArray(value) ? value.map((v) => String(v)).filter(Boolean) : [];
|
|
3619
3619
|
}
|
|
3620
3620
|
function moduleArtifactCoverage(dir, id) {
|
|
3621
|
-
const base = join(dir, "
|
|
3621
|
+
const base = join(dir, "knowledge", "tech", "modules", id);
|
|
3622
3622
|
return {
|
|
3623
3623
|
moduleDesign: exists(join(base, "module-design.md")),
|
|
3624
3624
|
stack: exists(join(base, "stack.md")),
|
|
@@ -3909,7 +3909,7 @@ function collectMatchedDomains(matchedArtifactDomains) {
|
|
|
3909
3909
|
}
|
|
3910
3910
|
|
|
3911
3911
|
// src/commands/guard.ts
|
|
3912
|
-
var ARCH_DIR2 = "
|
|
3912
|
+
var ARCH_DIR2 = "knowledge";
|
|
3913
3913
|
var CONFIG_PATH2 = ".kaddo/config.yml";
|
|
3914
3914
|
function loadConfig2(dir) {
|
|
3915
3915
|
const configPath = join(dir, CONFIG_PATH2);
|
|
@@ -4055,7 +4055,7 @@ async function runGuard(opts = {}) {
|
|
|
4055
4055
|
}
|
|
4056
4056
|
const archDir = join(dir, ARCH_DIR2);
|
|
4057
4057
|
if (!exists(archDir)) {
|
|
4058
|
-
console.log("kaddo guard: no
|
|
4058
|
+
console.log("kaddo guard: no knowledge/ directory found. Run `kaddo init` first.");
|
|
4059
4059
|
return;
|
|
4060
4060
|
}
|
|
4061
4061
|
const artifacts = readArtifacts(archDir);
|
|
@@ -4170,8 +4170,60 @@ function runIgnoreRemove(artifactId) {
|
|
|
4170
4170
|
import matter2 from "gray-matter";
|
|
4171
4171
|
import { parse as parseYaml8 } from "yaml";
|
|
4172
4172
|
|
|
4173
|
+
// src/core/layers.ts
|
|
4174
|
+
var KNOWLEDGE = "knowledge";
|
|
4175
|
+
var LAYER_SPEC = [
|
|
4176
|
+
{
|
|
4177
|
+
layer: "Business",
|
|
4178
|
+
items: [
|
|
4179
|
+
{ name: "problem", path: `${KNOWLEDGE}/business/problem.md` },
|
|
4180
|
+
{ name: "users", path: `${KNOWLEDGE}/business/users.md` },
|
|
4181
|
+
{ name: "value-proposition", path: `${KNOWLEDGE}/business/value-proposition.md` },
|
|
4182
|
+
{ name: "constraints", path: `${KNOWLEDGE}/business/constraints.md` },
|
|
4183
|
+
{ name: "business-rules", path: `${KNOWLEDGE}/business/business-rules.md` }
|
|
4184
|
+
]
|
|
4185
|
+
},
|
|
4186
|
+
{
|
|
4187
|
+
layer: "Product",
|
|
4188
|
+
items: [
|
|
4189
|
+
{ name: "product brief", path: `${KNOWLEDGE}/product/product-brief.md` },
|
|
4190
|
+
{ name: "capabilities", path: `${KNOWLEDGE}/product/capabilities.md` }
|
|
4191
|
+
]
|
|
4192
|
+
},
|
|
4193
|
+
{
|
|
4194
|
+
layer: "Tech",
|
|
4195
|
+
items: [
|
|
4196
|
+
{ name: "codebase", path: `${KNOWLEDGE}/tech/codebase.md` },
|
|
4197
|
+
{ name: "current-state", path: `${KNOWLEDGE}/tech/current-state.md` },
|
|
4198
|
+
{ name: "decisions", path: `${KNOWLEDGE}/tech/decisions` }
|
|
4199
|
+
]
|
|
4200
|
+
},
|
|
4201
|
+
{
|
|
4202
|
+
layer: "Delivery",
|
|
4203
|
+
items: [
|
|
4204
|
+
{ name: "roadmap", path: `${KNOWLEDGE}/delivery/roadmap.md` },
|
|
4205
|
+
{ name: "work items", path: `${KNOWLEDGE}/delivery/work-items` }
|
|
4206
|
+
]
|
|
4207
|
+
}
|
|
4208
|
+
];
|
|
4209
|
+
function knowledgeLayers(dir) {
|
|
4210
|
+
return LAYER_SPEC.map(({ layer, items }) => ({
|
|
4211
|
+
layer,
|
|
4212
|
+
items: items.map((it) => ({ name: it.name, present: exists(join(dir, it.path)) }))
|
|
4213
|
+
}));
|
|
4214
|
+
}
|
|
4215
|
+
function renderLayersMarkdown(layers) {
|
|
4216
|
+
const lines = [];
|
|
4217
|
+
for (const { layer, items } of layers) {
|
|
4218
|
+
lines.push(`### ${layer}`);
|
|
4219
|
+
for (const it of items) lines.push(`- ${it.present ? "\u2713" : "\u2717"} ${it.name}`);
|
|
4220
|
+
lines.push("");
|
|
4221
|
+
}
|
|
4222
|
+
return lines.join("\n").trimEnd();
|
|
4223
|
+
}
|
|
4224
|
+
|
|
4173
4225
|
// src/core/project-explain.ts
|
|
4174
|
-
var ARCH_DIR3 = "
|
|
4226
|
+
var ARCH_DIR3 = "knowledge";
|
|
4175
4227
|
function first(values) {
|
|
4176
4228
|
if (Array.isArray(values)) {
|
|
4177
4229
|
const v = values.find((x) => typeof x === "string" && x);
|
|
@@ -4229,9 +4281,9 @@ function buildProjectExplanation(dir) {
|
|
|
4229
4281
|
hasInventory: exists(join(dir, ARCH_DIR3, "inventory.md")),
|
|
4230
4282
|
hasContextPack: exists(join(dir, ".kaddo", "context-pack.md")),
|
|
4231
4283
|
hasUnderstand: exists(join(dir, ".kaddo", "understand.md")),
|
|
4232
|
-
hasCapabilities: exists(join(dir, ARCH_DIR3, "capabilities.md")),
|
|
4233
|
-
hasArchitecture: exists(join(dir, ARCH_DIR3, "current-state.md")),
|
|
4234
|
-
hasRoadmap: exists(join(dir, ARCH_DIR3, "roadmap.md")),
|
|
4284
|
+
hasCapabilities: exists(join(dir, ARCH_DIR3, "product", "capabilities.md")),
|
|
4285
|
+
hasArchitecture: exists(join(dir, ARCH_DIR3, "tech", "current-state.md")),
|
|
4286
|
+
hasRoadmap: exists(join(dir, ARCH_DIR3, "delivery", "roadmap.md")),
|
|
4235
4287
|
hasAgents: hasAgents(dir)
|
|
4236
4288
|
};
|
|
4237
4289
|
const archDir = join(dir, ARCH_DIR3);
|
|
@@ -4265,14 +4317,14 @@ function buildProjectExplanation(dir) {
|
|
|
4265
4317
|
const missingKnowledge = [];
|
|
4266
4318
|
if (!knowledge.hasScan) missingKnowledge.push("Scan baseline (.kaddo/scan.json)");
|
|
4267
4319
|
if (!knowledge.hasContextPack) missingKnowledge.push("Context pack (.kaddo/context-pack.md)");
|
|
4268
|
-
if (!knowledge.hasInventory) missingKnowledge.push("Inventory (
|
|
4320
|
+
if (!knowledge.hasInventory) missingKnowledge.push("Inventory (knowledge/inventory.md)");
|
|
4269
4321
|
if (!knowledge.hasCapabilities)
|
|
4270
|
-
missingKnowledge.push("Capabilities (
|
|
4322
|
+
missingKnowledge.push("Capabilities (knowledge/product/capabilities.md)");
|
|
4271
4323
|
if (!knowledge.hasArchitecture)
|
|
4272
|
-
missingKnowledge.push("Architecture baseline (
|
|
4273
|
-
if (!knowledge.hasRoadmap) missingKnowledge.push("Roadmap (
|
|
4274
|
-
if (!knowledge.hasAgents) missingKnowledge.push("Agents (
|
|
4275
|
-
if (items.length === 0) missingKnowledge.push("Work items (
|
|
4324
|
+
missingKnowledge.push("Architecture baseline (knowledge/tech/current-state.md)");
|
|
4325
|
+
if (!knowledge.hasRoadmap) missingKnowledge.push("Roadmap (knowledge/delivery/roadmap.md)");
|
|
4326
|
+
if (!knowledge.hasAgents) missingKnowledge.push("Agents (knowledge/agents/)");
|
|
4327
|
+
if (items.length === 0) missingKnowledge.push("Work items (knowledge/delivery/work-items/)");
|
|
4276
4328
|
const suggestedNextSteps = [];
|
|
4277
4329
|
if (!knowledge.hasScan) {
|
|
4278
4330
|
suggestedNextSteps.push("Run `kaddo scan` to detect the technical stack.");
|
|
@@ -4283,13 +4335,13 @@ function buildProjectExplanation(dir) {
|
|
|
4283
4335
|
suggestedNextSteps.push("Run `kaddo add agents` to install knowledge agents.");
|
|
4284
4336
|
}
|
|
4285
4337
|
if (!knowledge.hasCapabilities) {
|
|
4286
|
-
suggestedNextSteps.push("Use capability-agent to generate
|
|
4338
|
+
suggestedNextSteps.push("Use capability-agent to generate knowledge/product/capabilities.md.");
|
|
4287
4339
|
}
|
|
4288
4340
|
if (!knowledge.hasArchitecture) {
|
|
4289
|
-
suggestedNextSteps.push("Use architecture-agent to generate
|
|
4341
|
+
suggestedNextSteps.push("Use architecture-agent to generate knowledge/tech/current-state.md.");
|
|
4290
4342
|
}
|
|
4291
4343
|
if (!knowledge.hasRoadmap) {
|
|
4292
|
-
suggestedNextSteps.push("Use roadmap-agent to generate
|
|
4344
|
+
suggestedNextSteps.push("Use roadmap-agent to generate knowledge/delivery/roadmap.md.");
|
|
4293
4345
|
}
|
|
4294
4346
|
if (items.length === 0) {
|
|
4295
4347
|
suggestedNextSteps.push("Create your first Work Item with `kaddo create`.");
|
|
@@ -4305,6 +4357,7 @@ function buildProjectExplanation(dir) {
|
|
|
4305
4357
|
workItems,
|
|
4306
4358
|
ownership,
|
|
4307
4359
|
domains,
|
|
4360
|
+
layers: knowledgeLayers(dir),
|
|
4308
4361
|
mappedModules,
|
|
4309
4362
|
missingKnowledge,
|
|
4310
4363
|
suggestedNextSteps
|
|
@@ -4323,6 +4376,9 @@ function renderExplanationHuman(exp) {
|
|
|
4323
4376
|
lines.push(`- Team: ${exp.project.teamSize}`);
|
|
4324
4377
|
lines.push(`- Structure: ${exp.project.structure}`);
|
|
4325
4378
|
lines.push("");
|
|
4379
|
+
lines.push("## Knowledge Layers");
|
|
4380
|
+
lines.push(renderLayersMarkdown(exp.layers));
|
|
4381
|
+
lines.push("");
|
|
4326
4382
|
if (exp.stack) {
|
|
4327
4383
|
lines.push("## Detected Stack");
|
|
4328
4384
|
if (exp.stack.language) lines.push(`- Language: ${exp.stack.language}`);
|
|
@@ -4400,7 +4456,7 @@ function renderExplanationAgent(exp) {
|
|
|
4400
4456
|
}
|
|
4401
4457
|
|
|
4402
4458
|
// src/commands/explain.ts
|
|
4403
|
-
var ARCH_DIR4 = "
|
|
4459
|
+
var ARCH_DIR4 = "knowledge";
|
|
4404
4460
|
var CONFIG_PATH3 = ".kaddo/config.yml";
|
|
4405
4461
|
function readKnowledge(dir) {
|
|
4406
4462
|
const knowledgePath = join(dir, ARCH_DIR4, "knowledge.md");
|
|
@@ -4565,7 +4621,7 @@ function runExplain(opts) {
|
|
|
4565
4621
|
}
|
|
4566
4622
|
const archDir = join(dir, ARCH_DIR4);
|
|
4567
4623
|
if (!exists(archDir)) {
|
|
4568
|
-
console.error("No
|
|
4624
|
+
console.error("No knowledge/ directory found. Run `kaddo init` first.");
|
|
4569
4625
|
process.exit(1);
|
|
4570
4626
|
}
|
|
4571
4627
|
let artifacts = readArtifacts(archDir);
|
|
@@ -4588,7 +4644,7 @@ function runExplain(opts) {
|
|
|
4588
4644
|
// src/core/context-pack.ts
|
|
4589
4645
|
import matter3 from "gray-matter";
|
|
4590
4646
|
var CONTEXT_PACK_VERSION = "1";
|
|
4591
|
-
var ARCH_DIR5 = "
|
|
4647
|
+
var ARCH_DIR5 = "knowledge";
|
|
4592
4648
|
function readScanJson(dir) {
|
|
4593
4649
|
const scanPath = join(dir, ".kaddo", "scan.json");
|
|
4594
4650
|
if (!exists(scanPath)) return null;
|
|
@@ -4679,7 +4735,7 @@ function buildContextPack(dir, config, now = /* @__PURE__ */ new Date()) {
|
|
|
4679
4735
|
if (!knowledgeSummary) {
|
|
4680
4736
|
missing.push("No project knowledge summary found yet.");
|
|
4681
4737
|
}
|
|
4682
|
-
const roadmapSummary = readMarkdownSummary(dir, "roadmap.md") ?? "";
|
|
4738
|
+
const roadmapSummary = readMarkdownSummary(dir, "delivery/roadmap.md") ?? "";
|
|
4683
4739
|
if (!roadmapSummary) {
|
|
4684
4740
|
missing.push("No roadmap baseline found.");
|
|
4685
4741
|
}
|
|
@@ -4693,6 +4749,7 @@ function buildContextPack(dir, config, now = /* @__PURE__ */ new Date()) {
|
|
|
4693
4749
|
}
|
|
4694
4750
|
const state = config.project.state;
|
|
4695
4751
|
const mappedModules = loadMappedModules(dir);
|
|
4752
|
+
const layers = knowledgeLayers(dir);
|
|
4696
4753
|
return {
|
|
4697
4754
|
version: CONTEXT_PACK_VERSION,
|
|
4698
4755
|
generatedAt: now.toISOString(),
|
|
@@ -4719,6 +4776,7 @@ function buildContextPack(dir, config, now = /* @__PURE__ */ new Date()) {
|
|
|
4719
4776
|
workItems: workItems.map(toContextWorkItem),
|
|
4720
4777
|
artifacts: workItems.filter((a) => a.codeGlobs.length > 0).map(toContextArtifact)
|
|
4721
4778
|
},
|
|
4779
|
+
layers,
|
|
4722
4780
|
mappedModules,
|
|
4723
4781
|
missing,
|
|
4724
4782
|
handoff: {
|
|
@@ -4752,6 +4810,11 @@ function renderContextPack(pack) {
|
|
|
4752
4810
|
`- Structure: ${project.structure}`
|
|
4753
4811
|
].join("\n") + "\n"
|
|
4754
4812
|
);
|
|
4813
|
+
parts.push("## Knowledge Layers\n");
|
|
4814
|
+
parts.push(
|
|
4815
|
+
"Project knowledge is organized in four layers: **Business \u2192 Product \u2192 Tech \u2192 Delivery**.\n"
|
|
4816
|
+
);
|
|
4817
|
+
parts.push(renderLayersMarkdown(pack.layers) + "\n");
|
|
4755
4818
|
parts.push("## Technical Inventory\n");
|
|
4756
4819
|
if (scan2.available) {
|
|
4757
4820
|
const lines = [
|
|
@@ -4881,22 +4944,22 @@ function flowForState(state) {
|
|
|
4881
4944
|
switch (state) {
|
|
4882
4945
|
case "new":
|
|
4883
4946
|
return [
|
|
4884
|
-
{ agent: "roadmap-agent.md", output: "
|
|
4885
|
-
{ agent: "architecture-agent.md", output: "
|
|
4947
|
+
{ agent: "roadmap-agent.md", output: "knowledge/delivery/roadmap.md" },
|
|
4948
|
+
{ agent: "architecture-agent.md", output: "knowledge/tech/current-state.md" }
|
|
4886
4949
|
];
|
|
4887
4950
|
case "legacy":
|
|
4888
4951
|
return [
|
|
4889
|
-
{ agent: "legacy-agent.md", output: "
|
|
4890
|
-
{ agent: "architecture-agent.md", output: "
|
|
4891
|
-
{ agent: "capability-agent.md", output: "
|
|
4892
|
-
{ agent: "roadmap-agent.md", output: "
|
|
4952
|
+
{ agent: "legacy-agent.md", output: "knowledge/legacy/risks.md" },
|
|
4953
|
+
{ agent: "architecture-agent.md", output: "knowledge/tech/current-state.md" },
|
|
4954
|
+
{ agent: "capability-agent.md", output: "knowledge/product/capabilities.md" },
|
|
4955
|
+
{ agent: "roadmap-agent.md", output: "knowledge/delivery/roadmap.md" }
|
|
4893
4956
|
];
|
|
4894
4957
|
case "pre-ai":
|
|
4895
4958
|
default:
|
|
4896
4959
|
return [
|
|
4897
|
-
{ agent: "capability-agent.md", output: "
|
|
4898
|
-
{ agent: "architecture-agent.md", output: "
|
|
4899
|
-
{ agent: "roadmap-agent.md", output: "
|
|
4960
|
+
{ agent: "capability-agent.md", output: "knowledge/product/capabilities.md" },
|
|
4961
|
+
{ agent: "architecture-agent.md", output: "knowledge/tech/current-state.md" },
|
|
4962
|
+
{ agent: "roadmap-agent.md", output: "knowledge/delivery/roadmap.md" }
|
|
4900
4963
|
];
|
|
4901
4964
|
}
|
|
4902
4965
|
}
|
|
@@ -4904,11 +4967,11 @@ function buildUnderstandPlan(dir, config) {
|
|
|
4904
4967
|
const state = config.project.state;
|
|
4905
4968
|
const flow = flowForState(state);
|
|
4906
4969
|
const steps = flow.map((s) => {
|
|
4907
|
-
const installed = exists(join(dir, "
|
|
4970
|
+
const installed = exists(join(dir, "knowledge", "agents", s.agent));
|
|
4908
4971
|
return { agent: s.agent, output: s.output, installed };
|
|
4909
4972
|
});
|
|
4910
4973
|
const missingAgents = steps.filter((s) => !s.installed).map((s) => s.agent);
|
|
4911
|
-
const agentsInstalled = exists(join(dir, "
|
|
4974
|
+
const agentsInstalled = exists(join(dir, "knowledge", "agents")) && missingAgents.length === 0;
|
|
4912
4975
|
return {
|
|
4913
4976
|
project: {
|
|
4914
4977
|
name: config.project.name,
|
|
@@ -4962,7 +5025,7 @@ function renderUnderstand(plan) {
|
|
|
4962
5025
|
`);
|
|
4963
5026
|
parts.push("## Agent Prompts\n");
|
|
4964
5027
|
parts.push(
|
|
4965
|
-
steps.map((s) => `- \`
|
|
5028
|
+
steps.map((s) => `- \`knowledge/agents/${s.agent}\``).join("\n") + "\n"
|
|
4966
5029
|
);
|
|
4967
5030
|
parts.push("## Expected Outputs\n");
|
|
4968
5031
|
parts.push(steps.map((s) => `- \`${s.output}\``).join("\n") + "\n");
|
|
@@ -4975,7 +5038,7 @@ function renderUnderstand(plan) {
|
|
|
4975
5038
|
"",
|
|
4976
5039
|
"1. Open your preferred LLM chat (Claude, ChatGPT, Cursor, Copilot, Windsurf\u2026).",
|
|
4977
5040
|
`2. Paste the context pack: \`${plan.contextPackPath}\``,
|
|
4978
|
-
`3. Paste the agent prompt: \`
|
|
5041
|
+
`3. Paste the agent prompt: \`knowledge/agents/${first2.agent}\``,
|
|
4979
5042
|
`4. Ask the LLM to produce: \`${first2.output}\``,
|
|
4980
5043
|
`5. Save the result in: \`${first2.output}\``
|
|
4981
5044
|
].join("\n") + "\n"
|
|
@@ -5014,7 +5077,7 @@ function renderUnderstandTerminal(plan) {
|
|
|
5014
5077
|
lines.push(`First step: use ${agentName(first2.agent)}.`);
|
|
5015
5078
|
lines.push("");
|
|
5016
5079
|
lines.push(` Context: ${plan.contextPackPath}`);
|
|
5017
|
-
lines.push(` Agent prompt:
|
|
5080
|
+
lines.push(` Agent prompt: knowledge/agents/${first2.agent}`);
|
|
5018
5081
|
lines.push(` Expected output: ${first2.output}`);
|
|
5019
5082
|
lines.push("");
|
|
5020
5083
|
}
|
|
@@ -5215,7 +5278,7 @@ function classify(declaredType, declaredLevel, touchedFiles) {
|
|
|
5215
5278
|
}
|
|
5216
5279
|
|
|
5217
5280
|
// src/commands/classify.ts
|
|
5218
|
-
var ARCH_DIR6 = "
|
|
5281
|
+
var ARCH_DIR6 = "knowledge";
|
|
5219
5282
|
function findActiveWorkItem(dir) {
|
|
5220
5283
|
const archDir = join(dir, ARCH_DIR6);
|
|
5221
5284
|
if (!exists(archDir)) return null;
|
|
@@ -5283,7 +5346,7 @@ async function runClassify(opts = {}) {
|
|
|
5283
5346
|
|
|
5284
5347
|
// src/commands/status.ts
|
|
5285
5348
|
import { parse as parseYaml9 } from "yaml";
|
|
5286
|
-
var ARCH_DIR7 = "
|
|
5349
|
+
var ARCH_DIR7 = "knowledge";
|
|
5287
5350
|
var CONFIG_PATH4 = ".kaddo/config.yml";
|
|
5288
5351
|
function loadConfig3(dir) {
|
|
5289
5352
|
const p2 = join(dir, CONFIG_PATH4);
|
|
@@ -5297,7 +5360,7 @@ function loadConfig3(dir) {
|
|
|
5297
5360
|
function runStatus() {
|
|
5298
5361
|
const dir = cwd();
|
|
5299
5362
|
if (!exists(join(dir, ARCH_DIR7))) {
|
|
5300
|
-
console.error("No
|
|
5363
|
+
console.error("No knowledge/ directory found. Run `kaddo init` first.");
|
|
5301
5364
|
process.exit(1);
|
|
5302
5365
|
}
|
|
5303
5366
|
const config = loadConfig3(dir);
|
|
@@ -5347,8 +5410,8 @@ function runStatus() {
|
|
|
5347
5410
|
|
|
5348
5411
|
// src/commands/learn.ts
|
|
5349
5412
|
import matter4 from "gray-matter";
|
|
5350
|
-
var ARCH_DIR8 = "
|
|
5351
|
-
var WORK_ITEMS_DIR2 = "
|
|
5413
|
+
var ARCH_DIR8 = "knowledge";
|
|
5414
|
+
var WORK_ITEMS_DIR2 = "knowledge/delivery/work-items";
|
|
5352
5415
|
function findWorkItemFile(dir, id) {
|
|
5353
5416
|
const wiDir = join(dir, WORK_ITEMS_DIR2);
|
|
5354
5417
|
if (!exists(wiDir)) return null;
|
|
@@ -5389,7 +5452,7 @@ ${learning.trim()}
|
|
|
5389
5452
|
async function runLearn(artifactId) {
|
|
5390
5453
|
const dir = cwd();
|
|
5391
5454
|
if (!exists(join(dir, ARCH_DIR8))) {
|
|
5392
|
-
console.error("No
|
|
5455
|
+
console.error("No knowledge/ directory found. Run `kaddo init` first.");
|
|
5393
5456
|
process.exit(1);
|
|
5394
5457
|
}
|
|
5395
5458
|
intro2("kaddo learn");
|
|
@@ -5431,12 +5494,12 @@ async function runLearn(artifactId) {
|
|
|
5431
5494
|
updateWorkItemFile(filePath, learning.trim());
|
|
5432
5495
|
log2.success(`${targetId} marked as done`);
|
|
5433
5496
|
log2.success(`Learning recorded in ${filePath.replace(dir + "/", "")}`);
|
|
5434
|
-
log2.info("Consider updating
|
|
5497
|
+
log2.info("Consider updating knowledge/knowledge.md if this changes the current state.");
|
|
5435
5498
|
outro2("Work item closed.");
|
|
5436
5499
|
}
|
|
5437
5500
|
|
|
5438
5501
|
// src/commands/history.ts
|
|
5439
|
-
var ARCH_DIR9 = "
|
|
5502
|
+
var ARCH_DIR9 = "knowledge";
|
|
5440
5503
|
function formatRow(a) {
|
|
5441
5504
|
const id = (a.id || "").padEnd(8);
|
|
5442
5505
|
const type = a.type.padEnd(18);
|
|
@@ -5448,7 +5511,7 @@ function formatRow(a) {
|
|
|
5448
5511
|
function runHistory(opts = {}) {
|
|
5449
5512
|
const dir = cwd();
|
|
5450
5513
|
if (!exists(join(dir, ARCH_DIR9))) {
|
|
5451
|
-
console.error("No
|
|
5514
|
+
console.error("No knowledge/ directory found. Run `kaddo init` first.");
|
|
5452
5515
|
process.exit(1);
|
|
5453
5516
|
}
|
|
5454
5517
|
let artifacts = readArtifacts(join(dir, ARCH_DIR9)).filter(
|
|
@@ -5582,7 +5645,7 @@ function runAdd(moduleName, dir = cwd()) {
|
|
|
5582
5645
|
|
|
5583
5646
|
// src/core/ownership-suggest.ts
|
|
5584
5647
|
import matter5 from "gray-matter";
|
|
5585
|
-
var WORK_ITEMS_DIR3 = "
|
|
5648
|
+
var WORK_ITEMS_DIR3 = "knowledge/delivery/work-items";
|
|
5586
5649
|
var SCAN_PATH = ".kaddo/scan.json";
|
|
5587
5650
|
function toStringArray3(value) {
|
|
5588
5651
|
return Array.isArray(value) ? value.map((v) => String(v)).filter(Boolean) : [];
|
|
@@ -5823,7 +5886,7 @@ ${globs.map((g) => ` - ${g}`).join("\n")}`);
|
|
|
5823
5886
|
|
|
5824
5887
|
// src/commands/module-descriptor.ts
|
|
5825
5888
|
import { parse as parseYaml11, stringify as stringifyYaml4 } from "yaml";
|
|
5826
|
-
var DESCRIPTOR_PATH2 = "
|
|
5889
|
+
var DESCRIPTOR_PATH2 = "knowledge/module.yml";
|
|
5827
5890
|
function readDescriptor(dir) {
|
|
5828
5891
|
const path6 = join(dir, DESCRIPTOR_PATH2);
|
|
5829
5892
|
if (!exists(path6)) return null;
|
|
@@ -5848,7 +5911,7 @@ async function runModuleDescriptor(opts) {
|
|
|
5848
5911
|
return;
|
|
5849
5912
|
}
|
|
5850
5913
|
intro2("kaddo module --init");
|
|
5851
|
-
log2.info("Creates
|
|
5914
|
+
log2.info("Creates knowledge/module.yml \u2014 declares this repository's identity for multirepo contexts.");
|
|
5852
5915
|
const name = await text2({
|
|
5853
5916
|
message: "Module name (this repository)",
|
|
5854
5917
|
placeholder: "e.g. payments-service",
|
|
@@ -5897,7 +5960,7 @@ async function runModuleDescriptor(opts) {
|
|
|
5897
5960
|
};
|
|
5898
5961
|
writeDescriptor(dir, descriptor);
|
|
5899
5962
|
log2.success(`Created ${DESCRIPTOR_PATH2}`);
|
|
5900
|
-
outro2(`Module descriptor ready. Share
|
|
5963
|
+
outro2(`Module descriptor ready. Share knowledge/module.yml with dependent repositories.`);
|
|
5901
5964
|
}
|
|
5902
5965
|
function printDescriptor(d) {
|
|
5903
5966
|
console.log("");
|
|
@@ -6063,7 +6126,7 @@ ${QUALITY}
|
|
|
6063
6126
|
- [ ] Capabilities describe outcomes, not implementation.
|
|
6064
6127
|
- [ ] Each capability cites evidence or is flagged as an assumption.
|
|
6065
6128
|
`;
|
|
6066
|
-
var
|
|
6129
|
+
var KNOWLEDGE2 = `---
|
|
6067
6130
|
type: current-state
|
|
6068
6131
|
updated_at: YYYY-MM-DD
|
|
6069
6132
|
---
|
|
@@ -6864,7 +6927,7 @@ status: draft
|
|
|
6864
6927
|
|
|
6865
6928
|
# Codebase Foundation
|
|
6866
6929
|
|
|
6867
|
-
> Created by \`kaddo bootstrap\`. Refine with the codebase-
|
|
6930
|
+
> Created by \`kaddo bootstrap\`. Refine with the codebase-agent.
|
|
6868
6931
|
> This describes the intended base \u2014 it does **not** generate code.
|
|
6869
6932
|
|
|
6870
6933
|
## Suggested structure
|
|
@@ -6881,7 +6944,7 @@ TBD
|
|
|
6881
6944
|
|
|
6882
6945
|
## Git strategy
|
|
6883
6946
|
|
|
6884
|
-
See \`
|
|
6947
|
+
See \`knowledge/tech/git-strategy.md\`.
|
|
6885
6948
|
|
|
6886
6949
|
## Minimum criteria to start development
|
|
6887
6950
|
|
|
@@ -6911,7 +6974,7 @@ status: draft
|
|
|
6911
6974
|
|
|
6912
6975
|
## Layers
|
|
6913
6976
|
|
|
6914
|
-
- **Business** \u2014 \`
|
|
6977
|
+
- **Business** \u2014 \`knowledge/business/\`
|
|
6915
6978
|
- **Architecture** \u2014 capabilities, quality-attributes, stack, current-state, decisions
|
|
6916
6979
|
- **Codebase** \u2014 codebase-foundation, standards, git-strategy
|
|
6917
6980
|
- **Development** \u2014 roadmap, work-items
|
|
@@ -6927,7 +6990,7 @@ status: draft
|
|
|
6927
6990
|
|
|
6928
6991
|
1. Run \`kaddo context\` and \`kaddo add agents\`.
|
|
6929
6992
|
2. Refine the artifacts with the business-agent, bootstrap-agent and
|
|
6930
|
-
codebase-
|
|
6993
|
+
codebase-agent in your LLM.
|
|
6931
6994
|
3. Run \`kaddo create --from roadmap\` to create the first Work Items.
|
|
6932
6995
|
|
|
6933
6996
|
## Open questions
|
|
@@ -6944,8 +7007,8 @@ var KADDO_TEMPLATES = [
|
|
|
6944
7007
|
{
|
|
6945
7008
|
id: "work-item",
|
|
6946
7009
|
name: "Work Item",
|
|
6947
|
-
category: "
|
|
6948
|
-
outputPath: "
|
|
7010
|
+
category: "delivery",
|
|
7011
|
+
outputPath: "knowledge/delivery/work-items/",
|
|
6949
7012
|
description: "Smallest traceable unit of product evolution.",
|
|
6950
7013
|
whenToUse: "When you start any change (feature, bugfix, hotfix, spike).",
|
|
6951
7014
|
relatedCommand: "kaddo create",
|
|
@@ -6955,8 +7018,8 @@ var KADDO_TEMPLATES = [
|
|
|
6955
7018
|
{
|
|
6956
7019
|
id: "roadmap",
|
|
6957
7020
|
name: "Roadmap",
|
|
6958
|
-
category: "
|
|
6959
|
-
outputPath: "
|
|
7021
|
+
category: "delivery",
|
|
7022
|
+
outputPath: "knowledge/delivery/roadmap.md",
|
|
6960
7023
|
description: "Initiatives and candidate work items for human review.",
|
|
6961
7024
|
whenToUse: "When planning what to build next and why.",
|
|
6962
7025
|
relatedCommand: "kaddo create --from roadmap",
|
|
@@ -6966,8 +7029,8 @@ var KADDO_TEMPLATES = [
|
|
|
6966
7029
|
{
|
|
6967
7030
|
id: "capabilities",
|
|
6968
7031
|
name: "Capabilities",
|
|
6969
|
-
category: "
|
|
6970
|
-
outputPath: "
|
|
7032
|
+
category: "product",
|
|
7033
|
+
outputPath: "knowledge/product/capabilities.md",
|
|
6971
7034
|
description: "What the system can do from the product point of view.",
|
|
6972
7035
|
whenToUse: "When mapping product capabilities to the system.",
|
|
6973
7036
|
relatedAgent: "capability-agent",
|
|
@@ -6976,19 +7039,19 @@ var KADDO_TEMPLATES = [
|
|
|
6976
7039
|
{
|
|
6977
7040
|
id: "knowledge",
|
|
6978
7041
|
name: "Knowledge (Current State)",
|
|
6979
|
-
category: "
|
|
6980
|
-
outputPath: "
|
|
7042
|
+
category: "tech",
|
|
7043
|
+
outputPath: "knowledge/knowledge.md",
|
|
6981
7044
|
description: "What is true about the product right now.",
|
|
6982
7045
|
whenToUse: "Created by `kaddo init`; keep it current as the product evolves.",
|
|
6983
7046
|
relatedCommand: "kaddo init",
|
|
6984
|
-
content:
|
|
7047
|
+
content: KNOWLEDGE2
|
|
6985
7048
|
},
|
|
6986
7049
|
// business (bootstrap)
|
|
6987
7050
|
{
|
|
6988
7051
|
id: "business-product-brief",
|
|
6989
7052
|
name: "Product Brief",
|
|
6990
|
-
category: "
|
|
6991
|
-
outputPath: "
|
|
7053
|
+
category: "product",
|
|
7054
|
+
outputPath: "knowledge/product/product-brief.md",
|
|
6992
7055
|
description: "The product in one page: problem, users, value, MVP boundary.",
|
|
6993
7056
|
whenToUse: "At the start of a new project (kaddo bootstrap).",
|
|
6994
7057
|
relatedCommand: "kaddo bootstrap",
|
|
@@ -6999,7 +7062,7 @@ var KADDO_TEMPLATES = [
|
|
|
6999
7062
|
id: "business-problem",
|
|
7000
7063
|
name: "Problem Statement",
|
|
7001
7064
|
category: "business",
|
|
7002
|
-
outputPath: "
|
|
7065
|
+
outputPath: "knowledge/business/problem.md",
|
|
7003
7066
|
description: "The problem the product solves, without assuming the solution.",
|
|
7004
7067
|
whenToUse: "When defining a new project (kaddo bootstrap).",
|
|
7005
7068
|
relatedCommand: "kaddo bootstrap",
|
|
@@ -7010,7 +7073,7 @@ var KADDO_TEMPLATES = [
|
|
|
7010
7073
|
id: "business-users",
|
|
7011
7074
|
name: "Users & Personas",
|
|
7012
7075
|
category: "business",
|
|
7013
|
-
outputPath: "
|
|
7076
|
+
outputPath: "knowledge/business/users.md",
|
|
7014
7077
|
description: "Primary and secondary users with goals.",
|
|
7015
7078
|
whenToUse: "When defining a new project (kaddo bootstrap).",
|
|
7016
7079
|
relatedCommand: "kaddo bootstrap",
|
|
@@ -7021,7 +7084,7 @@ var KADDO_TEMPLATES = [
|
|
|
7021
7084
|
id: "business-value-proposition",
|
|
7022
7085
|
name: "Value Proposition",
|
|
7023
7086
|
category: "business",
|
|
7024
|
-
outputPath: "
|
|
7087
|
+
outputPath: "knowledge/business/value-proposition.md",
|
|
7025
7088
|
description: "For whom, what we offer and why it is better.",
|
|
7026
7089
|
whenToUse: "When defining a new project (kaddo bootstrap).",
|
|
7027
7090
|
relatedCommand: "kaddo bootstrap",
|
|
@@ -7032,7 +7095,7 @@ var KADDO_TEMPLATES = [
|
|
|
7032
7095
|
id: "business-rules",
|
|
7033
7096
|
name: "Business Rules",
|
|
7034
7097
|
category: "business",
|
|
7035
|
-
outputPath: "
|
|
7098
|
+
outputPath: "knowledge/business/business-rules.md",
|
|
7036
7099
|
description: "Product rules as testable statements.",
|
|
7037
7100
|
whenToUse: "When defining a new project (kaddo bootstrap).",
|
|
7038
7101
|
relatedCommand: "kaddo bootstrap",
|
|
@@ -7043,7 +7106,7 @@ var KADDO_TEMPLATES = [
|
|
|
7043
7106
|
id: "business-constraints",
|
|
7044
7107
|
name: "Business Constraints",
|
|
7045
7108
|
category: "business",
|
|
7046
|
-
outputPath: "
|
|
7109
|
+
outputPath: "knowledge/business/constraints.md",
|
|
7047
7110
|
description: "Business, regulatory and resource constraints.",
|
|
7048
7111
|
whenToUse: "When defining a new project (kaddo bootstrap).",
|
|
7049
7112
|
relatedCommand: "kaddo bootstrap",
|
|
@@ -7054,7 +7117,7 @@ var KADDO_TEMPLATES = [
|
|
|
7054
7117
|
id: "business-glossary",
|
|
7055
7118
|
name: "Glossary",
|
|
7056
7119
|
category: "business",
|
|
7057
|
-
outputPath: "
|
|
7120
|
+
outputPath: "knowledge/business/glossary.md",
|
|
7058
7121
|
description: "Shared vocabulary for the project.",
|
|
7059
7122
|
whenToUse: "When defining a new project (kaddo bootstrap).",
|
|
7060
7123
|
relatedCommand: "kaddo bootstrap",
|
|
@@ -7065,8 +7128,8 @@ var KADDO_TEMPLATES = [
|
|
|
7065
7128
|
{
|
|
7066
7129
|
id: "current-state",
|
|
7067
7130
|
name: "Current State",
|
|
7068
|
-
category: "
|
|
7069
|
-
outputPath: "
|
|
7131
|
+
category: "tech",
|
|
7132
|
+
outputPath: "knowledge/tech/current-state.md",
|
|
7070
7133
|
description: "Reconstructed architecture baseline.",
|
|
7071
7134
|
whenToUse: "When establishing the architecture baseline of an existing system.",
|
|
7072
7135
|
relatedAgent: "architecture-agent",
|
|
@@ -7075,8 +7138,8 @@ var KADDO_TEMPLATES = [
|
|
|
7075
7138
|
{
|
|
7076
7139
|
id: "architecture-notes",
|
|
7077
7140
|
name: "Architecture Notes",
|
|
7078
|
-
category: "
|
|
7079
|
-
outputPath: "
|
|
7141
|
+
category: "tech",
|
|
7142
|
+
outputPath: "knowledge/tech/architecture-notes.md",
|
|
7080
7143
|
description: "Working notes on architecture topics not yet decided.",
|
|
7081
7144
|
whenToUse: "When exploring an architecture topic before it becomes an ADR.",
|
|
7082
7145
|
content: ARCHITECTURE_NOTES
|
|
@@ -7084,8 +7147,8 @@ var KADDO_TEMPLATES = [
|
|
|
7084
7147
|
{
|
|
7085
7148
|
id: "decision-candidates",
|
|
7086
7149
|
name: "Decision Candidates",
|
|
7087
|
-
category: "
|
|
7088
|
-
outputPath: "
|
|
7150
|
+
category: "tech",
|
|
7151
|
+
outputPath: "knowledge/tech/decision-candidates.md",
|
|
7089
7152
|
description: "Candidate architecture decisions for human review.",
|
|
7090
7153
|
whenToUse: "When surfacing decisions that may become ADRs.",
|
|
7091
7154
|
relatedAgent: "adr-agent",
|
|
@@ -7094,8 +7157,8 @@ var KADDO_TEMPLATES = [
|
|
|
7094
7157
|
{
|
|
7095
7158
|
id: "quality-attributes",
|
|
7096
7159
|
name: "Quality Attributes",
|
|
7097
|
-
category: "
|
|
7098
|
-
outputPath: "
|
|
7160
|
+
category: "tech",
|
|
7161
|
+
outputPath: "knowledge/tech/quality-attributes.md",
|
|
7099
7162
|
description: "Prioritized quality attributes and accepted trade-offs.",
|
|
7100
7163
|
whenToUse: "During bootstrap, to record what matters most technically.",
|
|
7101
7164
|
relatedCommand: "kaddo bootstrap",
|
|
@@ -7103,21 +7166,21 @@ var KADDO_TEMPLATES = [
|
|
|
7103
7166
|
content: QUALITY_ATTRIBUTES
|
|
7104
7167
|
},
|
|
7105
7168
|
{
|
|
7106
|
-
id: "codebase
|
|
7169
|
+
id: "codebase",
|
|
7107
7170
|
name: "Codebase Foundation",
|
|
7108
|
-
category: "
|
|
7109
|
-
outputPath: "
|
|
7171
|
+
category: "tech",
|
|
7172
|
+
outputPath: "knowledge/tech/codebase.md",
|
|
7110
7173
|
description: "Intended codebase structure and conventions (no source code).",
|
|
7111
7174
|
whenToUse: "During bootstrap, before writing code.",
|
|
7112
7175
|
relatedCommand: "kaddo bootstrap",
|
|
7113
|
-
relatedAgent: "codebase-
|
|
7176
|
+
relatedAgent: "codebase-agent",
|
|
7114
7177
|
content: CODEBASE_FOUNDATION
|
|
7115
7178
|
},
|
|
7116
7179
|
{
|
|
7117
7180
|
id: "bootstrap-summary",
|
|
7118
7181
|
name: "Bootstrap Summary",
|
|
7119
|
-
category: "
|
|
7120
|
-
outputPath: "
|
|
7182
|
+
category: "tech",
|
|
7183
|
+
outputPath: "knowledge/bootstrap-summary.md",
|
|
7121
7184
|
description: "Index of the initial knowledge base and next steps.",
|
|
7122
7185
|
whenToUse: "Generated by kaddo bootstrap.",
|
|
7123
7186
|
relatedCommand: "kaddo bootstrap",
|
|
@@ -7127,8 +7190,8 @@ var KADDO_TEMPLATES = [
|
|
|
7127
7190
|
{
|
|
7128
7191
|
id: "adr",
|
|
7129
7192
|
name: "ADR",
|
|
7130
|
-
category: "
|
|
7131
|
-
outputPath: "
|
|
7193
|
+
category: "tech",
|
|
7194
|
+
outputPath: "knowledge/tech/decisions/",
|
|
7132
7195
|
description: "A single architecture decision record.",
|
|
7133
7196
|
whenToUse: "When recording a significant, accepted architecture decision.",
|
|
7134
7197
|
relatedCommand: "kaddo create adr",
|
|
@@ -7139,7 +7202,7 @@ var KADDO_TEMPLATES = [
|
|
|
7139
7202
|
id: "module-design",
|
|
7140
7203
|
name: "Module Design",
|
|
7141
7204
|
category: "module",
|
|
7142
|
-
outputPath: "
|
|
7205
|
+
outputPath: "knowledge/tech/modules/<id>/module-design.md",
|
|
7143
7206
|
description: "A module's purpose, boundaries and dependencies.",
|
|
7144
7207
|
whenToUse: "After mapping a secondary repo as a module.",
|
|
7145
7208
|
relatedCommand: "kaddo modules map",
|
|
@@ -7150,7 +7213,7 @@ var KADDO_TEMPLATES = [
|
|
|
7150
7213
|
id: "module-stack",
|
|
7151
7214
|
name: "Module Stack",
|
|
7152
7215
|
category: "module",
|
|
7153
|
-
outputPath: "
|
|
7216
|
+
outputPath: "knowledge/tech/modules/<id>/stack.md",
|
|
7154
7217
|
description: "A module's technology stack.",
|
|
7155
7218
|
whenToUse: "To document the stack of a specific module.",
|
|
7156
7219
|
relatedAgent: "stack-agent",
|
|
@@ -7160,7 +7223,7 @@ var KADDO_TEMPLATES = [
|
|
|
7160
7223
|
id: "module-security",
|
|
7161
7224
|
name: "Module Security",
|
|
7162
7225
|
category: "module",
|
|
7163
|
-
outputPath: "
|
|
7226
|
+
outputPath: "knowledge/tech/modules/<id>/security.md",
|
|
7164
7227
|
description: "A module's security considerations.",
|
|
7165
7228
|
whenToUse: "To document security concerns specific to a module.",
|
|
7166
7229
|
relatedAgent: "security-agent",
|
|
@@ -7170,7 +7233,7 @@ var KADDO_TEMPLATES = [
|
|
|
7170
7233
|
id: "module-standards",
|
|
7171
7234
|
name: "Module Standards",
|
|
7172
7235
|
category: "module",
|
|
7173
|
-
outputPath: "
|
|
7236
|
+
outputPath: "knowledge/tech/modules/<id>/standards.md",
|
|
7174
7237
|
description: "A module's coding and testing standards.",
|
|
7175
7238
|
whenToUse: "When a module needs standards beyond the system defaults.",
|
|
7176
7239
|
relatedAgent: "standards-agent",
|
|
@@ -7180,7 +7243,7 @@ var KADDO_TEMPLATES = [
|
|
|
7180
7243
|
id: "module-adr",
|
|
7181
7244
|
name: "Module ADR",
|
|
7182
7245
|
category: "module",
|
|
7183
|
-
outputPath: "
|
|
7246
|
+
outputPath: "knowledge/tech/modules/<id>/adrs/",
|
|
7184
7247
|
description: "A module-scoped architecture decision record.",
|
|
7185
7248
|
whenToUse: "When a decision affects only one module.",
|
|
7186
7249
|
content: MODULE_ADR
|
|
@@ -7190,7 +7253,7 @@ var KADDO_TEMPLATES = [
|
|
|
7190
7253
|
id: "security",
|
|
7191
7254
|
name: "Security",
|
|
7192
7255
|
category: "operations",
|
|
7193
|
-
outputPath: "
|
|
7256
|
+
outputPath: "knowledge/tech/security.md",
|
|
7194
7257
|
description: "Global security considerations (no scanning).",
|
|
7195
7258
|
whenToUse: "To document system-wide security concerns.",
|
|
7196
7259
|
relatedCommand: "kaddo add security",
|
|
@@ -7201,7 +7264,7 @@ var KADDO_TEMPLATES = [
|
|
|
7201
7264
|
id: "standards",
|
|
7202
7265
|
name: "Standards",
|
|
7203
7266
|
category: "operations",
|
|
7204
|
-
outputPath: "
|
|
7267
|
+
outputPath: "knowledge/tech/standards.md",
|
|
7205
7268
|
description: "Global lightweight coding/docs/testing standards.",
|
|
7206
7269
|
whenToUse: "To document system-wide standards.",
|
|
7207
7270
|
relatedCommand: "kaddo add standards",
|
|
@@ -7212,7 +7275,7 @@ var KADDO_TEMPLATES = [
|
|
|
7212
7275
|
id: "stack",
|
|
7213
7276
|
name: "Stack",
|
|
7214
7277
|
category: "operations",
|
|
7215
|
-
outputPath: "
|
|
7278
|
+
outputPath: "knowledge/tech/stack.md",
|
|
7216
7279
|
description: "Global technology stack documentation.",
|
|
7217
7280
|
whenToUse: "To document the system-wide stack.",
|
|
7218
7281
|
relatedCommand: "kaddo add stack",
|
|
@@ -7223,7 +7286,7 @@ var KADDO_TEMPLATES = [
|
|
|
7223
7286
|
id: "git-strategy",
|
|
7224
7287
|
name: "Git Strategy",
|
|
7225
7288
|
category: "operations",
|
|
7226
|
-
outputPath: "
|
|
7289
|
+
outputPath: "knowledge/tech/git-strategy.md",
|
|
7227
7290
|
description: "Recommended, customizable Git workflow.",
|
|
7228
7291
|
whenToUse: "To agree on branching, commits and tagging.",
|
|
7229
7292
|
relatedCommand: "kaddo add git-strategy",
|
|
@@ -7234,7 +7297,7 @@ var KADDO_TEMPLATES = [
|
|
|
7234
7297
|
id: "incident",
|
|
7235
7298
|
name: "Incident",
|
|
7236
7299
|
category: "operations",
|
|
7237
|
-
outputPath: "
|
|
7300
|
+
outputPath: "knowledge/incidents/",
|
|
7238
7301
|
description: "A post-incident record.",
|
|
7239
7302
|
whenToUse: "After a production incident.",
|
|
7240
7303
|
relatedCommand: "kaddo create incident",
|
|
@@ -7244,7 +7307,7 @@ var KADDO_TEMPLATES = [
|
|
|
7244
7307
|
id: "runbook",
|
|
7245
7308
|
name: "Runbook",
|
|
7246
7309
|
category: "operations",
|
|
7247
|
-
outputPath: "
|
|
7310
|
+
outputPath: "knowledge/runbooks/",
|
|
7248
7311
|
description: "How to perform a recurring operational task safely.",
|
|
7249
7312
|
whenToUse: "For repeatable operational procedures.",
|
|
7250
7313
|
content: RUNBOOK
|
|
@@ -7254,7 +7317,7 @@ var KADDO_TEMPLATES = [
|
|
|
7254
7317
|
id: "legacy-risks",
|
|
7255
7318
|
name: "Legacy Risks",
|
|
7256
7319
|
category: "legacy",
|
|
7257
|
-
outputPath: "
|
|
7320
|
+
outputPath: "knowledge/legacy/risks.md",
|
|
7258
7321
|
description: "High-risk areas before changing legacy code.",
|
|
7259
7322
|
whenToUse: "Before modifying legacy code.",
|
|
7260
7323
|
relatedAgent: "legacy-agent",
|
|
@@ -7264,7 +7327,7 @@ var KADDO_TEMPLATES = [
|
|
|
7264
7327
|
id: "legacy-unknowns",
|
|
7265
7328
|
name: "Legacy Unknowns",
|
|
7266
7329
|
category: "legacy",
|
|
7267
|
-
outputPath: "
|
|
7330
|
+
outputPath: "knowledge/legacy/unknowns.md",
|
|
7268
7331
|
description: "What is not yet understood about the legacy system.",
|
|
7269
7332
|
whenToUse: "When surfacing gaps in legacy knowledge.",
|
|
7270
7333
|
relatedAgent: "legacy-agent",
|
|
@@ -7274,7 +7337,7 @@ var KADDO_TEMPLATES = [
|
|
|
7274
7337
|
id: "modernization-candidates",
|
|
7275
7338
|
name: "Modernization Candidates",
|
|
7276
7339
|
category: "legacy",
|
|
7277
|
-
outputPath: "
|
|
7340
|
+
outputPath: "knowledge/legacy/modernization-candidates.md",
|
|
7278
7341
|
description: "Candidate modernization efforts for human review.",
|
|
7279
7342
|
whenToUse: "When planning legacy modernization.",
|
|
7280
7343
|
content: MODERNIZATION_CANDIDATES
|
|
@@ -7314,7 +7377,7 @@ function writeModulesDescriptor(dir, descriptor) {
|
|
|
7314
7377
|
writeFile(join(dir, DESCRIPTOR_PATH3), stringifyYaml5(descriptor));
|
|
7315
7378
|
}
|
|
7316
7379
|
function moduleDir(id) {
|
|
7317
|
-
return `
|
|
7380
|
+
return `knowledge/tech/modules/${id}`;
|
|
7318
7381
|
}
|
|
7319
7382
|
function buildModule(input) {
|
|
7320
7383
|
const id = slugify2(input.name);
|
|
@@ -7511,30 +7574,19 @@ function runModulesList(dir = cwd()) {
|
|
|
7511
7574
|
// src/commands/bootstrap.ts
|
|
7512
7575
|
var CONFIG_PATH8 = ".kaddo/config.yml";
|
|
7513
7576
|
var TARGETS = [
|
|
7514
|
-
// Business
|
|
7515
|
-
{ layer: "Business", path: "
|
|
7516
|
-
{ layer: "Business", path: "
|
|
7517
|
-
{ layer: "Business", path: "
|
|
7518
|
-
{ layer: "Business", path: "
|
|
7519
|
-
{ layer: "Business", path: "
|
|
7520
|
-
|
|
7521
|
-
{ layer: "
|
|
7522
|
-
|
|
7523
|
-
|
|
7524
|
-
{ layer: "
|
|
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" }
|
|
7577
|
+
// Business — why it exists
|
|
7578
|
+
{ layer: "Business", path: "knowledge/business/problem.md", templateId: "business-problem" },
|
|
7579
|
+
{ layer: "Business", path: "knowledge/business/users.md", templateId: "business-users" },
|
|
7580
|
+
{ layer: "Business", path: "knowledge/business/value-proposition.md", templateId: "business-value-proposition" },
|
|
7581
|
+
{ layer: "Business", path: "knowledge/business/constraints.md", templateId: "business-constraints" },
|
|
7582
|
+
{ layer: "Business", path: "knowledge/business/business-rules.md", templateId: "business-rules" },
|
|
7583
|
+
// Product — what we build
|
|
7584
|
+
{ layer: "Product", path: "knowledge/product/product-brief.md", templateId: "business-product-brief" },
|
|
7585
|
+
{ layer: "Product", path: "knowledge/product/capabilities.md", templateId: "capabilities" },
|
|
7586
|
+
// Tech — how we build it
|
|
7587
|
+
{ layer: "Tech", path: "knowledge/tech/codebase.md", templateId: "codebase" }
|
|
7536
7588
|
];
|
|
7537
|
-
var BOOTSTRAP_LAYERS = ["Business", "
|
|
7589
|
+
var BOOTSTRAP_LAYERS = ["Business", "Product", "Tech"];
|
|
7538
7590
|
function bootstrap(dir) {
|
|
7539
7591
|
const written = [];
|
|
7540
7592
|
const skipped = [];
|
|
@@ -7550,15 +7602,6 @@ function bootstrap(dir) {
|
|
|
7550
7602
|
`);
|
|
7551
7603
|
written.push(target.path);
|
|
7552
7604
|
}
|
|
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
7605
|
return { written, skipped, layers: BOOTSTRAP_LAYERS };
|
|
7563
7606
|
}
|
|
7564
7607
|
async function runBootstrap(dir = cwd()) {
|
|
@@ -7578,7 +7621,7 @@ async function runBootstrap(dir = cwd()) {
|
|
|
7578
7621
|
process.exit(1);
|
|
7579
7622
|
}
|
|
7580
7623
|
log2.info(`Project state: ${state}`);
|
|
7581
|
-
log2.info("Base layers: Business \u2192
|
|
7624
|
+
log2.info("Base layers: Business \u2192 Product \u2192 Tech \u2192 Delivery");
|
|
7582
7625
|
if (state !== "new") {
|
|
7583
7626
|
log2.warn("This project is not marked as new. Bootstrap is designed for new projects.");
|
|
7584
7627
|
const ok = await confirm2({ message: "Continue anyway?", initialValue: false });
|
|
@@ -7603,20 +7646,20 @@ async function runBootstrap(dir = cwd()) {
|
|
|
7603
7646
|
}
|
|
7604
7647
|
console.log("");
|
|
7605
7648
|
outro2(
|
|
7606
|
-
"
|
|
7649
|
+
"Minimal knowledge base ready (Business \u2192 Product \u2192 Tech). Run `kaddo context` and `kaddo add agents`, then refine with the business-agent, bootstrap-agent and codebase-agent. Roadmap and work items come next under knowledge/delivery/."
|
|
7607
7650
|
);
|
|
7608
7651
|
}
|
|
7609
7652
|
|
|
7610
7653
|
// src/index.ts
|
|
7611
7654
|
var program = new Command();
|
|
7612
|
-
program.name("kaddo").description("Knowledge Driven Development toolkit").version("
|
|
7655
|
+
program.name("kaddo").description("Knowledge Driven Development toolkit").version("3.0.0");
|
|
7613
7656
|
program.command("init").description("Initialize Kaddo in the current project").action(async () => {
|
|
7614
7657
|
await runInit();
|
|
7615
7658
|
});
|
|
7616
7659
|
program.command("scan").description("Detect project stack and suggest domains").action(async () => {
|
|
7617
7660
|
await runScan();
|
|
7618
7661
|
});
|
|
7619
|
-
program.command("bootstrap").description("Build the initial knowledge base for a new project (Business \u2192
|
|
7662
|
+
program.command("bootstrap").description("Build the initial knowledge base for a new project (Business \u2192 Product \u2192 Tech \u2192 Delivery)").action(async () => {
|
|
7620
7663
|
await runBootstrap();
|
|
7621
7664
|
});
|
|
7622
7665
|
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) => {
|
|
@@ -7663,7 +7706,7 @@ program.command("owners [action]").description("List domain owners, or run `owne
|
|
|
7663
7706
|
runOwners(opts);
|
|
7664
7707
|
}
|
|
7665
7708
|
});
|
|
7666
|
-
program.command("module").description("Show or initialize the multirepo module descriptor (
|
|
7709
|
+
program.command("module").description("Show or initialize the multirepo module descriptor (knowledge/module.yml)").option("--init", "Create the module descriptor interactively").option("--show", "Print the current module descriptor").action(async (opts) => {
|
|
7667
7710
|
await runModuleDescriptor(opts);
|
|
7668
7711
|
});
|
|
7669
7712
|
var modulesCmd = program.command("modules").description("Map and list secondary repositories as modules of the system (multirepo)");
|