Langsung ke konten
Skillpedia
Pemrograman umum8.1k Β· #12566

code-health

Fungsinya

Skill ini membantu AI Anda menilai seberapa sehat sebuah basis kode dan berkas mana yang paling sulit dirawat. Skill ini untuk pengembang yang ingin merencanakan pembersihan atau refaktor berdasarkan bukti.

Kapan dipakai

  • βœ“Saat Anda bertanya seberapa sehat basis kode atau apa yang sebaiknya dibersihkan berikutnya.
  • βœ“Saat Anda merencanakan atau menyelesaikan refaktor dan ingin perbandingan sebelum dan sesudah.
  • βœ“Saat Anda ingin tahu mengapa berkas tertentu ditandai sebagai berisiko atau sulit dirawat.

Link skill

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

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/repowise-dev/repowise/blob/main/plugins/claude-code/skills/code-health/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œTampilkan berkas paling berisiko di proyek ini dan apa yang sebaiknya saya refaktor lebih dulu.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Skill menjalankan pemeriksaan kesehatan Repowise yang memberi skor pada setiap berkas dari 1 sampai 10 memakai sinyal yang bisa diukur, seperti kompleksitas dan titik panas tanpa tes. Skill mengembalikan daftar peringkat apa yang harus diperbaiki lebih dulu, atau rincian untuk berkas tertentu.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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.

Pertanyaan umum

Apa arti skor rendah?

Skill menyatakan bahwa skor rendah berarti berkas tersebut lebih mungkin menyembunyikan bug, bukan sekadar karena ukurannya besar.

Bisakah saya memeriksa hanya beberapa berkas?

Bisa. Anda dapat menyebutkan berkas tertentu untuk mendapatkan skornya dan temuan di baliknya.

Apakah ia memakai model AI untuk menilai kode?

Tidak. Skill menyatakan analisisnya deterministik dan lokal, tanpa panggilan model.

Detail

Deskripsi asli dari pembuat

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

Popularitas

Bintang GitHub
8.1k
Peringkat
#12566
Lisensi
AGPL-3.0
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa