code-review
Skill76 starsChanged 10 months agoMITView on GitHub
代码审查方法论。用于系统化审查代码质量、安全性和最佳实践。
188 other projects use a version of this.
Adopted by
Most recently taken up by
- github/spec-kittheir own version, first seen Nov 23, 2026
- microsoft/vscodetheir own version, first seen Nov 12, 2026
- mattpocock/skillstheir own version, first seen Oct 8, 2026
- rafaelob/pragmatic-agent-skillstheir own version, first seen Oct 5, 2026
- Kangentic/kangentictheir own version, first seen Oct 5, 2026
- dzhng/skillstheir own version, first seen Oct 4, 2026
Used with
Projects with it also use starter, media-processing and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
ww-w-aiSkillstarter
Static web development guide for beginners. Covers HTML/CSS/JavaScript and Next.js App Router basics. Project initialization with "init starter". Triggers: static website, portfolio, landing page, HTML CSS, beginner, 정적 웹, 포트폴리오, 초보자, 静的サイト, 初心者, 静态网站, 初学者, sitio web estático, site statique, statische Website, sito web statico Do NOT use for: fullstack apps (use $dynamic), enterprise (use $enterprise).
Also in 4 projects that use this
mrgoonieSkillmedia-processing
Process multimedia files with FFmpeg (video/audio encoding, conversion, streaming, filtering, hardware acceleration) and ImageMagick (image manipulation, format conversion, batch processing, effects, composition). Use when converting media formats, encoding videos with specific codecs (H.264, H.265, VP9), resizing/cropping images, extracting audio from video, applying filters and effects, optimizing file sizes, creating streaming manifests (HLS/DASH), generating thumbnails, batch processing images, creating composite images, or implementing media processing pipelines. Supports 100+ formats, hardware acceleration (NVENC, QSV), and complex filtergraphs.
Also in 5 projects that use this
loulanyueSkillsetup-ts-deep-modules
Wire dependency-cruiser into a TypeScript repo so each package is a deep module — implementation hidden in subfolders, reachable only through its entry-point files. User-invoked.
Also in 15 projects that use this
mrgoonieSkillaesthetic
Create aesthetically beautiful interfaces following proven design principles. Use when building UI/UX, analyzing designs from inspiration sites, generating design images with ai-multimodal, implementing visual hierarchy and color theory, adding micro-interactions, or creating design documentation. Includes workflows for capturing and analyzing inspiration screenshots with chrome-devtools and ai-multimodal, iterative design image generation until aesthetic standards are met, and comprehensive design system guidance covering BEAUTIFUL (aesthetic principles), RIGHT (functionality/accessibility), SATISFYING (micro-interactions), and PEAK (storytelling) stages. Integrates with chrome-devtools, ai-multimodal, media-processing, ui-styling, and web-frameworks skills.
Also in 4 projects that use this
AWSSkillask-matt
Ask which skill or flow fits your situation. A router over the skills in this repo.
Also in 32 projects that use this
AWSSkillresolving-merge-conflicts
Use when you need to resolve an in-progress git merge/rebase conflict.
Also in 48 projects that use this
- +1 more from mrgoonie
- +2 more from aws
Other versions188 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 188
- mattpocock/skills★ 335ksame name
- microsoft/vscode★ 196ksame name
- github/spec-kit★ 153ksame name
- shareAI-lab/learn-claude-code★ 78ksame name
- github/awesome-copilot★ 40ksame name
- langchain-ai/deepagents★ 30ksame name
- microsoft/vcpkg★ 28ksame name
- anthropics/knowledge-work-plugins★ 26ksame name
- Donchitos/Claude-Code-Game-Studios★ 26ksame name
- microsoft/onnxruntime★ 22ksame name
178 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repositoryOne other file it gives its agents.
- pdfSkill
The file
Files
代码审查技能
本技能提供系统化的代码审查方法论和检查清单。
审查流程
1. 快速浏览(2分钟)
先获得整体印象:
# 查看文件结构
ls -la
# 统计代码行数
wc -l *.cs
# 查看最近修改
git log --oneline -102. 逐项检查(核心)
按以下顺序检查:
- 安全问题 ← 最高优先级
- 正确性问题
- 性能问题
- 可维护性问题
- 风格问题 ← 最低优先级
安全检查清单
🔴 严重
- SQL 注入: 是否使用参数化查询?
// ❌ 危险 $"SELECT * FROM Users WHERE Id = {userId}" // ✅ 安全 "SELECT * FROM Users WHERE Id = @Id", new { Id = userId } - 密码处理: 是否安全存储和比较?
// ❌ 危险 if (inputPassword == storedPassword) // ✅ 安全(常量时间比较) if (CryptographicOperations.FixedTimeEquals(hash1, hash2)) - 敏感数据: 日志中是否暴露密码/token?
// ❌ 危险 _logger.LogInfo($"User {user} logged in with password {password}"); // ✅ 安全 _logger.LogInfo($"User {user} logged in");
🟠 重要
- 输入验证: 所有外部输入是否验证?
- 权限检查: API 端点是否有授权?
- CORS 配置: 是否过于宽松?
- 依赖安全: 是否有已知漏洞?
# 检查 NuGet 包漏洞
dotnet list package --vulnerable正确性检查清单
逻辑错误
- 边界条件: 空值、零、最大值是否处理?
- 异常处理: catch 块是否吞掉错误?
// ❌ 吞掉错误 catch (Exception) { } // ✅ 至少记录 catch (Exception ex) { _logger.LogError(ex, "Operation failed"); throw; } - 资源释放: IDisposable 是否正确处理?
// ❌ 可能泄露 var client = new HttpClient(); // ✅ 正确 using var client = new HttpClient();
并发问题
- 线程安全: 共享状态是否有竞态条件?
- 死锁: async 代码是否有
.Result或.Wait()?// ❌ 可能死锁 var result = GetDataAsync().Result; // ✅ 安全 var result = await GetDataAsync();
性能检查清单
常见问题
- N+1 查询: 循环中是否有数据库调用?
// ❌ N+1 foreach (var order in orders) order.Customer = await db.GetCustomer(order.CustomerId); // ✅ 批量加载 var customerIds = orders.Select(o => o.CustomerId).Distinct(); var customers = await db.GetCustomers(customerIds); - 内存分配: 是否在热路径上频繁分配?
- 字符串拼接: 是否使用 StringBuilder?
- LINQ 滥用: 是否多次枚举 IEnumerable?
检测工具
# 使用 BenchmarkDotNet
dotnet add package BenchmarkDotNet
# 内存分析
dotnet-counters monitor --process-id <PID>可维护性检查清单
代码组织
- 单一职责: 类/方法是否只做一件事?
- 方法长度: 是否超过 50 行?考虑拆分
- 嵌套深度: 是否超过 3 层?考虑提前返回
命名
- 有意义: 名字是否描述意图?
// ❌ 含糊 var d = GetData(); // ✅ 清晰 var activeUsers = GetActiveUsers(); - 一致性: 是否遵循项目约定?
注释
- 必要性: 注释是否解释"为什么"而非"是什么"?
- 准确性: 注释是否与代码一致?
审查报告模板
## 代码审查报告
**文件**: src/Services/AuthService.cs
**审查者**: [你的名字]
**日期**: [日期]
### 🔴 严重问题
1. **第 45 行 - SQL 注入风险**
```csharp
// 当前
var query = $"SELECT * FROM Users WHERE Email = '{email}'";
// 建议
var query = "SELECT * FROM Users WHERE Email = @Email";🟠 重要问题
- 第 78 行 - 缺少输入验证
用户输入
email未经验证直接使用。
🟡 建议
- 第 120 行 - 方法过长
ProcessOrder方法有 150 行,建议拆分为:ValidateOrder()CalculateTotal()SaveOrder()
✅ 优点
- 良好的异常处理
- 代码结构清晰
## 自动化工具
### 静态分析
```bash
# 使用 .NET Analyzers(内置)
# 在 .csproj 中启用
<PropertyGroup>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<AnalysisLevel>latest-recommended</AnalysisLevel>
</PropertyGroup>
# 使用 SonarQube
dotnet sonarscanner begin /k:"project-key"
dotnet build
dotnet sonarscanner end格式化
# 使用 dotnet format
dotnet format
# 检查但不修改
dotnet format --verify-no-changes常见反模式
1. 上帝类 (God Class)
一个类做太多事情。拆分为多个单一职责的类。
2. 魔法数字
// ❌
if (status == 3) { ... }
// ✅
if (status == OrderStatus.Completed) { ... }3. 注释掉的代码
删除它。用版本控制恢复。
4. 过早优化
先让它正确工作,再考虑优化。
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

