ce-simplify-code
Skill này làm gì
Skill này làm cho code hiện có dễ đọc và bảo trì hơn mà không thay đổi những gì nó làm. Dành cho lập trình viên muốn dọn dẹp sau khi viết code và trước khi review.
Khi nào nên dùng
- ✓Khi bạn vừa viết xong một tính năng và muốn code được dọn gọn trước khi review.
- ✓Khi bạn muốn kiểm tra một phần của dự án xem có code, test hoặc chú thích thừa không có mục đích.
- ✓Khi bạn có một lỗi cần sửa, đây là công cụ sai, vì nó chỉ dọn dẹp code.
Liên kết skill
https://github.com/EveryInc/compound-engineering-plugin/blob/main/skills/ce-simplify-code/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
“Bạn có thể đơn giản hóa các code tôi đã thay đổi hôm nay và đảm bảo không có gì bị hỏng không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill đọc code trong phạm vi, tìm các phần có thể rõ ràng hơn hoặc ngắn hơn, rồi áp dụng các thay đổi đó trong khi giữ nguyên hành vi.
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.
Simplify code for clarity, reuse, quality, and efficiency, and prune tests and comments that carry no value, while preserving exact behavior. Prioritize readable, explicit code over compact code — fewer lines is not the goal.
Mode
Strip a mode:pipeline token and every proof-test:<path> token from the input before reading the rest as the scope. The proof-test path is context for Step 3, never scope; a caller may pass several.
- Pipeline when
mode:pipelineis present, or when no one asked for this run in their own current message: a step of another skill, or a run the agent starts itself, such as at a completion boundary. Work only on the current work, apply fixes without asking or waiting, and return the Step 5 summary to the caller. That summary is for the caller's record; never paste it into a commit, PR body, or other artifact. - Standalone when the user's own current message asked for this run. Their request sets the scope and focus. Report findings before editing anything, unless the request says to just fix them. Read
references/standalone-report.mdnow, and again before applying any reported finding.
Step 1: Identify scope
Resolve the scope in this order:
- User-named scope is authoritative; do not widen it. In standalone mode it may be the whole repo, an area, or a path.
- Otherwise, in git, use the current branch versus its base. Without a usable base, use staged and unstaged changes (
git diff HEAD). - Outside git or without a diff, use files the user named or that were edited earlier in the conversation.
In pipeline mode the scope is what the caller passed, else the branch diff. Within it, prune only tests and comments the current work added or changed.
If none of the above produces a non-empty scope, pipeline mode reports "nothing to simplify" and returns. Standalone mode asks the user what to simplify, as references/standalone-report.md describes.
Preflight. If the scope has no substantive human-authored code — only documentation, generated or vendored files, dependencies or lockfiles, or mechanical churn — report that there is nothing to simplify and stop without reviewers. For mixed scopes, retain only the code and its tests. This check is about the kind of change, never its size: explicit small scopes still run, and any size or cost threshold is the caller's to set.
When the platform's task-tracking capability is available, show the review, apply, and verification outcomes without creating one task per reviewer. Otherwise continue without simulating a task list in chat.
Step 2: Launch review agents in parallel
Dispatch generic subagents via the platform's subagent primitive (Agent/Task in Claude Code, spawn_agent in Codex) where available; otherwise run the reviews inline or serially. For each reviewer, read its prompt asset from this skill's directory and pass the full file content as the subagent's prompt, together with the resolved scope (the full diff or file set), the mode, any proof test, the user's constraints, and the project standards governing the scope (or their file paths):
references/personas/code-reuse-reviewer.mdreferences/personas/code-quality-reviewer.mdreferences/personas/efficiency-reviewer.mdreferences/personas/test-value-reviewer.md, when the scope holds testsreferences/personas/comment-reviewer.md, when the scope holds comments
A standalone request about only tests or only comments runs only that reviewer.
Do not paraphrase these rubrics from memory. Read each file and pass it verbatim, or the reviewer loses the rules that keep the pass behavior-preserving.
Read references/reviewer-dispatch.md before dispatching; it covers a full harness, releasing review agents, and the permission mode.
Model selection. Use the platform's balanced mid-tier model for these reviewers when the current harness exposes a known override. In Claude Code this is the Sonnet class. In Codex, apply this tier only when the active dispatch primitive exposes an explicit model or custom-agent selector; task wording alone does not select a different model. Otherwise omit the override and inherit the parent model -- a working pass on the parent model beats a broken dispatch.
If the user's or project's active instructions or the live prompt name a model for this subagent, use that model instead of the default tier above. They can name it by the subagent's tier, by its prompt-asset name, or for the subagents bei
Câu hỏi thường gặp
Việc này có thay đổi cách code hoạt động không?
Nó được thiết kế để giữ hành vi chính xác như cũ và chỉ làm code rõ ràng hơn hoặc hiệu quả hơn.
Nó có sửa lỗi không?
Không. Skill tập trung vào dọn dẹp, còn sửa lỗi do một skill gỡ lỗi riêng đảm nhận.
Nó có thể chỉ xem một phần dự án không?
Có. Bạn có thể nêu một thư mục hoặc đường dẫn, và công việc giữ trong phạm vi đó.
Chi tiết
Mô tả gốc của tác giả
Simplify code for clarity, reuse, quality, and efficiency while preserving behavior, and prune tests and comments that carry no value. Use after implementation and before review, or to audit tests or comments in any part of a repo; use ce-debug for bugs.
Độ phổ biến
- Sao GitHub
- 26k
- Vị trí xếp hạng
- #10046
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
ce-babysit-pr
26kGiúp agent của bạn theo dõi pull request GitHub đang mở, xử lý bình luận review, kiểm tra lỗi và nhánh cũ để nó tiến tới khi được merge.
ce-bakeoff
26kGiúp agent của bạn xây dựng nhiều giải pháp cạnh tranh cho một vấn đề, so sánh chúng và kết hợp các phần mạnh nhất thành một cách tiếp cận được đề xuất.
ce-brainstorm
26kGiúp agent của bạn biến một ý tưởng mơ hồ thành tập yêu cầu rõ ràng, vừa đủ quy mô, trước khi bắt đầu làm, qua một cuộc trò chuyện có hướng dẫn ngắn.
ce-code-review
26kGiúp agent của bạn review một thay đổi mã hoặc pull request để tìm lỗi, hồi quy, thiếu kiểm thử và vi phạm tiêu chuẩn, rồi báo cáo rõ ràng.
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á.