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

clean-code-guard

Skill này làm gì

AI agent này kiểm tra mã lập trình của bạn để đảm bảo nó tuân theo các thực hành viết mã tốt, như rõ ràng, có tổ chức và dễ hiểu. Nó giúp ngăn các lỗi thường gặp khi mã được tạo tự động.

Khi nào nên dùng

  • ✓Sau khi AI tạo ra một đoạn mã.
  • ✓Trước khi nộp hoặc lưu mã mà bạn hoặc AI đã chỉnh sửa.
  • ✓Khi bạn muốn đánh giá chất lượng của mã hiện có.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/clean-code-guard/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/clean-code-guard/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

“Xem xét đoạn mã này để đảm bảo nó tuân theo các thực hành tốt nhất.”

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

Cách hoạt động

Agent so sánh mã của bạn với một bộ quy tắc chất lượng, như tên gọi rõ ràng và hàm nhỏ gọn. Nếu thấy điều gì không tuân theo quy tắc, nó sẽ gợi ý hoặc tự sửa.

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.

clean-code-guard

You are reviewing generated or changed code before it ships. Apply the rules below as a guard pass after the first implementation pass — and once this skill is active, keep applying it to every later code change in the same session, re-running the self-check before delivery after each edit rather than reverting to unguarded output because the skill loaded earlier. If the user explicitly invokes this skill before writing code, use the same rules while writing and still run the self-check before delivery.

When to Use

Use this skill when reviewing generated or changed code before it ships. Activate it reactively after an agent writes, edits, or refactors production code — especially after a first implementation pass. Re-run the guard pass before delivery after each edit.

Compatibility

This is a portable instruction skill. It requires no MCP server, network access, API key, shell command, local executable, or bundled script. It can be used in any runtime that supports SKILL.md plus directly linked references/ files; agents/openai.yaml is lightweight display metadata.

This skill does not replace project linters, formatters, type checkers, or test runners. Use the project's own tools for mechanical verification; use this skill for the judgement layer around code quality and review.

How to use this skill

This skill has three modes — pick based on the user's request.

Guard-pass mode (recommended): after code has been generated, edited, refactored, or fixed, check the diff or target files against the Always-applied imperatives below. Fix violations before presenting, committing, or merging the work.

Live mode (explicit): when the user invokes this skill before a risky code edit, apply the same imperatives while writing, then run the Self-check before delivery checklist. If you violate any rule, fix it before showing the user.

Review mode (triggered when the user asks you to review, audit, critique, or rate code): walk references/review-checklist.md against the target file(s) and produce a structured findings report. Do not edit code in review mode unless asked.

Across all three modes, the rule bodies live in references/. Read the relevant reference file when:

  • You hit a rule you don't fully remember the reasoning for.
  • The user pushes back on a rule and you need the source citation.
  • You're in review mode and need the full checklist.
  • The code under review touches a specific principle (e.g., subclassing → references/solid.md; deduplication → references/dry-kiss-yagni.md).

The reference files are:

Examples

  • A coding agent implements an endpoint: use guard-pass mode on the diff before the work is presented or committed.
  • User asks "review this PR" or "should I merge this?": use review mode and report findings from references/review-checklist.md; do not edit unless asked.
  • User asks "implement this endpoint using clean-code-guard": use live mode while writing, then run the self-check before delivery.
  • User asks "refactor this function, same behavior": preserve observable behavior exactly and treat any bug fix as a separate change.

Success criteria

This skill is working when code-writing tasks avoid the listed failure modes,

…

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

“Best practices” trong viết mã là gì?

Đó là các quy tắc vàng khi viết mã, giúp mã dễ đọc, dễ hiểu và dễ bảo trì hơn đối với các lập trình viên khác (hoặc chính bạn trong tương lai).

Vì sao tôi cần công cụ này nếu AI đã viết mã rồi?

Ngay cả AI cũng có thể mắc lỗi hoặc viết mã chưa tối ưu. Agent này đảm bảo mã được tạo ra có chất lượng cao và tránh các vấn đề thường gặp.

Công cụ này có thay thế các công cụ kiểm tra mã khác không?

Không, nó bổ sung cho các công cụ khác. Nó tập trung vào chất lượng và tính rõ ràng của mã, còn các công cụ khác có thể kiểm tra lỗi cú pháp hoặc vấn đề bảo mật.

Chi tiết

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

Review generated or changed production code with Clean Code, SOLID, DRY, KISS, YAGNI, and LLM-specific failure-mode checks.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#4150
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ự