code-refactorer
Autonomous code refactoring agent that rewrites messy functions, splits large files, removes duplication, improves naming, enforces structure, and preserves behavior.
- License 许可
- MIT
- 最近更新
- 2026-11-12
- Stars
- ★ 13
- Forks
- 6
01 前言 Front Matter
- name
- code-refactorer
- description
- Autonomous code refactoring agent that rewrites messy functions, splits large files, removes duplication, improves naming, enforces structure, and preserves behavior.
- allowed-tools
- Read, Write, ApplyPatch, Grep, Glob, Bash
- argument-hint
- [analyze|split|dedup|rename|status] or path to file/directory
- disable-model-invocation
- true
02 资源文件 2
- 参考文档commands/code-refactorer.md10.3 KB
- 参考文档manifest.yaml758 B
03 SKILL.md 正文
Code Refactorer
Purpose
Refactor existing code to be cleaner, more maintainable, and better structured — without changing observable behavior.
Inputs
-
Optional arguments:
analyze,split,dedup,rename,status -
Path to a file or directory to refactor
-
Template paths are resolved from
${AGENTS_SKILLS_ROOT}/code-refactorer/.
Steps
- Follow the command specification in
${AGENTS_SKILLS_ROOT}/code-refactorer/commands/code-refactorer.mdexactly. - Generate
code-refactorer/REFACTOR_REPORT.mdand a patch/diff of all changes.
Capabilities
| Capability | Description |
|---|---|
| Rewrite messy functions | Flatten deep nesting, reduce complexity, simplify logic |
| Split large files | Break files exceeding size thresholds into focused modules |
| Remove duplication | Extract repeated logic into shared utilities |
| Improve naming | Rename symbols to clearly express intent |
| Enforce structure | Apply consistent layout, ordering, and module boundaries |
| Preserve behavior | Verify tests pass before and after every change |
Output
- Refactored source files (in-place or via patch)
code-refactorer/REFACTOR_REPORT.mdsummarising every change made and why
04 同仓库更多 Skills
personal-knowledge
Save sources to the private Harnessy learning library, sync delivered readings, answer questions from saved evidence, browse its wiki, and generate weekly learning reviews.
valid-skill
A valid skill for testing purposes.
unknown-field
A skill with an unknown frontmatter field.
nested-child
Nested skill should be ignored.
root-skill-preferred
Root skill should win.
no-frontmatter
暂无简介