remove impact and impactDescription from supabase skills frontmatter header

This commit is contained in:
Pedro Rodrigues
2026-02-16 15:32:50 +00:00
parent 2c81513baa
commit 69575f4c87
89 changed files with 8 additions and 198 deletions

View File

@@ -100,7 +100,7 @@ function parseSectionsFromFile(filePath: string): Section[] {
const sections: Section[] = [];
const sectionMatches = content.matchAll(
/##\s+(\d+)\.\s+([^\n(]+)\s*\((\w+)\)\s*\n\*\*Impact:\*\*\s*(\w+(?:-\w+)?)\s*\n\*\*Description:\*\*\s*([^\n]+)/g,
/##\s+(\d+)\.\s+([^\n(]+)\s*\((\w+)\)\s*\n(?:\*\*Impact:\*\*\s*(\w+(?:-\w+)?)\s*\n)?\*\*Description:\*\*\s*([^\n]+)/g,
);
for (const match of sectionMatches) {
@@ -108,7 +108,7 @@ function parseSectionsFromFile(filePath: string): Section[] {
number: parseInt(match[1], 10),
title: match[2].trim(),
prefix: match[3].trim(),
impact: match[4].trim() as Section["impact"],
impact: match[4]?.trim() as Section["impact"],
description: match[5].trim(),
});
}

View File

@@ -237,11 +237,11 @@ export function parseRuleFile(
return { success: false, errors, warnings };
}
// Get impact level
const impact = frontmatter.impact as ImpactLevel;
if (!impact || !IMPACT_LEVELS.includes(impact)) {
// Validate impact level when provided
const impact = frontmatter.impact as ImpactLevel | undefined;
if (impact && !IMPACT_LEVELS.includes(impact)) {
errors.push(
`Invalid or missing impact level: ${impact}. Must be one of: ${IMPACT_LEVELS.join(", ")}`,
`Invalid impact level: ${impact}. Must be one of: ${IMPACT_LEVELS.join(", ")}`,
);
return { success: false, errors, warnings };
}

View File

@@ -19,7 +19,7 @@ export interface Rule {
title: string;
section: number;
subsection?: number;
impact: ImpactLevel;
impact?: ImpactLevel;
impactDescription?: string;
explanation: string;
examples: CodeExample[];
@@ -32,7 +32,7 @@ export interface Section {
number: number;
title: string;
prefix: string;
impact: ImpactLevel;
impact?: ImpactLevel;
description: string;
}

View File

@@ -11,7 +11,6 @@ import {
import {
discoverSkills,
getSkillPaths,
IMPACT_LEVELS,
type SkillPaths,
validateSkillExists,
} from "./config.js";
@@ -123,20 +122,6 @@ export function validateRuleFile(
}
}
// Validate impact level
if (!IMPACT_LEVELS.includes(rule.impact)) {
errors.push(
`Invalid impact level: ${rule.impact}. Must be one of: ${IMPACT_LEVELS.join(", ")}`,
);
}
// Warning for missing impact description
if (!rule.impactDescription) {
warnings.push(
"Missing impactDescription (recommended for quantifying benefit)",
);
}
return {
valid: errors.length === 0,
errors,