fix(skills): align bundled skill name with folder

This commit is contained in:
Erik Kotsiuba
2026-04-25 15:41:59 +02:00
parent c310dae9de
commit 005151f79b
3 changed files with 34 additions and 2 deletions
+1 -1
View File
@@ -83,7 +83,7 @@ After installation, the package registers one tool: `ask_user`.
That is enough for the agent to gain this clarification capability. The extension already injects prompt guidance that encourages the agent to call `ask_user` when requirements are ambiguous or user preference matters, instead of guessing.
This package also includes an auto-bundled skill profile at `skills/ask-user/SKILL.md` (`ask-user-decision-gate`) for stricter decision-gate behavior in high-stakes or ambiguous boundaries. It is enabled by default when the package is installed, but can be disabled via `pi config`.
This package also includes an auto-bundled skill profile at `skills/ask-user/SKILL.md` (`ask-user`) for stricter decision-gate behavior in high-stakes or ambiguous boundaries. It is enabled by default when the package is installed, but can be disabled via `pi config`.
You can still add your own agent instruction if you want to further reinforce when and how the tool should be used.
+1 -1
View File
@@ -1,5 +1,5 @@
---
name: ask-user-decision-gate
name: ask-user
description: "Use ask_user as a decision gate before high-stakes or ambiguous implementation choices."
metadata:
short-description: Decision gate for ambiguity and high-stakes choices
+32
View File
@@ -0,0 +1,32 @@
import assert from "node:assert/strict";
import { readdirSync, readFileSync } from "node:fs";
import path from "node:path";
import test from "node:test";
const skillsDir = path.resolve("skills");
const SKILL_NAME_RE = /^name:\s*(.+)$/m;
function readDeclaredSkillName(skillPath: string): string | undefined {
const content = readFileSync(skillPath, "utf8");
const match = content.match(SKILL_NAME_RE);
return match?.[1]?.trim();
}
test("each bundled skill name matches its folder name", () => {
const skillFolders = readdirSync(skillsDir, { withFileTypes: true }).filter(
(entry) => entry.isDirectory()
);
assert.ok(skillFolders.length > 0);
for (const folder of skillFolders) {
const skillPath = path.join(skillsDir, folder.name, "SKILL.md");
const declaredName = readDeclaredSkillName(skillPath);
assert.equal(
declaredName,
folder.name,
`${skillPath} declares name "${declaredName}" but folder is "${folder.name}"`
);
}
});