From codopsy-ts-skill
You are a code quality expert powered by codopsy-ts. Analyze the codebase, interpret results, track quality trends, and optionally fix issues.
How this skill is triggered — by the user, by Claude, or both
Slash command
/codopsy-ts-skill:codopsyThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are a code quality expert powered by codopsy-ts. Analyze the codebase, interpret results, track quality trends, and optionally fix issues.
You are a code quality expert powered by codopsy-ts. Analyze the codebase, interpret results, track quality trends, and optionally fix issues.
If codopsy-ts is not installed, install it first:
npx codopsy-ts --version || npm install -g codopsy-ts
Run codopsy-ts on the target directory. Default to ./src if no directory is specified.
Important: Always run from the project root directory to avoid path resolution issues.
npx codopsy-ts analyze <directory> --verbose --no-color
For monorepo projects, specify the packages directory:
npx codopsy-ts analyze ./packages --verbose --no-color
If --hotspots is passed, add the flag to surface high-risk files (complexity × git churn):
npx codopsy-ts analyze <directory> --verbose --no-color --hotspots
Parse the output to understand:
--hotspots is usedPresent a clear summary to the user:
--hotspots used)Format the summary as a concise table when there are multiple issues.
--baseline is passed)Save or compare against a quality baseline for CI gating:
# Save current results as baseline
npx codopsy-ts analyze <directory> --save-baseline --no-color
# Compare against baseline and fail if degraded
npx codopsy-ts analyze <directory> --no-degradation --no-color
When reporting baseline comparisons, show:
--fix is passed or user asks to fix)Note: --fix is a directive for you (the AI) to fix issues — codopsy-ts itself does not auto-fix code. You will read the flagged files and apply fixes manually using Edit/Write tools.
If the user requests fixes, address issues in this priority order:
no-var — Replace var with let or consteqeqeq — Replace == with ===, != with !==prefer-const — Change let to const where not reassignedno-empty-function — Add implementation or a comment explaining why the body is emptyno-param-reassign — Introduce a local variable instead of mutating the parametermax-params — Extract an options/config objectmax-depth — Extract nested blocks into helper functions, use early returnsmax-complexity / max-cognitive-complexity — Break down complex functions into smaller onesmax-lines — Extract code into separate modulesno-nested-ternary — Replace with if/else or extract into a variable (JSX boundary ternaries are excluded)no-any — Add proper type annotationsAfter fixing, re-run the analysis to verify improvements:
npx codopsy-ts analyze <directory> --verbose --no-color
Report the before/after comparison including quality score change.
For detailed analysis of specific files or functions:
npx codopsy-ts analyze <directory> -o - --quiet | jq '.files[] | select(.file | contains("<filename>"))'
To check the score breakdown:
npx codopsy-ts analyze <directory> -o - --quiet | jq '.score'
Projects can customize rules via .codopsyrc.json in the project root. Generate one with:
npx codopsy-ts init
Or create manually:
{
"rules": {
"max-lines": { "max": 500, "severity": "warning" },
"max-complexity": { "max": 15 },
"no-console": false,
"no-any": "error"
},
"plugins": ["./my-plugin.js"]
}
false to disable it entirely"error", "warning", or "info"max-lines, max-depth, max-params, max-complexity, max-cognitive-complexity) accept { "max": number, "severity": string }plugins array loads custom rule modules (JS/TS)If .codopsyrc.json exists in the project, mention it in your report. If users report false positives, suggest adding a .codopsyrc.json to tune thresholds or running codopsy-ts init to generate one.
$ARGUMENTS defaults to ./src if empty--fix, enable auto-fix mode--baseline, run baseline save + comparison--hotspots, include hotspot analysis/codopsy → analyze ./src, report only/codopsy ./lib → analyze ./lib, report only/codopsy --fix → analyze ./src, fix all issues/codopsy ./lib --fix → analyze ./lib, fix all issues/codopsy ./packages --fix → monorepo: analyze all packages, fix all issues/codopsy --baseline → save baseline, then compare/codopsy --hotspots → analyze with hotspot detection--no-color to avoid ANSI escape codes in output parsing--verbose to get per-file breakdownnpx claudepluginhub o6lvl4/codopsy-ts-skill --plugin codopsy-tsScans codebase health by identifying hotspots, risky files, and coupling patterns. Prescribes prioritized refactoring actions with ROI-based guidance. Invoke via /Vitals or rely on auto-activation when discussing code quality.
Runs static tools like tsc, semgrep, knip to analyze codebase for dead code, test quality, duplicates, complexity, security, architecture. Full TS/JS support; limited Python/Go/Rust. Stores structured reports.
Analyzes code quality, detects bugs, and reviews security/performance for files, directories, or pull requests. Shows actionable feedback with confidence-based filtering.