import type { SkillOwnershipConfig } from "../config/types.ts"; import { type SkillProvenanceMap } from "./skill-provenance.ts"; type SkillRootKind = "nested" | "flat"; export interface SkillRoot { kind: SkillRootKind; relPath: string; } export interface SkillIndex { roots: SkillRoot[]; /** All discovered skill slugs (owned + foreign) — used for link resolution. */ slugs: string[]; /** * Slugs that exist as flat trees (`/SKILL.md` at repo root). * Flat path matching must use this set — never the union `slugs` — so a * nested-only foreign slug cannot poison top-level dirs with the same name. */ flatSlugs: string[]; /** Skill slugs whose bodies this repo owns and should lint. */ ownedSlugs: string[]; /** Synced / lockfile foreign skills — skipped for body lint. */ foreignSlugs: string[]; provenance: SkillProvenanceMap; } export declare function detectSkillRoots(root: string): SkillRoot[]; export declare function buildSkillIndex(root: string, ownership?: SkillOwnershipConfig): SkillIndex; export declare function resolveSkillPath(index: SkillIndex, root: string, slug: string): string | null; export declare function isSkillPath(relPath: string, index: SkillIndex): boolean; /** True when path is under a skill tree classified foreign for body lint. */ export declare function isForeignSkillPath(relPath: string, index: SkillIndex): boolean; /** * Resolve a skill slug from a read path. * Covers `…/SKILL.md`, nested `.claude|agents/skills//**`, and flat * `/references/**` (optionally verified via workspaceRoot + SKILL.md). */ export declare function slugFromPath(filePath: string, workspaceRoot?: string): string | null; export declare function skillCollectAugments(index: SkillIndex): string[]; /** * Repo-relative markdown paths for owned skill trees (SKILL.md + references/**, * including under scan.exclude). Used by validate --base policy prove so skill-scoped * prose still runs against the full skill body, not just SKILL.md. * * Walks each nested root independently so the same slug under both `.claude/skills` * and `.agents/skills` (distinct dirs) is fully covered — not first-wins only. */ export declare function listSkillMarkdownPaths(root: string, index: SkillIndex): string[]; export declare function listSkillSlugs(index: SkillIndex): string[]; export declare function listOwnedSkillSlugs(index: SkillIndex): string[]; export {};