Code Stats Skill
Analyzes a workspace directory for code complexity metrics.
Usage
const { analyze, report } = require('./skills/code-stats');
// Analyze current workspace
const stats = analyze(process.cwd());
console.log(report(stats));
CLI
node skills/code-stats/scripts/stats.js [directory]
Exports
analyze(dir)— Returns stats object with file counts, line counts, language breakdownreport(stats)— Returns human-readable formatted report stringcountTodos(dir)— Scans for TODO/FIXME/HACK/XXX comments
Output Fields
filesByExt— File count grouped by extensionlinesByExt— Line count grouped by extensiontotalFiles— Total file count (excludes node_modules, .git)totalLines— Total lines of codetodoCount— TODO/FIXME/HACK/XXX comment countlanguageBreakdown— Percentage breakdown by language
