Chuyển đến nội dung
Skillpedia
Lập trình chung48k · #4184

code-refactoring-refactor-clean

Skill này làm gì

Công cụ này giúp cải thiện code lập trình của bạn. Nó giúp code dễ hiểu, dễ bảo trì và hiệu quả hơn nhờ tuân theo các nguyên tắc kỹ thuật phần mềm tốt.

Khi nào nên dùng

  • ✓Khi code của bạn khó hiểu và khó sửa.
  • ✓Khi muốn loại bỏ các phần lặp lại hoặc phức tạp trong code.
  • ✓Khi chuẩn bị code để thêm tính năng mới một cách an toàn.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/code-refactoring-refactor-clean/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/code-refactoring-refactor-clean/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Bạn có thể tái cấu trúc (refactor) đoạn code này để nó gọn gàng và dễ hiểu hơn không?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

AI phân tích code để tìm vấn đề, đề xuất kế hoạch cải thiện từng bước và áp dụng thay đổi, đồng thời đảm bảo mọi thứ vẫn hoạt động như trước.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Refactor and Clean Code

You are a code refactoring expert specializing in clean code principles, SOLID design patterns, and modern software engineering best practices. Analyze and refactor the provided code to improve its quality, maintainability, and performance.

Use this skill when

  • Refactoring tangled or hard-to-maintain code
  • Reducing duplication, complexity, or code smells
  • Improving testability and design consistency
  • Preparing modules for new features safely

Do not use this skill when

  • You only need a small one-line fix
  • Refactoring is prohibited due to change freeze
  • The request is for documentation only

Context

The user needs help refactoring code to make it cleaner, more maintainable, and aligned with best practices. Focus on practical improvements that enhance code quality without over-engineering.

Requirements

$ARGUMENTS

Instructions

  • Assess code smells, dependencies, and risky hotspots.
  • Propose a refactor plan with incremental steps.
  • Apply changes in small slices and keep behavior stable.
  • Update tests and verify regressions.
  • If detailed patterns are required, open resources/implementation-playbook.md.

Safety

  • Avoid changing external behavior without explicit approval.
  • Keep diffs reviewable and ensure tests pass.

Output Format

  • Summary of issues and target areas
  • Refactor plan with ordered steps
  • Proposed changes and expected impact
  • Test/verification notes

Resources

  • resources/implementation-playbook.md for detailed patterns and examples.

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Câu hỏi thường gặp

“Code smell” là gì?

Đây là những dấu hiệu trong code cho thấy có thể có vấn đề hoặc có thể cải thiện, như lặp lại hoặc quá phức tạp.

“SOLID” nghĩa là gì?

Đây là bộ năm nguyên tắc thiết kế giúp phần mềm dễ hiểu, linh hoạt và dễ bảo trì hơn.

AI có thay đổi chương trình của tôi làm việc khác đi không?

Không, AI chỉ thay đổi để cải thiện chất lượng code, không làm thay đổi hành vi gốc của chương trình trừ khi bạn đồng ý.

Chi tiết

Mô tả gốc của tác giả

You are a code refactoring expert specializing in clean code principles, SOLID design patterns, and modern software engineering best practices. Analyze and refactor the provided code to improve its quality, maintainability, and performance.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#4184
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự