fix(prompting): instructed agents to load matching skills

- Added default system-prompt guidance to scan skill descriptions and read applicable skill:// content before work.
- Covered the rendered prompt contract with a frontend-design skill regression test.

Fixes #2829
This commit is contained in:
roboomp
2026-06-17 04:28:03 +00:00
parent 8eeb707387
commit b112a7d381
3 changed files with 31 additions and 0 deletions
+4
View File
@@ -2,6 +2,10 @@
## [Unreleased]
### Fixed
- Fixed default prompts to instruct the agent to read applicable `skill://<name>` 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
@@ -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://<name>` before proceeding.
<skills>
{{#each skills}}
- {{name}}: {{description}}
@@ -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://<name>` 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");