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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user