本文へスキップ
Skillpedia
一般的なプログラミング8.1k · #12566

code-health

できること

このスキルは、コードベースがどれほど健全か、どのファイルが最も保守しにくいかを、AIが判断する手助けをします。証拠に基づいて、整理やリファクタリングの作業を計画したい開発者向けです。

使う場面

  • ✓コードベースがどれほど健全か、または次に何を整理すべきかを尋ねるとき。
  • ✓リファクタリングを計画または完了し、前後の比較をしたいとき。
  • ✓特定のファイルが、なぜリスクがある、または保守しにくいと印付けられているかを知りたいとき。

スキルのリンク

https://github.com/repowise-dev/repowise/blob/main/plugins/claude-code/skills/code-health/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/repowise-dev/repowise/blob/main/plugins/claude-code/skills/code-health/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“このプロジェクトの最もリスクの高いファイルを見せてください。最初にどれをリファクタリングすべきかも教えてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

スキルは、複雑さや未テストのホットスポットなど、測定可能な指標を使って、各ファイルを1から10で採点するRepowiseの健全性チェックを実行します。何を最初に直すかの順位付きの一覧、または特定のファイルの詳細を返します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

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

  • Dashboard: get_health() (no targets): fix_first, the ranked list of 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?".
  • Targeted — get_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 fix_first; open an item with get_health(fix_id=...) for its steps and the tests to run, and present the plan, 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 repowise health --recompute to fold it into the scores.

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.

よくある質問

低いスコアは何を意味しますか?

スキルによると、低いスコアは、ファイルが大きいことではなく、バグを隠している可能性が高いことを意味します。

少数のファイルだけを確認できますか?

はい。特定のファイルを指定して、そのスコアとその背後にある指摘を取得できます。

コードを判断するためにAIモデルを使いますか?

いいえ。スキルは、分析は決定的でローカルであり、モデルの呼び出しはないと説明しています。

詳細

作者による元の説明

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.

repo: repowise-dev/repowise

人気

GitHubのスター
8.1k
ランキング
#12566
ライセンス
AGPL-3.0
更新日
2026/11/2

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル