Fix: omit allowed-tools from Claude output only (#736)

Keep allowed-tools in shared source for other providers; drop it from the
Claude Code transformer and plugin rewrite so claude -p can activate the
skill. Verify gate now checks parsed frontmatter, not body text.

AI-assisted commit.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Abdul Wahab
2026-09-05 17:11:50 +05:00
co-authored by Cursor
parent 681569712f
commit c8f93c55db
4 changed files with 19 additions and 7 deletions
+12 -5
View File
@@ -290,9 +290,16 @@ describe('verifyPluginSkillRewrite', () => {
});
test('fails the build when allowed-tools frontmatter survives the removal', () => {
const p = writeSkill(
'allowed-tools:\n - Bash(npx impeccable *)\n' + rewritePluginMarkdown(goodSkill),
);
const p = writeSkill([
'---',
'name: impeccable',
'allowed-tools:',
' - Bash(npx impeccable *)',
'license: Apache 2.0',
'---',
'',
rewritePluginMarkdown(goodSkill),
].join('\n'));
expect(() => verifyPluginSkillRewrite(p)).toThrow(/allowed-tools/);
});
@@ -317,12 +324,12 @@ describe('verifyPluginSkillRewrite', () => {
});
describe('SKILL.src.md frontmatter', () => {
test('does not declare allowed-tools (issue #736)', () => {
test('keeps allowed-tools in source for non-Claude providers (issue #736)', () => {
const src = fs.readFileSync(
path.join(import.meta.dirname, '../skill/SKILL.src.md'),
'utf-8',
);
const { frontmatter } = parseFrontmatter(src);
expect(frontmatter['allowed-tools']).toBeUndefined();
expect(frontmatter['allowed-tools']).toBeDefined();
});
});