xonecas.io
64875
Mc

mini-coder / commit 1977015

feat: switch skills catalog to XML format and tighten activation wording

- Replace markdown bullet list with <available_skills> XML block per agentskills.io spec
- Each <skill> has name, description, location, source, and optional compatibility tags
- Instruction wording: concise imperative — call readSkill before anything else, check ALL skills not just first match
- Remove verbose multi-sentence guidance that diluted the activation signal
- Update system-prompt tests to match new structure

xonecas2026-03-21 1977015e36936962760c263bad888076b0249a59 parent bd0768a

2 files changed

src/agent/system-prompt.test.ts+11−6
@@ -102,7 +102,6 @@ describe("buildSystemPrompt", () => {
102102 "Inspect code and files primarily through shell commands",
103103 );
104104 expect(prompt).toContain("invoke `mc-edit` via shell");
105- expect(prompt).toContain("scan the skills list below");
106105 expect(prompt).toContain("never guess unknown state");
107106 });
108107
@@ -168,12 +167,16 @@ describe("buildSystemPrompt", () => {
168167 );
169168
170169 const prompt = buildSystemPrompt("mock", tmpDir, fakeHome);
171- expect(prompt).toContain("# Available skills (metadata only)");
170+ expect(prompt).toContain("# Skills");
172171 expect(prompt).toContain(
173- "Use `listSkills` to browse and `readSkill` to load one SKILL.md on demand.",
172+ "call `readSkill` with that skill name before doing anything else",
174173 );
175- expect(prompt).toContain("- deploy: Deploy safely (local,");
176- expect(prompt).toContain(".agents/skills/deploy/SKILL.md)");
174+ expect(prompt).toContain("Check ALL skills against the current task");
175+ expect(prompt).toContain("<available_skills>");
176+ expect(prompt).toContain("<name>deploy</name>");
177+ expect(prompt).toContain("<description>Deploy safely</description>");
178+ expect(prompt).toContain(".agents/skills/deploy/SKILL.md</location>");
179+ expect(prompt).toContain("<source>local</source>");
177180 expect(prompt).not.toContain("Detailed body");
178181 });
179182
@@ -186,7 +189,9 @@ describe("buildSystemPrompt", () => {
186189 );
187190
188191 const prompt = buildSystemPrompt("mock", tmpDir, fakeHome);
189- expect(prompt).toContain("- release: Ship releases (global,");
192+ expect(prompt).toContain("<name>release</name>");
193+ expect(prompt).toContain("<description>Ship releases</description>");
194+ expect(prompt).toContain("<source>global</source>");
190195 expect(prompt).not.toContain("Release body");
191196 });
192197 });
src/agent/system-prompt.ts+13−12
@@ -84,21 +84,22 @@ Usage: mc-edit <path> (--old <text> | --old-file <path>) [--new <text> | --new-f
8484
8585 const skills = Array.from(loadSkillsIndex(cwd, homeDir).values());
8686 if (skills.length > 0) {
87- prompt += "\n\n# Available skills (metadata only)";
87+ prompt += "\n\n# Skills";
8888 prompt +=
89- "\nUse `listSkills` to browse and `readSkill` to load one SKILL.md on demand.";
90- prompt +=
91- "\nMatch skill triggers against your current task. Load and follow matching skills BEFORE writing code or making changes.";
92- prompt +=
93- "\nWhen a skill references relative paths, resolve them against the skill directory (parent of SKILL.md).";
94- prompt +=
95- '\nFor complex skills that would clutter your context, consider delegating to a subagent via `mc "prompt"` in the shell tool.';
96- prompt +=
97- "\nDo NOT rationalize skipping skills. If a skill's description overlaps with your task at all, load it. When in doubt, load it.\n";
89+ "\nSkills provide specialized instructions for specific tasks. When a task matches a skill description, call `readSkill` with that skill name before doing anything else — including asking clarifying questions. Check ALL skills against the current task, not just the first match. When a skill references relative paths, resolve them against the skill directory (parent of SKILL.md).";
90+ prompt += "\n\n<available_skills>";
9891 for (const skill of skills) {
99- const compat = skill.compatibility ? ` [${skill.compatibility}]` : "";
100- prompt += `\n- ${skill.name}: ${skill.description}${compat} (${skill.source}, ${skill.filePath})`;
92+ const compat = skill.compatibility
93+ ? `\n <compatibility>${skill.compatibility}</compatibility>`
94+ : "";
95+ prompt += `\n <skill>`;
96+ prompt += `\n <name>${skill.name}</name>`;
97+ prompt += `\n <description>${skill.description}</description>`;
98+ prompt += `\n <location>${skill.filePath}</location>`;
99+ prompt += `\n <source>${skill.source}</source>${compat}`;
100+ prompt += `\n </skill>`;
101101 }
102+ prompt += "\n</available_skills>";
102103 }
103104
104105 return prompt;