
Guiding Refactoring With Code Health
- 1 installs
- 59 repo stars
- Updated August 4, 2026
- codescene-oss/codescene-mcp-server
Use CodeScene Code Health scores and reviews to guide refactoring of an unhealthy file in small steps and verify each step improved it.
About
Uses CodeScene Code Health findings to guide refactoring in small safe steps and verify measurable improvement. A developer uses it when refactoring an unhealthy file and needing an objective progress signal.
- Uses code_health_review and code_health_score as the refactoring control signal
- Guides small safe steps and re-measures improvement after each one
Guiding Refactoring With Code Health by the numbers
- 1 all-time installs (skills.sh)
- Ranked #982 of 1,352 Code Review & Quality skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/codescene-oss/codescene-mcp-server --skill guiding-refactoring-with-code-healthAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 1 |
|---|---|
| repo stars | ★ 59 |
| Last updated | August 4, 2026 |
| Repository | codescene-oss/codescene-mcp-server ↗ |
What it does
Use CodeScene Code Health scores and reviews to guide refactoring of an unhealthy file in small steps and verify each step improved it.
Files
Guiding Refactoring With Code Health
Overview
Use Code Health as the control signal for refactoring. The agent should first understand why a file is hard to work with, establish a measurable baseline, then improve it in small structural steps and verify that each step helped. The goal is not just cleaner code, but code that is easier for both humans and agents to understand and modify safely.
When to Use
- A file is hard to read, risky to change, or repeatedly attracts defects.
- The user asks for refactoring help and wants an objective way to measure progress.
- A safeguard or review points to complexity, size, low cohesion, or deep nesting.
Do not use this skill when the task is to rank project-wide priorities. Use prioritizing-technical-debt for that.
Quick Reference
code_health_review: Detailed maintainability findings for a file.code_health_score: Numeric baseline and trend check across refactoring iterations.
Implementation
1. Run code_health_review on the target file. 2. Record the current code_health_score so the refactoring starts from a measurable baseline. 3. Identify the highest-leverage structural problems, such as excessive responsibilities, deep nesting, low cohesion, or hard-to-follow control flow. 4. Propose 3 to 5 small structural refactor steps, not a single rewrite. 5. After each meaningful step, re-run code_health_review to see whether the targeted structural problems were reduced. 6. Use code_health_score as the compact checkpoint to confirm directional improvement across iterations. 7. Stop only when the targeted structural issues are substantially reduced and the score has measurably improved, or when the user explicitly accepts a partial uplift.
Common Mistakes
- Refactoring without a baseline review.
- Refactoring without recording the initial score.
- Making a large rewrite that hides whether things improved.
- Counting cosmetic cleanup as meaningful progress when the structural problems remain.
- Using score checks alone without re-running the detailed review.
- Forgetting to re-measure after each meaningful step.