eyaltoledano/claude-task-master · error

Profile not found: static import missing for '${name}'. Vali

Error message

Profile not found: static import missing for '${name}'. Valid profiles: ${RULE_PROFILES.join(', ')}

What it means

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.

Source

Thrown at src/utils/rule-transformer.js:49

	return RULE_PROFILES.includes(profile);
}

/**
 * Get rule profile by name
 * @param {string} name - Profile name
 * @returns {Object|null} Profile object or null if not found
 */
export function getRulesProfile(name) {
	if (!isValidProfile(name)) {
		return null;
	}

	// Get the profile from the imported profiles module
	const profileKey = `${name}Profile`;
	const profile = profilesModule[profileKey];

	if (!profile) {
		throw new Error(
			`Profile not found: static import missing for '${name}'. Valid profiles: ${RULE_PROFILES.join(', ')}`
		);
	}

	return profile;
}

/**
 * Replace basic Cursor terms with profile equivalents
 */
function replaceBasicTerms(content, conversionConfig) {
	let result = content;

	// Apply profile term replacements
	conversionConfig.profileTerms.forEach((pattern) => {
		if (typeof pattern.to === 'function') {
			result = result.replace(pattern.from, pattern.to);
		} else {

View on GitHub (pinned to c0c98d367c)

Solutions

  1. Use one of the valid profile names listed in the error message (e.g. 'cursor', 'claude', 'gemini', 'opencode')
  2. If adding a new profile, import it statically in the profiles module so <name>Profile exists
  3. Validate the profile name against RULE_PROFILES before calling getRulesProfile

Example fix

// before
const profile = getRulesProfile(userInputRules); // 'cursorr' typo
// after
import { RULE_PROFILES } from './constants.js';
const name = RULE_PROFILES.includes(userInputRules) ? userInputRules : 'cursor';
const profile = getRulesProfile(name);
Defensive patterns

Strategy: validation

Validate before calling

import { RULE_PROFILES } from './constants.js';
if (!RULE_PROFILES.includes(name)) {
  throw new Error(`Unknown rule profile '${name}'. Valid: ${RULE_PROFILES.join(', ')}`);
}

Type guard

const isValidProfile = (name) => RULE_PROFILES.includes(name);

Try / catch

try {
  const profile = getRulesProfile(name);
} catch (err) {
  if (err.message.startsWith('Profile not found')) {
    console.error(`Unsupported profile '${name}'. Use one of: ${err.message.split('Valid profiles: ')[1]}`);
    process.exitCode = 1;
  } else throw err;
}

Prevention

When it happens

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

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

Related errors


AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29). Data as JSON: /api/errors/4f292ecd27d3f082. Report an issue: GitHub.