/** * @napplet/skills — agent skills for building napplets end-to-end. * * Ships Markdown skills (`make-napplet`, `design-napplet`, `build-napplet`, * `port-nostr-app`, `test-napplet`) plus the logic to install them into * whatever skill / rules location a given coding agent reads. The * `napplet-skills` CLI (see * `./cli.ts`) is a thin wrapper over the exports here. * * @packageDocumentation */ /** Metadata for one shipped skill. */ interface Skill { /** Kebab-case skill name, also the directory name. */ name: string; /** One-line summary parsed from the SKILL.md `description` frontmatter. */ description: string; /** Absolute path to the skill's `SKILL.md`. */ path: string; } /** * Resolve the directory that holds the skill folders. Works both from built * `dist/` and from `src/` (both are siblings of `skills/`), and from a * published package tarball. */ declare function skillsRoot(): string; /** * List the skills shipped by this package. * * @returns Skill metadata, sorted by name. * @example * ```ts * import { listSkills } from '@napplet/skills'; * for (const s of listSkills()) console.log(s.name, '—', s.description); * ``` */ declare function listSkills(): Skill[]; /** * Read a skill's raw `SKILL.md` (frontmatter included). * * @param name - Skill name, e.g. `"build-napplet"`. * @returns The full Markdown source. */ declare function readSkill(name: string): string; /** How a target materializes skills on disk. */ type TargetKind = 'skillDir' | 'ruleFile' | 'appendDoc'; /** An install destination for a particular agent / convention. */ interface Target { /** Target id used on the CLI (`--to `). */ id: string; /** Human label shown in help. */ label: string; /** Placement strategy. */ kind: TargetKind; /** Base path relative to cwd (or absolute / home-anchored). */ base: string; /** File extension for `ruleFile` targets. */ ext?: string; /** True when `base` is anchored at the user home directory. */ home?: boolean; } /** * Built-in install targets. `skillDir` writes `base//SKILL.md`; * `ruleFile` writes one `base/` per skill; `appendDoc` folds the * selected skills into a single `base` document between managed markers. */ declare const TARGETS: Record; /** Options for {@link install}. */ interface InstallOptions { /** Target id from {@link TARGETS}, or a custom one via `dir`/`out`. */ to?: string; /** Skill names to install; defaults to all. */ skills?: string[]; /** Working directory; defaults to `process.cwd()`. */ cwd?: string; /** Override base path for `skillDir` placement (ignores `to`). */ dir?: string; /** Override file path for `appendDoc` placement (ignores `to`). */ out?: string; /** Symlink instead of copy (only valid for `skillDir`). */ symlink?: boolean; } /** One written path plus how it was produced. */ interface InstallResult { skill: string; dest: string; action: 'wrote' | 'symlinked' | 'appended'; } /** * Install selected skills to a target. * * @param opts - {@link InstallOptions}. * @returns One {@link InstallResult} per written destination. * @example * ```ts * import { install } from '@napplet/skills'; * install({ to: 'claude' }); // .claude/skills//SKILL.md * install({ to: 'codex' }); // .codex/skills//SKILL.md * install({ to: 'agents' }); // append to ./AGENTS.md * install({ dir: 'vendor/skills' }); // custom skillDir * ``` */ declare function install(opts?: InstallOptions): InstallResult[]; export { type InstallOptions, type InstallResult, type Skill, TARGETS, type Target, type TargetKind, install, listSkills, readSkill, skillsRoot };