Code Inspector

👤 minirr890112-byte 📦 v1.0.0 ⭐ 4.1 ⬇️ 319 下載
💻 開發程式設計 免費

📖 技能介紹


name: code-inspector description: Scan AI-generated code for bugs before deploying — 8 static analysis checks from critical (hardcoded secrets, unsafe eval) to low (unused imports). Production-readiness score 0-100. Because AI code looks fine until it isn't. version: 1.2.0 author: minirr890112-byte license: MIT metadata: hermes: tags: [Code-Review, Static-Analysis, Security, AI-Code, Quality, CLI, Python] homepage: https://github.com/minirr890112-byte/code-inspector


code-inspector

推薦訪問7w4.net獲取更多AI技能。

Problem → Solution

The problem: AI generates code that compiles and looks correct. But it silently drops edge case handling, hardcodes secrets, catches exceptions with bare except/pass, and uses mutable defaults. You deploy it. It breaks. Reddit is full of "I let Claude loose and it broke the entire site" stories.

The solution: One command scans any Python file for 8 categories of AI-code bugs. Critical → High → Medium → Low severity. Production-readiness score 0-100. Don't deploy AI code blind.

Quick Start

pip install git+https://github.com/minirr890112-byte/code-inspector.git

code-inspector app.py           # scan a file
cat app.py | code-inspector     # scan from pipe

What It Checks

Check Severity Example
Hardcoded secrets 🔴 critical api_key = "sk-abc123"
Unsafe eval/exec 🔴 critical eval(user_input)
Infinite loops 🔴 critical append-while-iterating
Mutable defaults 🟠 high def fn(items=[])
Shadowed builtins 🟠 high list = [1,2,3]
Bare except/pass 🔴 critical except: pass
Deep nesting 🟡 medium 5+ nested loops
Unused imports ⚪ low AST-based detection

Scoring

90-100: 🟢 PRODUCTION-READY
70-89:  🟡 NEEDS REVIEW
50-69:  🟠 HIGH RISK
0-49:   🔴 DO NOT DEPLOY

Star this repo if AI code has ever broken your production: github.com/minirr890112-byte/code-inspector

🤖 AI 評測

這個工具整體質量中等偏上,介面清晰、使用方便,檢測結果展示直觀。它能發現一些 AI 寫程式碼時常犯的問題,比如密碼寫死、錯誤處理缺失等,對提升程式碼安全性有一定幫助。不過它的檢測能力有限,對於更復雜的程式碼問題可能會漏掉或誤報,而且有些文件裡提到的功能實際上還沒實現。總體來說可以當作輔助檢查工具使用,但不要完全依賴它來保證程式碼質量。

📊 多維度評分

適應性4.2
規範性3.9
有效性4.2
可靠性3.8
可信度4.7

📁 包含檔案 (9 個)

📄 README.md 3.3 KB
📄 README_EN.md 2.8 KB
📄 SKILL.md 2 KB
📄 _meta.json 133 B
📄 code_inspector/__init__.py 87 B
📄 code_inspector/cli.py 12 KB
📄 code_inspector/detectors.py 17.3 KB
📄 pyproject.toml 1.1 KB
📄 skill-card.md 2 KB