UNPKG

aiwg

Version:

Deployment tool and support utility for AI context. Copies agents, skills, commands, rules, and behaviors into the paths each AI platform reads (Claude Code, Codex, Copilot, Cursor, Warp, OpenClaw, and 6 more) so one source of truth works across 10 platfo

78 lines 2.66 kB
/** * skill-lint — rubric-based quality scoring for SKILL.md files. * * Complements `validate-metadata` (#1014's CI gate, schema-only) * with a richer per-skill quality score across multiple dimensions. * Designed for headless use: `--json` outputs structured results for * CI consumption; exit code 0/1 reflects whether all checked files * meet the chosen rubric threshold. * * @module src/cli/handlers/skill-lint */ import type { CommandHandler } from './types.js'; /** * Three rubric strictness levels. The minimum-passing score in each * mode reflects how much we expect of a SKILL.md before flagging it. */ export type RubricMode = 'strict' | 'standard' | 'lenient'; interface DimensionScore { /** 0–100 score for this dimension. */ score: number; /** Reasons the dimension lost points; empty when score is 100. */ notes: string[]; } interface SkillScore { file: string; /** Weighted total, 0–100. */ score: number; /** Per-dimension breakdown. */ dimensions: { schema: DimensionScore; description: DimensionScore; discoverability: DimensionScore; body: DimensionScore; }; /** Did the file meet the chosen rubric's threshold? */ passes: boolean; } interface CompanionCliInventoryItem { file: string; commands: string[]; workflowLanguage: boolean; risk: 'ok' | 'review'; notes: string[]; } interface LintReport { rubric: RubricMode; threshold: number; files: SkillScore[]; /** Average score across files (helpful trend metric). */ averageScore: number; /** Files that did not meet the threshold. */ failedCount: number; companionCli: { total: number; reviewCount: number; items: CompanionCliInventoryItem[]; }; } /** * Lint a single SKILL.md file end-to-end. * * @param filePath - Absolute or relative path to the SKILL.md * @param rubric - Strictness level (drives the pass threshold) */ export declare function lintSkillFile(filePath: string, rubric?: RubricMode): Promise<SkillScore>; /** * Lint all SKILL.md files under one or more paths. Returns a structured * report. Each path may be a directory (walked recursively) or a * specific SKILL.md file. Files in `failedCount` and the per-file list * are deduplicated. * * Pure function — does not print or exit. The CLI handler renders * output and translates the report into an exit code. */ export declare function lintSkills(targetPaths: string | string[], rubric?: RubricMode): Promise<LintReport>; export declare const skillLintHandler: CommandHandler; export {}; //# sourceMappingURL=skill-lint.d.ts.map