{"record":{"id":"84262c42a17c58eb","repo":"nextlevelbuilder/ui-ux-pro-max-skill","slug":"unknown-ai-type-aitype","errorCode":null,"errorMessage":"Unknown AI type: ${aiType}","messagePattern":"Unknown AI type: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/utils/template.ts","lineNumber":75,"sourceCode":"  universal: 'universal',\n};\n\nasync function exists(path: string): Promise<boolean> {\n  try {\n    await access(path);\n    return true;\n  } catch {\n    return false;\n  }\n}\n\n/**\n * Load platform configuration from JSON file\n */\nexport async function loadPlatformConfig(aiType: string): Promise<PlatformConfig> {\n  const platformName = AI_TO_PLATFORM[aiType];\n  if (!platformName) {\n    throw new Error(`Unknown AI type: ${aiType}`);\n  }\n\n  const configPath = join(ASSETS_DIR, 'templates', 'platforms', `${platformName}.json`);\n  const content = await readFile(configPath, 'utf-8');\n  return JSON.parse(content) as PlatformConfig;\n}\n\n/**\n * Load all available platform configs\n */\nexport async function loadAllPlatformConfigs(): Promise<Map<string, PlatformConfig>> {\n  const configs = new Map<string, PlatformConfig>();\n\n  for (const [aiType, platformName] of Object.entries(AI_TO_PLATFORM)) {\n    try {\n      const config = await loadPlatformConfig(aiType);\n      configs.set(aiType, config);\n    } catch {","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/nextlevelbuilder/ui-ux-pro-max-skill/blob/a38d04c3d5c298c851dbe5e6ee1965ee3de42cb5/cli/src/utils/template.ts#L57-L93","documentation":"loadPlatformConfig() maps the user-supplied aiType string through the AI_TO_PLATFORM table (claude, cursor, windsurf, antigravity, copilot, kiro, opencode, roocode, codex, qoder, gemini, trae, continue, codebuddy, droid, kilocode, warp, augment, codewhale, universal). Any string not in that table throws before a config file is ever read.","triggerScenarios":"Calling loadPlatformConfig() (or `uipro init` with an AI selection flag) with a misspelled or unsupported value, e.g. 'Claude' (capitalized), 'vscode', 'jetbrains', or a newly added platform whose entry was not added to AI_TO_PLATFORM in template.ts.","commonSituations":"Case mismatch between what the CLI prompt accepted and the map keys; a new AI tool name expected by users but not yet in the map; scripts passing user input directly without normalizing.","solutions":["Pass a supported identifier: one of claude, cursor, windsurf, antigravity, copilot, kiro, opencode, roocode, codex, qoder, gemini, trae, continue, codebuddy, droid, kilocode, warp, augment, codewhale, universal.","Normalize input to lowercase/trimmed before lookup.","If adding a new platform, add the mapping entry and the corresponding templates/platforms/<name>.json config.","Use 'universal' as the generic fallback when the specific tool isn't supported."],"exampleFix":"// before\nconst config = await loadPlatformConfig(rawInput);\n// after\nconst config = await loadPlatformConfig(rawInput.trim().toLowerCase());","handlingStrategy":"type-guard","validationCode":"const SUPPORTED_AI_TYPES = [\n  'claude','cursor','windsurf','antigravity','copilot','kiro','opencode','roocode',\n  'codex','qoder','gemini','trae','continue','codebuddy','droid','kilocode',\n  'warp','augment','codewhale','universal'\n] as const;\n\nconst normalizeAiType = (raw: string) => raw.trim().toLowerCase();\n\nfunction assertSupportedAiType(raw: string): void {\n  if (!SUPPORTED_AI_TYPES.includes(normalizeAiType(raw) as any)) {\n    throw new Error(`Unsupported AI type '${raw}'. Supported: ${SUPPORTED_AI_TYPES.join(', ')}`);\n  }\n}","typeGuard":"type AiType = typeof SUPPORTED_AI_TYPES[number];\n\nfunction isAiType(value: string): value is AiType {\n  return (SUPPORTED_AI_TYPES as readonly string[]).includes(value.trim().toLowerCase());\n}","tryCatchPattern":null,"preventionTips":["Normalize (trim + lowercase) user input before the AI_TO_PLATFORM lookup.","Surface the supported list in the error/usage help so users self-correct.","When adding platforms, update AI_TO_PLATFORM and the exported type/list in the same commit."],"tags":["cli","validation","typescript","config"],"backgroundTag":null,"analyzedSha":"a38d04c3d5c298c851dbe5e6ee1965ee3de42cb5","analyzedAt":"2026-08-14T18:51:02.321Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}