Agent Skillsrepowise-dev/repowise › code-health

code-health

GitHub

基于Repowise对代码库进行静态分析,评估文件健康度、复杂度及技术债务。支持仪表盘概览与目标文件检测,提供重构建议、覆盖率分析及趋势预测,辅助识别高风险文件并指导优化决策。

plugins/claude-code/skills/code-health/SKILL.md repowise-dev/repowise

触发场景

询问代码质量或技术债务 识别难维护或高风险文件 规划或完成重构前后的健康度对比 查找未测试的热点区域

安装

npx skills add repowise-dev/repowise --skill code-health -g -y
更多选项

非标准路径

npx skills add https://github.com/repowise-dev/repowise/tree/main/plugins/claude-code/skills/code-health -g -y

不安装直接使用

npx skills use repowise-dev/repowise@code-health

指定 Agent (Claude Code)

npx skills add repowise-dev/repowise --skill code-health -a claude-code -g -y

安装 repo 全部 skill

npx skills add repowise-dev/repowise --all -g -y

预览 repo 内 skill

npx skills add repowise-dev/repowise --list

SKILL.md

Frontmatter
{
    "name": "code-health",
    "description": "Use when the user asks about code health, code quality, complexity, technical debt, which files are risky or hard to maintain, what to refactor next, untested hotspots, or coverage gaps in a Repowise-indexed codebase (.repowise\/ directory exists). Also use to get a before\/after health read when planning or finishing a refactor.\n",
    "user-invocable": false
}

Code Health with Repowise

Repowise scores every file 1–10 from deterministic markers — McCabe complexity, deep nesting, brain methods, class cohesion (LCOM4), god classes, clone detection, untested hotspots, function-level churn, ownership dispersion, and more. Zero LLM calls; pure local analysis. The weights are calibrated against a real defect corpus, so a low score means more likely to harbour bugs, not just bigger.

Pick the mode by what you pass

  • Dashboardget_health() (no targets): a directive naming what to fix first, then repo-level KPIs and the lowest-scoring files. Start here for "how healthy is this codebase?" or "what should we clean up?".
  • Targetedget_health(targets=["src/x.py", "src/y.py"]): per-file score and the specific marker findings driving it. Use before/after a refactor, or to explain why a file is flagged.

Useful include flags

get_health(targets=[...], include=[...]):

  • "biomarkers" — always return the findings list (what's wrong, where).
  • "refactoring" — deterministic, ranked refactoring suggestions (by impact/effort).
  • "coverage" — surface coverage data when it's been ingested.
  • "trend" — recent health snapshots + declining / predicted-decline signal.

include adds blocks; only=[...] subtracts them.

How to use the results

  1. For "what should I refactor?" → dashboard mode, lead with directive, then get_health(targets=[worst files], include=["refactoring"]) and present the ranked plans, not just the scores.
  2. Rank by weighted_deficit, not score — the score floors at 1.0.
  3. For a specific file → report the score, the top 2–3 marker findings, and what each one means in plain language. Avoid dumping the raw payload.
  4. Check unresolved before calling a file clean: a target listed there matched nothing, and not_indexed means run repowise update.
  5. Before editing a flagged file → cross-check get_risk(targets=[...]); a file that is both low-health and a churn hotspot deserves the most care.
  6. Untested-hotspot / coverage questions → tell the user coverage markers light up once they ingest a report: repowise coverage add cov.lcov (LCOV / Cobertura / Clover; a coverage.py .coverage also builds the per-test map), then re-run repowise health.

CLI equivalents

  • repowise health — KPIs + lowest-scoring files
  • repowise health --refactoring-targets — ranked by impact / effort
  • repowise health --trend — snapshots + declining alerts
  • repowise coverage add <file> — ingest coverage, light up untested-hotspot

Error handling

If get_health reports no repository, suggest /repowise:init. Code health is computed even with a template-rendered wiki (no LLM needed), so it should be available whenever the repo is indexed.

版本历史

  • 370793f 当前 2026-08-19 23:15

    修复 get_health 丢弃未解析目标且不报错的问题;统一限制排名列表长度并显示总数;优化 Windows 路径兼容性及重构建议输出结构。

  • b5f4753 2026-07-25 05:12

同 Skill 集合

plugins/claude-code/skills/architectural-decisions/SKILL.md
plugins/claude-code/skills/change-review/SKILL.md
plugins/claude-code/skills/codebase-exploration/SKILL.md
plugins/claude-code/skills/dead-code-cleanup/SKILL.md
plugins/claude-code/skills/pre-modification/SKILL.md
plugins/codex/skills/architectural-decisions/SKILL.md
plugins/codex/skills/change-review/SKILL.md
plugins/codex/skills/code-health/SKILL.md
plugins/codex/skills/codebase-exploration/SKILL.md
plugins/codex/skills/dead-code-cleanup/SKILL.md
plugins/codex/skills/pre-modification-check/SKILL.md

元信息

文件数
0
版本
ce350d1
Hash
e4c034e1
收录时间
2026-07-25 05:12

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-09 17:55
浙ICP备14020137号-1 $访客地图$