/** * Shared SKILL.md frontmatter parser + agentskills.io name validation. * * The SKILL.md format (https://agentskills.io/specification) is YAML * frontmatter between `---` markers followed by a Markdown body. This parser is * intentionally minimal — it handles the fields skills actually use, with YAML * block scalars (`|` / `>`) for multi-line values and an indented map for * `metadata`. It is NOT a general YAML parser; skill files are trusted markdown. */ export interface ParsedSkillFrontmatter { name?: string | undefined; description?: string | undefined; /** WrongStack extension; informational only. */ version?: string | undefined; license?: string | undefined; compatibility?: string | undefined; metadata?: Record | undefined; /** `allowed-tools` (spec, experimental) → split on whitespace. */ allowedTools?: string[] | undefined; } /** * Parse the YAML frontmatter block from a raw SKILL.md file. Returns `{}` when * there is no (or unclosed) frontmatter — callers treat that as "skip". * * Line endings are normalized first: CRLF (and lone CR) would otherwise leave a * trailing `\r` on each line, and since `.` / `$` don't match `\r`, the * `key: value` regex would fail on every line and silently drop the whole * frontmatter. Real skill files are frequently CRLF (Windows / some editors). */ export declare function parseSkillFrontmatter(raw: string): ParsedSkillFrontmatter; /** Strip leading YAML frontmatter (`---\n…\n---`) from a SKILL.md file. */ export declare function stripFrontmatter(raw: string): string; /** True when `name` matches the agentskills.io name format (chars + length only). */ export declare function isValidSkillNameFormat(name: string): boolean; /** * Validate a skill `name` against the agentskills.io spec: * 1-64 chars; lowercase letters, digits, and single hyphens only; no * leading/trailing/consecutive hyphens. Pass the parent directory name to also * enforce the "name must match the parent directory" rule. * * Returns a list of human-readable violations (empty = valid). */ export declare function validateSkillName(name: string, parentDirName?: string): string[]; //# sourceMappingURL=frontmatter.d.ts.map