Constrain audit/critique to only suggest real commands via {{available_commands}}

Adds a dynamic {{available_commands}} placeholder that the build system
replaces with the actual list of user-invokable skill names. Audit and
critique now explicitly instruct the LLM to only suggest from this list,
preventing hallucinated commands like /redesign.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Paul Bakaus
2026-03-05 10:18:52 -08:00
co-authored by Claude Opus 4.6
parent aadaee5c37
commit 870d65b1e3
8 changed files with 24 additions and 13 deletions
+2 -1
View File
@@ -23,6 +23,7 @@ export function transformClaudeCode(skills, distDir, patterns = null, options =
ensureDir(skillsDir);
const allSkillNames = skills.map(s => s.name);
const commandNames = skills.filter(s => s.userInvokable).map(s => `${prefix}${s.name}`);
let refCount = 0;
for (const skill of skills) {
const skillName = `${prefix}${skill.name}`;
@@ -41,7 +42,7 @@ export function transformClaudeCode(skills, distDir, patterns = null, options =
if (skill.allowedTools) frontmatterObj['allowed-tools'] = skill.allowedTools;
const frontmatter = generateYamlFrontmatter(frontmatterObj);
let skillBody = replacePlaceholders(skill.body, 'claude-code');
let skillBody = replacePlaceholders(skill.body, 'claude-code', commandNames);
if (prefix) skillBody = prefixSkillReferences(skillBody, prefix, allSkillNames);
const content = `${frontmatter}\n\n${skillBody}`;
const outputPath = path.join(skillDir, 'SKILL.md');