The skills test carries its own skill text
Jonas Templestein, 2026-11-26 16:39 UTC · 512f4c237726ed2ff38fca9455119ba6f02ac0c1 · parent 7fc35fc
1 file changed
M core/mind-worker/src/library/mcp-skills.test.ts
@@ -3,7 +3,6 @@ // the skills of a config, and against a fake server whose entries and files may disagree. How // the platform builds a skill's entry is ../mcp-skills.test.ts. import { createHash } from "node:crypto"; -import { readFileSync } from "node:fs"; import { createMcpHandler, McpServer, ProtocolError } from "@modelcontextprotocol/server"; import { expect, test } from "vitest"; import { z } from "zod"; @@ -15,16 +14,23 @@ const FAKE = "https://notes.test/mcp"; const NOTES = "skill://notes/SKILL.md"; +// The start of `skills/mind-skills/SKILL.md` as a mind's config repo holds it. A config is no part +// of this repo, so the test carries the text: a long description in plain YAML, as people write one. +const MIND_SKILLS = `--- +name: mind-skills +description: Add, change or remove a skill of this iterate mind, so that every agent connected to the mind's MCP server gets it. Use when someone asks to save a workflow as a skill, to import a skill from GitHub or a file, or asks which skills the mind serves. +--- + +# The skills of this mind + +A skill is a folder under \`skills/\` of the config repo with a \`SKILL.md\` in it. +`; + test("the skills of a mind's own MCP server: each is listed, and each file is read and checked", async () => { - // the skill that every new mind serves, as its config repo holds it - const mindSkills = readFileSync( - new URL("../../../configs/default/skills/mind-skills/SKILL.md", import.meta.url).pathname, - "utf8", - ); const png = new Uint8Array([137, 80, 78, 71]); const mcp = await connectToMcp( itxOfMind({ - "mind-skills/SKILL.md": mindSkills, + "mind-skills/SKILL.md": MIND_SKILLS, "refunds/SKILL.md": "---\nname: refunds\ndescription: >-\n Refund an order.\n---\n", "refunds/assets/a b.png": png, "refunds/references/policy.md": "# Policy\n", @@ -53,7 +59,7 @@ server: MIND, uri: "skill://mind-skills/SKILL.md", mimeType: "text/markdown", - text: mindSkills, + text: MIND_SKILLS, verified: true, }); expect(await mcp.readSkill("skill://refunds/SKILL.md", "references/policy.md")).toEqual({