{"record":{"id":"4f292ecd27d3f082","repo":"eyaltoledano/claude-task-master","slug":"profile-not-found-static-import-missing-for-na","errorCode":null,"errorMessage":"Profile not found: static import missing for '${name}'. Valid profiles: ${RULE_PROFILES.join(', ')}","messagePattern":"Profile not found: static import missing for '(.+?)'\\. Valid profiles: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/utils/rule-transformer.js","lineNumber":49,"sourceCode":"\treturn RULE_PROFILES.includes(profile);\n}\n\n/**\n * Get rule profile by name\n * @param {string} name - Profile name\n * @returns {Object|null} Profile object or null if not found\n */\nexport function getRulesProfile(name) {\n\tif (!isValidProfile(name)) {\n\t\treturn null;\n\t}\n\n\t// Get the profile from the imported profiles module\n\tconst profileKey = `${name}Profile`;\n\tconst profile = profilesModule[profileKey];\n\n\tif (!profile) {\n\t\tthrow new Error(\n\t\t\t`Profile not found: static import missing for '${name}'. Valid profiles: ${RULE_PROFILES.join(', ')}`\n\t\t);\n\t}\n\n\treturn profile;\n}\n\n/**\n * Replace basic Cursor terms with profile equivalents\n */\nfunction replaceBasicTerms(content, conversionConfig) {\n\tlet result = content;\n\n\t// Apply profile term replacements\n\tconversionConfig.profileTerms.forEach((pattern) => {\n\t\tif (typeof pattern.to === 'function') {\n\t\t\tresult = result.replace(pattern.from, pattern.to);\n\t\t} else {","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/src/utils/rule-transformer.js#L31-L67","documentation":"getRulesProfile looks up a statically imported profile object (e.g. cursorProfile, claudeProfile) from the profiles module using the key `${name}Profile`. If the profile object is absent — meaning no static import exists for that rule name — it throws with the list of valid profiles. This guards against dynamic or typo'd profile names silently producing undefined config.","triggerScenarios":"Calling getRulesProfile('aider') or any name whose `${name}Profile` key is not exported/imported; typos like 'curosr'; profile removed/renamed in the profiles module while callers still pass the old name; dynamic user input mapped straight into the name argument.","commonSituations":"Users typing an unsupported profile in a --rules flag before CLI validation; custom forks adding a profile to RULE_PROFILES but forgetting the static import; version mismatch where a profile was renamed between releases.","solutions":["Use one of the valid profile names listed in the error message (e.g. 'cursor', 'claude', 'gemini', 'opencode')","If adding a new profile, import it statically in the profiles module so <name>Profile exists","Validate the profile name against RULE_PROFILES before calling getRulesProfile"],"exampleFix":"// before\nconst profile = getRulesProfile(userInputRules); // 'cursorr' typo\n// after\nimport { RULE_PROFILES } from './constants.js';\nconst name = RULE_PROFILES.includes(userInputRules) ? userInputRules : 'cursor';\nconst profile = getRulesProfile(name);","handlingStrategy":"validation","validationCode":"import { RULE_PROFILES } from './constants.js';\nif (!RULE_PROFILES.includes(name)) {\n  throw new Error(`Unknown rule profile '${name}'. Valid: ${RULE_PROFILES.join(', ')}`);\n}","typeGuard":"const isValidProfile = (name) => RULE_PROFILES.includes(name);","tryCatchPattern":"try {\n  const profile = getRulesProfile(name);\n} catch (err) {\n  if (err.message.startsWith('Profile not found')) {\n    console.error(`Unsupported profile '${name}'. Use one of: ${err.message.split('Valid profiles: ')[1]}`);\n    process.exitCode = 1;\n  } else throw err;\n}","preventionTips":["Validate user-supplied profile names against RULE_PROFILES before lookup","When adding a profile, update both RULE_PROFILES and the static import together","Never interpolate arbitrary user input directly into profile lookups without whitelist checks"],"tags":["configuration","profiles","validation"],"backgroundTag":"unknown-profile-name","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}