nextlevelbuilder/ui-ux-pro-max-skill · error · Error

Unknown AI type: ${aiType}

Error message

Unknown AI type: ${aiType}

What it means

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.

Source

Thrown at cli/src/utils/template.ts:75

  universal: 'universal',
};

async function exists(path: string): Promise<boolean> {
  try {
    await access(path);
    return true;
  } catch {
    return false;
  }
}

/**
 * Load platform configuration from JSON file
 */
export async function loadPlatformConfig(aiType: string): Promise<PlatformConfig> {
  const platformName = AI_TO_PLATFORM[aiType];
  if (!platformName) {
    throw new Error(`Unknown AI type: ${aiType}`);
  }

  const configPath = join(ASSETS_DIR, 'templates', 'platforms', `${platformName}.json`);
  const content = await readFile(configPath, 'utf-8');
  return JSON.parse(content) as PlatformConfig;
}

/**
 * Load all available platform configs
 */
export async function loadAllPlatformConfigs(): Promise<Map<string, PlatformConfig>> {
  const configs = new Map<string, PlatformConfig>();

  for (const [aiType, platformName] of Object.entries(AI_TO_PLATFORM)) {
    try {
      const config = await loadPlatformConfig(aiType);
      configs.set(aiType, config);
    } catch {

View on GitHub (pinned to a38d04c3d5)

Solutions

  1. 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.
  2. Normalize input to lowercase/trimmed before lookup.
  3. If adding a new platform, add the mapping entry and the corresponding templates/platforms/<name>.json config.
  4. Use 'universal' as the generic fallback when the specific tool isn't supported.

Example fix

// before
const config = await loadPlatformConfig(rawInput);
// after
const config = await loadPlatformConfig(rawInput.trim().toLowerCase());
Defensive patterns

Strategy: type-guard

Validate before calling

const SUPPORTED_AI_TYPES = [
  'claude','cursor','windsurf','antigravity','copilot','kiro','opencode','roocode',
  'codex','qoder','gemini','trae','continue','codebuddy','droid','kilocode',
  'warp','augment','codewhale','universal'
] as const;

const normalizeAiType = (raw: string) => raw.trim().toLowerCase();

function assertSupportedAiType(raw: string): void {
  if (!SUPPORTED_AI_TYPES.includes(normalizeAiType(raw) as any)) {
    throw new Error(`Unsupported AI type '${raw}'. Supported: ${SUPPORTED_AI_TYPES.join(', ')}`);
  }
}

Type guard

type AiType = typeof SUPPORTED_AI_TYPES[number];

function isAiType(value: string): value is AiType {
  return (SUPPORTED_AI_TYPES as readonly string[]).includes(value.trim().toLowerCase());
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of nextlevelbuilder/ui-ux-pro-max-skill@a38d04c3d5 (2026-08-14). Data as JSON: /api/errors/84262c42a17c58eb. Report an issue: GitHub.