code-review

bởi anthropic

Đánh giá mã có cấu trúc về bảo mật, hiệu suất, tính chính xác và khả năng bảo trì trên các bản diff PR và thay đổi tệp. Kiểm tra rủi ro bảo mật bao gồm SQL injection, XSS, CSRF, lỗ hổng xác thực và lộ thông tin xác thực. Xác định các vấn đề về hiệu suất như truy vấn N+1, rò rỉ bộ nhớ, độ phức tạp thuật toán và rò rỉ tài nguyên. Kiểm tra tính chính xác cho các trường hợp biên, điều kiện cạnh tranh, xử lý lỗi và lỗ hổng an toàn kiểu dữ liệu. Hoạt động độc lập với các bản diff và đường dẫn tệp; tích hợp với

npx skills add https://github.com/anthropics/knowledge-work-plugins --skill code-review

/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.

Thêm skills từ anthropic

comps-analysis
anthropic
LUÔN tuân theo thứ tự ưu tiên nguồn dữ liệu sau:
official
analyzing-financial-statements
anthropic
Kỹ năng này tính toán các tỷ số và chỉ số tài chính chính từ dữ liệu báo cáo tài chính để phân tích đầu tư.
official
applying-brand-guidelines
anthropic
Kỹ năng này áp dụng nhận diện thương hiệu và phong cách doanh nghiệp nhất quán cho tất cả tài liệu được tạo ra, bao gồm màu sắc, phông chữ, bố cục và thông điệp.
official
cookbook-audit
anthropic
Kiểm tra một notebook trong Anthropic Cookbook dựa trên tiêu chí đánh giá. Sử dụng khi có yêu cầu xem xét hoặc kiểm tra notebook.
official
creating-financial-models
anthropic
Kỹ năng này cung cấp bộ công cụ lập mô hình tài chính nâng cao với phân tích DCF, kiểm tra độ nhạy, mô phỏng Monte Carlo và lập kế hoạch kịch bản cho đầu tư…
official
action-creator
anthropic
Tạo các mẫu hành động một cú nhấp chuột dành riêng cho người dùng, thực thi các thao tác email khi được nhấp trong giao diện trò chuyện. Sử dụng khi người dùng muốn các hành động có thể tái sử dụng cho…
official
docx
anthropic
Tạo, chỉnh sửa và phân tích tài liệu toàn diện với hỗ trợ theo dõi thay đổi, nhận xét, bảo toàn định dạng và trích xuất văn bản. Khi Claude…
official
executive-briefing
anthropic
Chuyển đổi các phát hiện nghiên cứu thành bản tóm tắt dành cho lãnh đạo. Tự động kích hoạt khi người dùng đề cập đến 'executive', 'briefing', 'C-suite', 'board',…
official