一键导入
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 页面并帮你完成安装。
基于 SOC 职业分类
Test failure diagnosis, source code fixes, and regression detection
Environment verification, dependency installation, baseline test verification
Contract-first single-task implementation dispatched by Coder Coordinator
Integration test writing for component boundaries and external dependencies
Unit test writing and execution with coverage threshold enforcement
API reference documentation skill. Produces and updates API endpoint documentation from contract files in .sdd/docs/api-reference.md.
| 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):
#tool:search/searchSubagent to find WP-scoped files efficiently. Use #tool:read/problems to check for lint and compile errors.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**: Dimension 7 - Dead Code
- **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**: Dimension 2 - Complexity
- **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.Before completing, verify:
finding_counts match actual findings in the outputfiles_reviewed lists every file read during this review