/** * Skill loader — discovers, parses, and injects workflow instructions * from local project/user/global scopes. * * Skills are markdown files with optional YAML frontmatter that define * reusable instructions, workflows, or conventions that get injected * into agent prompts at runtime. * * Discovery order (higher priority wins): * 1. Project scope: .opencode/skills/*.md * 2. User scope: ~/.config/opencode/skills/*.md * 3. Global scope: explicit paths from config.skills.scopes[] */ import type { Logger, SkillsConfig } from '../types'; export interface SkillFrontmatter { /** Skill name (defaults to filename without extension). */ name?: string; /** Description of what this skill does. */ description?: string; /** Priority for ordering (higher = injected first). Default: 0 */ priority?: number; /** Agent filter — only inject for these agents. Empty = all agents. */ agents?: string[]; /** Glob patterns — only inject when these files are touched. Empty = always. */ globs?: string[]; /** Whether this skill is enabled. Default: true */ enabled?: boolean; } export interface LoadedSkill { /** Resolved name of the skill. */ name: string; /** Source file path. */ path: string; /** Source scope. */ scope: 'project' | 'user' | 'global'; /** Parsed frontmatter. */ meta: SkillFrontmatter; /** Skill instruction body (without frontmatter). */ body: string; } export declare class SkillLoader { private logger; private config; private directory; private skills; private loaded; constructor(logger: Logger, directory: string, config?: SkillsConfig); /** * Whether skill loading is enabled. */ isEnabled(): boolean; /** * Discover and load all skills from all scopes. */ load(): LoadedSkill[]; /** * Get skills applicable for a specific agent and optionally filtered by touched files. */ getForAgent(agentName: string, touchedFiles?: string[]): LoadedSkill[]; /** * Format skills for injection into a prompt. */ formatForPrompt(skills: LoadedSkill[]): string; /** * Reload skills from disk. */ reload(): LoadedSkill[]; private loadFromDir; } //# sourceMappingURL=skill-loader.d.ts.map