@kaddo/mcp 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.
Files changed (2) hide show
  1. package/dist/index.js +155 -111
  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";
@@ -2464,19 +2500,32 @@ function resolveNextStep(dir, now = /* @__PURE__ */ new Date()) {
2464
2500
  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
2501
  }
2466
2502
  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
- });
2503
+ const resolveAgent = (agent) => {
2504
+ const file = agent.endsWith(".md") ? agent : `${agent}.md`;
2505
+ const path3 = agentInstallPath(file);
2506
+ const installed = isFile(join(dir, path3));
2507
+ const group = agentGroupOf(file);
2508
+ return { agentPath: path3, agentInstalled: installed, installCommand: installed ? void 0 : `kaddo add agents --group ${group}` };
2509
+ };
2510
+ const refine = (id, agent, target, quality, verb = "complete") => {
2511
+ const ar = resolveAgent(agent);
2512
+ return {
2513
+ id,
2514
+ phase: "Knowledge Refinement",
2515
+ label: `Use ${agent} to ${verb} \`${target}\`.`,
2516
+ agent,
2517
+ target,
2518
+ agentPath: ar.agentPath,
2519
+ agentInstalled: ar.agentInstalled,
2520
+ installCommand: ar.installCommand,
2521
+ reason: `${target} is ${quality === "missing" ? "missing" : "still a bootstrap placeholder or too thin"}.`,
2522
+ instructions: [
2523
+ "The baseline file exists but does not yet hold real, project-specific knowledge.",
2524
+ `Use the ${agent} to replace the placeholders with real knowledge.`,
2525
+ "Do not write code."
2526
+ ]
2527
+ };
2528
+ };
2480
2529
  if (qBusiness !== "useful") return refine("refine-business", "business-agent", B, qBusiness);
2481
2530
  if (qProduct !== "useful" || qCap !== "useful") {
2482
2531
  if (qCap !== "useful") {
@@ -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,12 @@ function mapNextStepId(id) {
5973
5986
  "add-skills": "enable-kaddo",
5974
5987
  scan: "scan-repository",
5975
5988
  context: "scan-repository",
5976
- understand: "scan-repository"
5989
+ understand: "scan-repository",
5990
+ "refine-business": "define-business",
5991
+ "refine-product": "define-product",
5992
+ "refine-capabilities": "discover-capabilities",
5993
+ "refine-current-state": "describe-architecture",
5994
+ "refine-codebase": "describe-architecture"
5977
5995
  };
5978
5996
  return MAP[id] ?? id;
5979
5997
  }
@@ -8563,9 +8581,22 @@ function renderContextPack(pack) {
8563
8581
  if (isBootstrapIncomplete) {
8564
8582
  parts.push("No agent handoff yet.\n");
8565
8583
  parts.push("Run `kaddo bootstrap` first to create the baseline files.\n");
8584
+ } else if (rec.agent && rec.agentInstalled === false) {
8585
+ parts.push(`Recommended agent: ${rec.agent.replace(/\.md$/, "")}
8586
+ `);
8587
+ parts.push("**Agent is not installed.**\n");
8588
+ if (rec.installCommand) {
8589
+ parts.push(`Run \`${rec.installCommand}\` to install it.
8590
+ `);
8591
+ }
8592
+ parts.push("Then run `kaddo context` and `kaddo understand`.\n");
8566
8593
  } else {
8567
8594
  parts.push(`Recommended next for the **${pack.phase.phase}** phase:
8568
8595
  `);
8596
+ if (rec.agentPath) {
8597
+ parts.push(`Agent prompt: \`${rec.agentPath}\`
8598
+ `);
8599
+ }
8569
8600
  parts.push(handoff.recommendedAgents.map((a, i) => `${i + 1}. ${a}`).join("\n") + "\n");
8570
8601
  if (handoff.nextSteps.length > 0) {
8571
8602
  parts.push("Next step:\n");
@@ -8741,72 +8772,85 @@ function renderUnderstand(plan) {
8741
8772
  parts.push(`Use \`${plan.contextPackPath}\` as the primary input${scanNote}.
8742
8773
  `);
8743
8774
  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}\`
8775
+ const agentMissing = rec && rec.agent && rec.agentInstalled === false;
8776
+ if (agentMissing) {
8777
+ parts.push("## Missing Agent\n");
8778
+ parts.push(`${agentName(rec.agent)} is not installed.
8760
8779
  `);
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.
8780
+ if (rec.installCommand) {
8781
+ parts.push(`Run \`${rec.installCommand}\` to install it.
8805
8782
  `);
8806
8783
  }
8784
+ parts.push("Then run:\n");
8785
+ parts.push("1. `kaddo context`\n2. `kaddo understand`\n");
8807
8786
  } else {
8808
- parts.push(`Paste \`${plan.contextPackPath}\` into your LLM chat.
8787
+ const agentPaths = [];
8788
+ if (plan.recommendedPaths && plan.recommendedPaths.length > 0) {
8789
+ agentPaths.push(...plan.recommendedPaths);
8790
+ } else if (steps.length > 0) {
8791
+ agentPaths.push(...steps.map((s) => agentInstallPath(s.agent)));
8792
+ }
8793
+ if (plan.recommendedSkillPaths && plan.recommendedSkillPaths.length > 0) {
8794
+ agentPaths.push(...plan.recommendedSkillPaths);
8795
+ }
8796
+ agentPaths.push(plan.contextPackPath);
8797
+ parts.push("## Agent Prompts\n");
8798
+ if (agentPaths.length > 1) {
8799
+ parts.push("Use:\n");
8800
+ parts.push(agentPaths.map((p) => `- \`${p}\``).join("\n") + "\n");
8801
+ } else {
8802
+ parts.push(`- \`${plan.contextPackPath}\`
8809
8803
  `);
8804
+ }
8805
+ if (steps.length > 0) {
8806
+ parts.push("## Expected Outputs\n");
8807
+ parts.push(steps.map((s) => `- \`${s.output}\``).join("\n") + "\n");
8808
+ } else if (rec) {
8809
+ parts.push("## Expected Outputs\n");
8810
+ const outputs = [];
8811
+ if (rec.target) outputs.push(`- \`${rec.target}\``);
8812
+ if (rec.id === "refine-work-item" || rec.id === "resolve-blocker")
8813
+ outputs.push("- Refined Work Item content.");
8814
+ if (rec.id === "create-work-item")
8815
+ outputs.push("- A new Work Item under `knowledge/delivery/work-items/`.");
8816
+ if (rec.id === "implement")
8817
+ outputs.push("- Implementation plan or code changes guided by the Work Item.");
8818
+ if (rec.id === "guard")
8819
+ outputs.push("- Updated knowledge artifacts reflecting recent code changes.");
8820
+ if (rec.id === "install-adapter")
8821
+ outputs.push("- An adapter configured and injected (`kaddo adapters list`).");
8822
+ if (outputs.length > 0) {
8823
+ parts.push("The LLM should produce:\n");
8824
+ parts.push(outputs.join("\n") + "\n");
8825
+ } else {
8826
+ parts.push("_See the primary recommendation above._\n");
8827
+ }
8828
+ }
8829
+ parts.push("## Copy/Paste Instructions\n");
8830
+ if (steps.length > 0) {
8831
+ const first2 = steps[0];
8832
+ parts.push(
8833
+ [
8834
+ `Start with **${agentName(first2.agent)}**:`,
8835
+ "",
8836
+ "1. Open your preferred LLM chat (Claude, ChatGPT, Cursor, Copilot, Windsurf\u2026).",
8837
+ `2. Paste the context pack: \`${plan.contextPackPath}\``,
8838
+ `3. Paste the agent prompt: \`${agentInstallPath(first2.agent)}\``,
8839
+ `4. Ask the LLM to produce: \`${first2.output}\``,
8840
+ `5. Save the result in: \`${first2.output}\``
8841
+ ].join("\n") + "\n"
8842
+ );
8843
+ } else if (agentPaths.length > 1) {
8844
+ parts.push("Paste the following into your LLM chat:\n");
8845
+ parts.push(agentPaths.map((p, i) => `${i + 1}. \`${p}\``).join("\n") + "\n");
8846
+ if (rec?.agent) {
8847
+ parts.push(`Ask the LLM to follow the ${agentName(rec.agent)} instructions.
8848
+ `);
8849
+ }
8850
+ } else {
8851
+ parts.push(`Paste \`${plan.contextPackPath}\` into your LLM chat.
8852
+ `);
8853
+ }
8810
8854
  }
8811
8855
  }
8812
8856
  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.52.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": {