@kaddo/mcp 3.50.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 +174 -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";
@@ -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
  }
@@ -8213,10 +8231,14 @@ function buildContextPack(dir, config, now = /* @__PURE__ */ new Date()) {
8213
8231
  if (techKnowledge.discovery.legacyLocation) {
8214
8232
  missing.push("Tech discovery files are in the legacy `knowledge/tech/` root. Run `kaddo tech organize` to move them to `knowledge/tech/discovery/`.");
8215
8233
  }
8234
+ const isBootstrap = nextStepRecommendation.id === "bootstrap";
8216
8235
  const unifiedPhase = {
8217
8236
  ...phase,
8237
+ phase: isBootstrap ? "Setup" : phase.phase,
8238
+ reasons: isBootstrap ? ["The knowledge baseline is incomplete."] : phase.reasons,
8218
8239
  nextStep: nextStepRecommendation.label,
8219
- recommendedAgents: nextStepRecommendation.agent ? [nextStepRecommendation.agent] : phase.recommendedAgents
8240
+ recommendedAgents: isBootstrap ? [] : nextStepRecommendation.agent ? [nextStepRecommendation.agent] : phase.recommendedAgents,
8241
+ llmInstructions: isBootstrap ? ["Run `kaddo bootstrap` before using agent handoff.", "Do not ask an LLM to generate baseline knowledge until bootstrap files exist."] : phase.llmInstructions
8220
8242
  };
8221
8243
  const deliveryState = { ...buildDeliveryState(dir), phase: nextStepRecommendation.phase };
8222
8244
  return {
@@ -8272,9 +8294,9 @@ function buildContextPack(dir, config, now = /* @__PURE__ */ new Date()) {
8272
8294
  // VS-052/VS-073.2: the handoff is driven by the unified next step, so the pack never contradicts
8273
8295
  // the Current Phase block above it.
8274
8296
  handoff: {
8275
- recommendedAgents: unifiedPhase.recommendedAgents.length > 0 ? unifiedPhase.recommendedAgents : recommendedAgentsForState(state),
8297
+ recommendedAgents: isBootstrap ? [] : unifiedPhase.recommendedAgents.length > 0 ? unifiedPhase.recommendedAgents : recommendedAgentsForState(state),
8276
8298
  nextSteps: [nextStepRecommendation.label],
8277
- instructions: unifiedPhase.llmInstructions.length > 0 ? unifiedPhase.llmInstructions : LLM_INSTRUCTIONS,
8299
+ instructions: isBootstrap ? ["No agent handoff yet.", "Run `kaddo bootstrap` first to create the baseline files."] : unifiedPhase.llmInstructions.length > 0 ? unifiedPhase.llmInstructions : LLM_INSTRUCTIONS,
8278
8300
  operatingRules: OPERATING_RULES
8279
8301
  }
8280
8302
  };
@@ -8559,9 +8581,22 @@ function renderContextPack(pack) {
8559
8581
  if (isBootstrapIncomplete) {
8560
8582
  parts.push("No agent handoff yet.\n");
8561
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");
8562
8593
  } else {
8563
8594
  parts.push(`Recommended next for the **${pack.phase.phase}** phase:
8564
8595
  `);
8596
+ if (rec.agentPath) {
8597
+ parts.push(`Agent prompt: \`${rec.agentPath}\`
8598
+ `);
8599
+ }
8565
8600
  parts.push(handoff.recommendedAgents.map((a, i) => `${i + 1}. ${a}`).join("\n") + "\n");
8566
8601
  if (handoff.nextSteps.length > 0) {
8567
8602
  parts.push("Next step:\n");
@@ -8736,75 +8771,100 @@ function renderUnderstand(plan) {
8736
8771
  const scanNote = plan.scanAvailable ? "" : " (incomplete \u2014 run `kaddo scan` first for a richer baseline)";
8737
8772
  parts.push(`Use \`${plan.contextPackPath}\` as the primary input${scanNote}.
8738
8773
  `);
8739
- const agentPaths = [];
8740
- if (plan.recommendedPaths && plan.recommendedPaths.length > 0) {
8741
- agentPaths.push(...plan.recommendedPaths);
8742
- } else if (steps.length > 0) {
8743
- agentPaths.push(...steps.map((s) => agentInstallPath(s.agent)));
8744
- }
8745
- if (plan.recommendedSkillPaths && plan.recommendedSkillPaths.length > 0) {
8746
- agentPaths.push(...plan.recommendedSkillPaths);
8747
- }
8748
- agentPaths.push(plan.contextPackPath);
8749
- parts.push("## Agent Prompts\n");
8750
- if (agentPaths.length > 1) {
8751
- parts.push("Use:\n");
8752
- parts.push(agentPaths.map((p) => `- \`${p}\``).join("\n") + "\n");
8753
- } else {
8754
- parts.push(`- \`${plan.contextPackPath}\`
8774
+ if (!isBootstrap) {
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.
8755
8779
  `);
8756
- }
8757
- if (steps.length > 0) {
8758
- parts.push("## Expected Outputs\n");
8759
- parts.push(steps.map((s) => `- \`${s.output}\``).join("\n") + "\n");
8760
- } else if (rec) {
8761
- parts.push("## Expected Outputs\n");
8762
- const outputs = [];
8763
- if (rec.target) outputs.push(`- \`${rec.target}\``);
8764
- if (rec.id === "refine-work-item" || rec.id === "resolve-blocker")
8765
- outputs.push("- Refined Work Item content.");
8766
- if (rec.id === "create-work-item")
8767
- outputs.push("- A new Work Item under `knowledge/delivery/work-items/`.");
8768
- if (rec.id === "implement")
8769
- outputs.push("- Implementation plan or code changes guided by the Work Item.");
8770
- if (rec.id === "guard")
8771
- outputs.push("- Updated knowledge artifacts reflecting recent code changes.");
8772
- if (rec.id === "install-adapter")
8773
- outputs.push("- An adapter configured and injected (`kaddo adapters list`).");
8774
- if (outputs.length > 0) {
8775
- parts.push("The LLM should produce:\n");
8776
- parts.push(outputs.join("\n") + "\n");
8780
+ if (rec.installCommand) {
8781
+ parts.push(`Run \`${rec.installCommand}\` to install it.
8782
+ `);
8783
+ }
8784
+ parts.push("Then run:\n");
8785
+ parts.push("1. `kaddo context`\n2. `kaddo understand`\n");
8777
8786
  } else {
8778
- parts.push("_See the primary recommendation above._\n");
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}\`
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
+ }
8779
8854
  }
8780
8855
  }
8781
- parts.push("## Copy/Paste Instructions\n");
8782
- if (steps.length > 0) {
8783
- const first2 = steps[0];
8856
+ parts.push("## Next Steps\n");
8857
+ if (isBootstrap) {
8784
8858
  parts.push(
8785
8859
  [
8786
- `Start with **${agentName(first2.agent)}**:`,
8787
- "",
8788
- "1. Open your preferred LLM chat (Claude, ChatGPT, Cursor, Copilot, Windsurf\u2026).",
8789
- `2. Paste the context pack: \`${plan.contextPackPath}\``,
8790
- `3. Paste the agent prompt: \`${agentInstallPath(first2.agent)}\``,
8791
- `4. Ask the LLM to produce: \`${first2.output}\``,
8792
- `5. Save the result in: \`${first2.output}\``
8860
+ "1. Run `kaddo bootstrap`.",
8861
+ "2. Run `kaddo add agents`.",
8862
+ "3. Run `kaddo add skills`.",
8863
+ "4. Run `kaddo context`.",
8864
+ "5. Run `kaddo understand`."
8793
8865
  ].join("\n") + "\n"
8794
8866
  );
8795
- } else if (agentPaths.length > 1) {
8796
- parts.push("Paste the following into your LLM chat:\n");
8797
- parts.push(agentPaths.map((p, i) => `${i + 1}. \`${p}\``).join("\n") + "\n");
8798
- if (rec?.agent) {
8799
- parts.push(`Ask the LLM to follow the ${agentName(rec.agent)} instructions.
8800
- `);
8801
- }
8802
- } else {
8803
- parts.push(`Paste \`${plan.contextPackPath}\` into your LLM chat.
8804
- `);
8805
- }
8806
- parts.push("## Next Steps\n");
8807
- if (rec) {
8867
+ } else if (rec) {
8808
8868
  const nextLines = [];
8809
8869
  nextLines.push(`1. ${rec.label}`);
8810
8870
  let n = 2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaddo/mcp",
3
- "version": "3.50.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": {