code-refactor

Featured

Refactor code có hệ thống dựa trên phương pháp luận của Martin Fowler. Sử dụng khi người dùng yêu cầu refactor code, cải thiện cấu trúc code, giảm nợ kỹ thuật, dọn code legacy, loại bỏ code smells, hoặc cải thiện khả năng duy trì code. Skill này hướng dẫn qua cách tiếp theo từng giai đoạn với nghiên cứu, lập kế hoạch, và triển khai tăng dần an toàn.

Code & Development 47,500 stars 5759 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 93/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Code Refactoring Skill Một cách tiếp có hệ thống để refactor code dựa trên *Refactoring: Improving the Design of Existing Code* (ấn bản 2) của Martin Fowler. Skill này nhấn mạnh các thay đổi tăng dần, an toàn được hỗ trợ bởi tests. > "Refactoring là quá trình thay đổi một hệ thống phần mềm theo cách mà nó không làm thay đổi hành vi bên ngoài của code nhưng cải thiện cấu trúc nội bộ của nó." — Martin Fowler ## Nguyên Tắc Cốt Lõi 1. **Bảo Tồn Hành Vi**: Hành vi bên ngoài phải không thay đổi 2. **Các Bước Nhỏ**: Thực hiện các thay đổi nhỏ, có thể test 3. **Được Dẫn Bởi Test**: Tests là lưới an toàn 4. **Liên Tục**: Refactoring là liên tục, không phải sự kiện một lần 5. **Hợp Tác**: Cần sự chấp thuận của người dùng tại mỗi giai đoạn ## Tổng Quan Workflow ``` Giai Đoạn 1: Nghiên Cứu & Phân Tích ↓ Giai Đoạn 2: Đánh Giá Phủ Vùng Test ↓ Giai Đoạn 3: Xác Định Code Smell ↓ Giai Đoạn 4: Tạo Kế Hoạch Refactoring ↓ Giai Đoạn 5: Triển Khai Tăng Dần ↓ Giai Đoạn 6: Review & Lặp Lại ``` --- ## Giai Đoạn 1: Nghiên Cứu & Phân Tích ### Mục Tiêu - Hiểu cấu trúc và mục đích của codebase - Xác định phạm vi của refactoring - Thu thập bối cảnh về các yêu cầu kinh doanh ### Câu Hỏi Đặt Cho Người Dùng Trước khi bắt đầu, làm rõ: 1. **Phạm Vi**: Những file/module/hàm nào cần refactor? 2. **Mục Tiêu**: Bạn đang cố gắng giải quyết vấn đề gì? (khả đọc, hiệu suất, khả năng duy trì) 3. **Ràng Buộc**: Có những khu vực nào KHÔNG NÊN thay đổi không? 4. **Áp Lực Thời Gian**: Điều ...

Details

Author
luongnv89
Repository
luongnv89/claude-howto
Created
1 years ago
Last Updated
yesterday
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category

Code & Development Listed

refactor

Restructure existing code without changing its behavior (extract, inline, rename, move, split large functions or modules, reduce complexity, remove duplication and dead code). Pins behavior with tests first, maps the contract and its consumers, and moves in small verified steps. Use when the user asks to refactor, restructure, split, extract, rename, or untangle code, in English or Vietnamese ("refactor", "tái cấu trúc", "tách hàm", "đổi tên", "dọn code", "giảm complexity"). Not for reviewing a finished diff (see verifier) or for rewrites meant to change behavior.

0 Updated 1 weeks ago
viettdann
Code & Development Featured

refactor

基于 Martin Fowler 方法论的系统化代码重构 skill。适用于用户请求重构代码、改进代码结构、减少技术债、清理旧代码、消除 code smell 或提升可维护性时。这个 skill 采用分阶段、带研究与计划的安全增量实施方式。

47,500 Updated yesterday
luongnv89
Code & Development Listed

refactor

Guide safe, disciplined code refactoring. Always use this skill when asked to refactor, restructure, reorganize, clean up, or improve the design of existing code. Use when the user says "this code is messy", "help me clean this up", "this function does too much", "extract this", "break this apart", "this is hard to read", "the codebase is tangled", or any time code structure needs to change without changing behavior. Read this skill before making any structural code changes.

1 Updated 1 months ago
AllThingsSmitty