eyaltoledano/claude-task-master · error
Dynamic slash command "${name}" must contain $ARGUMENTS plac
Error message
Dynamic slash command "${name}" must contain $ARGUMENTS placeholder What it means
The dynamicCommand factory in @tm/profiles builds slash commands whose template text is filled with user arguments at runtime. It requires the raw content to contain the literal $ARGUMENTS placeholder; a template without it cannot receive arguments, so the factory refuses to create the command.
Source
Thrown at packages/tm-profiles/src/slash-commands/factories.ts:87
* const goham = dynamicCommand(
* 'goham',
* 'Start Working with Hamster Brief',
* '[brief-url]',
* '# Start Working\n\nBrief URL: $ARGUMENTS'
* );
* ```
*
* @throws Error if content doesn't contain $ARGUMENTS placeholder
*/
export function dynamicCommand(
name: string,
description: string,
argumentHint: string,
content: string,
mode?: OperatingMode
): DynamicSlashCommand {
if (!content.includes('$ARGUMENTS')) {
throw new Error(
`Dynamic slash command "${name}" must contain $ARGUMENTS placeholder`
);
}
return {
type: 'dynamic',
metadata: {
name,
description,
argumentHint,
...(mode && { mode })
},
content
};
}
View on GitHub (pinned to c0c98d367c)
Solutions
- Add the literal $ARGUMENTS placeholder where user input should be inserted in the template content.
- Check spelling/casing: it must be exactly $ARGUMENTS.
- If loading content from a file, verify the file actually contains the placeholder (grep for it) before calling the factory.
- If the command needs no arguments, use a static slash command factory instead of dynamicCommand.
Example fix
// before
const content = 'Analyze the project structure and report findings.';
dynamicCommand('analyze', 'Analyze project', '[focus]', content); // throws
// after
const content = 'Analyze the project structure focusing on $ARGUMENTS and report findings.';
dynamicCommand('analyze', 'Analyze project', '[focus]', content); // ok Defensive patterns
Strategy: validation
Validate before calling
function assertArgumentsPlaceholder(content, name) {
if (typeof content !== 'string' || !content.includes('$ARGUMENTS')) {
throw new Error(`Slash command "${name}" template must contain $ARGUMENTS`);
}
return content;
}
// call before dynamicCommand(...) Type guard
function hasArgumentsPlaceholder(c) {
return typeof c === 'string' && c.includes('$ARGUMENTS');
} Try / catch
try {
const cmd = dynamicCommand(name, description, hint, content);
} catch (e) {
if (/must contain \$ARGUMENTS placeholder/.test(e.message)) {
console.error(`Fix template for "${name}": insert $ARGUMENTS where user input goes.`);
} else throw e;
} Prevention
- Keep $ARGUMENTS in every dynamic command template (grep your template files in CI).
- Use the exact casing $ARGUMENTS — no variants.
- Use static command factories for commands that take no arguments.
When it happens
Trigger: Calling dynamicCommand(name, description, argumentHint, content) with a content string that does not include '$ARGUMENTS' — e.g. a hand-written markdown template or one loaded from a file that was edited to remove the placeholder.
Common situations: Authors customizing slash-command templates delete the placeholder or misspell it ($ARGUMENT, $arguments, {{args}}), or templates written for older versions that used different substitution syntax.
Related errors
- Schema validation failed: ${errors}
- Invalid template structure: missing required fields (id, pro
- MFA_VERIFICATION_FAILED
- Failed to initialize services: ${(error as Error).message}
- Invalid format: ${options.format}. Valid formats are: text,
AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29).
Data as JSON: /api/errors/03af8813c5f0e302.
Report an issue: GitHub.