refactor SKILL.md skillA
refactor from chainlesschain/chainlesschain is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.
mdr add chainlesschain/chainlesschain/refactor@v1.0.0Pins v1.0.0 in mdr.lock. Pin the fingerprint instead.
- Audit grade
- A, 17 of 17 checks passed
- Kind
- SKILL.md skill
- Repository
- chainlesschain/chainlesschain
- Path
desktop-app-vue/src/main/ai-engine/cowork/skills/builtin/refactor/SKILL.md- Versions recorded
- 3
- Latest version
- v1.0.0, committed Aug 28, 2026
- First version recorded
- Jun 3, 2026
- Size
- 3,909 bytes
- Repository stars
- 11
- License
- a license file GitHub does not identify
代码重构技能 - 多文件重构、代码异味检测、设计模式应用.
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# 代码重构技能 ## 描述 执行跨文件的代码重构操作,包括符号重命名、函数提取、代码移动、重复消除和设计模式应用。与 code-review(只读分析)不同,此技能主动修改代码并确保所有引用一致更新。 ## 使用方法 ``` /refactor [目标路径] [操作] [选项] ``` ## 操作类型 ### 代码异味检测 ``` /refactor src/ --detect-smells ``` 检测以下代码异味: - **Long Method**: 函数超过 50 行 - **God Class**: 类超过 500 行或 20 个方法 - **Feature Envy**: 方法过度使用其他类的数据 - **Shotgun Surgery**: 一个变更需要修改多个类 - **Duplicate Code**: 重复代码块(相似度 > 80%) - **Dead Code**: 未被引用的函数/变量 ### 重命名符号 ``` /refactor --rename <oldName> <newName> [scope] ``` 跨文件重命名变量、函数、类名,自动更新所有引用。 ### 提取函数/类 ``` /refactor <file>:<startLine>-<endLine> --extract-function <name> /refactor <file> --extract-class <name> --methods <m1,m2,m3> ``` ### 移动模块 ``` /refactor --move <source> <destination> ``` 移动文件/模块并更新所有 import/require 路径。 ### 消除重复 ``` /refactor <scope> --extract-duplicates ``` 查找重复代码块,提取为共享函数。 ### 应用设计模式 ``` /refactor <file> --apply-pattern <pattern> ``` 支持的模式: strategy, observer, factory, builder, singleton ## 执行步骤 1. **分析代码**: 解析目标文件和所有引用文件 2. **生成变更计划**: 列出需要修改的文件和具体变更 3. **展示 Diff 预览**: 在应用前展示所有变更的 diff 4. **用户确认**: 等待用户确认后执行 5. **应用变更**: 按序修改所有文件 6. **验证一致性**: 确认所有引用已更新 ## 输出格式 - 变更计划摘要(影响的文件数、修改行数) - 每个文件的 diff 预览 - 代码复杂度变化对比(前后对比) - 潜在风险警告 …
Read the whole file at its exact version.
How to install
mdr add chainlesschain/chainlesschain/refactor@sha256:cec21498a0a6f261The line at the top of this page pins the label v1.0.0, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
[](https://markdownregistry.com/a/art_hxr64hu5hnhsdpsw)
5 badge image fetches in 30 days. What the badge shows.
Versions
The registry has recorded 3 versions of this file, between Jun 3, 2026 and Aug 28, 2026, about one every 43 days.
| version | committed | commit | size | audit | |
|---|---|---|---|---|---|
| v1.0.0 latest | 2026-08-28 | 44248c7 | 3,909 B | A | view · diff |
| v1.0.0 | 2026-08-28 | c29953e | 3,892 B | A | view · diff |
| v1.0.0 | 2026-06-03 | c3fe912 | 3,800 B | A | view |
Audit of the latest version
- pass: Frontmatter block present
- pass: Frontmatter declares a name
- pass: Frontmatter declares a description
- pass: Size between 200 bytes and 200 KB (3909 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
chainlesschain/chainlesschain · 11 stars · license a license file GitHub does not identify · pushed 2026-11-06 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_hxr64hu5hnhsdpsw GET https://markdownregistry.com/api/v1/resolve?ref=chainlesschain/chainlesschain/refactor GET https://markdownregistry.com/api/v1/blob/cec21498a0a6f2617ba4cfd86bbe8c1d262de7507b13bb431dd8a969d4392e22
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.
More from chainlesschain/chainlesschain
Every file in chainlesschain/chainlesschain