{"record":{"id":"e43548c7526901bd","repo":"ruvnet/ruflo","slug":"unknown-template-template","errorCode":null,"errorMessage":"Unknown template: ${template}","messagePattern":"Unknown template: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/codex/src/dual-mode/cli.ts","lineNumber":314,"sourceCode":"    workers.push(worker);\n  });\n\n  return workers;\n}\n\n/**\n * Get workers for a template\n */\nfunction getTemplateWorkers(template: string, task: string): WorkerConfig[] {\n  switch (template) {\n    case 'feature':\n      return CollaborationTemplates.featureDevelopment(task);\n    case 'security':\n      return CollaborationTemplates.securityAudit(task);\n    case 'refactor':\n      return CollaborationTemplates.refactoring(task);\n    default:\n      throw new Error(`Unknown template: ${template}`);\n  }\n}\n\n/**\n * Print collaboration results\n */\nfunction printResults(result: CollaborationResult): void {\n  console.log(chalk.bold('Results:'));\n  console.log(`  Status: ${result.success ? chalk.green('SUCCESS') : chalk.red('FAILED')}`);\n  console.log(`  Duration: ${(result.totalDuration / 1000).toFixed(2)}s`);\n  console.log();\n\n  console.log(chalk.bold('Worker Summary:'));\n  for (const worker of result.workers) {\n    const status = worker.status === 'completed' ? chalk.green('✓') :\n                   worker.status === 'failed' ? chalk.red('✗') :\n                   chalk.yellow('○');\n    const duration = worker.startedAt && worker.completedAt","sourceCodeStart":296,"sourceCodeEnd":332,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/codex/src/dual-mode/cli.ts#L296-L332","documentation":"getTemplateWorkers() maps the template argument of the dual-mode run command to a canned worker pipeline via a switch with exactly three cases: 'feature' (featureDevelopment), 'security' (securityAudit), and 'refactor' (refactoring). Any other template string falls through to default and throws — there is no fuzzy matching or listing fallback.","triggerScenarios":"(1) `dual-mode run review \"...\"` or `dual-mode run docs \"...\"` — a task kind that is not one of the three built-ins; (2) typos like 'features', 'Security' (case-sensitive match), or 'refactoring' instead of 'refactor'; (3) assuming any skill/agent name from the wider claude-flow ecosystem works here.","commonSituations":"Users familiar with the 60+ agent types assuming templates are equally broad; shell tab-completion offering stale names; scripts parameterized with a task type that outgrew the three templates.","solutions":["Use one of the three supported template names: feature, security, refactor (lowercase).","For any other workflow, skip templates and pass explicit --worker specs, which accept arbitrary roles and prompts.","Run the templates listing (the `templates` subcommand) to see the current built-ins.","Check spelling/case — the switch is exact-match."],"exampleFix":"# before\n$ dual-mode run refactoring \"clean up utils\"\nError: Unknown template: refactoring\n\n# after\n$ dual-mode run refactor \"clean up utils\"\n# or, for a custom pipeline:\n$ dual-mode collaborate --parallel --worker \"claude:analyst:Map utils usage\" --worker \"codex:coder:Apply the cleanup\"","handlingStrategy":"validation","validationCode":"const KNOWN_TEMPLATES = new Set(['feature', 'security', 'refactor']);\nif (!KNOWN_TEMPLATES.has(template)) {\n  throw new Error(`unknown template \"${template}\" — use one of ${[...KNOWN_TEMPLATES].join(', ')}, or pass explicit --worker specs`);\n}\nconst workers = getTemplateWorkers(template, task);","typeGuard":"function isKnownTemplate(v: string): v is 'feature' | 'security' | 'refactor' {\n  return v === 'feature' || v === 'security' || v === 'refactor';\n}","tryCatchPattern":"try {\n  const workers = getTemplateWorkers(template, task);\n} catch (err) {\n  if (err instanceof Error && err.message.startsWith('Unknown template:')) {\n    // degrade gracefully: fall back to an explicit worker pipeline\n    return explicitWorkers(task);\n  }\n  throw err;\n}","preventionTips":["Pin template names to constants in scripts instead of free-form user input","Check the templates listing when upgrading — the supported set is exactly feature/security/refactor","For anything beyond the three built-ins, switch to --worker specs which accept arbitrary roles","Match case exactly; the switch is not normalized"],"tags":["dual-mode","templates","cli-arguments"],"backgroundTag":"invalid-cli-argument-value","analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-08-22T04:17:13.399Z"}