/** * SMI-628: SkillParser - Parse SKILL.md files with YAML frontmatter. * Extracts metadata from the standard SKILL.md format. * * SMI-4813: Type surface and `parseYamlFrontmatter` helper extracted into * sibling files (`SkillParser.types.ts`, `SkillParser.helpers.ts`) to keep * this file under the audit:standards 500-line gate. */ import type { TrustTier } from '../types/skill.js'; import type { DependencyDeclaration } from '../types/dependencies.js'; import type { SkillFrontmatter, ParsedSkillMetadata, ValidationResult, SkillParserOptions } from './SkillParser.types.js'; export type { SkillFrontmatter, ParsedSkillMetadata, ValidationResult, SkillParserOptions }; /** * SkillParser - Parses SKILL.md files with YAML frontmatter */ export declare class SkillParser { private options; constructor(options?: SkillParserOptions); /** * Parse a SKILL.md file content * @param content - Raw file content * @returns Parsed skill metadata or null if invalid */ parse(content: string): ParsedSkillMetadata | null; /** * Parse with validation results * @param content - Raw file content * @returns Parsed metadata with validation info */ parseWithValidation(content: string): { metadata: ParsedSkillMetadata | null; validation: ValidationResult; frontmatter: SkillFrontmatter | null; }; /** * Extract YAML frontmatter from markdown content */ extractFrontmatter(content: string): SkillFrontmatter | null; /** * Validate skill frontmatter */ validate(frontmatter: SkillFrontmatter): ValidationResult; /** * Convert frontmatter to metadata */ private toMetadata; /** * Extract markdown body (content after frontmatter) */ extractBody(content: string): string; /** * Infer trust tier from metadata */ inferTrustTier(metadata: ParsedSkillMetadata): TrustTier; /** * Parse the dependencies block from raw YAML frontmatter content. * Best-effort using the built-in parser; nested objects need js-yaml. */ static parseDependencyBlock(rawYaml: string): DependencyDeclaration | undefined; /** * Check for project-specific references that shouldn't be in published skills. * Static method — does not require SkillParser instantiation. * * Default patterns may produce false positives (e.g., legitimate npm scopes * like `@types/`, common GitHub repo URLs). Use `customPatterns` to add * project-specific checks, or review results before acting on warnings. * * @param content - Raw file content to scan * @param customPatterns - Additional regex patterns to merge with defaults * @returns Object with warnings array and detailed match information */ static checkReferences(content: string, customPatterns?: RegExp[]): { warnings: string[]; matches: Array<{ line: number; text: string; pattern: string; }>; }; } export default SkillParser; //# sourceMappingURL=SkillParser.d.ts.map