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

code-review

Skill này làm gì

Skill này rà soát thay đổi mã để tìm vấn đề bảo mật, mã chạy chậm, lỗi và thiếu xử lý lỗi. Skill dành cho lập trình viên muốn có thêm một cái nhìn trước khi hợp nhất thay đổi.

Khi nào nên dùng

  • ✓Khi bạn muốn kiểm tra một pull request hoặc thay đổi mã trước khi hợp nhất.
  • ✓Khi bạn muốn biết một đoạn mã có an toàn trước các lỗi injection hoặc xác thực hay không.
  • ✓Khi bạn nghi ngờ truy vấn cơ sở dữ liệu chậm hoặc thiếu trường hợp đặc biệt trong mã mới.

Liên kết skill

https://github.com/TencentCloud/Octop/blob/main/src/octop/infra/agents/experts/library/engineering/skills/code-review/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/TencentCloud/Octop/blob/main/src/octop/infra/agents/experts/library/engineering/skills/code-review/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

“Hãy rà soát pull request này về các vấn đề bảo mật và thiếu xử lý lỗi trước khi tôi hợp nhất.”

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

Cách hoạt động

Agent đọc diff hoặc các tệp bạn chỉ định và kiểm tra bảo mật, hiệu năng, tính đúng đắn và phong cách viết. Agent trả về các phát hiện cụ thể kèm đề xuất sửa mã.

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.

/code-review

If you see unfamiliar placeholders or need to check which tools are connected, see CONNECTORS.md.

Review code changes with a structured lens on security, performance, correctness, and maintainability.

Usage

/code-review <PR URL or file path>

Review the provided code changes: @$1

If no specific file or URL is provided, ask what to review.

How It Works

┌─────────────────────────────────────────────────────────────────┐
│                      CODE REVIEW                                   │
├─────────────────────────────────────────────────────────────────┤
│  STANDALONE (always works)                                       │
│  ✓ Paste a diff, PR URL, or point to files                      │
│  ✓ Security audit (OWASP top 10, injection, auth)               │
│  ✓ Performance review (N+1, memory leaks, complexity)           │
│  ✓ Correctness (edge cases, error handling, race conditions)    │
│  ✓ Style (naming, structure, readability)                        │
│  ✓ Actionable suggestions with code examples                    │
├─────────────────────────────────────────────────────────────────┤
│  SUPERCHARGED (when you connect your tools)                      │
│  + Source control: Pull PR diff automatically                    │
│  + Project tracker: Link findings to tickets                     │
│  + Knowledge base: Check against team coding standards           │
└─────────────────────────────────────────────────────────────────┘

Review Dimensions

Security

  • SQL injection, XSS, CSRF
  • Authentication and authorization flaws
  • Secrets or credentials in code
  • Insecure deserialization
  • Path traversal
  • SSRF

Performance

  • N+1 queries
  • Unnecessary memory allocations
  • Algorithmic complexity (O(n²) in hot paths)
  • Missing database indexes
  • Unbounded queries or loops
  • Resource leaks

Correctness

  • Edge cases (empty input, null, overflow)
  • Race conditions and concurrency issues
  • Error handling and propagation
  • Off-by-one errors
  • Type safety

Maintainability

  • Naming clarity
  • Single responsibility
  • Duplication
  • Test coverage
  • Documentation for non-obvious logic

Output

## Code Review: [PR title or file]

### Summary
[1-2 sentence overview of the changes and overall quality]

### Critical Issues
| # | File | Line | Issue | Severity |
|---|------|------|-------|----------|
| 1 | [file] | [line] | [description] | 🔴 Critical |

### Suggestions
| # | File | Line | Suggestion | Category |
|---|------|------|------------|----------|
| 1 | [file] | [line] | [description] | Performance |

### What Looks Good
- [Positive observations]

### Verdict
[Approve / Request Changes / Needs Discussion]

If Connectors Available

If ~~source control is connected:

  • Pull the PR diff automatically from the URL
  • Check CI status and test results

If ~~project tracker is connected:

  • Link findings to related tickets
  • Verify the PR addresses the stated requirements

If ~~knowledge base is connected:

  • Check changes against team coding standards and style guides

Tips

  1. Provide context — "This is a hot path" or "This handles PII" helps me focus.
  2. Specify concerns — "Focus on security" narrows the review.
  3. Include tests — I'll check test coverage and quality too.
Câu hỏi thường gặp

Skill có đọc được pull request từ liên kết không?

Có. Bạn có thể đưa cho agent URL của pull request, diff hoặc đường dẫn tệp.

Agent tìm những gì?

Các vấn đề như rủi ro injection, truy vấn N+1, rò rỉ bộ nhớ, thiếu trường hợp đặc biệt và thiếu xử lý lỗi.

Nếu tôi không nói cần rà soát gì thì sao?

Agent sẽ hỏi bạn muốn rà soát gì trước khi bắt đầu.

Chi tiết

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

Review code changes for security, performance, and correctness. Trigger with a PR URL or diff, "review this before I merge", "is this code safe?", or when checking a change for N+1 queries, injection risks, missing edge cases, or error handling gaps.

repo: TencentCloud/Octop

Độ phổ biến

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