/**
 * Skill-usage analyst — a DETERMINISTIC `Analyst` over a Claude/Codex skill
 * library + its trace corpus. Unlike the trace-store kinds (failure-mode,
 * improvement, ...) this kind calls no LLM: it mines real usage and skill
 * structure and emits findings by rule.
 *
 * It exists because the naive "Skill-tool invocation count" lies low — it
 * misses orchestrated sub-dispatch (a leaf skill run BY /pursue or /governor
 * logs under the parent), slash-command entry, local-script bypass, and
 * on-disk artifacts. The 2026-05-30 skill audit found 39/53 skills at zero
 * direct invocations, yet only one was a genuine cut: the rest were
 * measurement-invisible or discovery-limited. This analyst encodes that
 * lesson as a multi-signal usage model so a cheap repeatable pass can keep
 * the library honest, and so the expensive audit workflow's verdicts can
 * GEPA-distill it toward agreement (see `gold/skill-verdicts.gold.jsonl`).
 *
 * Report-building (`buildSkillUsageReport`, an fs scan) is separated from
 * finding emission (`SkillUsageAnalyst.analyze`, pure) so the slow scan runs
 * once at the registry boundary and the rule logic stays unit-testable.
 */
import type { Analyst, AnalystContext, AnalystFinding } from '../types';
export type SkillKind = 'public' | 'private';
/** One skill's multi-signal usage + structure. All counts are deterministic. */
export interface SkillUsageRecord {
    name: string;
    kind: SkillKind;
    /** Absolute path to the skill's SKILL.md. */
    path: string;
    lines: number;
    /** `"skill":"<name>"` Skill-tool invocations across the trace corpus. */
    directInvocations: number;
    /** `<command-name>/<name>` slash invocations across the trace corpus. */
    slashInvocations: number;
    /** Sibling skills whose SKILL.md dispatches to this one (`/<name>`). Proxy
     *  for orchestrated sub-dispatch the per-skill counter cannot see. */
    inboundRefs: number;
    /** On-disk artifacts attributable to the skill (e.g. `.evolve/<name>/**`). */
    artifactCount: number;
    /** Tangle-private reference count in the body (leak signal for public skills). */
    tanglePrivateRefs: number;
    hasReferencesDir: boolean;
    hasEvalsDir: boolean;
    /** Body mentions `skill-runs.jsonl` (visible to /reflect + /governor). */
    logsRuns: boolean;
    /** Description carries an explicit `Triggers:` clause / trigger phrases. */
    hasTriggerPhrases: boolean;
}
export interface SkillUsageReport {
    generatedFromTraces: number;
    records: SkillUsageRecord[];
}
export interface SkillUsageScanConfig {
    /** Dirs holding `*.jsonl` transcripts (Claude `~/.claude/projects`, Codex sessions). */
    transcriptDirs: string[];
    /** Skill roots to scan; each dir directly under `root` with a `SKILL.md` is a skill. */
    skillRoots: {
        root: string;
        kind: SkillKind;
    }[];
    /** Roots scanned for `<root>/.evolve/<skill>` artifact dirs. */
    artifactRoots?: string[];
    /** Token-prefixed mappings: skill name → extra artifact subpaths under an artifactRoot
     *  (e.g. reflect → `.evolve/reflections`). Catches non-eponymous artifact dirs. */
    artifactAliases?: Record<string, string[]>;
    /** Cap files read per transcript dir (bounds a huge corpus); 0 = unbounded. */
    maxTranscriptsPerDir?: number;
}
/** Scan the corpus + skill roots into a {@link SkillUsageReport}. Deterministic. */
export declare function buildSkillUsageReport(config: SkillUsageScanConfig): SkillUsageReport;
/** Pure rule pass over a report → findings. Exported for direct/unit use. */
export declare function emitSkillUsageFindings(report: SkillUsageReport, producedAt: string): AnalystFinding[];
export declare class SkillUsageAnalyst implements Analyst<SkillUsageReport> {
    readonly id = "skill-usage";
    readonly description = "Deterministic multi-signal skill-usage analysis: flags dead skills, measurement-invisible (orchestrated) usage, discovery gaps, public-repo leaks, bloat, missing evals, and missing run-logging.";
    readonly inputKind: "custom";
    readonly cost: {
        kind: "deterministic";
        est_usd_per_run: number;
    };
    readonly version = "1.0.0";
    analyze(input: SkillUsageReport, ctx: AnalystContext): Promise<AnalystFinding[]>;
}
export declare const SKILL_USAGE_ANALYST: SkillUsageAnalyst;
//# sourceMappingURL=skill-usage.d.ts.map