Files
affaan-m--everything-claude…/scripts/skills-health.js
T
wehub-resource-sync d48cda4081
CI / Test (ubuntu-latest, Node 18.x, bun) (push) Failing after 15m1s
CI / Test (ubuntu-latest, Node 18.x, npm) (push) Failing after 15m1s
CI / Test (ubuntu-latest, Node 18.x, pnpm) (push) Failing after 15m1s
CI / Test (ubuntu-latest, Node 18.x, yarn) (push) Failing after 15m1s
CI / Test (ubuntu-latest, Node 20.x, bun) (push) Failing after 17m13s
CI / Test (ubuntu-latest, Node 20.x, npm) (push) Failing after 18m42s
CI / Test (ubuntu-latest, Node 20.x, pnpm) (push) Failing after 15m0s
CI / Test (ubuntu-latest, Node 20.x, yarn) (push) Failing after 49m44s
CI / Test (ubuntu-latest, Node 22.x, bun) (push) Failing after 51m55s
CI / Test (ubuntu-latest, Node 22.x, pnpm) (push) Failing after 21m57s
CI / Test (ubuntu-latest, Node 22.x, npm) (push) Failing after 37m39s
CI / Test (ubuntu-latest, Node 22.x, yarn) (push) Failing after 34m7s
CI / Validate Components (push) Failing after 37m15s
CI / Python Tests (push) Failing after 10m1s
CI / Security Scan (push) Failing after 10m1s
CI / Lint (push) Failing after 17m12s
CI / Coverage (push) Failing after 20m19s
CI / Test (macos-latest, Node 18.x, bun) (push) Has been cancelled
CI / Test (macos-latest, Node 18.x, npm) (push) Has been cancelled
CI / Test (macos-latest, Node 18.x, pnpm) (push) Has been cancelled
CI / Test (macos-latest, Node 18.x, yarn) (push) Has been cancelled
CI / Test (windows-latest, Node 18.x, npm) (push) Has been cancelled
CI / Test (windows-latest, Node 18.x, pnpm) (push) Has been cancelled
CI / Test (windows-latest, Node 18.x, yarn) (push) Has been cancelled
CI / Test (macos-latest, Node 20.x, bun) (push) Has been cancelled
CI / Test (macos-latest, Node 20.x, npm) (push) Has been cancelled
CI / Test (macos-latest, Node 20.x, pnpm) (push) Has been cancelled
CI / Test (macos-latest, Node 20.x, yarn) (push) Has been cancelled
CI / Test (windows-latest, Node 20.x, npm) (push) Has been cancelled
CI / Test (windows-latest, Node 20.x, pnpm) (push) Has been cancelled
CI / Test (windows-latest, Node 20.x, yarn) (push) Has been cancelled
CI / Test (macos-latest, Node 22.x, bun) (push) Has been cancelled
CI / Test (macos-latest, Node 22.x, npm) (push) Has been cancelled
CI / Test (macos-latest, Node 22.x, pnpm) (push) Has been cancelled
CI / Test (macos-latest, Node 22.x, yarn) (push) Has been cancelled
CI / Test (windows-latest, Node 22.x, npm) (push) Has been cancelled
CI / Test (windows-latest, Node 22.x, pnpm) (push) Has been cancelled
CI / Test (windows-latest, Node 22.x, yarn) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 11:55:55 +08:00

133 lines
3.4 KiB
JavaScript

#!/usr/bin/env node
'use strict';
const { collectSkillHealth, formatHealthReport } = require('./lib/skill-evolution/health');
const { renderDashboard } = require('./lib/skill-evolution/dashboard');
function showHelp() {
console.log(`
Usage: node scripts/skills-health.js [options]
Options:
--json Emit machine-readable JSON
--skills-root <path> Override curated skills root
--learned-root <path> Override learned skills root
--imported-root <path> Override imported skills root
--home <path> Override home directory for learned/imported skill roots
--runs-file <path> Override skill run JSONL path
--now <timestamp> Override current time for deterministic reports
--dashboard Show rich health dashboard with charts
--panel <name> Show only a specific panel (success-rate, failures, amendments, versions)
--warn-threshold <n> Decline sensitivity threshold (default: 0.1)
--help Show this help text
`);
}
function requireValue(argv, index, argName) {
const value = argv[index + 1];
if (!value || value.startsWith('--')) {
throw new Error(`Missing value for ${argName}`);
}
return value;
}
function parseArgs(argv) {
const options = {};
for (let index = 0; index < argv.length; index += 1) {
const arg = argv[index];
if (arg === '--json') {
options.json = true;
continue;
}
if (arg === '--help' || arg === '-h') {
options.help = true;
continue;
}
if (arg === '--skills-root') {
options.skillsRoot = requireValue(argv, index, '--skills-root');
index += 1;
continue;
}
if (arg === '--learned-root') {
options.learnedRoot = requireValue(argv, index, '--learned-root');
index += 1;
continue;
}
if (arg === '--imported-root') {
options.importedRoot = requireValue(argv, index, '--imported-root');
index += 1;
continue;
}
if (arg === '--home') {
options.homeDir = requireValue(argv, index, '--home');
index += 1;
continue;
}
if (arg === '--runs-file') {
options.runsFilePath = requireValue(argv, index, '--runs-file');
index += 1;
continue;
}
if (arg === '--now') {
options.now = requireValue(argv, index, '--now');
index += 1;
continue;
}
if (arg === '--warn-threshold') {
options.warnThreshold = Number(requireValue(argv, index, '--warn-threshold'));
index += 1;
continue;
}
if (arg === '--dashboard') {
options.dashboard = true;
continue;
}
if (arg === '--panel') {
options.panel = requireValue(argv, index, '--panel');
index += 1;
continue;
}
throw new Error(`Unknown argument: ${arg}`);
}
return options;
}
function main() {
try {
const options = parseArgs(process.argv.slice(2));
if (options.help) {
showHelp();
process.exit(0);
}
if (options.dashboard || options.panel) {
const result = renderDashboard(options);
process.stdout.write(options.json ? `${JSON.stringify(result.data, null, 2)}\n` : result.text);
} else {
const report = collectSkillHealth(options);
process.stdout.write(formatHealthReport(report, { json: options.json }));
}
} catch (error) {
process.stderr.write(`Error: ${error.message}\n`);
process.exit(1);
}
}
main();