@kaddo/cli 3.49.0 → 3.50.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/dist/index.js +119 -56
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9052,7 +9052,7 @@ function buildReadinessReport(dir, now = /* @__PURE__ */ new Date()) {
|
|
|
9052
9052
|
const ctx = buildCodexAdapterContext(dir);
|
|
9053
9053
|
const agents = ctx.hasAgents ? "present" : "missing";
|
|
9054
9054
|
const skills = ctx.hasSkills ? "present" : "missing";
|
|
9055
|
-
const
|
|
9055
|
+
const bootstrapBaseline2 = presence.business !== "missing" && presence.product !== "missing" ? "complete" : "incomplete";
|
|
9056
9056
|
const roadmap = roadmapSignal(dir);
|
|
9057
9057
|
const work_items = workItemsSignal(dir);
|
|
9058
9058
|
const adapters = installedAdapters(dir);
|
|
@@ -9060,7 +9060,7 @@ function buildReadinessReport(dir, now = /* @__PURE__ */ new Date()) {
|
|
|
9060
9060
|
const signals = {
|
|
9061
9061
|
scan: scan2,
|
|
9062
9062
|
understand,
|
|
9063
|
-
bootstrap_baseline:
|
|
9063
|
+
bootstrap_baseline: bootstrapBaseline2,
|
|
9064
9064
|
agents,
|
|
9065
9065
|
skills,
|
|
9066
9066
|
current_state: presence.current_state,
|
|
@@ -9079,7 +9079,7 @@ function buildReadinessReport(dir, now = /* @__PURE__ */ new Date()) {
|
|
|
9079
9079
|
const firstWeak = KNOWLEDGE_FILES.find((f) => presence[f.key] !== "useful");
|
|
9080
9080
|
let overall;
|
|
9081
9081
|
if (scan2 === "missing") overall = "initialized";
|
|
9082
|
-
else if (
|
|
9082
|
+
else if (bootstrapBaseline2 === "incomplete") overall = "bootstrap-incomplete";
|
|
9083
9083
|
else if (agents === "missing") overall = "agents-missing";
|
|
9084
9084
|
else if (skills === "missing") overall = "skills-missing";
|
|
9085
9085
|
else if (understand === "missing") overall = "scanned";
|
|
@@ -9346,6 +9346,14 @@ var scanRepository = {
|
|
|
9346
9346
|
return { status: "done", evidence: [".kaddo/scan.json"] };
|
|
9347
9347
|
}
|
|
9348
9348
|
};
|
|
9349
|
+
var bootstrapBaseline = {
|
|
9350
|
+
id: "bootstrap",
|
|
9351
|
+
label: "Bootstrap knowledge baseline",
|
|
9352
|
+
evaluate: (ctx) => {
|
|
9353
|
+
if (ctx.qBusiness !== "missing" && ctx.qProduct !== "missing") return { status: "done", evidence: ["knowledge/business/business.md", "knowledge/product/product.md"] };
|
|
9354
|
+
return { status: "pending", command: "kaddo bootstrap", reason: "The knowledge baseline is incomplete." };
|
|
9355
|
+
}
|
|
9356
|
+
};
|
|
9349
9357
|
var defineBusiness = {
|
|
9350
9358
|
id: "define-business",
|
|
9351
9359
|
label: "Define business context",
|
|
@@ -9542,6 +9550,7 @@ var NEW_STEPS = [
|
|
|
9542
9550
|
var PRE_AI_STEPS = [
|
|
9543
9551
|
enableKaddo,
|
|
9544
9552
|
scanRepository,
|
|
9553
|
+
bootstrapBaseline,
|
|
9545
9554
|
defineBusiness,
|
|
9546
9555
|
defineProduct,
|
|
9547
9556
|
discoverCapabilities,
|
|
@@ -9559,6 +9568,7 @@ var PRE_AI_STEPS = [
|
|
|
9559
9568
|
var LEGACY_STEPS = [
|
|
9560
9569
|
enableKaddo,
|
|
9561
9570
|
scanRepository,
|
|
9571
|
+
bootstrapBaseline,
|
|
9562
9572
|
identifyLegacyModules,
|
|
9563
9573
|
{ ...discoverCapabilities, label: "Discover critical capabilities" },
|
|
9564
9574
|
describeArchitecture,
|
|
@@ -9650,7 +9660,7 @@ function loadScanWarnings(dir) {
|
|
|
9650
9660
|
function mapNextStepId(id) {
|
|
9651
9661
|
const MAP = {
|
|
9652
9662
|
init: "enable-kaddo",
|
|
9653
|
-
bootstrap: "
|
|
9663
|
+
bootstrap: "bootstrap",
|
|
9654
9664
|
"add-agents": "enable-kaddo",
|
|
9655
9665
|
"add-skills": "enable-kaddo",
|
|
9656
9666
|
scan: "scan-repository",
|
|
@@ -9819,6 +9829,15 @@ function hasAgents(dir) {
|
|
|
9819
9829
|
}
|
|
9820
9830
|
return hasAgentMd(agentsDir);
|
|
9821
9831
|
}
|
|
9832
|
+
function hasSkills(dir) {
|
|
9833
|
+
const skillsDir = join(dir, ARCH_DIR4, "skills");
|
|
9834
|
+
if (!exists(skillsDir)) return false;
|
|
9835
|
+
try {
|
|
9836
|
+
return readDir(skillsDir).some((e) => e.endsWith(".md") && isFile(join(skillsDir, e)));
|
|
9837
|
+
} catch {
|
|
9838
|
+
return false;
|
|
9839
|
+
}
|
|
9840
|
+
}
|
|
9822
9841
|
function buildProjectExplanation(dir) {
|
|
9823
9842
|
const config = loadConfig(dir);
|
|
9824
9843
|
const project = {
|
|
@@ -9845,10 +9864,13 @@ function buildProjectExplanation(dir) {
|
|
|
9845
9864
|
hasInventory: exists(join(dir, ARCH_DIR4, "inventory.md")),
|
|
9846
9865
|
hasContextPack: exists(join(dir, ".kaddo", "context-pack.md")),
|
|
9847
9866
|
hasUnderstand: exists(join(dir, ".kaddo", "understand.md")),
|
|
9867
|
+
hasBusiness: exists(join(dir, "knowledge/business/business.md")),
|
|
9868
|
+
hasProduct: exists(join(dir, "knowledge/product/product.md")),
|
|
9848
9869
|
hasCapabilities: layerStatus("Product") !== "Missing",
|
|
9849
9870
|
hasArchitecture: layerStatus("Tech") !== "Missing",
|
|
9850
9871
|
hasRoadmap: layerStatus("Delivery") !== "Missing",
|
|
9851
|
-
hasAgents: hasAgents(dir)
|
|
9872
|
+
hasAgents: hasAgents(dir),
|
|
9873
|
+
hasSkills: hasSkills(dir)
|
|
9852
9874
|
};
|
|
9853
9875
|
const workItemArtifacts = discoverWorkItems(dir);
|
|
9854
9876
|
const items = workItemArtifacts.map((a) => {
|
|
@@ -9913,33 +9935,42 @@ function buildProjectExplanation(dir) {
|
|
|
9913
9935
|
if (!knowledge.hasAgents) missingKnowledge.push("Agents (knowledge/agents/)");
|
|
9914
9936
|
if (items.length === 0) missingKnowledge.push("Work items (knowledge/delivery/work-items/)");
|
|
9915
9937
|
const suggestedNextSteps = [];
|
|
9916
|
-
|
|
9917
|
-
|
|
9918
|
-
|
|
9919
|
-
suggestedNextSteps.push("
|
|
9920
|
-
|
|
9921
|
-
|
|
9922
|
-
suggestedNextSteps.push("
|
|
9923
|
-
}
|
|
9924
|
-
|
|
9925
|
-
|
|
9926
|
-
|
|
9927
|
-
|
|
9928
|
-
|
|
9929
|
-
|
|
9930
|
-
|
|
9931
|
-
|
|
9932
|
-
|
|
9933
|
-
|
|
9934
|
-
|
|
9935
|
-
)
|
|
9936
|
-
|
|
9937
|
-
|
|
9938
|
-
|
|
9939
|
-
|
|
9940
|
-
|
|
9941
|
-
|
|
9942
|
-
|
|
9938
|
+
const baselineIncomplete = !knowledge.hasBusiness || !knowledge.hasProduct;
|
|
9939
|
+
if (baselineIncomplete) {
|
|
9940
|
+
suggestedNextSteps.push("Run `kaddo bootstrap` to create the project knowledge baseline.");
|
|
9941
|
+
if (!knowledge.hasAgents) suggestedNextSteps.push("Then run `kaddo add agents`.");
|
|
9942
|
+
if (!knowledge.hasSkills) suggestedNextSteps.push("Then run `kaddo add skills`.");
|
|
9943
|
+
suggestedNextSteps.push("Then run `kaddo context`.");
|
|
9944
|
+
suggestedNextSteps.push("Then run `kaddo understand`.");
|
|
9945
|
+
} else {
|
|
9946
|
+
if (!knowledge.hasScan) {
|
|
9947
|
+
suggestedNextSteps.push("Run `kaddo scan` to detect the technical stack.");
|
|
9948
|
+
} else if (!knowledge.hasContextPack) {
|
|
9949
|
+
suggestedNextSteps.push("Run `kaddo context` to prepare an LLM context pack.");
|
|
9950
|
+
}
|
|
9951
|
+
if (!knowledge.hasAgents) {
|
|
9952
|
+
suggestedNextSteps.push("Run `kaddo add agents` to install knowledge agents.");
|
|
9953
|
+
}
|
|
9954
|
+
if (!knowledge.hasCapabilities) {
|
|
9955
|
+
suggestedNextSteps.push("Use capability-agent to generate knowledge/product/capabilities.md.");
|
|
9956
|
+
}
|
|
9957
|
+
if (!knowledge.hasArchitecture) {
|
|
9958
|
+
suggestedNextSteps.push("Use architecture-agent to generate knowledge/tech/current-state.md.");
|
|
9959
|
+
}
|
|
9960
|
+
if (!knowledge.hasRoadmap) {
|
|
9961
|
+
suggestedNextSteps.push("Use roadmap-agent to generate knowledge/delivery/roadmap.md.");
|
|
9962
|
+
} else if (roadmap.remaining > 0) {
|
|
9963
|
+
suggestedNextSteps.push(
|
|
9964
|
+
`Materialize ${roadmap.remaining} roadmap candidate(s) with \`kaddo create --from roadmap\`.`
|
|
9965
|
+
);
|
|
9966
|
+
}
|
|
9967
|
+
if (items.length === 0 && !roadmap.present) {
|
|
9968
|
+
suggestedNextSteps.push("Create your first Work Item with `kaddo create`.");
|
|
9969
|
+
} else if (ownership.workItemsMissingOwnership > 0) {
|
|
9970
|
+
suggestedNextSteps.push(
|
|
9971
|
+
"Run `kaddo owners suggest` for Work Items without code ownership."
|
|
9972
|
+
);
|
|
9973
|
+
}
|
|
9943
9974
|
}
|
|
9944
9975
|
const readiness = buildReadinessReport(dir);
|
|
9945
9976
|
return {
|
|
@@ -10978,19 +11009,35 @@ function renderContextPack(pack) {
|
|
|
10978
11009
|
parts.push(pack.skills.map((s) => `- ${s}`).join("\n") + "\n");
|
|
10979
11010
|
parts.push("Read full skill definitions in `knowledge/skills/` or via the Kaddo MCP server (`kaddo://skills`).\n");
|
|
10980
11011
|
}
|
|
11012
|
+
const isBootstrapIncomplete = rec.id === "bootstrap";
|
|
10981
11013
|
parts.push("## Missing Context\n");
|
|
10982
|
-
if (
|
|
11014
|
+
if (isBootstrapIncomplete) {
|
|
11015
|
+
const baselineMissing = [
|
|
11016
|
+
"- Bootstrap baseline is incomplete.",
|
|
11017
|
+
...!pack.knowledgeQuality.business || pack.knowledgeQuality.business.status === "Missing" ? ["- Missing business knowledge."] : [],
|
|
11018
|
+
...!pack.knowledgeQuality.product || pack.knowledgeQuality.product.status === "Missing" ? ["- Missing product knowledge."] : []
|
|
11019
|
+
];
|
|
11020
|
+
if (missing.length > 0) {
|
|
11021
|
+
baselineMissing.push(...missing.filter((m) => !baselineMissing.some((b) => b.includes(m))));
|
|
11022
|
+
}
|
|
11023
|
+
parts.push(baselineMissing.join("\n") + "\n");
|
|
11024
|
+
} else if (missing.length > 0) {
|
|
10983
11025
|
parts.push(missing.map((m) => `- ${m}`).join("\n") + "\n");
|
|
10984
11026
|
} else {
|
|
10985
11027
|
parts.push("_None \u2014 all expected context is present._\n");
|
|
10986
11028
|
}
|
|
10987
11029
|
parts.push("## Recommended Agent Handoff\n");
|
|
10988
|
-
|
|
11030
|
+
if (isBootstrapIncomplete) {
|
|
11031
|
+
parts.push("No agent handoff yet.\n");
|
|
11032
|
+
parts.push("Run `kaddo bootstrap` first to create the baseline files.\n");
|
|
11033
|
+
} else {
|
|
11034
|
+
parts.push(`Recommended next for the **${pack.phase.phase}** phase:
|
|
10989
11035
|
`);
|
|
10990
|
-
|
|
10991
|
-
|
|
10992
|
-
|
|
10993
|
-
|
|
11036
|
+
parts.push(handoff.recommendedAgents.map((a, i) => `${i + 1}. ${a}`).join("\n") + "\n");
|
|
11037
|
+
if (handoff.nextSteps.length > 0) {
|
|
11038
|
+
parts.push("Next step:\n");
|
|
11039
|
+
parts.push(handoff.nextSteps.map((s) => `- ${s}`).join("\n") + "\n");
|
|
11040
|
+
}
|
|
10994
11041
|
}
|
|
10995
11042
|
parts.push("## Instructions for the LLM\n");
|
|
10996
11043
|
parts.push(handoff.instructions.map((i) => `- ${i}`).join("\n") + "\n");
|
|
@@ -11155,7 +11202,12 @@ function renderUnderstand(plan) {
|
|
|
11155
11202
|
parts.push("## Project Route\n");
|
|
11156
11203
|
parts.push(renderRouteCompact(plan.projectRoute));
|
|
11157
11204
|
}
|
|
11158
|
-
|
|
11205
|
+
const isBootstrap = rec && rec.id === "bootstrap";
|
|
11206
|
+
if (isBootstrap) {
|
|
11207
|
+
parts.push("## Agent Handoff\n");
|
|
11208
|
+
parts.push("Agent handoff is not ready yet.\n");
|
|
11209
|
+
parts.push("Run `kaddo bootstrap` first.\n");
|
|
11210
|
+
} else if (steps.length > 0) {
|
|
11159
11211
|
parts.push("## Recommended Agent Flow\n");
|
|
11160
11212
|
parts.push(`Recommended order for a ${stateLabel2(project.state)} project:
|
|
11161
11213
|
`);
|
|
@@ -11308,25 +11360,36 @@ function renderUnderstandTerminal(plan) {
|
|
|
11308
11360
|
lines.push(`Team: ${project.teamSize}`);
|
|
11309
11361
|
lines.push(`Structure: ${project.structure}`);
|
|
11310
11362
|
lines.push("");
|
|
11311
|
-
const
|
|
11312
|
-
|
|
11313
|
-
|
|
11314
|
-
|
|
11315
|
-
|
|
11316
|
-
|
|
11317
|
-
});
|
|
11318
|
-
lines.push("");
|
|
11319
|
-
lines.push(`First step: use ${agentName(first2.agent)}.`);
|
|
11320
|
-
lines.push("");
|
|
11321
|
-
lines.push(` Context: ${plan.contextPackPath}`);
|
|
11322
|
-
lines.push(` Agent prompt: ${agentInstallPath(first2.agent)}`);
|
|
11323
|
-
lines.push(` Expected output: ${first2.output}`);
|
|
11363
|
+
const rec = plan.nextStepRecommendation;
|
|
11364
|
+
const isBootstrapIncomplete = rec && rec.id === "bootstrap";
|
|
11365
|
+
if (isBootstrapIncomplete) {
|
|
11366
|
+
lines.push("Current phase: Setup");
|
|
11367
|
+
lines.push("Next step: Run `kaddo bootstrap` to create the project knowledge baseline.");
|
|
11368
|
+
lines.push("Reason: The knowledge baseline is incomplete.");
|
|
11324
11369
|
lines.push("");
|
|
11325
|
-
lines.push("
|
|
11326
|
-
lines.push("
|
|
11327
|
-
lines.push(" prompt. Ask the LLM to generate the expected output and save it in the target file.");
|
|
11370
|
+
lines.push("Agent handoff is not ready yet.");
|
|
11371
|
+
lines.push("Run `kaddo bootstrap` first.");
|
|
11328
11372
|
} else {
|
|
11329
|
-
|
|
11373
|
+
const first2 = steps[0];
|
|
11374
|
+
if (first2) {
|
|
11375
|
+
lines.push("Foundational knowledge still needed:");
|
|
11376
|
+
steps.forEach((s, i) => {
|
|
11377
|
+
const flag = s.installed ? "" : " (not installed)";
|
|
11378
|
+
lines.push(` ${i + 1}. ${agentName(s.agent)} \u2192 ${s.output}${flag}`);
|
|
11379
|
+
});
|
|
11380
|
+
lines.push("");
|
|
11381
|
+
lines.push(`First step: use ${agentName(first2.agent)}.`);
|
|
11382
|
+
lines.push("");
|
|
11383
|
+
lines.push(` Context: ${plan.contextPackPath}`);
|
|
11384
|
+
lines.push(` Agent prompt: ${agentInstallPath(first2.agent)}`);
|
|
11385
|
+
lines.push(` Expected output: ${first2.output}`);
|
|
11386
|
+
lines.push("");
|
|
11387
|
+
lines.push("Instructions:");
|
|
11388
|
+
lines.push(" Open your preferred LLM chat, paste the context pack, then paste the agent");
|
|
11389
|
+
lines.push(" prompt. Ask the LLM to generate the expected output and save it in the target file.");
|
|
11390
|
+
} else {
|
|
11391
|
+
lines.push("Foundational knowledge looks complete \u2014 see the phase recommendation below.");
|
|
11392
|
+
}
|
|
11330
11393
|
}
|
|
11331
11394
|
lines.push("");
|
|
11332
11395
|
lines.push("Kaddo does not call an LLM. You stay in control of the interpretation.");
|