@kaddo/cli 2.8.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +21 -18
- package/dist/index.js +550 -282
- 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
|
}
|
|
@@ -566,8 +566,8 @@ function loadConfig(dir) {
|
|
|
566
566
|
const parsed = configSchema.safeParse(raw ?? {});
|
|
567
567
|
if (!parsed.success) {
|
|
568
568
|
const issues = parsed.error.issues.map((i) => {
|
|
569
|
-
const
|
|
570
|
-
return
|
|
569
|
+
const path5 = i.path.join(".");
|
|
570
|
+
return path5 ? ` - ${path5}: ${i.message}` : ` - ${i.message}`;
|
|
571
571
|
}).join("\n");
|
|
572
572
|
throw new ConfigError(`Invalid .kaddo/config.yml:
|
|
573
573
|
${issues}`);
|
|
@@ -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 {
|
|
@@ -3518,9 +3518,8 @@ function readArtifacts(archDir) {
|
|
|
3518
3518
|
|
|
3519
3519
|
// src/core/diff-analysis.ts
|
|
3520
3520
|
import { minimatch } from "minimatch";
|
|
3521
|
-
import path3 from "path";
|
|
3522
3521
|
function normalizePath(p2) {
|
|
3523
|
-
return p2.
|
|
3522
|
+
return p2.replace(/\\/g, "/");
|
|
3524
3523
|
}
|
|
3525
3524
|
function fileMatchesGlob(file, glob) {
|
|
3526
3525
|
return minimatch(normalizePath(file), glob, { matchBase: false, dot: true });
|
|
@@ -3578,10 +3577,10 @@ function analyzeGuard(touchedFiles, artifacts, silentWithoutOwnership) {
|
|
|
3578
3577
|
import { parse as parseYaml4, stringify as stringifyYaml2 } from "yaml";
|
|
3579
3578
|
var IGNORE_FILE = ".kaddo/ignores.yml";
|
|
3580
3579
|
function loadIgnores(dir) {
|
|
3581
|
-
const
|
|
3582
|
-
if (!exists(
|
|
3580
|
+
const path5 = join(dir, IGNORE_FILE);
|
|
3581
|
+
if (!exists(path5)) return [];
|
|
3583
3582
|
try {
|
|
3584
|
-
const raw = readFile(
|
|
3583
|
+
const raw = readFile(path5);
|
|
3585
3584
|
const parsed = parseYaml4(raw);
|
|
3586
3585
|
return Array.isArray(parsed) ? parsed : [];
|
|
3587
3586
|
} catch {
|
|
@@ -3589,7 +3588,7 @@ function loadIgnores(dir) {
|
|
|
3589
3588
|
}
|
|
3590
3589
|
}
|
|
3591
3590
|
function saveIgnore(dir, entry) {
|
|
3592
|
-
const
|
|
3591
|
+
const path5 = join(dir, IGNORE_FILE);
|
|
3593
3592
|
const existing = loadIgnores(dir);
|
|
3594
3593
|
const idx = existing.findIndex((e) => e.artifact_id === entry.artifact_id);
|
|
3595
3594
|
if (idx >= 0) {
|
|
@@ -3597,17 +3596,17 @@ function saveIgnore(dir, entry) {
|
|
|
3597
3596
|
} else {
|
|
3598
3597
|
existing.push(entry);
|
|
3599
3598
|
}
|
|
3600
|
-
writeFile(
|
|
3599
|
+
writeFile(path5, stringifyYaml2(existing));
|
|
3601
3600
|
}
|
|
3602
3601
|
function isIgnored(ignores, artifactId) {
|
|
3603
3602
|
return ignores.find((e) => e.artifact_id === artifactId);
|
|
3604
3603
|
}
|
|
3605
3604
|
function removeIgnore(dir, artifactId) {
|
|
3606
|
-
const
|
|
3605
|
+
const path5 = join(dir, IGNORE_FILE);
|
|
3607
3606
|
const existing = loadIgnores(dir);
|
|
3608
3607
|
const filtered = existing.filter((e) => e.artifact_id !== artifactId);
|
|
3609
3608
|
if (filtered.length === existing.length) return false;
|
|
3610
|
-
writeFile(
|
|
3609
|
+
writeFile(path5, stringifyYaml2(filtered));
|
|
3611
3610
|
return true;
|
|
3612
3611
|
}
|
|
3613
3612
|
|
|
@@ -3618,7 +3617,7 @@ function toStringArray(value) {
|
|
|
3618
3617
|
return Array.isArray(value) ? value.map((v) => String(v)).filter(Boolean) : [];
|
|
3619
3618
|
}
|
|
3620
3619
|
function moduleArtifactCoverage(dir, id) {
|
|
3621
|
-
const base = join(dir, "
|
|
3620
|
+
const base = join(dir, "knowledge", "tech", "modules", id);
|
|
3622
3621
|
return {
|
|
3623
3622
|
moduleDesign: exists(join(base, "module-design.md")),
|
|
3624
3623
|
stack: exists(join(base, "stack.md")),
|
|
@@ -3629,11 +3628,11 @@ function moduleArtifactCoverage(dir, id) {
|
|
|
3629
3628
|
};
|
|
3630
3629
|
}
|
|
3631
3630
|
function loadMappedModules(dir) {
|
|
3632
|
-
const
|
|
3633
|
-
if (!exists(
|
|
3631
|
+
const path5 = join(dir, DESCRIPTOR_PATH);
|
|
3632
|
+
if (!exists(path5)) return [];
|
|
3634
3633
|
let parsed;
|
|
3635
3634
|
try {
|
|
3636
|
-
parsed = parseYaml5(readFile(
|
|
3635
|
+
parsed = parseYaml5(readFile(path5));
|
|
3637
3636
|
} catch {
|
|
3638
3637
|
return [];
|
|
3639
3638
|
}
|
|
@@ -3725,7 +3724,7 @@ async function collectWorkspaceChanges(dir, mode = "head", deps = defaultDeps) {
|
|
|
3725
3724
|
}
|
|
3726
3725
|
|
|
3727
3726
|
// src/commands/guard.ts
|
|
3728
|
-
import
|
|
3727
|
+
import path3 from "path";
|
|
3729
3728
|
import { parse as parseYaml7 } from "yaml";
|
|
3730
3729
|
|
|
3731
3730
|
// src/plugins/prisma.ts
|
|
@@ -3909,7 +3908,7 @@ function collectMatchedDomains(matchedArtifactDomains) {
|
|
|
3909
3908
|
}
|
|
3910
3909
|
|
|
3911
3910
|
// src/commands/guard.ts
|
|
3912
|
-
var ARCH_DIR2 = "
|
|
3911
|
+
var ARCH_DIR2 = "knowledge";
|
|
3913
3912
|
var CONFIG_PATH2 = ".kaddo/config.yml";
|
|
3914
3913
|
function loadConfig2(dir) {
|
|
3915
3914
|
const configPath = join(dir, CONFIG_PATH2);
|
|
@@ -3929,7 +3928,7 @@ function printHeader(touchedFiles) {
|
|
|
3929
3928
|
function artifactLabel(artifact, dir) {
|
|
3930
3929
|
if (artifact.id) return artifact.id;
|
|
3931
3930
|
if (artifact.title) return artifact.title;
|
|
3932
|
-
const rel =
|
|
3931
|
+
const rel = path3.relative(dir, artifact.filePath).split(path3.sep).join("/");
|
|
3933
3932
|
return rel || artifact.filePath;
|
|
3934
3933
|
}
|
|
3935
3934
|
function printWorkspaceHeader(scan2) {
|
|
@@ -4055,7 +4054,7 @@ async function runGuard(opts = {}) {
|
|
|
4055
4054
|
}
|
|
4056
4055
|
const archDir = join(dir, ARCH_DIR2);
|
|
4057
4056
|
if (!exists(archDir)) {
|
|
4058
|
-
console.log("kaddo guard: no
|
|
4057
|
+
console.log("kaddo guard: no knowledge/ directory found. Run `kaddo init` first.");
|
|
4059
4058
|
return;
|
|
4060
4059
|
}
|
|
4061
4060
|
const artifacts = readArtifacts(archDir);
|
|
@@ -4170,8 +4169,66 @@ function runIgnoreRemove(artifactId) {
|
|
|
4170
4169
|
import matter2 from "gray-matter";
|
|
4171
4170
|
import { parse as parseYaml8 } from "yaml";
|
|
4172
4171
|
|
|
4172
|
+
// src/core/layers.ts
|
|
4173
|
+
var KNOWLEDGE = "knowledge";
|
|
4174
|
+
var LAYER_SPEC = [
|
|
4175
|
+
{
|
|
4176
|
+
layer: "Business",
|
|
4177
|
+
items: [
|
|
4178
|
+
{ name: "problem", path: `${KNOWLEDGE}/business/problem.md` },
|
|
4179
|
+
{ name: "users", path: `${KNOWLEDGE}/business/users.md` },
|
|
4180
|
+
{ name: "value-proposition", path: `${KNOWLEDGE}/business/value-proposition.md` },
|
|
4181
|
+
{ name: "constraints", path: `${KNOWLEDGE}/business/constraints.md` },
|
|
4182
|
+
{ name: "business-rules", path: `${KNOWLEDGE}/business/business-rules.md` }
|
|
4183
|
+
]
|
|
4184
|
+
},
|
|
4185
|
+
{
|
|
4186
|
+
layer: "Product",
|
|
4187
|
+
items: [
|
|
4188
|
+
{ name: "product brief", path: `${KNOWLEDGE}/product/product-brief.md` },
|
|
4189
|
+
{ name: "capabilities", path: `${KNOWLEDGE}/product/capabilities.md` }
|
|
4190
|
+
]
|
|
4191
|
+
},
|
|
4192
|
+
{
|
|
4193
|
+
layer: "Tech",
|
|
4194
|
+
items: [
|
|
4195
|
+
{ name: "codebase", path: `${KNOWLEDGE}/tech/codebase.md` },
|
|
4196
|
+
{ name: "current-state", path: `${KNOWLEDGE}/tech/current-state.md` },
|
|
4197
|
+
{ name: "decisions", path: `${KNOWLEDGE}/tech/decisions` }
|
|
4198
|
+
]
|
|
4199
|
+
},
|
|
4200
|
+
{
|
|
4201
|
+
layer: "Delivery",
|
|
4202
|
+
items: [
|
|
4203
|
+
{ name: "roadmap", path: `${KNOWLEDGE}/delivery/roadmap.md` },
|
|
4204
|
+
{ name: "work items", path: `${KNOWLEDGE}/delivery/work-items` }
|
|
4205
|
+
]
|
|
4206
|
+
}
|
|
4207
|
+
];
|
|
4208
|
+
function knowledgeLayers(dir) {
|
|
4209
|
+
return LAYER_SPEC.map(({ layer, items }) => ({
|
|
4210
|
+
layer,
|
|
4211
|
+
items: items.map((it) => ({ name: it.name, present: exists(join(dir, it.path)) }))
|
|
4212
|
+
}));
|
|
4213
|
+
}
|
|
4214
|
+
function currentPhase(layers) {
|
|
4215
|
+
for (const { layer, items } of layers) {
|
|
4216
|
+
if (items.some((i) => !i.present)) return layer;
|
|
4217
|
+
}
|
|
4218
|
+
return "Delivery";
|
|
4219
|
+
}
|
|
4220
|
+
function renderLayersMarkdown(layers) {
|
|
4221
|
+
const lines = [];
|
|
4222
|
+
for (const { layer, items } of layers) {
|
|
4223
|
+
lines.push(`### ${layer}`);
|
|
4224
|
+
for (const it of items) lines.push(`- ${it.present ? "\u2713" : "\u2717"} ${it.name}`);
|
|
4225
|
+
lines.push("");
|
|
4226
|
+
}
|
|
4227
|
+
return lines.join("\n").trimEnd();
|
|
4228
|
+
}
|
|
4229
|
+
|
|
4173
4230
|
// src/core/project-explain.ts
|
|
4174
|
-
var ARCH_DIR3 = "
|
|
4231
|
+
var ARCH_DIR3 = "knowledge";
|
|
4175
4232
|
function first(values) {
|
|
4176
4233
|
if (Array.isArray(values)) {
|
|
4177
4234
|
const v = values.find((x) => typeof x === "string" && x);
|
|
@@ -4229,9 +4286,9 @@ function buildProjectExplanation(dir) {
|
|
|
4229
4286
|
hasInventory: exists(join(dir, ARCH_DIR3, "inventory.md")),
|
|
4230
4287
|
hasContextPack: exists(join(dir, ".kaddo", "context-pack.md")),
|
|
4231
4288
|
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")),
|
|
4289
|
+
hasCapabilities: exists(join(dir, ARCH_DIR3, "product", "capabilities.md")),
|
|
4290
|
+
hasArchitecture: exists(join(dir, ARCH_DIR3, "tech", "current-state.md")),
|
|
4291
|
+
hasRoadmap: exists(join(dir, ARCH_DIR3, "delivery", "roadmap.md")),
|
|
4235
4292
|
hasAgents: hasAgents(dir)
|
|
4236
4293
|
};
|
|
4237
4294
|
const archDir = join(dir, ARCH_DIR3);
|
|
@@ -4265,14 +4322,14 @@ function buildProjectExplanation(dir) {
|
|
|
4265
4322
|
const missingKnowledge = [];
|
|
4266
4323
|
if (!knowledge.hasScan) missingKnowledge.push("Scan baseline (.kaddo/scan.json)");
|
|
4267
4324
|
if (!knowledge.hasContextPack) missingKnowledge.push("Context pack (.kaddo/context-pack.md)");
|
|
4268
|
-
if (!knowledge.hasInventory) missingKnowledge.push("Inventory (
|
|
4325
|
+
if (!knowledge.hasInventory) missingKnowledge.push("Inventory (knowledge/inventory.md)");
|
|
4269
4326
|
if (!knowledge.hasCapabilities)
|
|
4270
|
-
missingKnowledge.push("Capabilities (
|
|
4327
|
+
missingKnowledge.push("Capabilities (knowledge/product/capabilities.md)");
|
|
4271
4328
|
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 (
|
|
4329
|
+
missingKnowledge.push("Architecture baseline (knowledge/tech/current-state.md)");
|
|
4330
|
+
if (!knowledge.hasRoadmap) missingKnowledge.push("Roadmap (knowledge/delivery/roadmap.md)");
|
|
4331
|
+
if (!knowledge.hasAgents) missingKnowledge.push("Agents (knowledge/agents/)");
|
|
4332
|
+
if (items.length === 0) missingKnowledge.push("Work items (knowledge/delivery/work-items/)");
|
|
4276
4333
|
const suggestedNextSteps = [];
|
|
4277
4334
|
if (!knowledge.hasScan) {
|
|
4278
4335
|
suggestedNextSteps.push("Run `kaddo scan` to detect the technical stack.");
|
|
@@ -4283,13 +4340,13 @@ function buildProjectExplanation(dir) {
|
|
|
4283
4340
|
suggestedNextSteps.push("Run `kaddo add agents` to install knowledge agents.");
|
|
4284
4341
|
}
|
|
4285
4342
|
if (!knowledge.hasCapabilities) {
|
|
4286
|
-
suggestedNextSteps.push("Use capability-agent to generate
|
|
4343
|
+
suggestedNextSteps.push("Use capability-agent to generate knowledge/product/capabilities.md.");
|
|
4287
4344
|
}
|
|
4288
4345
|
if (!knowledge.hasArchitecture) {
|
|
4289
|
-
suggestedNextSteps.push("Use architecture-agent to generate
|
|
4346
|
+
suggestedNextSteps.push("Use architecture-agent to generate knowledge/tech/current-state.md.");
|
|
4290
4347
|
}
|
|
4291
4348
|
if (!knowledge.hasRoadmap) {
|
|
4292
|
-
suggestedNextSteps.push("Use roadmap-agent to generate
|
|
4349
|
+
suggestedNextSteps.push("Use roadmap-agent to generate knowledge/delivery/roadmap.md.");
|
|
4293
4350
|
}
|
|
4294
4351
|
if (items.length === 0) {
|
|
4295
4352
|
suggestedNextSteps.push("Create your first Work Item with `kaddo create`.");
|
|
@@ -4305,6 +4362,7 @@ function buildProjectExplanation(dir) {
|
|
|
4305
4362
|
workItems,
|
|
4306
4363
|
ownership,
|
|
4307
4364
|
domains,
|
|
4365
|
+
layers: knowledgeLayers(dir),
|
|
4308
4366
|
mappedModules,
|
|
4309
4367
|
missingKnowledge,
|
|
4310
4368
|
suggestedNextSteps
|
|
@@ -4323,6 +4381,9 @@ function renderExplanationHuman(exp) {
|
|
|
4323
4381
|
lines.push(`- Team: ${exp.project.teamSize}`);
|
|
4324
4382
|
lines.push(`- Structure: ${exp.project.structure}`);
|
|
4325
4383
|
lines.push("");
|
|
4384
|
+
lines.push("## Knowledge Layers");
|
|
4385
|
+
lines.push(renderLayersMarkdown(exp.layers));
|
|
4386
|
+
lines.push("");
|
|
4326
4387
|
if (exp.stack) {
|
|
4327
4388
|
lines.push("## Detected Stack");
|
|
4328
4389
|
if (exp.stack.language) lines.push(`- Language: ${exp.stack.language}`);
|
|
@@ -4400,7 +4461,7 @@ function renderExplanationAgent(exp) {
|
|
|
4400
4461
|
}
|
|
4401
4462
|
|
|
4402
4463
|
// src/commands/explain.ts
|
|
4403
|
-
var ARCH_DIR4 = "
|
|
4464
|
+
var ARCH_DIR4 = "knowledge";
|
|
4404
4465
|
var CONFIG_PATH3 = ".kaddo/config.yml";
|
|
4405
4466
|
function readKnowledge(dir) {
|
|
4406
4467
|
const knowledgePath = join(dir, ARCH_DIR4, "knowledge.md");
|
|
@@ -4565,7 +4626,7 @@ function runExplain(opts) {
|
|
|
4565
4626
|
}
|
|
4566
4627
|
const archDir = join(dir, ARCH_DIR4);
|
|
4567
4628
|
if (!exists(archDir)) {
|
|
4568
|
-
console.error("No
|
|
4629
|
+
console.error("No knowledge/ directory found. Run `kaddo init` first.");
|
|
4569
4630
|
process.exit(1);
|
|
4570
4631
|
}
|
|
4571
4632
|
let artifacts = readArtifacts(archDir);
|
|
@@ -4588,7 +4649,7 @@ function runExplain(opts) {
|
|
|
4588
4649
|
// src/core/context-pack.ts
|
|
4589
4650
|
import matter3 from "gray-matter";
|
|
4590
4651
|
var CONTEXT_PACK_VERSION = "1";
|
|
4591
|
-
var ARCH_DIR5 = "
|
|
4652
|
+
var ARCH_DIR5 = "knowledge";
|
|
4592
4653
|
function readScanJson(dir) {
|
|
4593
4654
|
const scanPath = join(dir, ".kaddo", "scan.json");
|
|
4594
4655
|
if (!exists(scanPath)) return null;
|
|
@@ -4679,7 +4740,7 @@ function buildContextPack(dir, config, now = /* @__PURE__ */ new Date()) {
|
|
|
4679
4740
|
if (!knowledgeSummary) {
|
|
4680
4741
|
missing.push("No project knowledge summary found yet.");
|
|
4681
4742
|
}
|
|
4682
|
-
const roadmapSummary = readMarkdownSummary(dir, "roadmap.md") ?? "";
|
|
4743
|
+
const roadmapSummary = readMarkdownSummary(dir, "delivery/roadmap.md") ?? "";
|
|
4683
4744
|
if (!roadmapSummary) {
|
|
4684
4745
|
missing.push("No roadmap baseline found.");
|
|
4685
4746
|
}
|
|
@@ -4693,6 +4754,7 @@ function buildContextPack(dir, config, now = /* @__PURE__ */ new Date()) {
|
|
|
4693
4754
|
}
|
|
4694
4755
|
const state = config.project.state;
|
|
4695
4756
|
const mappedModules = loadMappedModules(dir);
|
|
4757
|
+
const layers = knowledgeLayers(dir);
|
|
4696
4758
|
return {
|
|
4697
4759
|
version: CONTEXT_PACK_VERSION,
|
|
4698
4760
|
generatedAt: now.toISOString(),
|
|
@@ -4719,6 +4781,7 @@ function buildContextPack(dir, config, now = /* @__PURE__ */ new Date()) {
|
|
|
4719
4781
|
workItems: workItems.map(toContextWorkItem),
|
|
4720
4782
|
artifacts: workItems.filter((a) => a.codeGlobs.length > 0).map(toContextArtifact)
|
|
4721
4783
|
},
|
|
4784
|
+
layers,
|
|
4722
4785
|
mappedModules,
|
|
4723
4786
|
missing,
|
|
4724
4787
|
handoff: {
|
|
@@ -4752,6 +4815,11 @@ function renderContextPack(pack) {
|
|
|
4752
4815
|
`- Structure: ${project.structure}`
|
|
4753
4816
|
].join("\n") + "\n"
|
|
4754
4817
|
);
|
|
4818
|
+
parts.push("## Knowledge Layers\n");
|
|
4819
|
+
parts.push(
|
|
4820
|
+
"Project knowledge is organized in four layers: **Business \u2192 Product \u2192 Tech \u2192 Delivery**.\n"
|
|
4821
|
+
);
|
|
4822
|
+
parts.push(renderLayersMarkdown(pack.layers) + "\n");
|
|
4755
4823
|
parts.push("## Technical Inventory\n");
|
|
4756
4824
|
if (scan2.available) {
|
|
4757
4825
|
const lines = [
|
|
@@ -4881,22 +4949,22 @@ function flowForState(state) {
|
|
|
4881
4949
|
switch (state) {
|
|
4882
4950
|
case "new":
|
|
4883
4951
|
return [
|
|
4884
|
-
{ agent: "roadmap-agent.md", output: "
|
|
4885
|
-
{ agent: "architecture-agent.md", output: "
|
|
4952
|
+
{ agent: "roadmap-agent.md", output: "knowledge/delivery/roadmap.md" },
|
|
4953
|
+
{ agent: "architecture-agent.md", output: "knowledge/tech/current-state.md" }
|
|
4886
4954
|
];
|
|
4887
4955
|
case "legacy":
|
|
4888
4956
|
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: "
|
|
4957
|
+
{ agent: "legacy-agent.md", output: "knowledge/legacy/risks.md" },
|
|
4958
|
+
{ agent: "architecture-agent.md", output: "knowledge/tech/current-state.md" },
|
|
4959
|
+
{ agent: "capability-agent.md", output: "knowledge/product/capabilities.md" },
|
|
4960
|
+
{ agent: "roadmap-agent.md", output: "knowledge/delivery/roadmap.md" }
|
|
4893
4961
|
];
|
|
4894
4962
|
case "pre-ai":
|
|
4895
4963
|
default:
|
|
4896
4964
|
return [
|
|
4897
|
-
{ agent: "capability-agent.md", output: "
|
|
4898
|
-
{ agent: "architecture-agent.md", output: "
|
|
4899
|
-
{ agent: "roadmap-agent.md", output: "
|
|
4965
|
+
{ agent: "capability-agent.md", output: "knowledge/product/capabilities.md" },
|
|
4966
|
+
{ agent: "architecture-agent.md", output: "knowledge/tech/current-state.md" },
|
|
4967
|
+
{ agent: "roadmap-agent.md", output: "knowledge/delivery/roadmap.md" }
|
|
4900
4968
|
];
|
|
4901
4969
|
}
|
|
4902
4970
|
}
|
|
@@ -4904,11 +4972,11 @@ function buildUnderstandPlan(dir, config) {
|
|
|
4904
4972
|
const state = config.project.state;
|
|
4905
4973
|
const flow = flowForState(state);
|
|
4906
4974
|
const steps = flow.map((s) => {
|
|
4907
|
-
const installed = exists(join(dir, "
|
|
4975
|
+
const installed = exists(join(dir, "knowledge", "agents", s.agent));
|
|
4908
4976
|
return { agent: s.agent, output: s.output, installed };
|
|
4909
4977
|
});
|
|
4910
4978
|
const missingAgents = steps.filter((s) => !s.installed).map((s) => s.agent);
|
|
4911
|
-
const agentsInstalled = exists(join(dir, "
|
|
4979
|
+
const agentsInstalled = exists(join(dir, "knowledge", "agents")) && missingAgents.length === 0;
|
|
4912
4980
|
return {
|
|
4913
4981
|
project: {
|
|
4914
4982
|
name: config.project.name,
|
|
@@ -4962,7 +5030,7 @@ function renderUnderstand(plan) {
|
|
|
4962
5030
|
`);
|
|
4963
5031
|
parts.push("## Agent Prompts\n");
|
|
4964
5032
|
parts.push(
|
|
4965
|
-
steps.map((s) => `- \`
|
|
5033
|
+
steps.map((s) => `- \`knowledge/agents/${s.agent}\``).join("\n") + "\n"
|
|
4966
5034
|
);
|
|
4967
5035
|
parts.push("## Expected Outputs\n");
|
|
4968
5036
|
parts.push(steps.map((s) => `- \`${s.output}\``).join("\n") + "\n");
|
|
@@ -4975,7 +5043,7 @@ function renderUnderstand(plan) {
|
|
|
4975
5043
|
"",
|
|
4976
5044
|
"1. Open your preferred LLM chat (Claude, ChatGPT, Cursor, Copilot, Windsurf\u2026).",
|
|
4977
5045
|
`2. Paste the context pack: \`${plan.contextPackPath}\``,
|
|
4978
|
-
`3. Paste the agent prompt: \`
|
|
5046
|
+
`3. Paste the agent prompt: \`knowledge/agents/${first2.agent}\``,
|
|
4979
5047
|
`4. Ask the LLM to produce: \`${first2.output}\``,
|
|
4980
5048
|
`5. Save the result in: \`${first2.output}\``
|
|
4981
5049
|
].join("\n") + "\n"
|
|
@@ -5014,7 +5082,7 @@ function renderUnderstandTerminal(plan) {
|
|
|
5014
5082
|
lines.push(`First step: use ${agentName(first2.agent)}.`);
|
|
5015
5083
|
lines.push("");
|
|
5016
5084
|
lines.push(` Context: ${plan.contextPackPath}`);
|
|
5017
|
-
lines.push(` Agent prompt:
|
|
5085
|
+
lines.push(` Agent prompt: knowledge/agents/${first2.agent}`);
|
|
5018
5086
|
lines.push(` Expected output: ${first2.output}`);
|
|
5019
5087
|
lines.push("");
|
|
5020
5088
|
}
|
|
@@ -5027,6 +5095,69 @@ function renderUnderstandTerminal(plan) {
|
|
|
5027
5095
|
return lines.join("\n");
|
|
5028
5096
|
}
|
|
5029
5097
|
|
|
5098
|
+
// src/agents/groups.ts
|
|
5099
|
+
var AGENT_GROUPS = {
|
|
5100
|
+
business: ["business-agent.md"],
|
|
5101
|
+
product: ["bootstrap-agent.md", "capability-agent.md"],
|
|
5102
|
+
tech: [
|
|
5103
|
+
"architecture-agent.md",
|
|
5104
|
+
"codebase-agent.md",
|
|
5105
|
+
"stack-agent.md",
|
|
5106
|
+
"security-agent.md",
|
|
5107
|
+
"standards-agent.md",
|
|
5108
|
+
"module-design-agent.md",
|
|
5109
|
+
"adr-agent.md"
|
|
5110
|
+
],
|
|
5111
|
+
delivery: ["roadmap-agent.md", "work-item-agent.md", "git-strategy-agent.md"],
|
|
5112
|
+
utilities: ["legacy-agent.md"]
|
|
5113
|
+
};
|
|
5114
|
+
var AGENT_GROUP_NAMES = Object.keys(AGENT_GROUPS);
|
|
5115
|
+
var RECOMMENDED_BY_STATE = {
|
|
5116
|
+
new: [
|
|
5117
|
+
"business-agent.md",
|
|
5118
|
+
"bootstrap-agent.md",
|
|
5119
|
+
"codebase-agent.md",
|
|
5120
|
+
"roadmap-agent.md",
|
|
5121
|
+
"work-item-agent.md"
|
|
5122
|
+
],
|
|
5123
|
+
"pre-ai": [
|
|
5124
|
+
"capability-agent.md",
|
|
5125
|
+
"architecture-agent.md",
|
|
5126
|
+
"roadmap-agent.md",
|
|
5127
|
+
"work-item-agent.md"
|
|
5128
|
+
],
|
|
5129
|
+
legacy: [
|
|
5130
|
+
"legacy-agent.md",
|
|
5131
|
+
"architecture-agent.md",
|
|
5132
|
+
"capability-agent.md",
|
|
5133
|
+
"roadmap-agent.md",
|
|
5134
|
+
"work-item-agent.md"
|
|
5135
|
+
]
|
|
5136
|
+
};
|
|
5137
|
+
function recommendedAgents(state) {
|
|
5138
|
+
return RECOMMENDED_BY_STATE[state ?? "pre-ai"] ?? RECOMMENDED_BY_STATE["pre-ai"];
|
|
5139
|
+
}
|
|
5140
|
+
function selectAgentFiles(opts) {
|
|
5141
|
+
if (opts.all) {
|
|
5142
|
+
const all = AGENT_GROUP_NAMES.flatMap((g) => AGENT_GROUPS[g]);
|
|
5143
|
+
return { files: all, label: "all agents" };
|
|
5144
|
+
}
|
|
5145
|
+
if (opts.group) {
|
|
5146
|
+
const group = opts.group;
|
|
5147
|
+
const files = AGENT_GROUPS[group];
|
|
5148
|
+
if (!files) {
|
|
5149
|
+
throw new Error(
|
|
5150
|
+
`Unknown agent group "${opts.group}". Valid groups: ${AGENT_GROUP_NAMES.join(", ")}.`
|
|
5151
|
+
);
|
|
5152
|
+
}
|
|
5153
|
+
return { files, label: `group: ${group}` };
|
|
5154
|
+
}
|
|
5155
|
+
return {
|
|
5156
|
+
files: recommendedAgents(opts.state),
|
|
5157
|
+
label: `recommended for state: ${opts.state ?? "pre-ai"}`
|
|
5158
|
+
};
|
|
5159
|
+
}
|
|
5160
|
+
|
|
5030
5161
|
// src/commands/understand.ts
|
|
5031
5162
|
function runUnderstand() {
|
|
5032
5163
|
const dir = cwd();
|
|
@@ -5059,13 +5190,22 @@ function runUnderstand() {
|
|
|
5059
5190
|
);
|
|
5060
5191
|
}
|
|
5061
5192
|
console.log(renderUnderstandTerminal(plan));
|
|
5193
|
+
const phase = currentPhase(knowledgeLayers(dir));
|
|
5194
|
+
const group = phase.toLowerCase();
|
|
5195
|
+
const groupAgents = (AGENT_GROUPS[group] ?? []).map((a) => a.replace(/\.md$/, ""));
|
|
5196
|
+
if (groupAgents.length > 0) {
|
|
5197
|
+
console.log("");
|
|
5198
|
+
console.log(`Current phase: ${phase}`);
|
|
5199
|
+
console.log("Recommended agents for this phase:");
|
|
5200
|
+
for (const a of groupAgents) console.log(` - ${a}`);
|
|
5201
|
+
}
|
|
5062
5202
|
writeFile(join(dir, ".kaddo", "understand.md"), renderUnderstand(plan));
|
|
5063
5203
|
log2.success("Wrote .kaddo/understand.md");
|
|
5064
5204
|
outro2("Handoff ready. CLI prepares context \u2014 your LLM creates the understanding.");
|
|
5065
5205
|
}
|
|
5066
5206
|
|
|
5067
5207
|
// src/core/classifier.ts
|
|
5068
|
-
import
|
|
5208
|
+
import path4 from "path";
|
|
5069
5209
|
var MIGRATION_PATTERNS = [
|
|
5070
5210
|
/supabase\/migrations\//,
|
|
5071
5211
|
/prisma\/migrations\//,
|
|
@@ -5104,7 +5244,7 @@ var DEP_PATTERNS = [
|
|
|
5104
5244
|
/^pom\.xml$/
|
|
5105
5245
|
];
|
|
5106
5246
|
function normalizePath2(p2) {
|
|
5107
|
-
return p2.split(
|
|
5247
|
+
return p2.split(path4.sep).join("/");
|
|
5108
5248
|
}
|
|
5109
5249
|
function matchesAny(file, patterns) {
|
|
5110
5250
|
const normalized = normalizePath2(file);
|
|
@@ -5215,7 +5355,7 @@ function classify(declaredType, declaredLevel, touchedFiles) {
|
|
|
5215
5355
|
}
|
|
5216
5356
|
|
|
5217
5357
|
// src/commands/classify.ts
|
|
5218
|
-
var ARCH_DIR6 = "
|
|
5358
|
+
var ARCH_DIR6 = "knowledge";
|
|
5219
5359
|
function findActiveWorkItem(dir) {
|
|
5220
5360
|
const archDir = join(dir, ARCH_DIR6);
|
|
5221
5361
|
if (!exists(archDir)) return null;
|
|
@@ -5283,7 +5423,7 @@ async function runClassify(opts = {}) {
|
|
|
5283
5423
|
|
|
5284
5424
|
// src/commands/status.ts
|
|
5285
5425
|
import { parse as parseYaml9 } from "yaml";
|
|
5286
|
-
var ARCH_DIR7 = "
|
|
5426
|
+
var ARCH_DIR7 = "knowledge";
|
|
5287
5427
|
var CONFIG_PATH4 = ".kaddo/config.yml";
|
|
5288
5428
|
function loadConfig3(dir) {
|
|
5289
5429
|
const p2 = join(dir, CONFIG_PATH4);
|
|
@@ -5297,7 +5437,7 @@ function loadConfig3(dir) {
|
|
|
5297
5437
|
function runStatus() {
|
|
5298
5438
|
const dir = cwd();
|
|
5299
5439
|
if (!exists(join(dir, ARCH_DIR7))) {
|
|
5300
|
-
console.error("No
|
|
5440
|
+
console.error("No knowledge/ directory found. Run `kaddo init` first.");
|
|
5301
5441
|
process.exit(1);
|
|
5302
5442
|
}
|
|
5303
5443
|
const config = loadConfig3(dir);
|
|
@@ -5347,8 +5487,8 @@ function runStatus() {
|
|
|
5347
5487
|
|
|
5348
5488
|
// src/commands/learn.ts
|
|
5349
5489
|
import matter4 from "gray-matter";
|
|
5350
|
-
var ARCH_DIR8 = "
|
|
5351
|
-
var WORK_ITEMS_DIR2 = "
|
|
5490
|
+
var ARCH_DIR8 = "knowledge";
|
|
5491
|
+
var WORK_ITEMS_DIR2 = "knowledge/delivery/work-items";
|
|
5352
5492
|
function findWorkItemFile(dir, id) {
|
|
5353
5493
|
const wiDir = join(dir, WORK_ITEMS_DIR2);
|
|
5354
5494
|
if (!exists(wiDir)) return null;
|
|
@@ -5389,7 +5529,7 @@ ${learning.trim()}
|
|
|
5389
5529
|
async function runLearn(artifactId) {
|
|
5390
5530
|
const dir = cwd();
|
|
5391
5531
|
if (!exists(join(dir, ARCH_DIR8))) {
|
|
5392
|
-
console.error("No
|
|
5532
|
+
console.error("No knowledge/ directory found. Run `kaddo init` first.");
|
|
5393
5533
|
process.exit(1);
|
|
5394
5534
|
}
|
|
5395
5535
|
intro2("kaddo learn");
|
|
@@ -5431,12 +5571,12 @@ async function runLearn(artifactId) {
|
|
|
5431
5571
|
updateWorkItemFile(filePath, learning.trim());
|
|
5432
5572
|
log2.success(`${targetId} marked as done`);
|
|
5433
5573
|
log2.success(`Learning recorded in ${filePath.replace(dir + "/", "")}`);
|
|
5434
|
-
log2.info("Consider updating
|
|
5574
|
+
log2.info("Consider updating knowledge/knowledge.md if this changes the current state.");
|
|
5435
5575
|
outro2("Work item closed.");
|
|
5436
5576
|
}
|
|
5437
5577
|
|
|
5438
5578
|
// src/commands/history.ts
|
|
5439
|
-
var ARCH_DIR9 = "
|
|
5579
|
+
var ARCH_DIR9 = "knowledge";
|
|
5440
5580
|
function formatRow(a) {
|
|
5441
5581
|
const id = (a.id || "").padEnd(8);
|
|
5442
5582
|
const type = a.type.padEnd(18);
|
|
@@ -5448,7 +5588,7 @@ function formatRow(a) {
|
|
|
5448
5588
|
function runHistory(opts = {}) {
|
|
5449
5589
|
const dir = cwd();
|
|
5450
5590
|
if (!exists(join(dir, ARCH_DIR9))) {
|
|
5451
|
-
console.error("No
|
|
5591
|
+
console.error("No knowledge/ directory found. Run `kaddo init` first.");
|
|
5452
5592
|
process.exit(1);
|
|
5453
5593
|
}
|
|
5454
5594
|
let artifacts = readArtifacts(join(dir, ARCH_DIR9)).filter(
|
|
@@ -5493,6 +5633,24 @@ function runHistory(opts = {}) {
|
|
|
5493
5633
|
// src/commands/add.ts
|
|
5494
5634
|
import { parse as parseYaml10, stringify as stringifyYaml3 } from "yaml";
|
|
5495
5635
|
var CONFIG_PATH5 = ".kaddo/config.yml";
|
|
5636
|
+
function readProjectState(dir) {
|
|
5637
|
+
const configPath = join(dir, CONFIG_PATH5);
|
|
5638
|
+
if (!exists(configPath)) return void 0;
|
|
5639
|
+
try {
|
|
5640
|
+
const config = parseYaml10(readFile(configPath));
|
|
5641
|
+
return config.project?.state;
|
|
5642
|
+
} catch {
|
|
5643
|
+
return void 0;
|
|
5644
|
+
}
|
|
5645
|
+
}
|
|
5646
|
+
function selectAgentModuleFiles(files, opts, state) {
|
|
5647
|
+
const { files: names, label } = selectAgentFiles({ all: opts.all, group: opts.group, state });
|
|
5648
|
+
const wanted = new Set(names);
|
|
5649
|
+
const selected = files.filter(
|
|
5650
|
+
(f) => f.path.endsWith("README.md") || names.some((n) => f.path.endsWith(n)) || wanted.has(f.path)
|
|
5651
|
+
);
|
|
5652
|
+
return { files: selected, label };
|
|
5653
|
+
}
|
|
5496
5654
|
function markModuleInstalled(dir, configKey, moduleName) {
|
|
5497
5655
|
const configPath = join(dir, CONFIG_PATH5);
|
|
5498
5656
|
if (!exists(configPath)) return;
|
|
@@ -5517,7 +5675,7 @@ function isModuleInstalled(dir, configKey) {
|
|
|
5517
5675
|
return false;
|
|
5518
5676
|
}
|
|
5519
5677
|
}
|
|
5520
|
-
function runAdd(moduleName, dir = cwd()) {
|
|
5678
|
+
function runAdd(moduleName, opts = {}, dir = cwd()) {
|
|
5521
5679
|
if (!moduleName) {
|
|
5522
5680
|
console.log("");
|
|
5523
5681
|
console.log("Available modules:");
|
|
@@ -5543,9 +5701,20 @@ function runAdd(moduleName, dir = cwd()) {
|
|
|
5543
5701
|
for (const d of mod.dirs) {
|
|
5544
5702
|
ensureDir(join(dir, d));
|
|
5545
5703
|
}
|
|
5704
|
+
let filesToInstall = mod.files;
|
|
5705
|
+
if (mod.name === "agents") {
|
|
5706
|
+
try {
|
|
5707
|
+
const sel = selectAgentModuleFiles(mod.files, opts, readProjectState(dir));
|
|
5708
|
+
filesToInstall = sel.files;
|
|
5709
|
+
log2.info(`Installing agents (${sel.label}).`);
|
|
5710
|
+
} catch (err) {
|
|
5711
|
+
console.error(err instanceof Error ? err.message : String(err));
|
|
5712
|
+
process.exit(1);
|
|
5713
|
+
}
|
|
5714
|
+
}
|
|
5546
5715
|
const written = [];
|
|
5547
5716
|
const skipped = [];
|
|
5548
|
-
for (const file of
|
|
5717
|
+
for (const file of filesToInstall) {
|
|
5549
5718
|
const fullPath = join(dir, file.path);
|
|
5550
5719
|
if (exists(fullPath)) {
|
|
5551
5720
|
skipped.push(file.path);
|
|
@@ -5568,6 +5737,7 @@ function runAdd(moduleName, dir = cwd()) {
|
|
|
5568
5737
|
console.log(" 2. Open your preferred LLM chat");
|
|
5569
5738
|
console.log(" 3. Paste `.kaddo/context-pack.md`");
|
|
5570
5739
|
console.log(" 4. Use the recommended agent for your project state");
|
|
5740
|
+
log2.info("More agents: `kaddo add agents --all` or `--group <business|product|tech|delivery|utilities>`.");
|
|
5571
5741
|
outro2("Agents installed. Kaddo prepares context \u2014 your LLM does the interpretation.");
|
|
5572
5742
|
return;
|
|
5573
5743
|
}
|
|
@@ -5582,7 +5752,7 @@ function runAdd(moduleName, dir = cwd()) {
|
|
|
5582
5752
|
|
|
5583
5753
|
// src/core/ownership-suggest.ts
|
|
5584
5754
|
import matter5 from "gray-matter";
|
|
5585
|
-
var WORK_ITEMS_DIR3 = "
|
|
5755
|
+
var WORK_ITEMS_DIR3 = "knowledge/delivery/work-items";
|
|
5586
5756
|
var SCAN_PATH = ".kaddo/scan.json";
|
|
5587
5757
|
function toStringArray3(value) {
|
|
5588
5758
|
return Array.isArray(value) ? value.map((v) => String(v)).filter(Boolean) : [];
|
|
@@ -5823,12 +5993,12 @@ ${globs.map((g) => ` - ${g}`).join("\n")}`);
|
|
|
5823
5993
|
|
|
5824
5994
|
// src/commands/module-descriptor.ts
|
|
5825
5995
|
import { parse as parseYaml11, stringify as stringifyYaml4 } from "yaml";
|
|
5826
|
-
var DESCRIPTOR_PATH2 = "
|
|
5996
|
+
var DESCRIPTOR_PATH2 = "knowledge/module.yml";
|
|
5827
5997
|
function readDescriptor(dir) {
|
|
5828
|
-
const
|
|
5829
|
-
if (!exists(
|
|
5998
|
+
const path5 = join(dir, DESCRIPTOR_PATH2);
|
|
5999
|
+
if (!exists(path5)) return null;
|
|
5830
6000
|
try {
|
|
5831
|
-
return parseYaml11(readFile(
|
|
6001
|
+
return parseYaml11(readFile(path5));
|
|
5832
6002
|
} catch {
|
|
5833
6003
|
return null;
|
|
5834
6004
|
}
|
|
@@ -5848,7 +6018,7 @@ async function runModuleDescriptor(opts) {
|
|
|
5848
6018
|
return;
|
|
5849
6019
|
}
|
|
5850
6020
|
intro2("kaddo module --init");
|
|
5851
|
-
log2.info("Creates
|
|
6021
|
+
log2.info("Creates knowledge/module.yml \u2014 declares this repository's identity for multirepo contexts.");
|
|
5852
6022
|
const name = await text2({
|
|
5853
6023
|
message: "Module name (this repository)",
|
|
5854
6024
|
placeholder: "e.g. payments-service",
|
|
@@ -5897,7 +6067,7 @@ async function runModuleDescriptor(opts) {
|
|
|
5897
6067
|
};
|
|
5898
6068
|
writeDescriptor(dir, descriptor);
|
|
5899
6069
|
log2.success(`Created ${DESCRIPTOR_PATH2}`);
|
|
5900
|
-
outro2(`Module descriptor ready. Share
|
|
6070
|
+
outro2(`Module descriptor ready. Share knowledge/module.yml with dependent repositories.`);
|
|
5901
6071
|
}
|
|
5902
6072
|
function printDescriptor(d) {
|
|
5903
6073
|
console.log("");
|
|
@@ -6063,7 +6233,7 @@ ${QUALITY}
|
|
|
6063
6233
|
- [ ] Capabilities describe outcomes, not implementation.
|
|
6064
6234
|
- [ ] Each capability cites evidence or is flagged as an assumption.
|
|
6065
6235
|
`;
|
|
6066
|
-
var
|
|
6236
|
+
var KNOWLEDGE2 = `---
|
|
6067
6237
|
type: current-state
|
|
6068
6238
|
updated_at: YYYY-MM-DD
|
|
6069
6239
|
---
|
|
@@ -6857,47 +7027,138 @@ ${QUALITY}
|
|
|
6857
7027
|
- [ ] Attributes are prioritized, not all "high".
|
|
6858
7028
|
- [ ] Trade-offs are explicit.
|
|
6859
7029
|
`;
|
|
7030
|
+
var BUSINESS_CONSOLIDATED = `---
|
|
7031
|
+
type: business
|
|
7032
|
+
status: draft
|
|
7033
|
+
---
|
|
7034
|
+
|
|
7035
|
+
# Business
|
|
7036
|
+
|
|
7037
|
+
> Created by \`kaddo bootstrap\`. The minimal **why** of the project. Refine with the
|
|
7038
|
+
> business-agent. As this matures it can split into problem.md, users.md, \u2026
|
|
7039
|
+
|
|
7040
|
+
## Problem
|
|
7041
|
+
|
|
7042
|
+
TBD
|
|
7043
|
+
|
|
7044
|
+
## Users
|
|
7045
|
+
|
|
7046
|
+
TBD
|
|
7047
|
+
|
|
7048
|
+
## Value Proposition
|
|
7049
|
+
|
|
7050
|
+
TBD
|
|
7051
|
+
|
|
7052
|
+
## Business Rules
|
|
7053
|
+
|
|
7054
|
+
- TBD
|
|
7055
|
+
|
|
7056
|
+
## Constraints
|
|
7057
|
+
|
|
7058
|
+
- TBD
|
|
7059
|
+
|
|
7060
|
+
## Assumptions
|
|
7061
|
+
|
|
7062
|
+
- ...
|
|
7063
|
+
|
|
7064
|
+
## Open Questions
|
|
7065
|
+
|
|
7066
|
+
- ...
|
|
7067
|
+
|
|
7068
|
+
${QUALITY}
|
|
7069
|
+
|
|
7070
|
+
- [ ] The problem is stated without assuming the solution.
|
|
7071
|
+
- [ ] Users have goals, not just labels.
|
|
7072
|
+
`;
|
|
7073
|
+
var PRODUCT_CONSOLIDATED = `---
|
|
7074
|
+
type: product
|
|
7075
|
+
status: draft
|
|
7076
|
+
---
|
|
7077
|
+
|
|
7078
|
+
# Product
|
|
7079
|
+
|
|
7080
|
+
> Created by \`kaddo bootstrap\`. The minimal **what** of the project. Refine with the
|
|
7081
|
+
> bootstrap-agent / capability-agent. As this matures it can split into product-brief.md
|
|
7082
|
+
> and capabilities.md.
|
|
7083
|
+
|
|
7084
|
+
## Product Brief
|
|
7085
|
+
|
|
7086
|
+
TBD
|
|
7087
|
+
|
|
7088
|
+
## Capabilities
|
|
7089
|
+
|
|
7090
|
+
- TBD
|
|
7091
|
+
|
|
7092
|
+
## Scope
|
|
7093
|
+
|
|
7094
|
+
- TBD
|
|
7095
|
+
|
|
7096
|
+
## Out of Scope
|
|
7097
|
+
|
|
7098
|
+
- TBD
|
|
7099
|
+
|
|
7100
|
+
## Success Criteria
|
|
7101
|
+
|
|
7102
|
+
- TBD
|
|
7103
|
+
|
|
7104
|
+
## Assumptions
|
|
7105
|
+
|
|
7106
|
+
- ...
|
|
7107
|
+
|
|
7108
|
+
## Open Questions
|
|
7109
|
+
|
|
7110
|
+
- ...
|
|
7111
|
+
|
|
7112
|
+
${QUALITY}
|
|
7113
|
+
|
|
7114
|
+
- [ ] The product fits in one page.
|
|
7115
|
+
- [ ] Scope and out-of-scope are explicit.
|
|
7116
|
+
`;
|
|
6860
7117
|
var CODEBASE_FOUNDATION = `---
|
|
6861
|
-
type: codebase
|
|
7118
|
+
type: codebase
|
|
6862
7119
|
status: draft
|
|
6863
7120
|
---
|
|
6864
7121
|
|
|
6865
|
-
# Codebase
|
|
7122
|
+
# Codebase
|
|
6866
7123
|
|
|
6867
|
-
> Created by \`kaddo bootstrap\`. Refine with the
|
|
6868
|
-
>
|
|
7124
|
+
> Created by \`kaddo bootstrap\`. The minimal **how** of the project. Refine with the
|
|
7125
|
+
> codebase-agent. It describes the intended base \u2014 it does **not** generate code.
|
|
6869
7126
|
|
|
6870
|
-
##
|
|
7127
|
+
## Repository Structure
|
|
6871
7128
|
|
|
6872
7129
|
TBD
|
|
6873
7130
|
|
|
6874
|
-
##
|
|
7131
|
+
## Candidate Stack
|
|
7132
|
+
|
|
7133
|
+
- TBD
|
|
7134
|
+
|
|
7135
|
+
## Quality Attributes
|
|
6875
7136
|
|
|
6876
7137
|
- TBD
|
|
6877
7138
|
|
|
6878
|
-
##
|
|
7139
|
+
## Development Standards
|
|
6879
7140
|
|
|
6880
7141
|
- TBD
|
|
6881
7142
|
|
|
6882
|
-
## Git
|
|
7143
|
+
## Git Strategy
|
|
6883
7144
|
|
|
6884
|
-
See \`
|
|
7145
|
+
GitHub Flow + Conventional Commits + SemVer (default). See \`kaddo add git-strategy\`.
|
|
6885
7146
|
|
|
6886
|
-
##
|
|
7147
|
+
## Initial Modules
|
|
6887
7148
|
|
|
6888
|
-
-
|
|
7149
|
+
- TBD
|
|
6889
7150
|
|
|
6890
7151
|
## Assumptions
|
|
6891
7152
|
|
|
6892
7153
|
- ...
|
|
6893
7154
|
|
|
6894
|
-
## Open
|
|
7155
|
+
## Open Questions
|
|
6895
7156
|
|
|
6896
7157
|
- ...
|
|
6897
7158
|
|
|
6898
7159
|
${QUALITY}
|
|
6899
7160
|
|
|
6900
|
-
- [ ] Structure follows
|
|
7161
|
+
- [ ] Structure follows business and product, not a framework default.
|
|
6901
7162
|
- [ ] No production code is described here \u2014 only the foundation.
|
|
6902
7163
|
`;
|
|
6903
7164
|
var BOOTSTRAP_SUMMARY = `---
|
|
@@ -6911,7 +7172,7 @@ status: draft
|
|
|
6911
7172
|
|
|
6912
7173
|
## Layers
|
|
6913
7174
|
|
|
6914
|
-
- **Business** \u2014 \`
|
|
7175
|
+
- **Business** \u2014 \`knowledge/business/\`
|
|
6915
7176
|
- **Architecture** \u2014 capabilities, quality-attributes, stack, current-state, decisions
|
|
6916
7177
|
- **Codebase** \u2014 codebase-foundation, standards, git-strategy
|
|
6917
7178
|
- **Development** \u2014 roadmap, work-items
|
|
@@ -6927,7 +7188,7 @@ status: draft
|
|
|
6927
7188
|
|
|
6928
7189
|
1. Run \`kaddo context\` and \`kaddo add agents\`.
|
|
6929
7190
|
2. Refine the artifacts with the business-agent, bootstrap-agent and
|
|
6930
|
-
codebase-
|
|
7191
|
+
codebase-agent in your LLM.
|
|
6931
7192
|
3. Run \`kaddo create --from roadmap\` to create the first Work Items.
|
|
6932
7193
|
|
|
6933
7194
|
## Open questions
|
|
@@ -6944,8 +7205,8 @@ var KADDO_TEMPLATES = [
|
|
|
6944
7205
|
{
|
|
6945
7206
|
id: "work-item",
|
|
6946
7207
|
name: "Work Item",
|
|
6947
|
-
category: "
|
|
6948
|
-
outputPath: "
|
|
7208
|
+
category: "delivery",
|
|
7209
|
+
outputPath: "knowledge/delivery/work-items/",
|
|
6949
7210
|
description: "Smallest traceable unit of product evolution.",
|
|
6950
7211
|
whenToUse: "When you start any change (feature, bugfix, hotfix, spike).",
|
|
6951
7212
|
relatedCommand: "kaddo create",
|
|
@@ -6955,8 +7216,8 @@ var KADDO_TEMPLATES = [
|
|
|
6955
7216
|
{
|
|
6956
7217
|
id: "roadmap",
|
|
6957
7218
|
name: "Roadmap",
|
|
6958
|
-
category: "
|
|
6959
|
-
outputPath: "
|
|
7219
|
+
category: "delivery",
|
|
7220
|
+
outputPath: "knowledge/delivery/roadmap.md",
|
|
6960
7221
|
description: "Initiatives and candidate work items for human review.",
|
|
6961
7222
|
whenToUse: "When planning what to build next and why.",
|
|
6962
7223
|
relatedCommand: "kaddo create --from roadmap",
|
|
@@ -6966,107 +7227,138 @@ var KADDO_TEMPLATES = [
|
|
|
6966
7227
|
{
|
|
6967
7228
|
id: "capabilities",
|
|
6968
7229
|
name: "Capabilities",
|
|
6969
|
-
category: "
|
|
6970
|
-
outputPath: "
|
|
7230
|
+
category: "product",
|
|
7231
|
+
outputPath: "knowledge/product/capabilities.md",
|
|
6971
7232
|
description: "What the system can do from the product point of view.",
|
|
6972
7233
|
whenToUse: "When mapping product capabilities to the system.",
|
|
6973
7234
|
relatedAgent: "capability-agent",
|
|
7235
|
+
advanced: true,
|
|
6974
7236
|
content: CAPABILITIES
|
|
6975
7237
|
},
|
|
6976
7238
|
{
|
|
6977
7239
|
id: "knowledge",
|
|
6978
7240
|
name: "Knowledge (Current State)",
|
|
6979
|
-
category: "
|
|
6980
|
-
outputPath: "
|
|
7241
|
+
category: "tech",
|
|
7242
|
+
outputPath: "knowledge/knowledge.md",
|
|
6981
7243
|
description: "What is true about the product right now.",
|
|
6982
7244
|
whenToUse: "Created by `kaddo init`; keep it current as the product evolves.",
|
|
6983
7245
|
relatedCommand: "kaddo init",
|
|
6984
|
-
content:
|
|
7246
|
+
content: KNOWLEDGE2
|
|
6985
7247
|
},
|
|
6986
|
-
// business (bootstrap)
|
|
7248
|
+
// business / product (bootstrap — consolidated, minimal)
|
|
7249
|
+
{
|
|
7250
|
+
id: "business",
|
|
7251
|
+
name: "Business",
|
|
7252
|
+
category: "business",
|
|
7253
|
+
outputPath: "knowledge/business/business.md",
|
|
7254
|
+
description: "The minimal why: problem, users, value, rules, constraints (one file).",
|
|
7255
|
+
whenToUse: "Generated by kaddo bootstrap for new projects.",
|
|
7256
|
+
relatedCommand: "kaddo bootstrap",
|
|
7257
|
+
relatedAgent: "business-agent",
|
|
7258
|
+
content: BUSINESS_CONSOLIDATED
|
|
7259
|
+
},
|
|
7260
|
+
{
|
|
7261
|
+
id: "product",
|
|
7262
|
+
name: "Product",
|
|
7263
|
+
category: "product",
|
|
7264
|
+
outputPath: "knowledge/product/product.md",
|
|
7265
|
+
description: "The minimal what: product brief, capabilities, scope (one file).",
|
|
7266
|
+
whenToUse: "Generated by kaddo bootstrap for new projects.",
|
|
7267
|
+
relatedCommand: "kaddo bootstrap",
|
|
7268
|
+
relatedAgent: "bootstrap-agent",
|
|
7269
|
+
content: PRODUCT_CONSOLIDATED
|
|
7270
|
+
},
|
|
7271
|
+
// business (advanced — split out as knowledge matures, not generated by bootstrap)
|
|
6987
7272
|
{
|
|
6988
7273
|
id: "business-product-brief",
|
|
6989
7274
|
name: "Product Brief",
|
|
6990
|
-
category: "
|
|
6991
|
-
outputPath: "
|
|
7275
|
+
category: "product",
|
|
7276
|
+
outputPath: "knowledge/product/product-brief.md",
|
|
6992
7277
|
description: "The product in one page: problem, users, value, MVP boundary.",
|
|
6993
7278
|
whenToUse: "At the start of a new project (kaddo bootstrap).",
|
|
6994
7279
|
relatedCommand: "kaddo bootstrap",
|
|
6995
7280
|
relatedAgent: "business-agent",
|
|
7281
|
+
advanced: true,
|
|
6996
7282
|
content: BUSINESS_PRODUCT_BRIEF
|
|
6997
7283
|
},
|
|
6998
7284
|
{
|
|
6999
7285
|
id: "business-problem",
|
|
7000
7286
|
name: "Problem Statement",
|
|
7001
7287
|
category: "business",
|
|
7002
|
-
outputPath: "
|
|
7288
|
+
outputPath: "knowledge/business/problem.md",
|
|
7003
7289
|
description: "The problem the product solves, without assuming the solution.",
|
|
7004
7290
|
whenToUse: "When defining a new project (kaddo bootstrap).",
|
|
7005
7291
|
relatedCommand: "kaddo bootstrap",
|
|
7006
7292
|
relatedAgent: "business-agent",
|
|
7293
|
+
advanced: true,
|
|
7007
7294
|
content: BUSINESS_PROBLEM
|
|
7008
7295
|
},
|
|
7009
7296
|
{
|
|
7010
7297
|
id: "business-users",
|
|
7011
7298
|
name: "Users & Personas",
|
|
7012
7299
|
category: "business",
|
|
7013
|
-
outputPath: "
|
|
7300
|
+
outputPath: "knowledge/business/users.md",
|
|
7014
7301
|
description: "Primary and secondary users with goals.",
|
|
7015
7302
|
whenToUse: "When defining a new project (kaddo bootstrap).",
|
|
7016
7303
|
relatedCommand: "kaddo bootstrap",
|
|
7017
7304
|
relatedAgent: "business-agent",
|
|
7305
|
+
advanced: true,
|
|
7018
7306
|
content: BUSINESS_USERS
|
|
7019
7307
|
},
|
|
7020
7308
|
{
|
|
7021
7309
|
id: "business-value-proposition",
|
|
7022
7310
|
name: "Value Proposition",
|
|
7023
7311
|
category: "business",
|
|
7024
|
-
outputPath: "
|
|
7312
|
+
outputPath: "knowledge/business/value-proposition.md",
|
|
7025
7313
|
description: "For whom, what we offer and why it is better.",
|
|
7026
7314
|
whenToUse: "When defining a new project (kaddo bootstrap).",
|
|
7027
7315
|
relatedCommand: "kaddo bootstrap",
|
|
7028
7316
|
relatedAgent: "business-agent",
|
|
7317
|
+
advanced: true,
|
|
7029
7318
|
content: BUSINESS_VALUE_PROPOSITION
|
|
7030
7319
|
},
|
|
7031
7320
|
{
|
|
7032
7321
|
id: "business-rules",
|
|
7033
7322
|
name: "Business Rules",
|
|
7034
7323
|
category: "business",
|
|
7035
|
-
outputPath: "
|
|
7324
|
+
outputPath: "knowledge/business/business-rules.md",
|
|
7036
7325
|
description: "Product rules as testable statements.",
|
|
7037
7326
|
whenToUse: "When defining a new project (kaddo bootstrap).",
|
|
7038
7327
|
relatedCommand: "kaddo bootstrap",
|
|
7039
7328
|
relatedAgent: "business-agent",
|
|
7329
|
+
advanced: true,
|
|
7040
7330
|
content: BUSINESS_RULES
|
|
7041
7331
|
},
|
|
7042
7332
|
{
|
|
7043
7333
|
id: "business-constraints",
|
|
7044
7334
|
name: "Business Constraints",
|
|
7045
7335
|
category: "business",
|
|
7046
|
-
outputPath: "
|
|
7336
|
+
outputPath: "knowledge/business/constraints.md",
|
|
7047
7337
|
description: "Business, regulatory and resource constraints.",
|
|
7048
7338
|
whenToUse: "When defining a new project (kaddo bootstrap).",
|
|
7049
7339
|
relatedCommand: "kaddo bootstrap",
|
|
7050
7340
|
relatedAgent: "business-agent",
|
|
7341
|
+
advanced: true,
|
|
7051
7342
|
content: BUSINESS_CONSTRAINTS
|
|
7052
7343
|
},
|
|
7053
7344
|
{
|
|
7054
7345
|
id: "business-glossary",
|
|
7055
7346
|
name: "Glossary",
|
|
7056
7347
|
category: "business",
|
|
7057
|
-
outputPath: "
|
|
7348
|
+
outputPath: "knowledge/business/glossary.md",
|
|
7058
7349
|
description: "Shared vocabulary for the project.",
|
|
7059
7350
|
whenToUse: "When defining a new project (kaddo bootstrap).",
|
|
7060
7351
|
relatedCommand: "kaddo bootstrap",
|
|
7061
7352
|
relatedAgent: "business-agent",
|
|
7353
|
+
advanced: true,
|
|
7062
7354
|
content: BUSINESS_GLOSSARY
|
|
7063
7355
|
},
|
|
7064
7356
|
// architecture
|
|
7065
7357
|
{
|
|
7066
7358
|
id: "current-state",
|
|
7067
7359
|
name: "Current State",
|
|
7068
|
-
category: "
|
|
7069
|
-
outputPath: "
|
|
7360
|
+
category: "tech",
|
|
7361
|
+
outputPath: "knowledge/tech/current-state.md",
|
|
7070
7362
|
description: "Reconstructed architecture baseline.",
|
|
7071
7363
|
whenToUse: "When establishing the architecture baseline of an existing system.",
|
|
7072
7364
|
relatedAgent: "architecture-agent",
|
|
@@ -7075,8 +7367,8 @@ var KADDO_TEMPLATES = [
|
|
|
7075
7367
|
{
|
|
7076
7368
|
id: "architecture-notes",
|
|
7077
7369
|
name: "Architecture Notes",
|
|
7078
|
-
category: "
|
|
7079
|
-
outputPath: "
|
|
7370
|
+
category: "tech",
|
|
7371
|
+
outputPath: "knowledge/tech/architecture-notes.md",
|
|
7080
7372
|
description: "Working notes on architecture topics not yet decided.",
|
|
7081
7373
|
whenToUse: "When exploring an architecture topic before it becomes an ADR.",
|
|
7082
7374
|
content: ARCHITECTURE_NOTES
|
|
@@ -7084,8 +7376,8 @@ var KADDO_TEMPLATES = [
|
|
|
7084
7376
|
{
|
|
7085
7377
|
id: "decision-candidates",
|
|
7086
7378
|
name: "Decision Candidates",
|
|
7087
|
-
category: "
|
|
7088
|
-
outputPath: "
|
|
7379
|
+
category: "tech",
|
|
7380
|
+
outputPath: "knowledge/tech/decision-candidates.md",
|
|
7089
7381
|
description: "Candidate architecture decisions for human review.",
|
|
7090
7382
|
whenToUse: "When surfacing decisions that may become ADRs.",
|
|
7091
7383
|
relatedAgent: "adr-agent",
|
|
@@ -7094,30 +7386,31 @@ var KADDO_TEMPLATES = [
|
|
|
7094
7386
|
{
|
|
7095
7387
|
id: "quality-attributes",
|
|
7096
7388
|
name: "Quality Attributes",
|
|
7097
|
-
category: "
|
|
7098
|
-
outputPath: "
|
|
7389
|
+
category: "tech",
|
|
7390
|
+
outputPath: "knowledge/tech/quality-attributes.md",
|
|
7099
7391
|
description: "Prioritized quality attributes and accepted trade-offs.",
|
|
7100
7392
|
whenToUse: "During bootstrap, to record what matters most technically.",
|
|
7101
7393
|
relatedCommand: "kaddo bootstrap",
|
|
7102
7394
|
relatedAgent: "bootstrap-agent",
|
|
7395
|
+
advanced: true,
|
|
7103
7396
|
content: QUALITY_ATTRIBUTES
|
|
7104
7397
|
},
|
|
7105
7398
|
{
|
|
7106
|
-
id: "codebase
|
|
7399
|
+
id: "codebase",
|
|
7107
7400
|
name: "Codebase Foundation",
|
|
7108
|
-
category: "
|
|
7109
|
-
outputPath: "
|
|
7401
|
+
category: "tech",
|
|
7402
|
+
outputPath: "knowledge/tech/codebase.md",
|
|
7110
7403
|
description: "Intended codebase structure and conventions (no source code).",
|
|
7111
7404
|
whenToUse: "During bootstrap, before writing code.",
|
|
7112
7405
|
relatedCommand: "kaddo bootstrap",
|
|
7113
|
-
relatedAgent: "codebase-
|
|
7406
|
+
relatedAgent: "codebase-agent",
|
|
7114
7407
|
content: CODEBASE_FOUNDATION
|
|
7115
7408
|
},
|
|
7116
7409
|
{
|
|
7117
7410
|
id: "bootstrap-summary",
|
|
7118
7411
|
name: "Bootstrap Summary",
|
|
7119
|
-
category: "
|
|
7120
|
-
outputPath: "
|
|
7412
|
+
category: "tech",
|
|
7413
|
+
outputPath: "knowledge/bootstrap-summary.md",
|
|
7121
7414
|
description: "Index of the initial knowledge base and next steps.",
|
|
7122
7415
|
whenToUse: "Generated by kaddo bootstrap.",
|
|
7123
7416
|
relatedCommand: "kaddo bootstrap",
|
|
@@ -7127,8 +7420,8 @@ var KADDO_TEMPLATES = [
|
|
|
7127
7420
|
{
|
|
7128
7421
|
id: "adr",
|
|
7129
7422
|
name: "ADR",
|
|
7130
|
-
category: "
|
|
7131
|
-
outputPath: "
|
|
7423
|
+
category: "tech",
|
|
7424
|
+
outputPath: "knowledge/tech/decisions/",
|
|
7132
7425
|
description: "A single architecture decision record.",
|
|
7133
7426
|
whenToUse: "When recording a significant, accepted architecture decision.",
|
|
7134
7427
|
relatedCommand: "kaddo create adr",
|
|
@@ -7139,7 +7432,7 @@ var KADDO_TEMPLATES = [
|
|
|
7139
7432
|
id: "module-design",
|
|
7140
7433
|
name: "Module Design",
|
|
7141
7434
|
category: "module",
|
|
7142
|
-
outputPath: "
|
|
7435
|
+
outputPath: "knowledge/tech/modules/<id>/module-design.md",
|
|
7143
7436
|
description: "A module's purpose, boundaries and dependencies.",
|
|
7144
7437
|
whenToUse: "After mapping a secondary repo as a module.",
|
|
7145
7438
|
relatedCommand: "kaddo modules map",
|
|
@@ -7150,7 +7443,7 @@ var KADDO_TEMPLATES = [
|
|
|
7150
7443
|
id: "module-stack",
|
|
7151
7444
|
name: "Module Stack",
|
|
7152
7445
|
category: "module",
|
|
7153
|
-
outputPath: "
|
|
7446
|
+
outputPath: "knowledge/tech/modules/<id>/stack.md",
|
|
7154
7447
|
description: "A module's technology stack.",
|
|
7155
7448
|
whenToUse: "To document the stack of a specific module.",
|
|
7156
7449
|
relatedAgent: "stack-agent",
|
|
@@ -7160,7 +7453,7 @@ var KADDO_TEMPLATES = [
|
|
|
7160
7453
|
id: "module-security",
|
|
7161
7454
|
name: "Module Security",
|
|
7162
7455
|
category: "module",
|
|
7163
|
-
outputPath: "
|
|
7456
|
+
outputPath: "knowledge/tech/modules/<id>/security.md",
|
|
7164
7457
|
description: "A module's security considerations.",
|
|
7165
7458
|
whenToUse: "To document security concerns specific to a module.",
|
|
7166
7459
|
relatedAgent: "security-agent",
|
|
@@ -7170,7 +7463,7 @@ var KADDO_TEMPLATES = [
|
|
|
7170
7463
|
id: "module-standards",
|
|
7171
7464
|
name: "Module Standards",
|
|
7172
7465
|
category: "module",
|
|
7173
|
-
outputPath: "
|
|
7466
|
+
outputPath: "knowledge/tech/modules/<id>/standards.md",
|
|
7174
7467
|
description: "A module's coding and testing standards.",
|
|
7175
7468
|
whenToUse: "When a module needs standards beyond the system defaults.",
|
|
7176
7469
|
relatedAgent: "standards-agent",
|
|
@@ -7180,7 +7473,7 @@ var KADDO_TEMPLATES = [
|
|
|
7180
7473
|
id: "module-adr",
|
|
7181
7474
|
name: "Module ADR",
|
|
7182
7475
|
category: "module",
|
|
7183
|
-
outputPath: "
|
|
7476
|
+
outputPath: "knowledge/tech/modules/<id>/adrs/",
|
|
7184
7477
|
description: "A module-scoped architecture decision record.",
|
|
7185
7478
|
whenToUse: "When a decision affects only one module.",
|
|
7186
7479
|
content: MODULE_ADR
|
|
@@ -7190,7 +7483,7 @@ var KADDO_TEMPLATES = [
|
|
|
7190
7483
|
id: "security",
|
|
7191
7484
|
name: "Security",
|
|
7192
7485
|
category: "operations",
|
|
7193
|
-
outputPath: "
|
|
7486
|
+
outputPath: "knowledge/tech/security.md",
|
|
7194
7487
|
description: "Global security considerations (no scanning).",
|
|
7195
7488
|
whenToUse: "To document system-wide security concerns.",
|
|
7196
7489
|
relatedCommand: "kaddo add security",
|
|
@@ -7201,7 +7494,7 @@ var KADDO_TEMPLATES = [
|
|
|
7201
7494
|
id: "standards",
|
|
7202
7495
|
name: "Standards",
|
|
7203
7496
|
category: "operations",
|
|
7204
|
-
outputPath: "
|
|
7497
|
+
outputPath: "knowledge/tech/standards.md",
|
|
7205
7498
|
description: "Global lightweight coding/docs/testing standards.",
|
|
7206
7499
|
whenToUse: "To document system-wide standards.",
|
|
7207
7500
|
relatedCommand: "kaddo add standards",
|
|
@@ -7212,7 +7505,7 @@ var KADDO_TEMPLATES = [
|
|
|
7212
7505
|
id: "stack",
|
|
7213
7506
|
name: "Stack",
|
|
7214
7507
|
category: "operations",
|
|
7215
|
-
outputPath: "
|
|
7508
|
+
outputPath: "knowledge/tech/stack.md",
|
|
7216
7509
|
description: "Global technology stack documentation.",
|
|
7217
7510
|
whenToUse: "To document the system-wide stack.",
|
|
7218
7511
|
relatedCommand: "kaddo add stack",
|
|
@@ -7223,7 +7516,7 @@ var KADDO_TEMPLATES = [
|
|
|
7223
7516
|
id: "git-strategy",
|
|
7224
7517
|
name: "Git Strategy",
|
|
7225
7518
|
category: "operations",
|
|
7226
|
-
outputPath: "
|
|
7519
|
+
outputPath: "knowledge/tech/git-strategy.md",
|
|
7227
7520
|
description: "Recommended, customizable Git workflow.",
|
|
7228
7521
|
whenToUse: "To agree on branching, commits and tagging.",
|
|
7229
7522
|
relatedCommand: "kaddo add git-strategy",
|
|
@@ -7234,7 +7527,7 @@ var KADDO_TEMPLATES = [
|
|
|
7234
7527
|
id: "incident",
|
|
7235
7528
|
name: "Incident",
|
|
7236
7529
|
category: "operations",
|
|
7237
|
-
outputPath: "
|
|
7530
|
+
outputPath: "knowledge/incidents/",
|
|
7238
7531
|
description: "A post-incident record.",
|
|
7239
7532
|
whenToUse: "After a production incident.",
|
|
7240
7533
|
relatedCommand: "kaddo create incident",
|
|
@@ -7244,7 +7537,7 @@ var KADDO_TEMPLATES = [
|
|
|
7244
7537
|
id: "runbook",
|
|
7245
7538
|
name: "Runbook",
|
|
7246
7539
|
category: "operations",
|
|
7247
|
-
outputPath: "
|
|
7540
|
+
outputPath: "knowledge/runbooks/",
|
|
7248
7541
|
description: "How to perform a recurring operational task safely.",
|
|
7249
7542
|
whenToUse: "For repeatable operational procedures.",
|
|
7250
7543
|
content: RUNBOOK
|
|
@@ -7254,7 +7547,7 @@ var KADDO_TEMPLATES = [
|
|
|
7254
7547
|
id: "legacy-risks",
|
|
7255
7548
|
name: "Legacy Risks",
|
|
7256
7549
|
category: "legacy",
|
|
7257
|
-
outputPath: "
|
|
7550
|
+
outputPath: "knowledge/legacy/risks.md",
|
|
7258
7551
|
description: "High-risk areas before changing legacy code.",
|
|
7259
7552
|
whenToUse: "Before modifying legacy code.",
|
|
7260
7553
|
relatedAgent: "legacy-agent",
|
|
@@ -7264,7 +7557,7 @@ var KADDO_TEMPLATES = [
|
|
|
7264
7557
|
id: "legacy-unknowns",
|
|
7265
7558
|
name: "Legacy Unknowns",
|
|
7266
7559
|
category: "legacy",
|
|
7267
|
-
outputPath: "
|
|
7560
|
+
outputPath: "knowledge/legacy/unknowns.md",
|
|
7268
7561
|
description: "What is not yet understood about the legacy system.",
|
|
7269
7562
|
whenToUse: "When surfacing gaps in legacy knowledge.",
|
|
7270
7563
|
relatedAgent: "legacy-agent",
|
|
@@ -7274,7 +7567,7 @@ var KADDO_TEMPLATES = [
|
|
|
7274
7567
|
id: "modernization-candidates",
|
|
7275
7568
|
name: "Modernization Candidates",
|
|
7276
7569
|
category: "legacy",
|
|
7277
|
-
outputPath: "
|
|
7570
|
+
outputPath: "knowledge/legacy/modernization-candidates.md",
|
|
7278
7571
|
description: "Candidate modernization efforts for human review.",
|
|
7279
7572
|
whenToUse: "When planning legacy modernization.",
|
|
7280
7573
|
content: MODERNIZATION_CANDIDATES
|
|
@@ -7301,10 +7594,10 @@ function slugify2(name) {
|
|
|
7301
7594
|
return name.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
7302
7595
|
}
|
|
7303
7596
|
function readModulesDescriptor(dir) {
|
|
7304
|
-
const
|
|
7305
|
-
if (!exists(
|
|
7597
|
+
const path5 = join(dir, DESCRIPTOR_PATH3);
|
|
7598
|
+
if (!exists(path5)) return { version: 1, modules: [] };
|
|
7306
7599
|
try {
|
|
7307
|
-
const parsed = parseYaml12(readFile(
|
|
7600
|
+
const parsed = parseYaml12(readFile(path5));
|
|
7308
7601
|
return { version: parsed.version ?? 1, modules: parsed.modules ?? [] };
|
|
7309
7602
|
} catch {
|
|
7310
7603
|
return { version: 1, modules: [] };
|
|
@@ -7314,7 +7607,7 @@ function writeModulesDescriptor(dir, descriptor) {
|
|
|
7314
7607
|
writeFile(join(dir, DESCRIPTOR_PATH3), stringifyYaml5(descriptor));
|
|
7315
7608
|
}
|
|
7316
7609
|
function moduleDir(id) {
|
|
7317
|
-
return `
|
|
7610
|
+
return `knowledge/tech/modules/${id}`;
|
|
7318
7611
|
}
|
|
7319
7612
|
function buildModule(input) {
|
|
7320
7613
|
const id = slugify2(input.name);
|
|
@@ -7511,30 +7804,14 @@ function runModulesList(dir = cwd()) {
|
|
|
7511
7804
|
// src/commands/bootstrap.ts
|
|
7512
7805
|
var CONFIG_PATH8 = ".kaddo/config.yml";
|
|
7513
7806
|
var TARGETS = [
|
|
7514
|
-
//
|
|
7515
|
-
|
|
7516
|
-
|
|
7517
|
-
{ layer: "Business", path: "
|
|
7518
|
-
{ layer: "
|
|
7519
|
-
{ layer: "
|
|
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" }
|
|
7807
|
+
// Minimum sufficient knowledge: one consolidated file per layer. Specialized
|
|
7808
|
+
// artifacts (problem.md, users.md, capabilities.md, …) appear later, as the project
|
|
7809
|
+
// matures, via agents and refinement — not at bootstrap.
|
|
7810
|
+
{ layer: "Business", path: "knowledge/business/business.md", templateId: "business" },
|
|
7811
|
+
{ layer: "Product", path: "knowledge/product/product.md", templateId: "product" },
|
|
7812
|
+
{ layer: "Tech", path: "knowledge/tech/codebase.md", templateId: "codebase" }
|
|
7536
7813
|
];
|
|
7537
|
-
var BOOTSTRAP_LAYERS = ["Business", "
|
|
7814
|
+
var BOOTSTRAP_LAYERS = ["Business", "Product", "Tech"];
|
|
7538
7815
|
function bootstrap(dir) {
|
|
7539
7816
|
const written = [];
|
|
7540
7817
|
const skipped = [];
|
|
@@ -7550,15 +7827,6 @@ function bootstrap(dir) {
|
|
|
7550
7827
|
`);
|
|
7551
7828
|
written.push(target.path);
|
|
7552
7829
|
}
|
|
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
7830
|
return { written, skipped, layers: BOOTSTRAP_LAYERS };
|
|
7563
7831
|
}
|
|
7564
7832
|
async function runBootstrap(dir = cwd()) {
|
|
@@ -7578,7 +7846,7 @@ async function runBootstrap(dir = cwd()) {
|
|
|
7578
7846
|
process.exit(1);
|
|
7579
7847
|
}
|
|
7580
7848
|
log2.info(`Project state: ${state}`);
|
|
7581
|
-
log2.info("Base layers: Business \u2192
|
|
7849
|
+
log2.info("Base layers: Business \u2192 Product \u2192 Tech \u2192 Delivery");
|
|
7582
7850
|
if (state !== "new") {
|
|
7583
7851
|
log2.warn("This project is not marked as new. Bootstrap is designed for new projects.");
|
|
7584
7852
|
const ok = await confirm2({ message: "Continue anyway?", initialValue: false });
|
|
@@ -7603,20 +7871,20 @@ async function runBootstrap(dir = cwd()) {
|
|
|
7603
7871
|
}
|
|
7604
7872
|
console.log("");
|
|
7605
7873
|
outro2(
|
|
7606
|
-
"
|
|
7874
|
+
"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
7875
|
);
|
|
7608
7876
|
}
|
|
7609
7877
|
|
|
7610
7878
|
// src/index.ts
|
|
7611
7879
|
var program = new Command();
|
|
7612
|
-
program.name("kaddo").description("Knowledge Driven Development toolkit").version("
|
|
7880
|
+
program.name("kaddo").description("Knowledge Driven Development toolkit").version("3.1.0");
|
|
7613
7881
|
program.command("init").description("Initialize Kaddo in the current project").action(async () => {
|
|
7614
7882
|
await runInit();
|
|
7615
7883
|
});
|
|
7616
7884
|
program.command("scan").description("Detect project stack and suggest domains").action(async () => {
|
|
7617
7885
|
await runScan();
|
|
7618
7886
|
});
|
|
7619
|
-
program.command("bootstrap").description("Build the initial knowledge base for a new project (Business \u2192
|
|
7887
|
+
program.command("bootstrap").description("Build the initial knowledge base for a new project (Business \u2192 Product \u2192 Tech \u2192 Delivery)").action(async () => {
|
|
7620
7888
|
await runBootstrap();
|
|
7621
7889
|
});
|
|
7622
7890
|
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 +7931,7 @@ program.command("owners [action]").description("List domain owners, or run `owne
|
|
|
7663
7931
|
runOwners(opts);
|
|
7664
7932
|
}
|
|
7665
7933
|
});
|
|
7666
|
-
program.command("module").description("Show or initialize the multirepo module descriptor (
|
|
7934
|
+
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
7935
|
await runModuleDescriptor(opts);
|
|
7668
7936
|
});
|
|
7669
7937
|
var modulesCmd = program.command("modules").description("Map and list secondary repositories as modules of the system (multirepo)");
|
|
@@ -7673,8 +7941,8 @@ modulesCmd.command("map").description("Register a secondary repository as a modu
|
|
|
7673
7941
|
modulesCmd.command("list").description("List mapped modules").action(() => {
|
|
7674
7942
|
runModulesList();
|
|
7675
7943
|
});
|
|
7676
|
-
program.command("add [module]").description("Install an optional Kaddo module (adr, incident, rfc, migration, legacy, agents, standards, security, stack, git-strategy)").action((moduleName) => {
|
|
7677
|
-
runAdd(moduleName ?? "");
|
|
7944
|
+
program.command("add [module]").description("Install an optional Kaddo module (adr, incident, rfc, migration, legacy, agents, standards, security, stack, git-strategy)").option("--all", "For `add agents`: install every agent (not just the recommended set)").option("--group <name>", "For `add agents`: install one layer group (business, product, tech, delivery, utilities)").action((moduleName, opts) => {
|
|
7945
|
+
runAdd(moduleName ?? "", { all: opts.all, group: opts.group });
|
|
7678
7946
|
});
|
|
7679
7947
|
program.parseAsync(process.argv).catch((err) => {
|
|
7680
7948
|
console.error(err);
|