minimal-code-discipline
Skill này làm gì
Skill này hướng dẫn agent giữ các thay đổi mã nhỏ nhất có thể trong khi vẫn đúng đắn. Skill dành cho người muốn thay đổi tập trung, không có cồng kềnh hay phần thêm mang tính suy đoán.
Khi nào nên dùng
- ✓Khi bạn yêu cầu một thay đổi tối thiểu, gọn hoặc nhỏ nhất có thể.
- ✓Khi một kế hoạch hoặc thay đổi đang lớn hơn những gì được yêu cầu.
- ✓Khi bạn muốn một đề xuất thay đổi được xem xét về kích thước không cần thiết trước khi xây dựng.
Liên kết skill
https://github.com/Yeachan-Heo/oh-my-claudecode/blob/main/skills/minimal-code-discipline/SKILL.mdSao 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
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Thêm một nút xuất đơn giản vào trang báo cáo. Hãy giữ thay đổi nhỏ nhất có thể và tái sử dụng những gì chúng ta đã có.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent trước tiên hỏi xem thay đổi có thật sự cần không, kiểm tra codebase để tìm các helper đã có, và ưu tiên công cụ đơn giản nhất làm được việc. Nó giữ thay đổi ngắn trong khi vẫn giữ các kiểm tra an toàn.
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.
Minimal Code Discipline
Use this skill to apply a minimal-code (YAGNI-ladder) discipline while planning and writing code changes. It keeps diffs small and obviously correct without sacrificing the checks that keep users safe.
This skill complements ai-slop-cleaner: that skill cleans slop after it lands; this one keeps it from being written.
When to Use
Use this skill when:
- the user asks for a minimal, lean, YAGNI, or smallest-possible-diff implementation
- a plan or in-flight change is growing beyond the stated request
- writing new code where scope creep, reinvented helpers, or speculative generality are likely
- reviewing a proposed diff for size before implementation
When Not to Use
Do not use this skill when:
- the user explicitly asks for a broad, feature-rich, or future-proofed build (their explicit scope wins)
- the task is exploratory scaffolding the user has marked as throwaway
- minimization pressure would touch protected behavior (see Non-Negotiables)
The Discipline
Existence first. Ask whether the change needs to exist at all; skip work that serves only a speculative future need.
Reuse before writing. Search the codebase for an existing helper, type, or pattern before writing anything new. Never copy a helper that already lives a few files away — reuse it or extract it to one shared location.
Dependency ladder. Reach for the standard library first, then platform-native capability, then an already-installed dependency. Hand-written code is the last resort. Do not introduce a new dependency when a few lines of code suffice, unless the user explicitly requested or approved it.
Understand before minimizing. Read the affected code and follow its execution path first. Ship the shortest correct diff once the problem is understood — code you never write never breaks.
Boring over clever. Prefer boring, obviously-correct code over clever code.
Mark the ceiling. Record deliberate simplifications with a short comment naming the accepted limit and what would justify replacing it.
Root cause, not symptoms. Fix bugs at the root cause shared by every caller, not with a separate patch for each reported symptom.
Non-Negotiables
Never minimize away:
- validation wherever a trust boundary is crossed
- error handling that guards against data loss
- security controls
- accessibility fundamentals
- scope the user explicitly requested
Verification
Before reporting completion, confirm:
- every added line earns its place (no speculative generality, no duplicate helpers)
- the diff is the shortest one that correctly solves the stated problem
- non-negotiables are intact
- tests still pass and behavior is unchanged except as requested
Câu hỏi thường gặp
Nó có bỏ các kiểm tra an toàn để mã nhỏ lại không?
Không. Hành vi được bảo vệ và các kiểm tra an toàn không bao giờ bị cắt chỉ để tiết kiệm dòng.
Nó có ghi đè yêu cầu về một tính năng lớn không?
Không. Nếu bạn yêu cầu rõ ràng một bản xây dựng rộng hoặc có tính đến tương lai, phạm vi của bạn được ưu tiên.
Khác gì với skill dọn dẹp?
Skill này ngăn mã thừa được viết ra, còn skill dọn dẹp làm gọn mã sau khi nó đã được thêm vào.
Chi tiết
Mô tả gốc của tác giả
YAGNI-ladder coding discipline for writing changes — existence-first, reuse before writing, dependency ladder, shortest correct diff, with non-negotiables that must never be minimized away
Độ phổ biến
- Sao GitHub
- 41k
- Vị trí xếp hạng
- #7010
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
agent-doc-discipline
41kDạy agent của bạn viết hướng dẫn mà các agent AI khác có thể tự làm theo, với các quy tắc có thể kiểm tra và lý do rõ ràng đằng sau mỗi quy tắc.
ai-slop-cleaner
41kGiúp agent của bạn dọn dẹp mã do AI viết mà chạy được nhưng cồng kềnh hoặc lặp lại, loại bỏ mã thừa mà không thay đổi những gì nó làm.
architecture-survey
41kGiúp agent của bạn xem xét cấu trúc một codebase và liệt kê các phần ngày càng khó thay đổi, kèm bằng chứng, mà không tự thay đổi gì.
ask-navigator
41kGiúp agent của bạn biến một dự án còn mơ hồ thành bản đồ các câu hỏi quyết định rõ ràng, rồi giải quyết từng câu một cho đến khi con đường trở nên rõ.
Skill tương tự
diffs
394kGiúp agent của bạn tạo một diff có thể chia sẻ về các chỉnh sửa, dưới dạng liên kết xem hoặc file ảnh, thay vì một bản tóm tắt viết tay.
coding-agent
394kGiúp agent của bạn giao một việc lập trình lớn cho Codex, Claude Code hoặc OpenCode chạy nền, rồi theo dõi tiến độ của nó.
gh-issues
394kGiúp agent của bạn tìm issue trên GitHub, chọn những issue cần xử lý và mở pull request với bản sửa, kể cả theo dõi nhận xét đánh giá.