diff --git a/packages/coding-agent/CHANGELOG.md b/packages/coding-agent/CHANGELOG.md index 957bead69..16c07cbdc 100644 --- a/packages/coding-agent/CHANGELOG.md +++ b/packages/coding-agent/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] +### Fixed + +- Fixed default prompts to instruct the agent to read applicable `skill://` content before starting work, so discovered skills influence broad task requests like frontend generation ([#2829](https://github.com/can1357/oh-my-pi/issues/2829)). + ## [16.0.3] - 2026-06-16 ### Added diff --git a/packages/coding-agent/src/prompts/system/system-prompt.md b/packages/coding-agent/src/prompts/system/system-prompt.md index 0df136c69..ddf32e95a 100644 --- a/packages/coding-agent/src/prompts/system/system-prompt.md +++ b/packages/coding-agent/src/prompts/system/system-prompt.md @@ -117,6 +117,8 @@ ENV # Skills & Rules {{#if skills.length}} +Skills are specialized knowledge. Scan descriptions for your task domain. +If a skill applies, you MUST read `skill://` before proceeding. {{#each skills}} - {{name}}: {{description}} diff --git a/packages/coding-agent/test/system-prompt-inventory.test.ts b/packages/coding-agent/test/system-prompt-inventory.test.ts index d82e95f53..bee6e3f61 100644 --- a/packages/coding-agent/test/system-prompt-inventory.test.ts +++ b/packages/coding-agent/test/system-prompt-inventory.test.ts @@ -86,6 +86,31 @@ describe("system prompt tool inventory", () => { expect(text).not.toContain("- Read: `read`"); }); + it("tells the agent to read matching skills before work", async () => { + const { systemPrompt } = await buildSystemPrompt({ + cwd: tempDir, + contextFiles: [], + skills: [ + { + name: "frontend-design", + description: "Frontend UI workflow", + filePath: path.join(tempDir, "SKILL.md"), + baseDir: tempDir, + source: "test", + }, + ], + rules: [], + toolNames: ["read"], + tools: TOOLS, + workspaceTree: { ...EMPTY_TREE, rootPath: tempDir }, + }); + const text = systemPrompt.join("\n\n"); + + expect(text).toContain("Skills are specialized knowledge. Scan descriptions for your task domain."); + expect(text).toContain("If a skill applies, you MUST read `skill://` before proceeding."); + expect(text).toContain("- frontend-design: Frontend UI workflow"); + }); + it("places the inventory at the bottom of the TOOLS section (after I/O and Exploration)", async () => { const text = await render({ nativeTools: true, repeatToolDescriptions: false }); const inventoryIdx = text.indexOf("# Inventory");