code-health
Skill này làm gì
Skill này giúp AI của bạn đánh giá codebase khỏe mạnh đến đâu và file nào khó bảo trì nhất. Dành cho lập trình viên muốn lên kế hoạch dọn dẹp hoặc tái cấu trúc dựa trên bằng chứng.
Khi nào nên dùng
- ✓Khi bạn hỏi codebase khỏe mạnh đến đâu hoặc cần dọn dẹp gì tiếp theo.
- ✓Khi bạn lên kế hoạch hoặc vừa hoàn thành một đợt tái cấu trúc và muốn so sánh trước và sau.
- ✓Khi bạn muốn biết vì sao một file cụ thể bị đánh dấu là rủi ro hoặc khó bảo trì.
Liên kết skill
https://github.com/repowise-dev/repowise/blob/main/plugins/claude-code/skills/code-health/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Cho tôi xem các file rủi ro nhất trong dự án này và tôi nên tái cấu trúc cái nào trước.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill chạy các kiểm tra sức khỏe của Repowise, chấm điểm từng file từ 1 đến 10 bằng các tín hiệu đo được như độ phức tạp và các điểm nóng chưa được test. Nó trả về danh sách xếp hạng các việc nên sửa trước, hoặc chi tiết cho các file cụ thể.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
- For "what should I refactor?" → dashboard mode, lead with
fix_first; open an item withget_health(fix_id=...)for its steps and the tests to run, and present the plan, not just the scores. - Rank by
weighted_deficit, notscore— the score floors at 1.0. - 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.
- Check
unresolvedbefore calling a file clean: a target listed there matched nothing, andnot_indexedmeans runrepowise update. - 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. - 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.coveragealso builds the per-test map), thenrepowise health --recomputeto fold it into the scores.
CLI equivalents
repowise health— KPIs + lowest-scoring filesrepowise health --refactoring-targets— ranked by impact / effortrepowise health --trend— snapshots + declining alertsrepowise 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.
Câu hỏi thường gặp
Điểm thấp có nghĩa là gì?
Skill nói điểm thấp nghĩa là file đó có nhiều khả năng che giấu lỗi hơn, chứ không chỉ là file lớn.
Tôi có thể chỉ kiểm tra vài file không?
Có. Bạn có thể nêu tên file cụ thể để nhận điểm và các phát hiện đằng sau chúng.
Nó có dùng mô hình AI để đánh giá mã không?
Không. Skill mô tả việc phân tích là mang tính xác định và chạy cục bộ, không gọi mô hình nào.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 8.1k
- Vị trí xếp hạng
- #12566
- Giấy phép
- AGPL-3.0
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
architectural-decisions
8.1kGiúp agent của bạn tìm hiểu vì sao mã được xây dựng theo một cách nhất định, dựa trên các quyết định đã ghi và lịch sử, trước khi thay đổi kiến trúc.
change-review
8.1kGiúp agent của bạn rà soát pull request hoặc tập thay đổi trước khi hợp nhất, chỉ ra rủi ro, các file bị ảnh hưởng và việc cần làm tiếp.
codebase-exploration
8.1kGiúp agent của bạn hiểu nhanh một dự án lạ bằng cách trả lời cách mã hoạt động, ai gọi cái gì và các phần được xây dựng ở đâu.
dead-code-cleanup
8.1kGiúp agent của bạn tìm mã không dùng, file không thể truy cập và export không dùng trong dự án, để bạn dọn dẹp an toàn.
Skill tương tự
diffs
394kGiúp agent của bạn tạo một diff có thể chia sẻ về các chỉnh sửa, dưới dạng liên kết xem hoặc file ảnh, thay vì một bản tóm tắt viết tay.
coding-agent
394kGiúp agent của bạn giao một việc lập trình lớn cho Codex, Claude Code hoặc OpenCode chạy nền, rồi theo dõi tiến độ của nó.
gh-issues
394kGiúp agent của bạn tìm issue trên GitHub, chọn những issue cần xử lý và mở pull request với bản sửa, kể cả theo dõi nhận xét đánh giá.