import type { ResourceDiagnostic } from "./diagnostics.js"; import { type SourceInfo } from "./source-info.js"; export interface SkillFrontmatter { name?: string; description?: string; "disable-model-invocation"?: boolean; /** Tools this skill requires. Mapped via the Claude Code alias table (same as agent `tools`). */ "allowed-tools"?: string | string[]; [key: string]: unknown; } export interface Skill { name: string; description: string; filePath: string; baseDir: string; sourceInfo: SourceInfo; disableModelInvocation: boolean; /** Normalized hoocode tool names this skill needs, parsed from `allowed-tools`. */ allowedTools?: 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; /** * 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). * * Descriptions are emitted whole, deliberately — unlike ``, * which runs each agent through `summarizeAgentDescription`. The asymmetry is * not an oversight: an agent description is prose about a role, and the * summarizer extracts its positive region before capping, whereas a skill * description *is* the routing signal. Authors pack trigger conditions into it * ("use when the user mentions .docx, 'report', 'memo'…"), and a length cap * would silently amputate the triggers, costing activations to save tokens. * Trim a verbose skill at the source instead of truncating every skill here. */ export declare function formatSkillsForPrompt(skills: Skill[]): 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; /** * Discover skills from `.claude/skills/` directories (D7 native import). * Defaults to true. Set false in tests or when explicit path control is needed. */ includeClaude?: boolean; /** * Contributed skill directory -> owning plugin id. Skills loaded from such a * directory are named `:`, matching Claude Code. * * Applied here rather than by the caller because the name map below is * first-wins by name: two plugins shipping a `review` skill would collide and * lose one *before* any later rename could tell them apart. */ namespaces?: Map; } /** * Load skills from all configured locations. * Returns skills and any validation diagnostics. */ export declare function loadSkills(options: LoadSkillsOptions): LoadSkillsResult; //# sourceMappingURL=skills.d.ts.map