/** * Structured skill bundles — Codeep's answer to Claude Code-style skills. * * Unlike the JSON-manifest "skills" in `skills.ts` (which are sequential * step lists triggered by the user via `/`), bundles are * agent-discovered capabilities the model picks up on its own. Each * bundle lives in a directory: * * /.codeep/skills//SKILL.md (project-scoped) * ~/.codeep/skills//SKILL.md (global) * * Project bundles shadow global ones with the same name. The bundle dir * may also contain auxiliary files (`assets/`, `scripts/`, …) that the * SKILL.md body refers to — we don't enforce any sub-structure. * * The SKILL.md format is a deliberate superset of Claude Code's skills * format so existing skills can be dropped in unchanged. Frontmatter * keys we recognise: * * name: (required) short slug; matches dir name by default * description: (required) one-sentence summary for the catalog * allowed-tools: (optional) array of tool names this skill may call * triggers: (optional) array of phrases that hint when to use * version: (optional) semver string * author: (optional) free text * * Codeep-specific extensions (skipped by Claude Code parsers, valid YAML): * * codeep-min-version: (optional) require Codeep CLI ≥ this version * codeep-requires-mcp: (optional) array of MCP server names that must * be registered for this skill to run * * The body of SKILL.md is freeform Markdown — instructions the agent * reads when it decides to invoke the skill. */ export interface SkillBundleMeta { /** Slug — defaults to the directory name if frontmatter `name` is missing. */ name: string; /** One-line summary shown in the catalog. */ description: string; /** Filesystem path of the bundle directory. */ source: string; /** 'project' if loaded from `/.codeep/skills`, else 'global'. */ scope: 'project' | 'global'; /** Subset of tools the skill is allowed to call (advisory in v2.0; enforced in 2.1+). */ allowedTools: string[]; /** Hint phrases that suggest when to use this skill (sysprompt-only signal). */ triggers: string[]; /** Optional semver string. */ version?: string; /** Optional author free text. */ author?: string; /** Optional minimum Codeep version (semver string). */ codeepMinVersion?: string; /** Optional list of MCP servers the skill needs registered. */ requiresMcp: string[]; /** Raw frontmatter — kept for `/skills detail ` introspection. */ frontmatterRaw: Record; } export interface SkillBundle extends SkillBundleMeta { /** Body content (everything after the frontmatter). */ body: string; } interface ParsedFrontmatter { meta: Record; body: string; } /** * Tolerant YAML-frontmatter parser — handles `key: value`, `key: [a, b]`, * and `key:` followed by `- item` block-list lines. Quoted strings are * unquoted. We don't ship a real YAML dep for this — the keys we care * about are scalars or simple arrays. */ export declare function parseFrontmatter(raw: string): ParsedFrontmatter; export declare function stripQuotes(s: string): string; export declare function asStringArray(v: unknown): string[] | null; /** * Load all skill bundles available in this workspace. Project entries * shadow global entries with the same name. */ export declare function loadSkillBundles(workspaceRoot?: string): SkillBundle[]; /** Find a single bundle by name (case-insensitive). */ export declare function findSkillBundle(name: string, workspaceRoot?: string): SkillBundle | null; /** * Build a compact catalog block for the agent's system prompt. Each entry * is `name — description (triggers)` so the model can pattern-match user * intent to a skill name. Capped so a workspace with hundreds of skills * can't blow the token budget. */ export declare function formatBundlesForSysprompt(bundles: SkillBundle[]): string; /** Render a bundle list as a Markdown block for `/skills bundles`. */ export declare function formatBundleList(bundles: SkillBundle[]): string; /** * One-line summary for the welcome banner — same informed-consent * pattern as custom commands and hooks. Empty string if no bundles. */ export declare function summarizeBundles(workspaceRoot: string): string; export {};