🧪
QualityPython

Refactor Safety

by doccker

Refactor Safety is a Quality skill for Claude Code, published by doccker in cc-use-exp.

1K stars105 forkson doccker/cc-use-expAdded 2026/08/21Repository updated 2026/06/30
antigravityclaude-codecodexcursorgemini-cligithub-copilot
Install in seconds
Install Refactor Safety
Copy Refactor Safety into your Claude Code skills folder. Run the command in your terminal, or review the source on GitHub before installing.
terminal
npx degit https://github.com/doccker/cc-use-exp/tree/main/skills/refactor-safety ~/.claude/skills/refactor-safety

Requires Node.js. Downloads this skill only — not the rest of the repository — into your Claude Code skills folder.

Without Node.js

git clone https://github.com/doccker/cc-use-exp.git

Clones the whole repository, then copy the skill’s own directory into your skills folder yourself.

In this catalog

Source file
skills/refactor-safety/SKILL.md in doccker/cc-use-exp
Installs to
~/.claude/skills/refactor-safety
Collection
One of 23 skills cataloged from this repository
Category
Quality1354 skills

What Refactor Safety does

Refactor Safety provides a checklist for code refactors so you can preserve original structure, branches, and data while changing implementation. Use it when extracting components, merging logic, renaming fields, or simplifying conditionals.

Refactor Safety is cataloged under Quality on DirSkills. Refactor Safety comes from a repository tagged antigravity, claude-code, codex, cursor and gemini-cli.

Documentation

README

重构安全规范

触发场景

  • 用户说"重构"、"提取"、"合并"、"优化结构"、"简化代码"
  • 涉及表格列、数据结构、配置项的修改
  • 合并条件分支(if/else/switch)

重构流程

1. 读取原始代码(必须)

不要凭记忆或推测重构,必须完整读取原始代码:

# 读取完整文件
Read: file_path="src/views/Order.vue"

# 如果是条件分支,读取所有分支的代码
Grep: pattern="if.*健康云" -A 50 -B 5
Grep: pattern="else" -A 50 -B 5

常见错误

  • ❌ 只读一个分支,推测其他分支
  • ❌ 凭记忆重构表格列
  • ❌ 假设两个条件分支结构相似

2. 制作对比清单

表格重构示例

原始代码(健康云租户)

列1: 订单编号
列2: 订单日期
列3: 材料名称
列4: 材料数量
列5: 单价
列6: 金额

原始代码(非健康云租户)

列1: 订单编号
列2: 创建时间
列3: 材料名称
列4: 单价
列5: 金额

对比清单

健康云 非健康云 状态
订单编号 订单编号 ✅ 一致
订单日期 创建时间 ⚠️ 名称不同
材料名称 材料名称 ✅ 一致
材料数量 - ❌ 非健康云无此列
单价 单价 ✅ 一致
金额 金额 ✅ 一致
数据结构重构示例

This is the opening of the README. Read the full README on GitHub.

Frequently asked about Refactor Safety

  • What else does doccker publish alongside Refactor Safety?

    Refactor Safety is one of 23 skills that DirSkills catalogs from doccker/cc-use-exp, the repository it ships in. Its siblings there include API Design Safety, Api Design Safety and Api Proxy Safety. Each one is a separate skill with its own page in this directory, installs the same way Refactor Safety does, and is maintained by doccker in that same repository. The rest of the collection is listed on the doccker/cc-use-exp page.

  • How does Refactor Safety compare to other Quality skills?

    Refactor Safety ranks #843 by stars among the 1354 Quality skills in this catalog. The most-starred ones next to it are Benchmark, Benchmark Optimization Loop and API Design Patterns. DirSkills ranks by the star count of the repository each skill ships in, so that order reflects how popular those repositories are rather than any review of Refactor Safety against them. Open each page to compare what they document and how they install.

More from doccker/cc-use-exp

Refactor Safety is one of 23 skills cataloged on DirSkills from doccker/cc-use-exp.

See all 23 skills
🛡️
1w ago

API Design Safety

API Design Safety helps you design REST API responses and generated outputs with consistent field semantics, null handling, and status codes. It also checks required fields before exporting files or sending downstream payloads to avoid silent failures.
Quality
1K105
🧩
1w ago

Api Design Safety

Api Design Safety helps prevent REST API response design mistakes such as field mix-ups, ambiguous return types, and inconsistent empty values. Use it when designing or changing API responses and handling returned data.
AI Engineering
1K105
🛡️
1w ago

Api Proxy Safety

Api Proxy Safety defines safe keyword matching for gateways, proxies, WAFs, and CDNs so normal content is not misclassified as an error. It is used when implementing heuristic checks for response bodies, status codes, and error schemas.
DevOps
1K105
1w ago

Async Task Pattern

Async Task Pattern provides a standard triggerAsync/getStatus flow for operations that may run longer than 10 seconds. Use it for batch processing, remote API fan-out, or scans that would otherwise time out or be triggered twice.
Automation
1K105
🐚
1w ago

Bash Style

Bash Style provides shell scripting and command-writing conventions for .sh files, Dockerfiles, Makefiles, YAML, and Markdown bash blocks. Use it to format commands, heredocs, file writes, permissions, and script safety.
Writing
1K105
🧩
1w ago

Code Quality Principles

Code Quality Principles provides a checklist for modular design, refactoring, and code review. Use it to assess module size, call depth, fan-in/fan-out, boundaries, scope cohesion, and predictability.
Quality
1K105