by davila7
代码审查经常遗漏安全漏洞和性能问题。此技能提供遵循 Sentry 工程实践的结构化指南,用于识别运行时错误、N+1 查询、安全漏洞和设计问题。
1. 打开 Claude 聊天界面
2. 点击下方 "📋 复制" 按钮
3. 粘贴到 Claude 聊天框中并发送
4. 输入 "使用 code-review 技能" 开始使用
=== code-review 技能 === 作者: davila7 描述: 代码审查经常遗漏安全漏洞和性能问题。此技能提供遵循 Sentry 工程实践的结构化指南,用于识别运行时错误、N+1 查询、安全漏洞和设计问题。 使用方法: 1. 调用技能: "使用 code-review 技能" 2. 提供相关信息: 根据技能要求提供必要参数 3. 查看结果: 技能会返回处理结果 示例: "使用 code-review 技能,帮我分析一下这段代码"
这种方法适用于所有 Claude 用户,不需要安装额外工具。
coding
safe
Follow these guidelines when reviewing code for Sentry projects.
Look for these issues in code changes:
Every PR should have appropriate test coverage:
Verify tests cover actual requirements and edge cases. Avoid excessive branching or looping in test code.
Flag for senior engineer review when changes involve:
# 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')
// Bad: Missing dependency in useEffect
useEffect(() => {
fetchData(userId);
}, []); // userId not in deps
// Good: Include all dependencies
useEffect(() => {
fetchData(userId);
}, [userId]);
# 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])
View Count
0
Download Count
0
Favorite Count
0
Quality Score
69