mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-17 16:46:31 +03:00
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:
co-authored by
Claude Opus 4.6
parent
aadaee5c37
commit
870d65b1e3
@@ -326,13 +326,17 @@ function escapeRegex(str) {
|
||||
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
||||
}
|
||||
|
||||
export function replacePlaceholders(content, provider) {
|
||||
export function replacePlaceholders(content, provider, commandNames = []) {
|
||||
const placeholders = PROVIDER_PLACEHOLDERS[provider] || PROVIDER_PLACEHOLDERS['cursor'];
|
||||
const commandList = commandNames.length > 0
|
||||
? commandNames.map(n => `/${n}`).join(', ')
|
||||
: '';
|
||||
|
||||
return content
|
||||
.replace(/\{\{model\}\}/g, placeholders.model)
|
||||
.replace(/\{\{config_file\}\}/g, placeholders.config_file)
|
||||
.replace(/\{\{ask_instruction\}\}/g, placeholders.ask_instruction);
|
||||
.replace(/\{\{ask_instruction\}\}/g, placeholders.ask_instruction)
|
||||
.replace(/\{\{available_commands\}\}/g, commandList);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user