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
@@ -24,6 +24,7 @@ export function transformCodex(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}`;
@@ -45,7 +46,7 @@ export function transformCodex(skills, distDir, patterns = null, options = {}) {
const frontmatter = generateYamlFrontmatter(frontmatterObj);
let skillBody = replacePlaceholders(skill.body, 'codex');
let skillBody = replacePlaceholders(skill.body, 'codex', commandNames);
if (prefix) skillBody = prefixSkillReferences(skillBody, prefix, allSkillNames);
// For user-invokable skills, transform remaining {{argname}} to $ARGNAME
if (skill.userInvokable) {