/** * skailify — pure, individually-testable helpers for importing an existing * coding-agent skill (e.g. a Claude Code skill from `~/.claude/skills/`) into a * skaile library. Composed by the `asset import` command and the `skailify` * factory skill. See each export's TSDoc for specifics. * * @docLink cli/commands/asset#import */ /** Default authoring version stamped on a skill that ships none. */ export declare const DEFAULT_IMPORT_VERSION = "0.1.0"; /** Default lifecycle stage stamped on an imported skill. */ export declare const DEFAULT_IMPORT_STAGE = "alpha"; /** * Where coding-agent skills live on disk, highest precedence first. The * `SKAILE_CLAUDE_SKILLS_DIR` override exists so tests (and non-default setups) * can point the resolver at a fixture tree without touching `$HOME`. */ export declare function claudeSkillRoots(): string[]; export interface ResolvedImportSource { /** Absolute path to the skill directory. */ dir: string; /** Absolute path to the skill's SKILL.md. */ skillFile: string; /** How the source was located — for human-facing messages. */ via: "path" | "claude-skills"; } /** * Resolve an `import` argument to a concrete skill directory. A value that * exists on disk (file or dir) is used verbatim; otherwise it is treated as a * bare skill name and looked up under {@link claudeSkillRoots}. * * Returns `null` when nothing matches so the caller can print a tailored error. */ export declare function resolveImportSource(nameOrPath: string): ResolvedImportSource | null; export interface NormalizeOptions { /** Fallback name when frontmatter has none (usually the source dir name). */ fallbackName?: string; /** Version to stamp when the skill ships none. */ version?: string; /** Stage to stamp when the skill ships none. */ stage?: string; } export interface NormalizeResult { /** Rewritten SKILL.md content (frontmatter + body). */ content: string; /** Canonical asset name (slugified if the source was non-compliant). */ name: string; /** The name as it appeared in the source, when it differed from `name`. */ originalName?: string; /** True when `content` differs from the input (metadata added, name slugified, …). */ changed: boolean; /** Human-facing notes about what was normalized. */ notes: string[]; } /** * Bring a coding-agent `SKILL.md` into the skaile schema without touching the * body: ensure a canonical lowercase-kebab `name`, and a `metadata:` block * carrying at least `version`, `stage`, and `tags`. Idempotent — a SKILL.md * that already conforms comes back unchanged (`changed: false`). * * A Claude Code skill only requires `name` + `description`; skaile additionally * expects the `metadata:` block, so this is the transform `asset migrate`'s raw * byte-copy skips. */ export declare function normalizeSkillContent(raw: string, opts?: NormalizeOptions): NormalizeResult; export interface EnsureDomainResult { /** Absolute path to the domain directory. */ dir: string; /** Publisher slug derived for this domain (the dir name, kebab-cased). */ publisher: string; /** True when this call created the directory / DOMAIN.md. */ created: boolean; } /** * Scaffold a domain directory under a library: `//DOMAIN.md`. A * domain is the first-level dir of an asset repo and defines the publisher * namespace, so assets placed beneath it publish as `@/`. * No-op (returns `created: false`) when the DOMAIN.md already exists. */ export declare function ensureDomain(libraryPath: string, domain: string, opts?: { description?: string; publisher?: string; }): EnsureDomainResult; /** List the domains in a library — first-level dirs that carry a DOMAIN.md. */ export declare function listDomains(libraryPath: string): string[]; export interface UpsertAssetInput { kind: string; name: string; /** Repo-relative path to the asset directory (the AssetEntry `root`). */ root: string; version?: string; publisher?: string; description?: string; keywords?: string[]; } export interface UpsertAssetResult { manifestPath: string; /** True when a new entry was appended, false when an existing one was updated. */ added: boolean; } /** * Auto-wire an asset into a library's `skaile.manifest.yaml` (creating the * manifest when absent). Matches an existing entry by `(kind, name)` and * updates it in place; otherwise appends. This is the manifest half of import * that a plain byte-copy (`asset migrate`) leaves stale. */ export declare function upsertManifestAsset(libraryPath: string, input: UpsertAssetInput): UpsertAssetResult; //# sourceMappingURL=skailify-lib.d.ts.map