程式碼審查耗時,且經常漏掉安全漏洞或效能問題。此技能會自動分析 Pull Request,在進入正式環境前找出錯誤、安全風險與風格違規。
下載技能 ZIP
在 Claude 中上傳
前往 設定 → 功能 → 技能 → 上傳技能
開啟並開始使用
Agent 可讀資源
當 AI Agent、爬蟲或腳本需要乾淨上下文、而不是讀取完整頁面時,請使用這些連結。
測試它
正在使用「code-review-assistant」。 審查這個處理使用者登入的 Python function
預期結果:
安全性:第 12 行使用 MD5 進行密碼雜湊 — 請改用 bcrypt 或 Argon2。效能:第 8 行在迴圈中查詢資料庫 — 請改用 JOIN。風格:Function name 'doThing' 不清楚 — 請重新命名為 'authenticate_user'。
正在使用「code-review-assistant」。 檢查這個 React component 是否有問題
預期結果:
錯誤:第 15 行的 useEffect 缺少 dependency 'userId',導致 stale closures。無障礙性:第 22 行的 Button 缺少 aria-label。效能:第 30 行的大型列表應使用 virtualization。
正在使用「code-review-assistant」。 稽核這個 API endpoint
預期結果:
安全性:'email' parameter 沒有 input validation — 請新增 regex 或 schema validation。安全性:第 45 行的 SQL query 使用 string concatenation — 請改用 parameterized queries。效能:此 endpoint 沒有 rate limiting。
安全審計
安全Static analysis flagged two high-severity patterns, both confirmed as false positives. The 'Weak cryptographic algorithm' alert at SKILL.md:4 was triggered by Unicode arrow characters in a Chinese description string, not actual cryptography. The 'High file entropy' alert was caused by UTF-8 encoded Chinese text, which naturally has higher byte entropy than ASCII. The skill contains only a markdown description file with no executable code, no network access, no file system operations, and no command execution. No malicious intent detected.
低風險問題 (2)
品質評分
你能建構什麼
合併前安全掃描
在合併到 main branch 前,掃描 Pull Request 中的安全漏洞
程式碼品質審查
審查團隊提交內容中的程式碼風格、命名慣例與反模式
初階開發者學習工具
透過審查個人專案上的自動化回饋來學習最佳實務
試試這些提示
審查這個 Pull Request 是否有錯誤、安全問題與程式碼風格問題
對這段程式碼執行深入安全稽核。尋找 injection 風險、不安全的 deserialization、硬編碼 secrets,以及 authentication 缺陷
分析這段程式碼的效能瓶頸。檢查 N+1 queries、memory leaks、低效率演算法與 blocking operations
全面審查這個 PR:安全性、效能、可維護性、測試覆蓋率與架構契合度。提供按優先順序排列的行動計畫
最佳實務
- 提供完整的檔案脈絡,而不只是 diff,以獲得更準確的分析
- 在針對重大安全發現採取行動前,先手動審查技能輸出
- 使用具體 prompt 進行聚焦審查,而不是提出過於廣泛的請求
避免
- 在不了解脈絡的情況下盲目套用每一項建議
- 在團隊環境中將此技能用作同儕審查的替代品
- 忽略誤報,而不是調整 prompt 讓需求更清楚