跳到正文
cccskills
免费在 GitHub 公开

code-review-quality

Python code quality review lens. SOLID principles, dead code, exception handling, resource leaks, thread safety, performance. Triggered by "quality" ("품질"), "SOLID", "dead code" ("데드코드"), "exception", "resource leak", "thread safety" keywords.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md4.7 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Code Review Quality Lens

Review quality issues from 6 perspectives that automated tools miss.

Check 1: Dead Code Detection

# Unused imports
uv run ruff check core/ --select F401

# Unused variables
uv run ruff check core/ --select F841

# Residual TODO/FIXME/HACK
grep -rn "TODO\|FIXME\|HACK\|XXX" core/ --include="*.py"

# Empty function bodies (stubs with only pass)
grep -rn "def.*:" core/ --include="*.py" -A1 | grep -B1 "^\s*pass$"

Check 2: Exception Handling Anti-patterns

# Empty except blocks (swallowing exceptions)
grep -rn "except.*:" core/ --include="*.py" -A1 | grep -B1 "^\s*pass$"

# Catch-all Exception (overly broad except)
grep -rn "except Exception" core/ --include="*.py" | grep -v "# noqa"

# Bare except (except without type)
grep -rn "except:" core/ --include="*.py"

Rules:

  • Empty except is a discovery candidate: inspect expected failure, suppression and the upper caller. Follow the existing error conventions; do not add duplicate logging, lose cancellation or manufacture empty success.
  • except Exception: Must state legitimate justification
  • Bare except: Prohibited — specify at minimum the Exception type

Check 3: Resource Leak Detection

# File handles (without with statement)
grep -rn "open(" core/ --include="*.py" | grep -v "with " | grep -v "# noqa"

# subprocess handles not collected
grep -rn "subprocess\.Popen" core/ --include="*.py" | grep -v "with "

# Temporary files not cleaned up
grep -rn "tempfile\.\|NamedTemporaryFile\|mktemp" core/ --include="*.py"

Trace the creator, ownership transfer, borrower and lifetime owner. Use a context manager, finally or the established async shutdown owner as appropriate; verify constructor failure, cancellation and partial teardown. Preserve failed resources when the owning lifetime permits retry, and still attempt sibling cleanup. Follow construction/lifecycle and error conventions, rather than requiring a with statement for every shared client.

Check 4: Thread Safety

# Global mutable state
grep -rn "^[A-Z_]*\s*=\s*\[\|^[A-Z_]*\s*=\s*{" core/ --include="*.py" | grep -v "frozenset\|tuple\|Final"

# Shared state modification without Lock
grep -rn "threading\.\|asyncio\.\|concurrent\." core/ --include="*.py"

# ContextVar usage patterns
grep -rn "ContextVar\|contextvars" core/ --include="*.py"

GEODE context:

  • core.wiring composes services through constructors/configuration or typed contexts such as ToolContext; a service-locator ContextVar is not the DI contract.
  • Request-local ContextVar use does not prove mutable values are isolated or that context propagates across every thread/task boundary. Trace the actual producer, handoff, mutation, and reset paths.
  • For a module-level dict/list, establish whether concurrent mutation exists and which owner serializes it before recommending a lock or immutable type.

See architecture boundaries.

Check 5: SOLID Principles

PrincipleDiscovery candidates, not violationsDetection
SRP500+ line files, classes with 5+ responsibilitieswc -l core/**/*.py | sort -rn | head
OCPif/elif chains with 10+ branchesgrep -rn "elif" count
LSPNotImplementedError in subclassesgrep -rn "NotImplementedError"
ISPProtocol with 10+ methodsTrace actual Protocol consumers
DIPImport bypassing a declared package/capability boundaryCheck the current import-linter contracts

These source/size heuristics need caller and failure evidence. Concrete-class imports are valid when no declared boundary or substitution contract is bypassed. Use the field guide before deleting code/tests or introducing an abstraction.

Check 6: Performance

# N+1 pattern (I/O inside loops)
grep -rn "for.*in.*:" core/ --include="*.py" -A5 | grep "\.get\|\.fetch\|\.call\|\.execute"

# Unnecessary list creation (generator possible)
grep -rn "\[.*for.*in.*\]" core/ --include="*.py" | grep -v "test"

# Redundant computation (repeated calls to same function)
# (requires manual review)

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Audit agent runtimes and their tests for lifecycle inference, capability overload, context pollution, correlated verification, prompt-only control, false success, dead compatibility paths, test-only seams, and complexity without contribution. Use for whole-repository agent audits, slop or dead-code triage, test contribution reviews, large refactors, tool/context simplification, and cleanup requests that need proof before deleting code or tests.

中文简介正在准备中。当前显示原文说明。

mangowhoiscloud/geode152026年10月19日 更新

Diagnose agent operational failures through default-policy checks, multi-gap analysis, explicit service ownership, request-context lifetime, and degradation-versus-correctness checks.

中文简介正在准备中。当前显示原文说明。

mangowhoiscloud/geode152026年10月19日 更新

Align, run, audit, and publish GEODE benchmark comparisons against Agent-World arXiv 2604.18292v1 across MCP-Mark, BFCL V4, and tau2-bench. Use for Agent-World or AgentWorld comparison requests, cross-suite agent benchmark design, Tau2 comparator/profile diagnosis, paired thin-runtime-versus-GEODE experiments, mean-accuracy@8 replication, or benchmark comparability and artifact reviews.

中文简介正在准备中。当前显示原文说明。

mangowhoiscloud/geode152026年10月19日 更新

Verification checklist to prevent fake success. Detects test deletion/disabling, coverage regression, lint bypass, secret exposure. Triggered by "deception", "fake" ("가짜"), "fake success", "verification" ("검증"), "checklist" ("체크리스트"), "deletion detection" ("삭제 탐지"), "regression" keywords.

中文简介正在准备中。当前显示原文说明。

mangowhoiscloud/geode152026年10月19日 更新

Implement proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven Design. Use when architecting complex backend systems or refactoring existing applications for better maintainability.

中文简介正在准备中。当前显示原文说明。

mangowhoiscloud/geode152026年10月19日 更新

Auto-search and summarize latest AI/agent papers.

中文简介正在准备中。当前显示原文说明。

mangowhoiscloud/geode152026年10月19日 更新

查看 mangowhoiscloud 的全部技能

报告此技能的问题