@kaddo/cli 3.51.0 → 3.52.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 +154 -93
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4643,6 +4643,7 @@ var RECOMMENDED_BY_STATE = {
|
|
|
4643
4643
|
"adr-agent.md"
|
|
4644
4644
|
],
|
|
4645
4645
|
"pre-ai": [
|
|
4646
|
+
"business-agent.md",
|
|
4646
4647
|
"capability-agent.md",
|
|
4647
4648
|
"architecture-agent.md",
|
|
4648
4649
|
"roadmap-agent.md",
|
|
@@ -8860,19 +8861,32 @@ function resolveNextStep(dir, now = /* @__PURE__ */ new Date()) {
|
|
|
8860
8861
|
return { id: "understand", phase: "Discovery", label: "Run `kaddo understand` to summarize the project context.", command: "kaddo understand", reason: "No understand handoff has been generated yet." };
|
|
8861
8862
|
}
|
|
8862
8863
|
const discovery = state === "pre-ai" || state === "legacy";
|
|
8863
|
-
const
|
|
8864
|
-
|
|
8865
|
-
|
|
8866
|
-
|
|
8867
|
-
|
|
8868
|
-
|
|
8869
|
-
|
|
8870
|
-
|
|
8871
|
-
|
|
8872
|
-
|
|
8873
|
-
|
|
8874
|
-
|
|
8875
|
-
|
|
8864
|
+
const resolveAgent = (agent) => {
|
|
8865
|
+
const file = agent.endsWith(".md") ? agent : `${agent}.md`;
|
|
8866
|
+
const path6 = agentInstallPath(file);
|
|
8867
|
+
const installed = isFile(join(dir, path6));
|
|
8868
|
+
const group = agentGroupOf(file);
|
|
8869
|
+
return { agentPath: path6, agentInstalled: installed, installCommand: installed ? void 0 : `kaddo add agents --group ${group}` };
|
|
8870
|
+
};
|
|
8871
|
+
const refine = (id, agent, target, quality, verb = "complete") => {
|
|
8872
|
+
const ar = resolveAgent(agent);
|
|
8873
|
+
return {
|
|
8874
|
+
id,
|
|
8875
|
+
phase: "Knowledge Refinement",
|
|
8876
|
+
label: `Use ${agent} to ${verb} \`${target}\`.`,
|
|
8877
|
+
agent,
|
|
8878
|
+
target,
|
|
8879
|
+
agentPath: ar.agentPath,
|
|
8880
|
+
agentInstalled: ar.agentInstalled,
|
|
8881
|
+
installCommand: ar.installCommand,
|
|
8882
|
+
reason: `${target} is ${quality === "missing" ? "missing" : "still a bootstrap placeholder or too thin"}.`,
|
|
8883
|
+
instructions: [
|
|
8884
|
+
"The baseline file exists but does not yet hold real, project-specific knowledge.",
|
|
8885
|
+
`Use the ${agent} to replace the placeholders with real knowledge.`,
|
|
8886
|
+
"Do not write code."
|
|
8887
|
+
]
|
|
8888
|
+
};
|
|
8889
|
+
};
|
|
8876
8890
|
if (qBusiness !== "useful") return refine("refine-business", "business-agent", B, qBusiness);
|
|
8877
8891
|
if (qProduct !== "useful" || qCap !== "useful") {
|
|
8878
8892
|
if (qCap !== "useful") {
|
|
@@ -9665,7 +9679,12 @@ function mapNextStepId(id) {
|
|
|
9665
9679
|
"add-skills": "enable-kaddo",
|
|
9666
9680
|
scan: "scan-repository",
|
|
9667
9681
|
context: "scan-repository",
|
|
9668
|
-
understand: "scan-repository"
|
|
9682
|
+
understand: "scan-repository",
|
|
9683
|
+
"refine-business": "define-business",
|
|
9684
|
+
"refine-product": "define-product",
|
|
9685
|
+
"refine-capabilities": "discover-capabilities",
|
|
9686
|
+
"refine-current-state": "describe-architecture",
|
|
9687
|
+
"refine-codebase": "describe-architecture"
|
|
9669
9688
|
};
|
|
9670
9689
|
return MAP[id] ?? id;
|
|
9671
9690
|
}
|
|
@@ -11034,9 +11053,22 @@ function renderContextPack(pack) {
|
|
|
11034
11053
|
if (isBootstrapIncomplete) {
|
|
11035
11054
|
parts.push("No agent handoff yet.\n");
|
|
11036
11055
|
parts.push("Run `kaddo bootstrap` first to create the baseline files.\n");
|
|
11056
|
+
} else if (rec.agent && rec.agentInstalled === false) {
|
|
11057
|
+
parts.push(`Recommended agent: ${rec.agent.replace(/\.md$/, "")}
|
|
11058
|
+
`);
|
|
11059
|
+
parts.push("**Agent is not installed.**\n");
|
|
11060
|
+
if (rec.installCommand) {
|
|
11061
|
+
parts.push(`Run \`${rec.installCommand}\` to install it.
|
|
11062
|
+
`);
|
|
11063
|
+
}
|
|
11064
|
+
parts.push("Then run `kaddo context` and `kaddo understand`.\n");
|
|
11037
11065
|
} else {
|
|
11038
11066
|
parts.push(`Recommended next for the **${pack.phase.phase}** phase:
|
|
11039
11067
|
`);
|
|
11068
|
+
if (rec.agentPath) {
|
|
11069
|
+
parts.push(`Agent prompt: \`${rec.agentPath}\`
|
|
11070
|
+
`);
|
|
11071
|
+
}
|
|
11040
11072
|
parts.push(handoff.recommendedAgents.map((a, i) => `${i + 1}. ${a}`).join("\n") + "\n");
|
|
11041
11073
|
if (handoff.nextSteps.length > 0) {
|
|
11042
11074
|
parts.push("Next step:\n");
|
|
@@ -11264,72 +11296,85 @@ function renderUnderstand(plan) {
|
|
|
11264
11296
|
parts.push(`Use \`${plan.contextPackPath}\` as the primary input${scanNote}.
|
|
11265
11297
|
`);
|
|
11266
11298
|
if (!isBootstrap) {
|
|
11267
|
-
const
|
|
11268
|
-
if (
|
|
11269
|
-
|
|
11270
|
-
|
|
11271
|
-
agentPaths.push(...steps.map((s) => agentInstallPath(s.agent)));
|
|
11272
|
-
}
|
|
11273
|
-
if (plan.recommendedSkillPaths && plan.recommendedSkillPaths.length > 0) {
|
|
11274
|
-
agentPaths.push(...plan.recommendedSkillPaths);
|
|
11275
|
-
}
|
|
11276
|
-
agentPaths.push(plan.contextPackPath);
|
|
11277
|
-
parts.push("## Agent Prompts\n");
|
|
11278
|
-
if (agentPaths.length > 1) {
|
|
11279
|
-
parts.push("Use:\n");
|
|
11280
|
-
parts.push(agentPaths.map((p2) => `- \`${p2}\``).join("\n") + "\n");
|
|
11281
|
-
} else {
|
|
11282
|
-
parts.push(`- \`${plan.contextPackPath}\`
|
|
11299
|
+
const agentMissing = rec && rec.agent && rec.agentInstalled === false;
|
|
11300
|
+
if (agentMissing) {
|
|
11301
|
+
parts.push("## Missing Agent\n");
|
|
11302
|
+
parts.push(`${agentName(rec.agent)} is not installed.
|
|
11283
11303
|
`);
|
|
11284
|
-
|
|
11285
|
-
|
|
11286
|
-
parts.push("## Expected Outputs\n");
|
|
11287
|
-
parts.push(steps.map((s) => `- \`${s.output}\``).join("\n") + "\n");
|
|
11288
|
-
} else if (rec) {
|
|
11289
|
-
parts.push("## Expected Outputs\n");
|
|
11290
|
-
const outputs = [];
|
|
11291
|
-
if (rec.target) outputs.push(`- \`${rec.target}\``);
|
|
11292
|
-
if (rec.id === "refine-work-item" || rec.id === "resolve-blocker")
|
|
11293
|
-
outputs.push("- Refined Work Item content.");
|
|
11294
|
-
if (rec.id === "create-work-item")
|
|
11295
|
-
outputs.push("- A new Work Item under `knowledge/delivery/work-items/`.");
|
|
11296
|
-
if (rec.id === "implement")
|
|
11297
|
-
outputs.push("- Implementation plan or code changes guided by the Work Item.");
|
|
11298
|
-
if (rec.id === "guard")
|
|
11299
|
-
outputs.push("- Updated knowledge artifacts reflecting recent code changes.");
|
|
11300
|
-
if (rec.id === "install-adapter")
|
|
11301
|
-
outputs.push("- An adapter configured and injected (`kaddo adapters list`).");
|
|
11302
|
-
if (outputs.length > 0) {
|
|
11303
|
-
parts.push("The LLM should produce:\n");
|
|
11304
|
-
parts.push(outputs.join("\n") + "\n");
|
|
11305
|
-
} else {
|
|
11306
|
-
parts.push("_See the primary recommendation above._\n");
|
|
11307
|
-
}
|
|
11308
|
-
}
|
|
11309
|
-
parts.push("## Copy/Paste Instructions\n");
|
|
11310
|
-
if (steps.length > 0) {
|
|
11311
|
-
const first2 = steps[0];
|
|
11312
|
-
parts.push(
|
|
11313
|
-
[
|
|
11314
|
-
`Start with **${agentName(first2.agent)}**:`,
|
|
11315
|
-
"",
|
|
11316
|
-
"1. Open your preferred LLM chat (Claude, ChatGPT, Cursor, Copilot, Windsurf\u2026).",
|
|
11317
|
-
`2. Paste the context pack: \`${plan.contextPackPath}\``,
|
|
11318
|
-
`3. Paste the agent prompt: \`${agentInstallPath(first2.agent)}\``,
|
|
11319
|
-
`4. Ask the LLM to produce: \`${first2.output}\``,
|
|
11320
|
-
`5. Save the result in: \`${first2.output}\``
|
|
11321
|
-
].join("\n") + "\n"
|
|
11322
|
-
);
|
|
11323
|
-
} else if (agentPaths.length > 1) {
|
|
11324
|
-
parts.push("Paste the following into your LLM chat:\n");
|
|
11325
|
-
parts.push(agentPaths.map((p2, i) => `${i + 1}. \`${p2}\``).join("\n") + "\n");
|
|
11326
|
-
if (rec?.agent) {
|
|
11327
|
-
parts.push(`Ask the LLM to follow the ${agentName(rec.agent)} instructions.
|
|
11304
|
+
if (rec.installCommand) {
|
|
11305
|
+
parts.push(`Run \`${rec.installCommand}\` to install it.
|
|
11328
11306
|
`);
|
|
11329
11307
|
}
|
|
11308
|
+
parts.push("Then run:\n");
|
|
11309
|
+
parts.push("1. `kaddo context`\n2. `kaddo understand`\n");
|
|
11330
11310
|
} else {
|
|
11331
|
-
|
|
11311
|
+
const agentPaths = [];
|
|
11312
|
+
if (plan.recommendedPaths && plan.recommendedPaths.length > 0) {
|
|
11313
|
+
agentPaths.push(...plan.recommendedPaths);
|
|
11314
|
+
} else if (steps.length > 0) {
|
|
11315
|
+
agentPaths.push(...steps.map((s) => agentInstallPath(s.agent)));
|
|
11316
|
+
}
|
|
11317
|
+
if (plan.recommendedSkillPaths && plan.recommendedSkillPaths.length > 0) {
|
|
11318
|
+
agentPaths.push(...plan.recommendedSkillPaths);
|
|
11319
|
+
}
|
|
11320
|
+
agentPaths.push(plan.contextPackPath);
|
|
11321
|
+
parts.push("## Agent Prompts\n");
|
|
11322
|
+
if (agentPaths.length > 1) {
|
|
11323
|
+
parts.push("Use:\n");
|
|
11324
|
+
parts.push(agentPaths.map((p2) => `- \`${p2}\``).join("\n") + "\n");
|
|
11325
|
+
} else {
|
|
11326
|
+
parts.push(`- \`${plan.contextPackPath}\`
|
|
11327
|
+
`);
|
|
11328
|
+
}
|
|
11329
|
+
if (steps.length > 0) {
|
|
11330
|
+
parts.push("## Expected Outputs\n");
|
|
11331
|
+
parts.push(steps.map((s) => `- \`${s.output}\``).join("\n") + "\n");
|
|
11332
|
+
} else if (rec) {
|
|
11333
|
+
parts.push("## Expected Outputs\n");
|
|
11334
|
+
const outputs = [];
|
|
11335
|
+
if (rec.target) outputs.push(`- \`${rec.target}\``);
|
|
11336
|
+
if (rec.id === "refine-work-item" || rec.id === "resolve-blocker")
|
|
11337
|
+
outputs.push("- Refined Work Item content.");
|
|
11338
|
+
if (rec.id === "create-work-item")
|
|
11339
|
+
outputs.push("- A new Work Item under `knowledge/delivery/work-items/`.");
|
|
11340
|
+
if (rec.id === "implement")
|
|
11341
|
+
outputs.push("- Implementation plan or code changes guided by the Work Item.");
|
|
11342
|
+
if (rec.id === "guard")
|
|
11343
|
+
outputs.push("- Updated knowledge artifacts reflecting recent code changes.");
|
|
11344
|
+
if (rec.id === "install-adapter")
|
|
11345
|
+
outputs.push("- An adapter configured and injected (`kaddo adapters list`).");
|
|
11346
|
+
if (outputs.length > 0) {
|
|
11347
|
+
parts.push("The LLM should produce:\n");
|
|
11348
|
+
parts.push(outputs.join("\n") + "\n");
|
|
11349
|
+
} else {
|
|
11350
|
+
parts.push("_See the primary recommendation above._\n");
|
|
11351
|
+
}
|
|
11352
|
+
}
|
|
11353
|
+
parts.push("## Copy/Paste Instructions\n");
|
|
11354
|
+
if (steps.length > 0) {
|
|
11355
|
+
const first2 = steps[0];
|
|
11356
|
+
parts.push(
|
|
11357
|
+
[
|
|
11358
|
+
`Start with **${agentName(first2.agent)}**:`,
|
|
11359
|
+
"",
|
|
11360
|
+
"1. Open your preferred LLM chat (Claude, ChatGPT, Cursor, Copilot, Windsurf\u2026).",
|
|
11361
|
+
`2. Paste the context pack: \`${plan.contextPackPath}\``,
|
|
11362
|
+
`3. Paste the agent prompt: \`${agentInstallPath(first2.agent)}\``,
|
|
11363
|
+
`4. Ask the LLM to produce: \`${first2.output}\``,
|
|
11364
|
+
`5. Save the result in: \`${first2.output}\``
|
|
11365
|
+
].join("\n") + "\n"
|
|
11366
|
+
);
|
|
11367
|
+
} else if (agentPaths.length > 1) {
|
|
11368
|
+
parts.push("Paste the following into your LLM chat:\n");
|
|
11369
|
+
parts.push(agentPaths.map((p2, i) => `${i + 1}. \`${p2}\``).join("\n") + "\n");
|
|
11370
|
+
if (rec?.agent) {
|
|
11371
|
+
parts.push(`Ask the LLM to follow the ${agentName(rec.agent)} instructions.
|
|
11372
|
+
`);
|
|
11373
|
+
}
|
|
11374
|
+
} else {
|
|
11375
|
+
parts.push(`Paste \`${plan.contextPackPath}\` into your LLM chat.
|
|
11332
11376
|
`);
|
|
11377
|
+
}
|
|
11333
11378
|
}
|
|
11334
11379
|
}
|
|
11335
11380
|
parts.push("## Next Steps\n");
|
|
@@ -11391,25 +11436,36 @@ function renderUnderstandTerminal(plan) {
|
|
|
11391
11436
|
lines.push(" 3. kaddo context");
|
|
11392
11437
|
lines.push(" 4. kaddo understand");
|
|
11393
11438
|
} else {
|
|
11394
|
-
const
|
|
11395
|
-
if (
|
|
11396
|
-
lines.push(
|
|
11397
|
-
|
|
11398
|
-
|
|
11399
|
-
|
|
11400
|
-
|
|
11401
|
-
lines.push("");
|
|
11402
|
-
lines.push(
|
|
11403
|
-
lines.push("");
|
|
11404
|
-
lines.push(` Context: ${plan.contextPackPath}`);
|
|
11405
|
-
lines.push(` Agent prompt: ${agentInstallPath(first2.agent)}`);
|
|
11406
|
-
lines.push(` Expected output: ${first2.output}`);
|
|
11407
|
-
lines.push("");
|
|
11408
|
-
lines.push("Instructions:");
|
|
11409
|
-
lines.push(" Open your preferred LLM chat, paste the context pack, then paste the agent");
|
|
11410
|
-
lines.push(" prompt. Ask the LLM to generate the expected output and save it in the target file.");
|
|
11439
|
+
const agentMissing = rec && rec.agent && rec.agentInstalled === false;
|
|
11440
|
+
if (agentMissing) {
|
|
11441
|
+
lines.push(`Missing agent: ${agentName(rec.agent)}`);
|
|
11442
|
+
if (rec.installCommand) {
|
|
11443
|
+
lines.push(`Run: ${rec.installCommand}`);
|
|
11444
|
+
}
|
|
11445
|
+
lines.push("Then run:");
|
|
11446
|
+
lines.push(" 1. kaddo context");
|
|
11447
|
+
lines.push(" 2. kaddo understand");
|
|
11411
11448
|
} else {
|
|
11412
|
-
|
|
11449
|
+
const first2 = steps[0];
|
|
11450
|
+
if (first2) {
|
|
11451
|
+
lines.push("Foundational knowledge still needed:");
|
|
11452
|
+
steps.forEach((s, i) => {
|
|
11453
|
+
const flag = s.installed ? "" : " (not installed)";
|
|
11454
|
+
lines.push(` ${i + 1}. ${agentName(s.agent)} \u2192 ${s.output}${flag}`);
|
|
11455
|
+
});
|
|
11456
|
+
lines.push("");
|
|
11457
|
+
lines.push(`First step: use ${agentName(first2.agent)}.`);
|
|
11458
|
+
lines.push("");
|
|
11459
|
+
lines.push(` Context: ${plan.contextPackPath}`);
|
|
11460
|
+
lines.push(` Agent prompt: ${agentInstallPath(first2.agent)}`);
|
|
11461
|
+
lines.push(` Expected output: ${first2.output}`);
|
|
11462
|
+
lines.push("");
|
|
11463
|
+
lines.push("Instructions:");
|
|
11464
|
+
lines.push(" Open your preferred LLM chat, paste the context pack, then paste the agent");
|
|
11465
|
+
lines.push(" prompt. Ask the LLM to generate the expected output and save it in the target file.");
|
|
11466
|
+
} else {
|
|
11467
|
+
lines.push("Foundational knowledge looks complete \u2014 see the phase recommendation below.");
|
|
11468
|
+
}
|
|
11413
11469
|
}
|
|
11414
11470
|
}
|
|
11415
11471
|
lines.push("");
|
|
@@ -11524,6 +11580,11 @@ function runUnderstand() {
|
|
|
11524
11580
|
for (const r of assessment.reasons) console.log(` - ${r}`);
|
|
11525
11581
|
}
|
|
11526
11582
|
if (rec.agent) console.log(`Recommended: ${rec.agent}`);
|
|
11583
|
+
if (rec.agent && rec.agentInstalled === false) {
|
|
11584
|
+
console.log(` \u26A0 Agent not installed. Run: ${rec.installCommand ?? "kaddo add agents"}`);
|
|
11585
|
+
} else if (rec.agentPath) {
|
|
11586
|
+
console.log(` Agent prompt: ${rec.agentPath}`);
|
|
11587
|
+
}
|
|
11527
11588
|
if (rec.skill) console.log(`Recommended skill: ${rec.skill}`);
|
|
11528
11589
|
console.log(`Next step: ${rec.label}`);
|
|
11529
11590
|
if (rec.reason) console.log(`Why: ${rec.reason}`);
|