incremental-implementation
Skill này làm gì
Skill này giúp chia các tác vụ lập trình lớn thành các bước nhỏ, dễ quản lý. Nó đảm bảo mỗi bước được kiểm thử và hoạt động trước khi chuyển sang bước tiếp theo, giúp quá trình phát triển an toàn và có tổ chức hơn.
Khi nào nên dùng
- ✓Khi bạn triển khai một tính năng mới ảnh hưởng nhiều phần của code.
- ✓Khi một tác vụ có vẻ quá lớn để làm cùng lúc.
- ✓Khi bạn tái cấu trúc (cải thiện) code có sẵn.
Liên kết skill
https://github.com/addyosmani/agent-skills/blob/main/skills/incremental-implementation/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
“Chia nhỏ việc triển khai tính năng đăng nhập thành các bước nhỏ. Đầu tiên, tạo màn hình đăng nhập. Sau đó, thêm kiểm tra email và mật khẩu. Cuối cùng, kết nối với hệ thống xác thực.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Ý tưởng là làm một phần nhỏ mỗi lần: viết một ít code, kiểm tra xem nó có chạy không, xác minh là đúng và lưu tiến độ. Lặp lại cho từng phần nhỏ cho đến khi tác vụ hoàn thành.
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.
Incremental Implementation
Overview
Build in thin vertical slices — implement one piece, test it, verify it, then expand. Avoid implementing an entire feature in one pass. Each increment should leave the system in a working, testable state. This is the execution discipline that makes large features manageable.
When to Use
- Implementing any multi-file change
- Building a new feature from a task breakdown
- Refactoring existing code
- Any time you're tempted to write more than ~100 lines before testing
When NOT to use: Single-file, single-function changes where the scope is already minimal.
The Increment Cycle
┌──────────────────────────────────────┐
│ │
│ Implement ──→ Test ──→ Verify ──┐ │
│ ▲ │ │
│ └───── Commit ◄─────────────┘ │
│ │ │
│ ▼ │
│ Next slice │
│ │
└──────────────────────────────────────┘
For each slice:
- Implement the smallest complete piece of functionality
- Test — run the test suite (or write a test if none exists)
- Verify — confirm the slice works as expected (tests pass, build succeeds, manual check)
- Commit -- save your progress with a descriptive message (see
git-workflow-and-versioningfor atomic commit guidance) - Move to the next slice — carry forward, don't restart
Slicing Strategies
Vertical Slices (Preferred)
Build one complete path through the stack:
Slice 1: Create a task (DB + API + basic UI)
→ Tests pass, user can create a task via the UI
Slice 2: List tasks (query + API + UI)
→ Tests pass, user can see their tasks
Slice 3: Edit a task (update + API + UI)
→ Tests pass, user can modify tasks
Slice 4: Delete a task (delete + API + UI + confirmation)
→ Tests pass, full CRUD complete
Each slice delivers working end-to-end functionality.
Contract-First Slicing
When backend and frontend need to develop in parallel:
Slice 0: Define the API contract (types, interfaces, OpenAPI spec)
Slice 1a: Implement backend against the contract + API tests
Slice 1b: Implement frontend against mock data matching the contract
Slice 2: Integrate and test end-to-end
Risk-First Slicing
Tackle the riskiest or most uncertain piece first:
Slice 1: Prove the WebSocket connection works (highest risk)
Slice 2: Build real-time task updates on the proven connection
Slice 3: Add offline support and reconnection
If Slice 1 fails, you discover it before investing in Slices 2 and 3.
Implementation Rules
Rule 0: Simplicity First
Before writing any code, ask: "What is the simplest thing that could work?"
After writing code, review it against these checks:
- Can this be done in fewer lines?
- Are these abstractions earning their complexity?
- Would a staff engineer look at this and say "why didn't you just..."?
- Am I building for hypothetical future requirements, or the current task?
SIMPLICITY CHECK:
✗ Generic EventBus with middleware pipeline for one notification
✓ Simple function call
✗ Abstract factory pattern for two similar components
✓ Two straightforward components with shared utilities
✗ Config-driven form builder for three forms
✓ Three form components
Three similar lines of code is better than a premature abstraction. Implement the naive, obviously-correct version first. Optimize only after correctness is proven with tests.
Rule 0.5: Scope Discipline
Touch only what the task requires.
Do NOT:
- "Clean up" code adjacent to your change
- Refactor imports in files you're not modifying
- Remove comments you don't fully understand
- Add features not in the spec because they "seem useful"
- Modernize syntax in files you're only reading
If you notice something worth improving outside your task scope, note it — don't fix it:
NOTICED BUT NOT TOUCHING:
- src/utils/format.ts has an unused import (unrelated to this task)
- The auth middleware could use better error messages (separate task)
→ Want me to create tasks for these?
Rule 1: One Thing at a Time
Each increment changes one logical thing. Don't mix concerns:
Bad: One commit that adds a new component, refactors an existing one, and updates the build config.
Good: Three separate commits — one for each change.
Rule 2: Keep It Compilable
…
Câu hỏi thường gặp
Vì sao phải chia nhỏ?
Điều này giúp các tác vụ lớn bớt đáng sợ, cho phép phát hiện lỗi sớm hơn và dễ hoàn tác thay đổi nếu có gì sai.
“Verifiable” (có thể kiểm chứng) nghĩa là gì?
Nghĩa là sau mỗi bước, bạn có thể xác nhận code hoạt động đúng, thường bằng cách chạy bài kiểm thử hoặc kiểm tra thủ công.
Tôi có thể cải thiện code trong lúc chia nhỏ tác vụ không?
Tốt nhất chỉ tập trung vào những gì tác vụ yêu cầu. Nếu thấy điều cần cải thiện ngoài phạm vi, hãy ghi lại để làm sau trong một tác vụ khác.
Chi tiết
Mô tả gốc của tác giả
Delivers changes incrementally in thin, verifiable slices. Use when implementing any feature or change that touches more than one file, or when picking up the next task from a plan. Use when rolling a change out behind a feature flag, when you're about to write a large amount of code at once, or when a task feels too big to land in one step.
repo: addyosmani/agent-skills
Độ phổ biến
- Sao GitHub
- 107k
- Vị trí xếp hạng
- #775
- Giấy phép
- MIT
- Cập nhật
- 13/10/2026
Bình luận
- …
Thêm skill từ kho mã này
api-and-interface-design
107kGiúp tạo các API và giao diện được định nghĩa rõ ràng. Hữu ích khi thiết kế cách các phần của phần mềm giao tiếp với nhau.
browser-testing-with-devtools
107kGiúp agent kiểm thử code trực tiếp trên trình duyệt thật. Hữu ích để kiểm tra cách hoạt động trong môi trường thực tế, tìm lỗi và vấn đề hiệu suất.
ci-cd-and-automation
107kDạy agent AI của bạn tự động hóa các việc lặp lại, đưa dự án đi triển khai và quản lý hạ tầng.
code-review-and-quality
107kThực hiện rà soát code chi tiết trên nhiều khía cạnh. Hữu ích trước khi gộp thay đổi mới để đảm bảo chất lượng và ngăn vấn đề sau này.
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á.