xonecas.io
64875
Mc

mini-coder / commit c085a27

fix(system-prompt): instruct LLM to proactively match and follow skill triggers

The system prompt passively listed skills without directing the LLM to
actually check triggers and load matching skills before acting. Now:
- Guideline tells the LLM to check skills against current task and load
  matching ones via readSkill before proceeding
- Skills catalog header reinforces: match triggers BEFORE writing code

xonecas2026-03-21 c085a2734737f17b7fd3b79bc430f2846cf01d2d parent 92d0ed1

2 files changed

src/agent/system-prompt.test.ts+1−3
@@ -103,9 +103,7 @@ describe("buildSystemPrompt", () => {
103103 "Inspect code and files primarily through shell commands",
104104 );
105105 expect(prompt).toContain("use shell commands that invoke `mc-edit`");
106- expect(prompt).toContain(
107- "Use the skill tools only when you need to inspect available community/project skills",
108- );
106+ expect(prompt).toContain("check the available skills list below");
109107 expect(prompt).not.toContain(
110108 "Prefer dedicated tools (read, replace, insert) over shell for file operations.",
111109 );
src/agent/system-prompt.ts+3−1
@@ -64,7 +64,7 @@ Guidelines:
6464 - Use temp files to handle large content, prefer scanning over full reads.
6565 - Prefer small, targeted edits over large file rewrites.
6666 - For file edits, use shell commands that invoke \`mc-edit\`.
67-- Use the skill tools only when you need to inspect available community/project skills or load one skill body.
67+- Before starting work, check the available skills list below. If any skill's description/triggers match your current task, load it with \`readSkill\` and follow its instructions before proceeding.
6868 - Make parallel tool calls when independent searches/lookups can happen concurrently.
6969 - Keep your context clean and focused on the user request.
7070 - You are a capable senior engineer. Once given a direction, proactively gather context and implement — don't ask for permission to start.
@@ -106,6 +106,8 @@ Apply one safe exact-text edit to an existing file.
106106 prompt += "\n\n# Available skills (metadata only)";
107107 prompt +=
108108 "\nUse `listSkills` to browse and `readSkill` to load one SKILL.md on demand.";
109+ prompt +=
110+ "\nMatch skill triggers against your current task. Load and follow matching skills BEFORE writing code or making changes.";
109111 prompt +=
110112 "\nWhen a skill references relative paths, resolve them against the skill directory (parent of SKILL.md).";
111113 prompt +=