{"record":{"id":"861bec185a090874","repo":"ruvnet/ruflo","slug":"invalid-package-name-spec","errorCode":null,"errorMessage":"Invalid package name: ${spec}","messagePattern":"Invalid package name: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/plugins/manager.ts","lineNumber":35,"sourceCode":"// supported invocation is via a real `.exe` shell. We wrap every npm call\n// through `cmd.exe /d /s /c npm <args>`, which keeps Node's safe array-form\n// argument escaping intact and avoids both ENOENT and EINVAL.\nconst isWindows = process.platform === 'win32';\n\nfunction runNpm(args: string[], timeoutMs: number): Promise<{ stdout: string; stderr: string }> {\n  if (isWindows) {\n    return execFileAsync('cmd.exe', ['/d', '/s', '/c', 'npm', ...args], { timeout: timeoutMs });\n  }\n  return execFileAsync('npm', args, { timeout: timeoutMs });\n}\n\n/**\n * Validate npm package name to prevent shell injection (S-3)\n */\nconst VALID_PACKAGE_RE = /^(@[a-z0-9-~][a-z0-9-._~]*\\/)?[a-z0-9-~][a-z0-9-._~]*(@[a-z0-9._\\-^~>=<]+)?$/;\nfunction validatePackageName(spec: string): void {\n  if (!VALID_PACKAGE_RE.test(spec)) {\n    throw new Error(`Invalid package name: ${spec}`);\n  }\n}\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface InstalledPlugin {\n  name: string;\n  version: string;\n  installedAt: string;\n  enabled: boolean;\n  source: 'npm' | 'local' | 'ipfs';\n  path?: string;\n  commands?: string[];\n  hooks?: string[];\n  config?: Record<string, unknown>;\n}","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/ruvnet/ruflo/blob/6b01dc5a687b26b3e218f796de45ec51f8fa9e8c/v3/@claude-flow/cli/src/plugins/manager.ts#L17-L53","documentation":"Error \"Invalid package name: ${spec}\" thrown in ruvnet/ruflo.","triggerScenarios":"Thrown at v3/@claude-flow/cli/src/plugins/manager.ts:35 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6b01dc5a687b26b3e218f796de45ec51f8fa9e8c","analyzedAt":"2026-08-12T13:20:50.148Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}