/** * Programmatic API for `@directive-run/claude-plugin`. * * The canonical install path for end users is Claude Code's plugin * marketplace (`/plugin marketplace add directive-run/directive` * then `/plugin install directive@directive-plugins`). This module * is the alternative install path for tool authors who want to * consume the skill bundles programmatically — custom skill * registries, doc-generation pipelines, eval harnesses, or AI * orchestrators that want to expose Directive skills via their own * routing layer. * * The package ships the pre-built skill bundles in `skills/`. This * module exposes them as functions: list the skills, read a SKILL.md, * read a supporting knowledge file, or grab the whole skill tree. */ /** * One bundled skill — the `SKILL.md` plus its supporting knowledge * files (which are copied in from `@directive-run/knowledge` at * build time) and the auto-generated `examples.md` when present. */ interface Skill { /** Skill name (matches the directory under `skills/`). */ name: string; /** Full `SKILL.md` contents — the Claude-facing skill manifest. */ manifest: string; /** Supporting files keyed by base name (no `.md` suffix). */ files: Map; } /** * List the names of every bundled skill. * * Returns an alphabetically-sorted array — stable for snapshot tests. */ declare function listSkills(): string[]; /** * Get a single skill by name. * * @param name - Skill name (e.g. `"writing-directive-modules"`). * @returns The skill, or `undefined` if no skill by that name exists. */ declare function getSkill(name: string): Skill | undefined; /** * Get every bundled skill, keyed by name. * * Returns a defensive copy — mutating the returned Map won't affect * subsequent calls. */ declare function getAllSkills(): Map; /** * Read one supporting file from a skill bundle. * * @param skillName - Skill name (e.g. `"writing-directive-modules"`). * @param fileName - Supporting file base name without `.md` * (e.g. `"core-patterns"`, `"anti-patterns"`, `"examples"`). * @returns File contents, or `undefined` if the skill or file is not * present. */ declare function getSkillFile(skillName: string, fileName: string): string | undefined; /** * Clear the in-memory skill cache. Useful in tests or watch-mode * tooling that regenerates the `skills/` directory between calls. */ declare function clearCache(): void; export { type Skill, clearCache, getAllSkills, getSkill, getSkillFile, listSkills };