import type { BundledSkill } from "../skills.js"; /** * User-extensible skill discovery. * * Priority (last wins on name collisions): * bundled (compiled into the package) * → project (/.gg/editor-skills/ OR /.gg/skills/) * → user (~/.gg/editor-skills/ OR ~/.gg/skills/) * * Silent override is the intended behaviour. The system prompt's skill list * tags overridden entries so the agent (and the user) can see the layering. * * Two on-disk layouts are supported, identical to the Anthropic skill spec: * * - Flat: /.md * - Bundle: //SKILL.md (+ optional support files / scripts) * * Both forms accept optional YAML frontmatter (3-dash delimited): * * --- * name: my-skill * description: One-line description for the agent. * --- * * When frontmatter is absent, the skill name falls back to the basename and * the description is heuristically extracted from the first non-heading line. * * Two project / user dirs are searched in order — `.gg/editor-skills/` (the * legacy gg-editor location) then `.gg/skills/` (the broader ecosystem * convention used by ggcoder + skills.sh installs). Same for ~/.gg/. This * means a creator who has done `npx skills add kenkaiiii/agent-skills` into * `~/.gg/skills/` automatically gets the editor skills too. */ export interface SkillSource { name: string; description: string; content: string; origin: "bundled" | "project" | "user"; /** Absolute path on disk (project / user only). */ path?: string; } export interface DiscoverSkillsOptions { cwd: string; homeDir?: string; bundled: BundledSkill[]; } export declare function discoverSkills(opts: DiscoverSkillsOptions): SkillSource[]; /** * Parse a skill markdown into a SkillSource. Supports optional * 3-dash-delimited YAML frontmatter (only `name:` and `description:` are * inspected — additional keys are tolerated and ignored). * * The parsed `content` retains the frontmatter when present, so consumers * (read_skill / agent prompts) see the full file as authored. This matches * how ggcoder and the skills.sh ecosystem treat skill files. */ export declare function parseSkill(raw: string, origin: "bundled" | "project" | "user", path: string, fallbackName: string): SkillSource; interface Frontmatter { name?: string; description?: string; } /** * Read a YAML-ish frontmatter block at the start of a file. Only supports the * tiny subset we care about — `key: value` lines, no nesting, no lists. That * matches the Anthropic skill spec exactly. Multi-line `description: |` is * NOT supported by design (skill descriptions should fit on one line so the * system-prompt index reads cleanly). */ export declare function parseFrontmatter(raw: string): Frontmatter; /** Drop the frontmatter block (if any), return body only. */ export declare function stripFrontmatter(raw: string): string; /** * Extract a one-line description from a skill markdown. * * Strategy: the first non-empty, non-heading line of plain text. Truncated at * 200 chars. Falls back to "(no description)" if absent. */ export declare function extractDescription(content: string): string; export {}; //# sourceMappingURL=skills-loader.d.ts.map