function getModeSpecificityScore(modeInstance) {
				const extensionsStr = modeInstance.extensions;
				if (!extensionsStr) return 0;

				const patterns = extensionsStr.split("|");
				let maxScore = 0;

				for (const pattern of patterns) {
					let currentScore = 0;
					if (pattern.startsWith("^")) {
						// Exact filename match or anchored pattern
						currentScore = 1000 + (pattern.length - 1); // Subtract 1 for '^'
					} else {
						// Extension match
						currentScore = pattern.length;
					}
					if (currentScore > maxScore) {
						maxScore = currentScore;
					}
				}
				return maxScore;
			}
Calculates a specificity score for a mode.
Higher score means more specific.
- Anchored patterns (e.g., "^Dockerfile") get a base score of 1000.
- Non-anchored patterns (extensions) are scored by length.