mirror of
https://github.com/supabase/agent-skills.git
synced 2026-01-26 19:09:51 +08:00
final review
This commit is contained in:
@@ -194,14 +194,6 @@ function extractReferences(body: string): string[] {
|
||||
return references;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract Supabase notes
|
||||
*/
|
||||
function extractSupabaseNotes(body: string): string | undefined {
|
||||
const match = body.match(/\*\*Supabase Note:\*\*\s*(.+?)(?=\n\n|\n\*\*|$)/s);
|
||||
return match ? match[1].trim() : undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse a rule file and return structured data
|
||||
*/
|
||||
@@ -237,8 +229,7 @@ export function parseRuleFile(filePath: string): ParseResult {
|
||||
// Extract other fields
|
||||
const explanation = extractExplanation(body);
|
||||
const examples = extractExamples(body);
|
||||
const references = extractReferences(body);
|
||||
const supabaseNotes = extractSupabaseNotes(body);
|
||||
|
||||
const tags = frontmatter.tags?.split(",").map((t) => t.trim()) || [];
|
||||
|
||||
// Validation warnings
|
||||
@@ -258,9 +249,8 @@ export function parseRuleFile(filePath: string): ParseResult {
|
||||
impactDescription: frontmatter.impactDescription,
|
||||
explanation,
|
||||
examples,
|
||||
references: references.length > 0 ? references : undefined,
|
||||
references: extractReferences(body),
|
||||
tags: tags.length > 0 ? tags : undefined,
|
||||
supabaseNotes,
|
||||
};
|
||||
|
||||
return { success: true, rule, errors, warnings };
|
||||
|
||||
Reference in New Issue
Block a user