@kaddo/mcp 3.51.0 → 3.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +157 -114
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2283,6 +2283,42 @@ function buildAdapterStatuses(dir) {
2283
2283
  });
2284
2284
  }
2285
2285
 
2286
+ // ../cli/src/agents/groups.ts
2287
+ var AGENT_GROUPS = {
2288
+ business: ["business-agent.md"],
2289
+ product: ["bootstrap-agent.md", "capability-agent.md"],
2290
+ tech: [
2291
+ "architecture-agent.md",
2292
+ "codebase-agent.md",
2293
+ "stack-agent.md",
2294
+ "security-agent.md",
2295
+ "standards-agent.md",
2296
+ "module-design-agent.md",
2297
+ "adr-agent.md",
2298
+ "capsule-agent.md",
2299
+ "graph-agent.md"
2300
+ ],
2301
+ delivery: [
2302
+ "backlog-agent.md",
2303
+ "roadmap-agent.md",
2304
+ "work-item-agent.md",
2305
+ "implementation-agent.md",
2306
+ "ownership-agent.md",
2307
+ "git-strategy-agent.md"
2308
+ ],
2309
+ utilities: ["legacy-agent.md"]
2310
+ };
2311
+ var AGENT_GROUP_NAMES = Object.keys(AGENT_GROUPS);
2312
+ function agentGroupOf(fileName) {
2313
+ for (const g of AGENT_GROUP_NAMES) {
2314
+ if (AGENT_GROUPS[g].includes(fileName)) return g;
2315
+ }
2316
+ return "utilities";
2317
+ }
2318
+ function agentInstallPath(fileName) {
2319
+ return `knowledge/agents/${agentGroupOf(fileName)}/${fileName}`;
2320
+ }
2321
+
2286
2322
  // ../cli/src/core/decisions.ts
2287
2323
  var CANDIDATES_DISCOVERY = "knowledge/tech/discovery/decision-candidates.md";
2288
2324
  var CANDIDATES_LEGACY = "knowledge/tech/decision-candidates.md";
@@ -2460,23 +2496,33 @@ function resolveNextStep(dir, now = /* @__PURE__ */ new Date()) {
2460
2496
  if (!exists(join(dir, ".kaddo", "context-pack.md"))) {
2461
2497
  return { id: "context", phase: "Discovery", label: "Run `kaddo context` to prepare the LLM context pack.", command: "kaddo context", reason: "No context pack has been generated yet." };
2462
2498
  }
2463
- if (!exists(join(dir, ".kaddo", "understand.md"))) {
2464
- 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." };
2465
- }
2466
2499
  const discovery = state === "pre-ai" || state === "legacy";
2467
- const refine = (id, agent, target, quality, verb = "complete") => ({
2468
- id,
2469
- phase: "Knowledge Refinement",
2470
- label: `Use ${agent} to ${verb} \`${target}\`.`,
2471
- agent,
2472
- target,
2473
- reason: `${target} is ${quality === "missing" ? "missing" : "still a bootstrap placeholder or too thin"}.`,
2474
- instructions: [
2475
- "The baseline file exists but does not yet hold real, project-specific knowledge.",
2476
- `Use the ${agent} to replace the placeholders with real knowledge.`,
2477
- "Do not write code."
2478
- ]
2479
- });
2500
+ const resolveAgent = (agent) => {
2501
+ const file = agent.endsWith(".md") ? agent : `${agent}.md`;
2502
+ const path3 = agentInstallPath(file);
2503
+ const installed = isFile(join(dir, path3));
2504
+ const group = agentGroupOf(file);
2505
+ return { agentPath: path3, agentInstalled: installed, installCommand: installed ? void 0 : `kaddo add agents --group ${group}` };
2506
+ };
2507
+ const refine = (id, agent, target, quality, verb = "complete") => {
2508
+ const ar = resolveAgent(agent);
2509
+ return {
2510
+ id,
2511
+ phase: "Knowledge Refinement",
2512
+ label: `Use ${agent} to ${verb} \`${target}\`.`,
2513
+ agent,
2514
+ target,
2515
+ agentPath: ar.agentPath,
2516
+ agentInstalled: ar.agentInstalled,
2517
+ installCommand: ar.installCommand,
2518
+ reason: `${target} is ${quality === "missing" ? "missing" : "still a bootstrap placeholder or too thin"}.`,
2519
+ instructions: [
2520
+ "The baseline file exists but does not yet hold real, project-specific knowledge.",
2521
+ `Use the ${agent} to replace the placeholders with real knowledge.`,
2522
+ "Do not write code."
2523
+ ]
2524
+ };
2525
+ };
2480
2526
  if (qBusiness !== "useful") return refine("refine-business", "business-agent", B, qBusiness);
2481
2527
  if (qProduct !== "useful" || qCap !== "useful") {
2482
2528
  if (qCap !== "useful") {
@@ -2489,6 +2535,9 @@ function resolveNextStep(dir, now = /* @__PURE__ */ new Date()) {
2489
2535
  const agent = ctx.agents.includes("codebase-agent") ? "codebase-agent" : "architecture-agent";
2490
2536
  return refine("refine-codebase", agent, CB, qCodebase);
2491
2537
  }
2538
+ if (!exists(join(dir, ".kaddo", "understand.md"))) {
2539
+ 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." };
2540
+ }
2492
2541
  const oq = buildOpenQuestionsReport(dir, now);
2493
2542
  if (oq.summary.blocking_open > 0) {
2494
2543
  return { id: "questions", phase: "Knowledge Refinement", label: "Run `kaddo questions` to see source locations and resolution guidance, then resolve, assume or defer the blocking open questions.", command: "kaddo questions", reason: `${oq.summary.blocking_open} blocking open question(s) remain.` };
@@ -5199,42 +5248,6 @@ var AGENT_PROMPTS = [
5199
5248
  // Every official prompt ends with its responsibility boundaries + Agent Trace footer.
5200
5249
  ].map((p) => ({ fileName: p.fileName, content: withResponsibilityTrace(p.fileName, p.content) }));
5201
5250
 
5202
- // ../cli/src/agents/groups.ts
5203
- var AGENT_GROUPS = {
5204
- business: ["business-agent.md"],
5205
- product: ["bootstrap-agent.md", "capability-agent.md"],
5206
- tech: [
5207
- "architecture-agent.md",
5208
- "codebase-agent.md",
5209
- "stack-agent.md",
5210
- "security-agent.md",
5211
- "standards-agent.md",
5212
- "module-design-agent.md",
5213
- "adr-agent.md",
5214
- "capsule-agent.md",
5215
- "graph-agent.md"
5216
- ],
5217
- delivery: [
5218
- "backlog-agent.md",
5219
- "roadmap-agent.md",
5220
- "work-item-agent.md",
5221
- "implementation-agent.md",
5222
- "ownership-agent.md",
5223
- "git-strategy-agent.md"
5224
- ],
5225
- utilities: ["legacy-agent.md"]
5226
- };
5227
- var AGENT_GROUP_NAMES = Object.keys(AGENT_GROUPS);
5228
- function agentGroupOf(fileName) {
5229
- for (const g of AGENT_GROUP_NAMES) {
5230
- if (AGENT_GROUPS[g].includes(fileName)) return g;
5231
- }
5232
- return "utilities";
5233
- }
5234
- function agentInstallPath(fileName) {
5235
- return `knowledge/agents/${agentGroupOf(fileName)}/${fileName}`;
5236
- }
5237
-
5238
5251
  // ../cli/src/modules/agents.ts
5239
5252
  function withAgentFrontMatter(fileName, content) {
5240
5253
  const name = fileName.replace(/\.md$/, "");
@@ -5973,7 +5986,11 @@ function mapNextStepId(id) {
5973
5986
  "add-skills": "enable-kaddo",
5974
5987
  scan: "scan-repository",
5975
5988
  context: "scan-repository",
5976
- understand: "scan-repository"
5989
+ "refine-business": "define-business",
5990
+ "refine-product": "define-product",
5991
+ "refine-capabilities": "discover-capabilities",
5992
+ "refine-current-state": "describe-architecture",
5993
+ "refine-codebase": "describe-architecture"
5977
5994
  };
5978
5995
  return MAP[id] ?? id;
5979
5996
  }
@@ -8563,9 +8580,22 @@ function renderContextPack(pack) {
8563
8580
  if (isBootstrapIncomplete) {
8564
8581
  parts.push("No agent handoff yet.\n");
8565
8582
  parts.push("Run `kaddo bootstrap` first to create the baseline files.\n");
8583
+ } else if (rec.agent && rec.agentInstalled === false) {
8584
+ parts.push(`Recommended agent: ${rec.agent.replace(/\.md$/, "")}
8585
+ `);
8586
+ parts.push("**Agent is not installed.**\n");
8587
+ if (rec.installCommand) {
8588
+ parts.push(`Run \`${rec.installCommand}\` to install it.
8589
+ `);
8590
+ }
8591
+ parts.push("Then run `kaddo context` and `kaddo understand`.\n");
8566
8592
  } else {
8567
8593
  parts.push(`Recommended next for the **${pack.phase.phase}** phase:
8568
8594
  `);
8595
+ if (rec.agentPath) {
8596
+ parts.push(`Agent prompt: \`${rec.agentPath}\`
8597
+ `);
8598
+ }
8569
8599
  parts.push(handoff.recommendedAgents.map((a, i) => `${i + 1}. ${a}`).join("\n") + "\n");
8570
8600
  if (handoff.nextSteps.length > 0) {
8571
8601
  parts.push("Next step:\n");
@@ -8741,72 +8771,85 @@ function renderUnderstand(plan) {
8741
8771
  parts.push(`Use \`${plan.contextPackPath}\` as the primary input${scanNote}.
8742
8772
  `);
8743
8773
  if (!isBootstrap) {
8744
- const agentPaths = [];
8745
- if (plan.recommendedPaths && plan.recommendedPaths.length > 0) {
8746
- agentPaths.push(...plan.recommendedPaths);
8747
- } else if (steps.length > 0) {
8748
- agentPaths.push(...steps.map((s) => agentInstallPath(s.agent)));
8749
- }
8750
- if (plan.recommendedSkillPaths && plan.recommendedSkillPaths.length > 0) {
8751
- agentPaths.push(...plan.recommendedSkillPaths);
8752
- }
8753
- agentPaths.push(plan.contextPackPath);
8754
- parts.push("## Agent Prompts\n");
8755
- if (agentPaths.length > 1) {
8756
- parts.push("Use:\n");
8757
- parts.push(agentPaths.map((p) => `- \`${p}\``).join("\n") + "\n");
8758
- } else {
8759
- parts.push(`- \`${plan.contextPackPath}\`
8774
+ const agentMissing = rec && rec.agent && rec.agentInstalled === false;
8775
+ if (agentMissing) {
8776
+ parts.push("## Missing Agent\n");
8777
+ parts.push(`${agentName(rec.agent)} is not installed.
8760
8778
  `);
8761
- }
8762
- if (steps.length > 0) {
8763
- parts.push("## Expected Outputs\n");
8764
- parts.push(steps.map((s) => `- \`${s.output}\``).join("\n") + "\n");
8765
- } else if (rec) {
8766
- parts.push("## Expected Outputs\n");
8767
- const outputs = [];
8768
- if (rec.target) outputs.push(`- \`${rec.target}\``);
8769
- if (rec.id === "refine-work-item" || rec.id === "resolve-blocker")
8770
- outputs.push("- Refined Work Item content.");
8771
- if (rec.id === "create-work-item")
8772
- outputs.push("- A new Work Item under `knowledge/delivery/work-items/`.");
8773
- if (rec.id === "implement")
8774
- outputs.push("- Implementation plan or code changes guided by the Work Item.");
8775
- if (rec.id === "guard")
8776
- outputs.push("- Updated knowledge artifacts reflecting recent code changes.");
8777
- if (rec.id === "install-adapter")
8778
- outputs.push("- An adapter configured and injected (`kaddo adapters list`).");
8779
- if (outputs.length > 0) {
8780
- parts.push("The LLM should produce:\n");
8781
- parts.push(outputs.join("\n") + "\n");
8782
- } else {
8783
- parts.push("_See the primary recommendation above._\n");
8784
- }
8785
- }
8786
- parts.push("## Copy/Paste Instructions\n");
8787
- if (steps.length > 0) {
8788
- const first2 = steps[0];
8789
- parts.push(
8790
- [
8791
- `Start with **${agentName(first2.agent)}**:`,
8792
- "",
8793
- "1. Open your preferred LLM chat (Claude, ChatGPT, Cursor, Copilot, Windsurf\u2026).",
8794
- `2. Paste the context pack: \`${plan.contextPackPath}\``,
8795
- `3. Paste the agent prompt: \`${agentInstallPath(first2.agent)}\``,
8796
- `4. Ask the LLM to produce: \`${first2.output}\``,
8797
- `5. Save the result in: \`${first2.output}\``
8798
- ].join("\n") + "\n"
8799
- );
8800
- } else if (agentPaths.length > 1) {
8801
- parts.push("Paste the following into your LLM chat:\n");
8802
- parts.push(agentPaths.map((p, i) => `${i + 1}. \`${p}\``).join("\n") + "\n");
8803
- if (rec?.agent) {
8804
- parts.push(`Ask the LLM to follow the ${agentName(rec.agent)} instructions.
8779
+ if (rec.installCommand) {
8780
+ parts.push(`Run \`${rec.installCommand}\` to install it.
8805
8781
  `);
8806
8782
  }
8783
+ parts.push("Then run:\n");
8784
+ parts.push("1. `kaddo context`\n2. `kaddo understand`\n");
8807
8785
  } else {
8808
- parts.push(`Paste \`${plan.contextPackPath}\` into your LLM chat.
8786
+ const agentPaths = [];
8787
+ if (plan.recommendedPaths && plan.recommendedPaths.length > 0) {
8788
+ agentPaths.push(...plan.recommendedPaths);
8789
+ } else if (steps.length > 0) {
8790
+ agentPaths.push(...steps.map((s) => agentInstallPath(s.agent)));
8791
+ }
8792
+ if (plan.recommendedSkillPaths && plan.recommendedSkillPaths.length > 0) {
8793
+ agentPaths.push(...plan.recommendedSkillPaths);
8794
+ }
8795
+ agentPaths.push(plan.contextPackPath);
8796
+ parts.push("## Agent Prompts\n");
8797
+ if (agentPaths.length > 1) {
8798
+ parts.push("Use:\n");
8799
+ parts.push(agentPaths.map((p) => `- \`${p}\``).join("\n") + "\n");
8800
+ } else {
8801
+ parts.push(`- \`${plan.contextPackPath}\`
8802
+ `);
8803
+ }
8804
+ if (steps.length > 0) {
8805
+ parts.push("## Expected Outputs\n");
8806
+ parts.push(steps.map((s) => `- \`${s.output}\``).join("\n") + "\n");
8807
+ } else if (rec) {
8808
+ parts.push("## Expected Outputs\n");
8809
+ const outputs = [];
8810
+ if (rec.target) outputs.push(`- \`${rec.target}\``);
8811
+ if (rec.id === "refine-work-item" || rec.id === "resolve-blocker")
8812
+ outputs.push("- Refined Work Item content.");
8813
+ if (rec.id === "create-work-item")
8814
+ outputs.push("- A new Work Item under `knowledge/delivery/work-items/`.");
8815
+ if (rec.id === "implement")
8816
+ outputs.push("- Implementation plan or code changes guided by the Work Item.");
8817
+ if (rec.id === "guard")
8818
+ outputs.push("- Updated knowledge artifacts reflecting recent code changes.");
8819
+ if (rec.id === "install-adapter")
8820
+ outputs.push("- An adapter configured and injected (`kaddo adapters list`).");
8821
+ if (outputs.length > 0) {
8822
+ parts.push("The LLM should produce:\n");
8823
+ parts.push(outputs.join("\n") + "\n");
8824
+ } else {
8825
+ parts.push("_See the primary recommendation above._\n");
8826
+ }
8827
+ }
8828
+ parts.push("## Copy/Paste Instructions\n");
8829
+ if (steps.length > 0) {
8830
+ const first2 = steps[0];
8831
+ parts.push(
8832
+ [
8833
+ `Start with **${agentName(first2.agent)}**:`,
8834
+ "",
8835
+ "1. Open your preferred LLM chat (Claude, ChatGPT, Cursor, Copilot, Windsurf\u2026).",
8836
+ `2. Paste the context pack: \`${plan.contextPackPath}\``,
8837
+ `3. Paste the agent prompt: \`${agentInstallPath(first2.agent)}\``,
8838
+ `4. Ask the LLM to produce: \`${first2.output}\``,
8839
+ `5. Save the result in: \`${first2.output}\``
8840
+ ].join("\n") + "\n"
8841
+ );
8842
+ } else if (agentPaths.length > 1) {
8843
+ parts.push("Paste the following into your LLM chat:\n");
8844
+ parts.push(agentPaths.map((p, i) => `${i + 1}. \`${p}\``).join("\n") + "\n");
8845
+ if (rec?.agent) {
8846
+ parts.push(`Ask the LLM to follow the ${agentName(rec.agent)} instructions.
8809
8847
  `);
8848
+ }
8849
+ } else {
8850
+ parts.push(`Paste \`${plan.contextPackPath}\` into your LLM chat.
8851
+ `);
8852
+ }
8810
8853
  }
8811
8854
  }
8812
8855
  parts.push("## Next Steps\n");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaddo/mcp",
3
- "version": "3.51.0",
3
+ "version": "3.53.0",
4
4
  "description": "MCP server for Kaddo project knowledge: read-only resources/tools/prompts plus safe derived generation under .kaddo/.",
5
5
  "license": "MIT",
6
6
  "repository": {