{"record":{"id":"03af8813c5f0e302","repo":"eyaltoledano/claude-task-master","slug":"dynamic-slash-command-name-must-contain-argu","errorCode":null,"errorMessage":"Dynamic slash command \"${name}\" must contain $ARGUMENTS placeholder","messagePattern":"Dynamic slash command \"(.+?)\" must contain \\$ARGUMENTS placeholder","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/tm-profiles/src/slash-commands/factories.ts","lineNumber":87,"sourceCode":" * const goham = dynamicCommand(\n *   'goham',\n *   'Start Working with Hamster Brief',\n *   '[brief-url]',\n *   '# Start Working\\n\\nBrief URL: $ARGUMENTS'\n * );\n * ```\n *\n * @throws Error if content doesn't contain $ARGUMENTS placeholder\n */\nexport function dynamicCommand(\n\tname: string,\n\tdescription: string,\n\targumentHint: string,\n\tcontent: string,\n\tmode?: OperatingMode\n): DynamicSlashCommand {\n\tif (!content.includes('$ARGUMENTS')) {\n\t\tthrow new Error(\n\t\t\t`Dynamic slash command \"${name}\" must contain $ARGUMENTS placeholder`\n\t\t);\n\t}\n\n\treturn {\n\t\ttype: 'dynamic',\n\t\tmetadata: {\n\t\t\tname,\n\t\t\tdescription,\n\t\t\targumentHint,\n\t\t\t...(mode && { mode })\n\t\t},\n\t\tcontent\n\t};\n}\n","sourceCodeStart":69,"sourceCodeEnd":103,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/packages/tm-profiles/src/slash-commands/factories.ts#L69-L103","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nconst content = 'Analyze the project structure and report findings.';\ndynamicCommand('analyze', 'Analyze project', '[focus]', content); // throws\n// after\nconst content = 'Analyze the project structure focusing on $ARGUMENTS and report findings.';\ndynamicCommand('analyze', 'Analyze project', '[focus]', content); // ok","handlingStrategy":"validation","validationCode":"function assertArgumentsPlaceholder(content, name) {\n  if (typeof content !== 'string' || !content.includes('$ARGUMENTS')) {\n    throw new Error(`Slash command \"${name}\" template must contain $ARGUMENTS`);\n  }\n  return content;\n}\n// call before dynamicCommand(...)","typeGuard":"function hasArgumentsPlaceholder(c) {\n  return typeof c === 'string' && c.includes('$ARGUMENTS');\n}","tryCatchPattern":"try {\n  const cmd = dynamicCommand(name, description, hint, content);\n} catch (e) {\n  if (/must contain \\$ARGUMENTS placeholder/.test(e.message)) {\n    console.error(`Fix template for \"${name}\": insert $ARGUMENTS where user input goes.`);\n  } else throw e;\n}","preventionTips":["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."],"tags":["templates","validation","slash-commands"],"backgroundTag":"missing-template-placeholder","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}