Borrowing it
Nothing to install: this file belongs to u9401066/rootcause-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/u9401066/rootcause-mcp/master/.claude/skills/code-reviewer/SKILL.mdgit clone --depth 1 https://github.com/u9401066/rootcause-mcpWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/u9401066/rootcause-mcp/code-reviewer)<a href="https://agentmods.dev/skills/u9401066/rootcause-mcp/code-reviewer"><img src="https://agentmods.dev/badge/skills/u9401066/rootcause-mcp/code-reviewer/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/u9401066/rootcause-mcp/code-reviewer"><img src="https://agentmods.dev/badge/skills/u9401066/rootcause-mcp/code-reviewer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.01710 |
| Opus 5.5 | $0.00000 | $0.00684 |
| Sonnet 5.5 | $0.00000 | $0.00342 |
| Haiku 4.5 | $0.00000 | $0.00171 |
Grade A, and why
code-reviewer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
This is a copy
100% identical to code-reviewer — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 195 lines — stays where its author put it; the contents beside it link to each section on GitHub.
程式碼審查技能
描述
對程式碼進行全面審查,檢查品質、安全性、效能和最佳實踐。
觸發條件
- 「review 這段程式碼」「CR」「審查」
- 「檢查程式碼」「看一下」「幫看」
- 「code review」「PR review」
🔧 操作步驟
Step 1: 確定審查範圍
詢問或推斷審查目標:
- 特定檔案:
read_file("path/to/file.py") - 整個目錄:
grep_search取得概覽 - 特定功能:
semantic_search("功能名稱") - 最近變更:
get_changed_files()
Step 2: 執行靜態分析(Python 專案)
# Ruff - 快速 linter (取代 flake8 + isort + pyupgrade)
uv run ruff check src/ --output-format=concise
# Mypy - 型別檢查
uv run mypy src/ --ignore-missing-imports
# Bandit - 安全性檢查
uv run bandit -r src/ -ll
# Vulture - 死碼偵測
uv run vulture src/ --min-confidence 80
Step 3: 審查程式碼品質
| 檢查項目 | 標準 | 工具輔助 |
|---|---|---|
| 命名清晰度 | 名稱應描述用途 | 人工審查 |
| 函數長度 | < 50 行 | grep_search |
| 類別大小 | < 300 行 | grep_search |
| 複雜度 | McCabe < 10 | ruff --select=C901 |
| DRY 原則 | 無重複程式碼 | semantic_search |
| SOLID 原則 | 單一職責等 | 人工審查 |
Step 4: 審查安全性
| 風險類型 | 檢查方式 | 嚴重程度 |
|---|---|---|
| SQL 注入 | 搜尋 raw SQL | 🔴 Critical |
| XSS | 搜尋未轉義輸出 | 🔴 Critical |
| 硬編碼密碼 | grep "password|secret|key" | 🔴 Critical |
| 路徑遍歷 | 搜尋未驗證路徑 | 🟠 High |
| 日誌洩漏 | 搜尋敏感資料輸出 | 🟡 Medium |
Step 5: 審查效能
| 問題類型 | 偵測方式 |
|---|---|
| N+1 查詢 | 搜尋迴圈內的 DB 呼叫 |
| 無謂迴圈 | 審查巢狀迴圈 |
| 記憶體洩漏 | 檢查資源釋放 |
| 阻塞操作 | 審查 I/O 操作 |
Step 6: 審查 DDD 架構
參考 ddd-architect 規則:
- Domain 層是否有外部依賴?
- Repository Interface 是否在 Domain 層?
- Application 層是否過度膨脹?
Step 7: 產生審查報告
📊 審查報告格式
# 程式碼審查報告
📁 審查範圍:`src/domain/`, `src/application/`
📅 日期:2026-01-15
👤 審查者:AI Assistant
---
## 📈 總覽
| 指標 | 分數 | 說明 |
| ---- | ---- | ---- |
| 品質 | 8/10 | 命名清晰,部分函數過長 |
| 安全 | 9/10 | 無明顯漏洞 |
| 效能 | 7/10 | 存在 N+1 查詢風險 |
| 架構 | 8/10 | 符合 DDD,但有小違規 |
---
## ✅ 優點
1. **清晰的領域模型**:User entity 封裝良好
2. **完整的錯誤處理**:使用自定義例外
3. **良好的測試覆蓋**:核心邏輯有單元測試
---
## ⚠️ 問題發現
### 🔴 Critical (必須修復)
#### 1. SQL 注入風險
- **位置**:[user_repository.py](src/infrastructure/repositories/user_repository.py#L45)
- **問題**:使用字串拼接建立 SQL
- **建議**:使用參數化查詢
```python
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 195 lines · 0 tokens per session scan A c828461b4e15
code-reviewer is a skill published in the GitHub repository u9401066/rootcause-mcp (0 stars, last pushed 1mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,710 tokens. A static security scan graded it A with 0 findings. It is 100% identical to code-reviewer, differing in 0 lines, and is treated as a copy.
Other skills, from other repositories
code-review
Review code for quality, maintainability, and correctness.
code-review-architecture
Architecture-focused code review covering hexagonal boundary violations, DDD anti-patterns, CQRS misuse, and microservices coupling issues. Applied in addition to the language-specific review skill when architecture markers are detected. Invoked when reviewing hexagonal architectures, DDD patterns, or microservices…
code-audit
A broad audit of a codebase covering code quality, security, software structure, test coverage, and documentation consistency.
code-refactor
A code-refactoring workflow that finds overly long or complicated code and reorganizes it into smaller, clearer parts while preserving its purpose.
code-reviewer
A broad code review guide that checks source code for quality, security, performance, and common development practices. It can review files, folders, features, recent changes, or a pull request—a proposed change submitted for review.
audit
Use when the user wants a code review on recent changes — quality, spec, security, or performance feedback. Triggers a multi-level (L1-L5) review with a standalone Reviewer; on NEEDSFIX, offers to apply findings via /hyperflow:plan. Trigger with /hyperflow:audit, "review this change", "review my PR", "audit the diff"…