What Is the EXCLUDED_FROM_SUGGESTIONS Constant in Impeccable?

The EXCLUDED_FROM_SUGGESTIONS constant is a hard-coded JavaScript Set that filters out internal meta-commands from the automatically generated {{available_commands}} placeholder injected into skill templates.

In the pbakaus/impeccable repository, this constant ensures that specific administrative commands never appear in user-facing suggestion lists. It resides in the build pipeline's utility module and acts as a gatekeeper during the placeholder replacement phase, maintaining clean help text and preventing recursive self-references.

How EXCLUDED_FROM_SUGGESTIONS Filters Commands

When Impeccable processes skill markdown files containing the {{available_commands}} placeholder, the replacePlaceholders function constructs a comma-separated list of available command names. Before rendering this list, the code filters the command names through the EXCLUDED_FROM_SUGGESTIONS Set.

In scripts/lib/utils.js at lines 339-341, the filtering logic excludes any command name found in the Set:

const commandList = commandNames
  .filter(n => !EXCLUDED_FROM_SUGGESTIONS.has(n))   // exclusion step
  .map(n => `/${n}`)
  .join(', ');

The constant itself is declared at line 334 in the same file as a frozen Set containing two specific strings:

const EXCLUDED_FROM_SUGGESTIONS = new Set(['teach-impeccable', 'i-teach-impeccable']);

Why Impeccable Excludes These Specific Commands

The commands teach-impeccable and i-teach-impeccable serve as internal "meta-skills" used to teach the Impeccable system itself. Including these in the {{available_commands}} placeholder would create a recursive suggestion problem—the teach command would suggest itself within its own body text.

By hard-coding these exclusions, the build system ensures that:

  • End-users see only relevant commands in help text, not internal tooling
  • Skill templates remain free of self-referential loops that could confuse AI agents
  • Provider-specific outputs (for Cursor, Gemini, Claude Code, etc.) maintain consistent command hygiene across all distributions

Implementation in the Build Pipeline

The replacePlaceholders function in scripts/lib/utils.js processes skill files during the source-to-dist transformation. When it encounters the {{available_commands}} token, it generates the final string only after applying the exclusion filter.

Practical Example: Generating Clean Command Lists

import { replacePlaceholders } from './utils.js';

const allCommands = [
  'normalize',
  'teach-impeccable',   // filtered out
  'i-teach-impeccable', // filtered out
  'format-code'
];

const body = `
You can run any of the following commands: {{available_commands}}.
`;

const rendered = replacePlaceholders(body, 'cursor', allCommands);
console.log(rendered);
// Output: "You can run any of the following commands: /normalize, /format-code."

Direct Usage of the Constant

While primarily used internally, you can reference the constant directly to check exclusion status:

import { EXCLUDED_FROM_SUGGESTIONS } from './utils.js';

if (EXCLUDED_FROM_SUGGESTIONS.has('teach-impeccable')) {
  console.log('This command is hidden from suggestions.');
}

Summary

  • Located in scripts/lib/utils.js at line 334, the EXCLUDED_FROM_SUGGESTIONS constant defines which commands never appear in suggestion lists
  • Contains exactly two entries: 'teach-impeccable' and 'i-teach-impeccable'
  • Operates in replacePlaceholders (lines 339-341) by filtering the command array before mapping names to /{command} format
  • Prevents recursive suggestions where meta-skills would recommend themselves in generated help text
  • Affects all provider outputs including Cursor, Gemini, Codex, Claude Code, Kiro, and generic agents

Frequently Asked Questions

Where is the EXCLUDED_FROM_SUGGESTIONS constant defined?

According to the Impeccable source code, the constant is declared in scripts/lib/utils.js at line 334 as a new Set(['teach-impeccable', 'i-teach-impeccable']). It is referenced within the replacePlaceholders function at lines 339-341.

Which commands does EXCLUDED_FROM_SUGGESTIONS filter out?

The Set specifically contains two string values: 'teach-impeccable' and 'i-teach-impeccable'. These correspond to internal skills used for teaching the Impeccable framework itself, rather than end-user functionality.

Why does Impeccable need to exclude commands from suggestions?

Without this exclusion, the {{available_commands}} placeholder would include the teaching commands in their own help text. This would create a confusing self-reference where the system suggests learning about itself while explaining itself, potentially leading to infinite loops in AI agent interactions.

How does this constant affect the final skill output?

During the build process, replacePlaceholders runs for every skill file across all provider-specific transformers (Cursor, Gemini, etc.). The constant ensures that generated skill files in the dist/ folders never list the internal teaching commands as available options, keeping the public command interface clean and focused on user tasks.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →