mirror of
https://github.com/supabase/agent-skills.git
synced 2026-03-27 10:09:26 +08:00
remove impact and impactDescription from supabase skills frontmatter header
This commit is contained in:
@@ -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(),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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 };
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user