Skip to content

Commit 15e2945

Browse files
committed
feat(check-agent-instructions): validate reference files in SKILL.md
1 parent ff5669b commit 15e2945

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

scripts/check-agent-instructions.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,15 @@ for (const filePath of collectInstructionFiles(skillDirs)) {
132132
}
133133
}
134134

135+
if (path.basename(filePath) === 'SKILL.md' && path.dirname(filePath).startsWith(skillsRoot)) {
136+
for (const match of reportMatches(text, /references\/[A-Za-z0-9._-]+\.md/g)) {
137+
const referencePath = path.join(path.dirname(filePath), match[0]);
138+
if (!exists(referencePath)) {
139+
fail(`${rel}: ${match[0]} does not point to an existing reference file`);
140+
}
141+
}
142+
}
143+
135144
for (const match of reportMatches(text, /`npm run ([A-Za-z0-9:_-]+)`/g)) {
136145
const scriptName = match[1];
137146
if (!packageScripts.has(scriptName)) {

0 commit comments

Comments
 (0)