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.

Install it, pinned
mdr add chainlesschain/chainlesschain/refactor@v1.0.0

Pins 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

The exact contents, by fingerprint
mdr add chainlesschain/chainlesschain/refactor@sha256:cec21498a0a6f261

The 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.

Badge

mdr badge

[![mdr](https://markdownregistry.com/badge/art_hxr64hu5hnhsdpsw.svg)](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.

versioncommittedcommitsizeaudit
v1.0.0 latest2026-08-28 44248c7 3,909 BA view · diff
v1.0.02026-08-28 c29953e 3,892 BA view · diff
v1.0.02026-06-03 c3fe912 3,800 BA view

Audit of the latest version

A  17 of 17 checks passed. Fixed automatic checks with no AI involved, so the same checks give the same answer every run.
  • 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

GitHub

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

cc-cli SKILL.md skill
chainlesschain/chainlesschain · .claude/skills/cc-cli/SKILL.md · Invoke ChainlessChain `cc` CLI commands from natural language. Triggers when the user wants to run any `cc …` action…
git:20260618.4898c75 · audit A · 11 stars
pdh-android-collect SKILL.md skill
chainlesschain/chainlesschain · .claude/skills/pdh-android-collect/SKILL.md · Collect a rooted Android device's real personal data into the Personal Data Hub (PDH) vault to feed the user's…
git:20260618.58d3bd9 · audit A · 11 stars
AGENTS.md AGENTS.md file
chainlesschain/chainlesschain · AGENTS.md
git:20261023.f06ee98 · audit A · 11 stars
CLAUDE.md CLAUDE.md file
chainlesschain/chainlesschain · CLAUDE.md
git:20260920.96ab90a · audit A · 11 stars
ab-compare SKILL.md skill
chainlesschain/chainlesschain · desktop-app-vue/src/main/ai-engine/cowork/skills/builtin/ab-compare/SKILL.md · Generate and compare multiple implementation variants with benchmarking and scoring
v1.0.0 · audit A · 11 stars
agent-browser SKILL.md skill
chainlesschain/chainlesschain · desktop-app-vue/src/main/ai-engine/cowork/skills/builtin/agent-browser/SKILL.md · Advanced browser automation for AI agents with snapshot-ref interaction pattern - navigate, snapshot interactive…
v1.0.0 · audit A · 11 stars
api-design SKILL.md skill
chainlesschain/chainlesschain · desktop-app-vue/src/main/ai-engine/cowork/skills/builtin/api-design/SKILL.md · Design RESTful APIs with best practices, conventions, and OpenAPI specs
v1.0.0 · audit A · 11 stars
api-docs-generator SKILL.md skill
chainlesschain/chainlesschain · desktop-app-vue/src/main/ai-engine/cowork/skills/builtin/api-docs-generator/SKILL.md · Generate API documentation from code - produce OpenAPI/Swagger specs, Markdown API references, request/response…
v1.0.0 · audit A · 11 stars
api-gateway SKILL.md skill
chainlesschain/chainlesschain · desktop-app-vue/src/main/ai-engine/cowork/skills/builtin/api-gateway/SKILL.md · Universal API gateway - connect to 100+ APIs with a unified interface, manage API keys, and chain API calls
v1.2.0 · audit A · 11 stars
api-tester SKILL.md skill
chainlesschain/chainlesschain · desktop-app-vue/src/main/ai-engine/cowork/skills/builtin/api-tester/SKILL.md · API测试技能 - IPC处理器发现、测试生成、健康检查、回归测试
v1.0.0 · audit A · 11 stars
architect-mode SKILL.md skill
chainlesschain/chainlesschain · desktop-app-vue/src/main/ai-engine/cowork/skills/builtin/architect-mode/SKILL.md · 双阶段架构模式 - 先规划后编辑,分离推理与代码修改,提升多文件编辑准确率
v1.0.0 · audit A · 11 stars
audio-transcriber SKILL.md skill
chainlesschain/chainlesschain · desktop-app-vue/src/main/ai-engine/cowork/skills/builtin/audio-transcriber/SKILL.md · Speech-to-text transcription using Whisper API or local engine
v1.0.0 · audit A · 11 stars

Every file in chainlesschain/chainlesschain

Other files named refactor

refactor SKILL.md skill
code-yeongyu/oh-my-openagent · packages/shared-skills/skills/refactor/SKILL.md · Guides a refactor, cleanup, or restructure with the right decomposition. Use when the user asks to refactor, simplify…
git:20261106.b98a091 · audit A · 70,763 stars
refactor SKILL.md skill
sethgammon/citadel · skills/refactor/SKILL.md · Safe multi-file refactoring with automatic rollback. Establishes a type/test baseline, plans all changes, executes…
git:20260611.0f3f8e7 · audit A · 927 stars
refactor SKILL.md skill
greenfield-inc/pane · main/src/services/paneChatBundle/skills/refactor/SKILL.md · Quality pass on a branch against its remote default branch. Runs a simple analysis (conventions and smells) and, on…
git:20261105.60e9622 · audit A · 603 stars
refactor SKILL.md skill
dcouple/pane · main/src/services/paneChatBundle/skills/refactor/SKILL.md · Quality pass on a branch against its remote default branch. Runs a simple analysis (conventions and smells) and, on…
git:20261105.60e9622 · audit A · 603 stars
refactor SKILL.md skill
rsmdt/the-startup · plugins/start/skills/refactor/SKILL.md · Refactor, simplify, or clean up code for improved maintainability without changing business logic
git:20261011.48bd3ee · audit A · 577 stars
refactor SKILL.md skill
boshu2/agentops · skills/refactor/SKILL.md · Restructure or clean up code with no behavior change, proved by before-and-after checks. Use when: asked to clean up…
git:20261031.73cbeae · audit A · 453 stars
refactor SKILL.md skill
boshu2/agentops · plugin/skills/refactor/SKILL.md · Restructure or clean up code with no behavior change, proved by before-and-after checks. Use when: asked to clean up…
git:20261026.1b5f59a · audit A · 453 stars
refactor SKILL.md skill
justxor/claude-code-pro-course · starter-kit/.claude/skills/refactor/SKILL.md · Безопасный рефакторинг маленькими шагами без изменения поведения. Используй, когда просят отрефакторить, упростить…
git:20260930.76c4189 · audit A · 341 stars

Browse by kind, by grade A, or by owner.