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

code-review

Skill này làm gì

Skill này hướng dẫn agent AI rà soát pull request và thay đổi mã theo một danh sách kiểm tra thực tế. Skill dành cho lập trình viên muốn nhận phản hồi kỹ lưỡng và hữu ích về mã.

Khi nào nên dùng

  • ✓Khi bạn yêu cầu agent rà soát một pull request trước khi merge.
  • ✓Khi bạn muốn có phản hồi về chất lượng mã, hiệu năng và xử lý lỗi.
  • ✓Khi bạn cần kiểm tra xem một thay đổi có đủ độ phủ kiểm thử hay không.

Liên kết skill

https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/sentry/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/davila7/claude-code-templates/blob/main/cli-tool/components/skills/sentry/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

“Bạn có thể rà soát pull request này để tìm lỗi, vấn đề bảo mật và thiếu kiểm thử không?”

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

Cách hoạt động

Agent đọc các thay đổi, đối chiếu chúng với danh sách rà soát, rồi đưa ra phản hồi về vấn đề và kiểm thử.

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.

Sentry Code Review

Follow these guidelines when reviewing code for Sentry projects.

Review Checklist

Identifying Problems

Look for these issues in code changes:

  • Runtime errors: Potential exceptions, null pointer issues, out-of-bounds access
  • Performance: Unbounded O(n²) operations, N+1 queries, unnecessary allocations
  • Side effects: Unintended behavioral changes affecting other components
  • Backwards compatibility: Breaking API changes without migration path
  • ORM queries: Complex Django ORM with unexpected query performance
  • Security vulnerabilities: Injection, XSS, access control gaps, secrets exposure

Design Assessment

  • Do component interactions make logical sense?
  • Does the change align with existing project architecture?
  • Are there conflicts with current requirements or goals?

Test Coverage

Every PR should have appropriate test coverage:

  • Functional tests for business logic
  • Integration tests for component interactions
  • End-to-end tests for critical user paths

Verify tests cover actual requirements and edge cases. Avoid excessive branching or looping in test code.

Long-Term Impact

Flag for senior engineer review when changes involve:

  • Database schema modifications
  • API contract changes
  • New framework or library adoption
  • Performance-critical code paths
  • Security-sensitive functionality

Feedback Guidelines

Tone

  • Be polite and empathetic
  • Provide actionable suggestions, not vague criticism
  • Phrase as questions when uncertain: "Have you considered...?"

Approval

  • Approve when only minor issues remain
  • Don't block PRs for stylistic preferences
  • Remember: the goal is risk reduction, not perfect code

Common Patterns to Flag

Python/Django

# Bad: N+1 query
for user in users:
    print(user.profile.name)  # Separate query per user

# Good: Prefetch related
users = User.objects.prefetch_related('profile')

TypeScript/React

// Bad: Missing dependency in useEffect
useEffect(() => {
  fetchData(userId);
}, []);  // userId not in deps

// Good: Include all dependencies
useEffect(() => {
  fetchData(userId);
}, [userId]);

Security

# Bad: SQL injection risk
cursor.execute(f"SELECT * FROM users WHERE id = {user_id}")

# Good: Parameterized query
cursor.execute("SELECT * FROM users WHERE id = %s", [user_id])

References

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

Skill kiểm tra những gì?

Skill kiểm tra lỗi lúc chạy, vấn đề hiệu năng, tác dụng phụ, thay đổi phá vỡ tương thích và vấn đề bảo mật.

Có đánh dấu các thay đổi lớn để cấp cao rà soát không?

Có. Thay đổi schema, thay đổi API và mã nhạy cảm về bảo mật được đánh dấu để kỹ sư cấp cao rà soát.

Skill chỉ dành cho dự án Sentry à?

Skill được viết theo thực hành kỹ thuật của Sentry, nhưng danh sách kiểm tra đủ chung để áp dụng cho nhiều dự án.

Chi tiết

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

Perform code reviews following Sentry engineering practices. Use when reviewing pull requests, examining code changes, or providing feedback on code quality. Covers security, performance, testing, and design review.

repo: davila7/claude-code-templates

Độ phổ biến

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