INNER CODE UNIT · TypeScript

dedupStub

HoangNguyen0403/agent-skills-standard · mcp/src/tools/index.ts:961

function dedupStub(category: string, id: string, why: string): string {
  return `<!-- skill: ${category}/${id} | matched: ${why} | already loaded this session, body omitted (pass force_reload: true to resend) -->`;
}

/**
 * Best-practice 1.4 (avoid "not found"): when a load returns no match, return
 * what's available so the LLM can pick the next useful action instead of giving up.
 */
function noMatchGuidance(
  via: "load_skills_for_files" | "load_skills_for_keywords",
  input: string[],
  ctx: ToolContext,
): ToolResult {
  const categories = ctx.index.listCategories();
  const routing = ctx.index.getRouting();

  const lines: string[] = [];
  if (via === "load_skills_for_files") {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…