import type { ResourceDiagnostic } from "./diagnostics.js"; import { type SourceInfo } from "./source-info.js"; export interface SkillFrontmatter { name?: string; description?: string; "disable-model-invocation"?: boolean; "allowed-tools"?: string; compatibility?: string; license?: string; metadata?: Record; [key: string]: unknown; } export interface Skill { name: string; description: string; filePath: string; baseDir: string; sourceInfo: SourceInfo; disableModelInvocation: boolean; allowedTools?: string; compatibility?: string; license?: string; metadata?: Record; /** Paths to executable scripts in the skill's scripts/ directory */ scripts: string[]; /** Paths to reference documents in the skill's references/ directory */ references: string[]; } export interface LoadSkillsResult { skills: Skill[]; diagnostics: ResourceDiagnostic[]; } export interface LoadSkillsFromDirOptions { /** Directory to scan for skills */ dir: string; /** Source identifier for these skills */ source: string; } /** * Load skills from a directory. * * Discovery rules: * - if a directory contains SKILL.md, treat it as a skill root and do not recurse further * - otherwise, load direct .md children in the root * - recurse into subdirectories to find SKILL.md */ export declare function loadSkillsFromDir(options: LoadSkillsFromDirOptions): LoadSkillsResult; /** A skill that matches the detected project stack, with the framework names it matched on. */ export interface SkillRelevance { skill: Skill; matchedOn: string[]; } /** * Split skills into those relevant to the detected frameworks and the rest. * * A skill is relevant when a framework name or one of its aliases appears as * a whole token in the skill name, description, compatibility, or * metadata.stack / metadata.tags. Input order is preserved within each group; * matchedOn follows framework detection order. */ export declare function rankSkillsForStack(skills: Skill[], frameworks: readonly { name: string; }[]): { relevant: SkillRelevance[]; other: Skill[]; }; /** * Format skills for inclusion in a system prompt. * Uses XML format per Agent Skills standard. * See: https://agentskills.io/integrate-skills * * Skills with disableModelInvocation=true are excluded from the prompt * (they can only be invoked explicitly via /skill:name commands). * * When `frameworks` (from stack detection) is provided, skills matching the * stack are listed first with a lead-in and a element. */ export declare function formatSkillsForPrompt(skills: Skill[], frameworks?: readonly { name: string; }[]): string; export interface LoadSkillsOptions { /** Working directory for project-local skills. */ cwd: string; /** Agent config directory for global skills. */ agentDir: string; /** Explicit skill paths (files or directories) */ skillPaths: string[]; /** Include default skills directories. */ includeDefaults: boolean; } /** * Load skills from all configured locations. * Returns skills and any validation diagnostics. */ export declare function loadSkills(options: LoadSkillsOptions): LoadSkillsResult; //# sourceMappingURL=skills.d.ts.map