code-audit
Skill3 starsChanged 8 months agoApache-2.0View on GitHub
Deep comprehensive code audit across quality, security, architecture compliance, test coverage, and documentation sync. Triggers: AUDIT, 審計, audit, 全面審查, deep review, 深度審查, 健檢, health check, 程式碼審計, codebase audit, 完整檢查, full check.
- Reads credentials
27 other projects use a version of this.
Adopted by
Most recently taken up by
- arcasilesgroup/ai-engineeringtheir own version, first seen Nov 8, 2026
- pietz/skillstheir own version, first seen Nov 8, 2026
- robinbril/claude-code-harnesstheir own version, first seen Nov 1, 2026
- lza6/claw-code-tingfengtheir own version, first seen Nov 1, 2026
- VorElze/hermes-office-skillstheir own version, first seen Nov 1, 2026
- greglas75/zuvotheir own version, first seen Oct 16, 2026
Used with
Projects with it also use database-security, malware-analysis and 7 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.
JeremyMorganSkilldatabase-security
Examines all database interactions for injection, access control, encryption, and data-exposure risks. Use when auditing database and data-layer security.
Also in 3 projects that use this
tsaleSkillmalware-analysis
Professional malware analysis workflow for PE executables and suspicious files. Triggers on file uploads with requests like "analyze this malware", "analyze this sample", "what does this executable do", "check this file for malware", or any request to examine suspicious files. Performs static analysis, threat intelligence triage, behavioral inference, and produces analyst-grade reports with reasoned conclusions.
Also in 3 projects that use this
jefflesterSkillapi-security
API security best practices and common vulnerability prevention. Enforces security checks for authentication, input validation, SQL injection, XSS, and OWASP Top 10 vulnerabilities. Use when building or modifying APIs.
Also in 3 projects that use this
QiuChenlySkillreverse-engineering
专业二进制逆向工程分析技能。使用IDA Pro MCP工具分析二进制文件、反编译代码、识别漏洞、理解程序逻辑。当用户要求分析可执行文件、反汇编、逆向工程、漏洞挖掘、恶意软件分析时使用此技能。
Also in 3 projects that use this
SentrySkillui-design
Also in 3 projects that use this
GitHubSkillrefactor
Surgical code refactoring to improve maintainability without changing behavior. Covers extracting functions, renaming variables, breaking down god functions, improving type safety, eliminating code smells, and applying design patterns. Less drastic than repo-rebuilder; use for gradual improvements.
Also in 3 projects that use this
Other versions27 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 27
- zhaoxuya520/reverse-skill-private★ 40ksame name
- zhaoxuya520/reverse-skill★ 38ksame name
- epicenter-md/epicenter★ 4.8ksame name
- EpicenterHQ/epicenter★ 4.8ksame name
- pass-with-high-score/blockads-android★ 2.7ksame name
- 3stoneBrother/code-audit★ 893same name
- aspi6246/Claude-Code-Skills-for-Academics★ 153same name
- arcasilesgroup/ai-engineering★ 65same name
- hawkyre/hawk-skills★ 30same name
- greglas75/zuvo★ 7same name
17 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 repository21 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- bug-fixSkill
- changelog-updaterSkill
- code-refactorSkill
- code-reviewerSkill
- code-review-workflowSkill
- ddd-architectSkill
- feature-developmentSkill
- git-doc-updaterSkill
- git-precommitSkill
- memory-checkpointSkill
- memory-updaterSkill
- project-initSkill
- readme-i18nSkill
- readme-updaterSkill
- releaseSkill
- roadmap-updaterSkill
- security-reviewerSkill
- skill-generatorSkill
- skill-health-checkSkill
- test-generatorSkill
The file
Files
深度程式碼審計
描述
對整個程式庫進行系統性的深度審計,涵蓋程式碼品質、安全性、架構合規性、測試覆蓋率和文檔同步度。比 code-reviewer(單檔審查)和 code-review-workflow(PR 審查)更全面,適合定期健檢。
觸發條件
- 「程式碼審計」「AUDIT」「全面審查」
- 「deep review」「深度審查」「健檢」
- 「codebase audit」「完整檢查」
法規依據
- 憲法:CONSTITUTION.md 第一章(DDD 架構)
- 子法:bylaws/ddd-architecture.md
- 子法:bylaws/git-workflow.md
🔧 審計流程(5 大維度)
Phase 1: 🏗️ 架構合規性審計
目標:驗證 DDD 分層架構是否被正確遵守
# 檢查目錄結構
Get-ChildItem -Path src/ -Directory -Recurse | Select-Object FullName檢查清單:
| 項目 | 檢查方式 | 嚴重度 |
| Domain 層無外部依賴 | grep_search Domain 層的 import | 🔴 Critical |
| Repository Interface 在 Domain | 檢查 interfaces 位置 | 🔴 Critical |
| 依賴方向正確 | 分析 import 圖 | 🔴 Critical |
| Application 層不過度膨脹 | 計算行數 | 🟡 Medium |
| Presentation 只呼叫 Application | 檢查 import | 🟠 High |
# 偵測 Domain 層違規 import 的搜尋模式
# ❌ Domain 層不應出現這些:
import_violations = [
"from fastapi",
"from flask",
"from sqlalchemy",
"from django",
"import requests",
"from infrastructure",
"from presentation",
]Phase 2: 📊 程式碼品質審計
自動化工具:
# Ruff - 全面 linting
uv run ruff check src/ --output-format=grouped --statistics
# Ruff - 格式檢查
uv run ruff format --check src/
# MyPy - 型別安全
uv run mypy src/ --ignore-missing-imports --show-error-codes
# Vulture - 死碼偵測
uv run vulture src/ --min-confidence 80
# 圈複雜度
uv run ruff check src/ --select=C901 --output-format=concise人工檢查項目:
| 指標 | 閾值 | 工具 |
| 函數長度 | < 50 行 | grep + 人工 |
| 類別大小 | < 300 行 | grep + 人工 |
| 圈複雜度 | McCabe < 10 | ruff C901 |
| 重複程式碼 | 無明顯重複 | semantic_search |
| 命名一致性 | snake_case/CamelCase | ruff |
| 型別覆蓋率 | 公開 API 100% | mypy |
Phase 3: 🔒 安全性審計
呼叫 security-reviewer skill 執行 OWASP Top 10 檢查
# Bandit - 靜態安全分析
uv run bandit -r src/ -ll -f txt
# 依賴漏洞
uv run pip-audit 2>/dev/null || echo "pip-audit 未安裝"
# Secrets 偵測
git log --all --diff-filter=A -- "*.env" "*.key" "*.pem" 2>/dev/null || true額外安全檢查:
grep_search("password|secret|api_key|token|private_key", src/)
grep_search("pickle\.load|yaml\.load|eval\(|exec\(", src/)
grep_search('f"SELECT|f"INSERT|f"UPDATE|f"DELETE', src/)Phase 4: 🧪 測試覆蓋率審計
呼叫 test-generator 的分析能力
# 執行測試並產生覆蓋率
uv run pytest tests/ \
--cov=src \
--cov-report=term-missing \
--cov-fail-under=80 \
-q --no-header 2>/dev/null || echo "pytest 未配置"測試品質評估:
| 指標 | 標準 |
| 覆蓋率 | ≥ 80% |
| Domain 層覆蓋 | ≥ 90% |
| 邊界測試 | 有 |
| 錯誤路徑測試 | 有 |
| 整合測試 | 有(獨立標記) |
Phase 5: 📚 文檔同步審計
檢查所有文檔是否與程式碼同步:
| 文檔 | 檢查方式 |
| README.md | 功能列表 vs 實際 src/ |
| CHANGELOG.md | 最新版本是否有記錄 |
| ARCHITECTURE.md | 架構描述 vs 實作 |
| Memory Bank | 上次更新時間 |
| API 文檔 | 端點 vs 路由定義 |
# 檢查 Memory Bank 最後更新
git log -1 --format="%ai" -- memory-bank/ 2>/dev/null📊 審計報告格式
# 🔬 程式碼審計報告
📅 審計日期:YYYY-MM-DD
📁 審計範圍:src/, tests/
🔍 審計師:AI Assistant
---
## 🎯 評分總覽
| 維度 | 分數 | 等級 | 說明 |
|------|------|------|------|
| 🏗️ 架構合規 | ?/10 | 🟢🟡🔴 | ... |
| 📊 程式碼品質 | ?/10 | 🟢🟡🔴 | ... |
| 🔒 安全性 | ?/10 | 🟢🟡🔴 | ... |
| 🧪 測試覆蓋 | ?/10 | 🟢🟡🔴 | ... |
| 📚 文檔同步 | ?/10 | 🟢🟡🔴 | ... |
| **總分** | **?/50** | | |
### 評分標準
- 🟢 8-10:優秀,無重大問題
- 🟡 5-7:可接受,有改進空間
- 🔴 0-4:亟需改善
---
## 🔴 Critical Issues(阻擋級)
> 必須在下次 release 前修復
1. ...
## 🟠 High Issues(重要)
1. ...
## 🟡 Medium Issues(改進)
1. ...
## 🟢 Positive Findings(優點)
1. ...
---
## 📈 趨勢分析
與上次審計比較(如有記錄):
- 架構合規:↑ / → / ↓
- 品質分數:↑ / → / ↓
- 測試覆蓋:XX% → XX%
---
## 📋 改進行動計畫
### 立即(本週)
- [ ] ...
### 短期(本月)
- [ ] ...
### 長期(本季)
- [ ] ...
---
## 📝 審計備註
- 審計結果已記錄至 memory-bank/decisionLog.md
- 下次建議審計日期:YYYY-MM-DD🎮 使用方式
| 指令 | 效果 |
「審計」或 「AUDIT」 | 完整 5 維度審計 |
「快速審計」 | 僅執行自動化工具 |
「審計 安全性」 | 僅 Phase 3 安全審計 |
「審計 架構」 | 僅 Phase 1 架構審計 |
「審計 測試」 | 僅 Phase 4 測試覆蓋 |
🔄 與其他 Skills 的關係
code-audit (審計編排器)
├── code-reviewer (品質審查)
├── security-reviewer (安全審查)
├── test-generator (測試分析)
├── ddd-architect (架構驗證)
└── skill-health-check (自身健康)| 情境 | 動作 |
| 發現安全問題 | 調用 security-reviewer 深入分析 |
| 發現架構違規 | 調用 ddd-architect 提供修正建議 |
| 測試不足 | 調用 test-generator 生成測試 |
| 品質問題 | 調用 code-refactor 提供重構方案 |
| 審計完成 | 調用 memory-updater 記錄結果 |
⚠️ 注意事項
- 全面審計可能耗時:大型專案建議分 Phase 執行
- 首次審計設定基線:記錄分數作為後續比較基準
- 記錄到 Memory Bank:審計結果寫入 decisionLog.md
- 不自動修改:審計只產生報告,修復由專門 Skill 負責
- 定期執行:建議每月或每個 milestone 後執行
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.

