一键导入
guiding-refactoring-with-code-health
Use when refactoring unhealthy code and needing Code Health findings to choose small safe steps and verify improvement.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when refactoring unhealthy code and needing Code Health findings to choose small safe steps and verify improvement.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | guiding-refactoring-with-code-health |
| description | Use when refactoring unhealthy code and needing Code Health findings to choose small safe steps and verify improvement. |
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.
Do not use this skill when the task is to rank project-wide priorities. Use prioritizing-technical-debt for that.
code_health_review: Detailed maintainability findings for a file.code_health_score: Numeric baseline and trend check across refactoring iterations.code_health_review on the target file.code_health_score so the refactoring starts from a measurable baseline.code_health_review to see whether the targeted structural problems were reduced.code_health_score as the compact checkpoint to confirm directional improvement across iterations.Use when a user asks what Code Health means, how to interpret scores, or why Code Health matters in daily development.
Use when a user asks for ROI, stakeholder justification, delivery impact, or defect-risk reduction from improving Code Health in a file.
Use when AI-generated or AI-modified changes need a Code Health gate before commit, handoff, or pull request.
Run linting and unit tests against the current repository, auto-discovering the correct commands from Justfile, Makefile, pyproject.toml, or package.json.
Create a conventional commit from staged changes, with a diff-derived description body.
Reliably obtain a non-empty unified git diff for the current branch using safe fallbacks (origin/HEAD...HEAD, origin/main...HEAD, origin/master...HEAD) and return structured JSON containing the diff and the command used.