一键导入
review-quality
Code quality review skill. Evaluates readability, complexity, naming, comments, error handling, style consistency, dead code, and duplication.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Code quality review skill. Evaluates readability, complexity, naming, comments, error handling, style consistency, dead code, and duplication.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Architecture adherence review skill. Evaluates component design, tech stack compliance, directory structure, SOLID principles, dependency direction, and scope discipline.
Dependency review skill. Checks for known CVEs, abandoned packages, unnecessary dependencies, license compatibility, version pinning, and supply chain integrity.
Documentation accuracy review skill. Compares .sdd/docs/ content against implementation for accuracy, completeness, and staleness.
Performance review skill. Detects N+1 queries, missing indexes, blocking in async contexts, unbounded data fetching, unnecessary computation, inefficient data structures, and missing caching opportunities.
Security review skill. Audits implementation against all 14 OWASP Secure Coding Practices categories. Cross-references spec security requirements. Uses web research to verify unfamiliar patterns.
Spec adherence review skill. Evaluates implementation against functional requirements, success criteria, and acceptance scenarios from the specification. Verifies SHALL obligations, preconditions, postconditions, error paths, edge cases, data models, and API contracts.
基于 SOC 职业分类
| name | review-quality |
| description | Code quality review skill. Evaluates readability, complexity, naming, comments, error handling, style consistency, dead code, and duplication. |
| argument-hint | Invoked by Review Coordinator - do not call directly |
This skill is invoked by the Review Coordinator as a subagent. It evaluates implementation code quality across 8 dimensions, enforcing objective standards based on codebase conventions - not subjective preferences.
Input contract (received via subagent prompt):
Constraint: Do NOT modify any source code, the WP file, or the spec file. Only write to the specified output path.
Critical rule (FR-039): Do NOT enforce subjective style preferences. Only flag deviations from EXISTING codebase patterns. If you cannot determine the codebase convention for a style question, do not flag it.
Before evaluating, discover existing codebase patterns first: naming conventions (camelCase vs snake_case), indentation style, import ordering, module structure. These become the baseline for consistency checks.
except: in Python, no empty catch {} blocks)?Note: Framework hooks, lifecycle methods, signal handlers, and route handlers are NOT dead code even if not explicitly called. Only flag symbols with zero references AND no framework registration.
| Finding type | Severity |
|---|---|
| Dead code: declared but never referenced symbols | FAIL |
| Unreachable code paths | FAIL |
| Bare exception handlers / empty catch blocks | FAIL |
| Silently swallowed exceptions | FAIL |
| Cyclomatic complexity > 10 | WARN |
| Cyclomatic complexity > 20 | FAIL |
| Naming issues (misleading, single-letter outside loops) | WARN |
| Comment issues (TODO/FIXME/HACK, commented-out code) | WARN |
| Style inconsistencies (deviations from codebase patterns) | WARN |
| Code duplication (3+ lines) | WARN |
| Readability concerns (long functions, deep nesting) | WARN |
Escalation rule: 3+ WARN-level issues of the same type in the same file indicate a systemic quality problem. Note this pattern in the findings but do not escalate to FAIL unless individual items cross FAIL thresholds above.
Non-applicable items: Mark as N/A with justification when a dimension does not apply (e.g., "No database code in this WP, SQL duplication check N/A").
Write findings to the specified output path using this exact format:
---
skill: review-quality
wp: <WP-id>
spec: <spec_path>
reviewed_at: <ISO 8601 timestamp>
status: completed
finding_counts:
pass: <count>
warn: <count>
fail: <count>
na: <count>
files_reviewed:
- <file1>
- <file2>
---
# review-quality Findings for <WP-id>
## Summary
<Brief overview: files reviewed, overall code quality assessment, key concerns.>
## Findings
### QUAL-001 [FAIL]
- **Checklist item**: Dead Code - Unused function
- **Requirement**: FR-037 dimension 7
- **File**: <file_path>#L<start>-L<end>
- **Description**: Function `process_legacy()` is defined but never called anywhere.
- **Expected**: Remove unused function or document why it is retained.
- **Evidence**: Search for `process_legacy` returns only the definition, no call sites.
### QUAL-002 [WARN]
- **Checklist item**: Complexity - High cyclomatic complexity
- **Requirement**: FR-037 dimension 2
- **File**: <file_path>#L<start>-L<end>
- **Description**: Function has estimated cyclomatic complexity of 14.
- **Expected**: Refactor into smaller functions or simplify branching logic. Threshold: 10.
- **Evidence**: 14 branching points counted (6 if/elif, 3 for, 2 try/except, 3 boolean operators).
### QUAL-003 [N/A]
- **Checklist item**: Duplication - SQL pattern duplication
- **Justification**: No SQL or database code in this WP.
QUAL- and are sequential: QUAL-001, QUAL-002, etc. No gaps.finding_counts MUST accurately reflect the actual findings in the file.files_reviewed MUST list every file read and evaluated during this review.