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

reducing-entropy

Skill này làm gì

Skill này thúc đẩy agent của bạn làm cho mã nguồn nhỏ nhất có thể, đánh giá thay đổi theo tổng lượng mã còn lại. Skill dành cho lập trình viên muốn cắt bỏ mã thừa, và chỉ chạy khi bạn yêu cầu.

Khi nào nên dùng

  • ✓Khi bạn yêu cầu rõ ràng giảm lượng mã trong một dự án.
  • ✓Khi một mã nguồn đã phình to và bạn muốn tìm những gì có thể xóa.
  • ✓Khi một thay đổi đề xuất sẽ thêm mã và bạn muốn kiểm tra xem có lựa chọn nhỏ hơn không.

Liên kết skill

https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/productivity/reducing-entropy/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/davila7/claude-code-templates/blob/main/cli-tool/components/skills/productivity/reducing-entropy/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

“Tôi muốn tìm những gì có thể xóa trong module này. Dùng reducing-entropy và giữ mã cuối cùng nhỏ nhất có thể.”

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

Cách hoạt động

Agent tải một trong các tư duy của skill, hỏi liệu kết quả nhỏ nhất có thể là ít hàm hơn hoặc không có hàm nào, đếm số dòng trước và sau mỗi thay đổi, và ưu tiên xóa bỏ.

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.

Reducing Entropy

More code begets more code. Entropy accumulates. This skill biases toward the smallest possible codebase.

Core question: "What does the codebase look like after?"

Before You Begin

Load at least one mindset from references/

  1. List the files in the reference directory
  2. Read frontmatter descriptions to pick which applies
  3. Load at least one
  4. State which you loaded and its core principle

Do not proceed until you've done this.

The Goal

The goal is less total code in the final codebase - not less code to write right now.

  • Writing 50 lines that delete 200 lines = net win
  • Keeping 14 functions to avoid writing 2 = net loss
  • "No churn" is not a goal. Less code is the goal.

Measure the end state, not the effort.

Three Questions

1. What's the smallest codebase that solves this?

Not "what's the smallest change" - what's the smallest result.

  • Could this be 2 functions instead of 14?
  • Could this be 0 functions (delete the feature)?
  • What would we delete if we did this?

2. Does the proposed change result in less total code?

Count lines before and after. If after > before, reject it.

  • "Better organized" but more code = more entropy
  • "More flexible" but more code = more entropy
  • "Cleaner separation" but more code = more entropy

3. What can we delete?

Every change is an opportunity to delete. Ask:

  • What does this make obsolete?
  • What was only needed because of what we're replacing?
  • What's the maximum we could remove?

Red Flags

  • "Keep what exists" - Status quo bias. The question is total code, not churn.
  • "This adds flexibility" - Flexibility for what? YAGNI.
  • "Better separation of concerns" - More files/functions = more code. Separation isn't free.
  • "Type safety" - Worth how many lines? Sometimes runtime checks in less code wins.
  • "Easier to understand" - 14 things are not easier than 2 things.

When This Doesn't Apply

  • The codebase is already minimal for what it does
  • You're in a framework with strong conventions (don't fight it)
  • Regulatory/compliance requirements mandate certain structures

Reference Mindsets

See references/ for philosophical grounding.

To add new mindsets, see adding-reference-mindsets.md.


Bias toward deletion. Measure the end state.

Câu hỏi thường gặp

Nó có tự chạy không?

Không. Skill chỉ dùng thủ công và chỉ kích hoạt khi bạn yêu cầu rõ ràng.

Ít mã có luôn thắng không?

Skill đo thành công bằng lượng mã còn lại cuối cùng, nên một thay đổi thêm dòng có thể bị từ chối dù trông gọn hơn.

Câu hỏi cốt lõi nó đặt ra là gì?

Mã nguồn trông như thế nào sau thay đổi?

Chi tiết

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

Manual-only skill for minimizing total codebase size. Only activate when explicitly requested by user. Measures success by final code amount, not effort. Bias toward deletion.

repo: davila7/claude-code-templates

Độ phổ biến

Sao GitHub
33k
Vị trí xếp hạng
#8896
Giấy phép
MIT
Cập nhật
2/11/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ự