{"record":{"id":"236ee5a8ecbb3c40","repo":"paperclipai/paperclip","slug":"invalid-template-template-expected-one-of","errorCode":null,"errorMessage":"Invalid template '${template}'. Expected one of: ${VALID_TEMPLATES.join(\", \")}","messagePattern":"Invalid template '(.+?)'\\. Expected one of: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/plugins/create-paperclip-plugin/src/index.ts","lineNumber":126,"sourceCode":"\n  const tarballPath = path.join(sdkBundleDir, tarballFileName);\n  if (!fs.existsSync(tarballPath)) {\n    throw new Error(`Packed tarball was not created at ${tarballPath}`);\n  }\n\n  return tarballPath;\n}\n\n/**\n * Generate a complete Paperclip plugin starter project.\n *\n * Output includes manifest/worker/UI entries, SDK harness tests, bundler presets,\n * and a local dev server script for hot-reload workflow.\n */\nexport function scaffoldPluginProject(options: ScaffoldPluginOptions): string {\n  const template = options.template ?? \"default\";\n  if (!VALID_TEMPLATES.includes(template)) {\n    throw new Error(`Invalid template '${template}'. Expected one of: ${VALID_TEMPLATES.join(\", \")}`);\n  }\n\n  if (!isValidPluginName(options.pluginName)) {\n    throw new Error(\"Invalid plugin name. Must be lowercase and may include scope, dots, underscores, or hyphens.\");\n  }\n\n  if (options.category && !VALID_CATEGORIES.has(options.category)) {\n    throw new Error(`Invalid category '${options.category}'. Expected one of: ${[...VALID_CATEGORIES].join(\", \")}`);\n  }\n\n  const outputDir = path.resolve(options.outputDir);\n  if (fs.existsSync(outputDir)) {\n    throw new Error(`Directory already exists: ${outputDir}`);\n  }\n\n  const displayName = options.displayName ?? makeDisplayName(options.pluginName);\n  const description = options.description ?? \"A Paperclip plugin\";\n  const author = options.author ?? \"Plugin Author\";","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/paperclipai/paperclip/blob/a7e689b3c35347b529cb9f54c9b9a8575a3dcab6/packages/plugins/create-paperclip-plugin/src/index.ts#L108-L144","documentation":"Argument validation at the top of scaffoldPluginProject: options.template is not one of VALID_TEMPLATES (defaulting to \"default\" when omitted). The scaffolder only ships a fixed set of starter templates, so an unknown template string is rejected before any files are written.","triggerScenarios":"Thrown at packages/plugins/create-paperclip-plugin/src/index.ts:126 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Choose one of the listed valid templates."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a7e689b3c35347b529cb9f54c9b9a8575a3dcab6","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}