Analyze code quality based on "Clean Code" principles. Identify naming, function size, duplication, over-engineering, and magic number issues with severity ratings and refactoring suggestions. Use when the user requests code quality checks, refactoring advice, Clean Code analysis, code smell detection, or mentions terms like code review, code quality, refactoring check.
Focused on 7 high-impact review dimensions based on "Clean Code" principles.
Review Progress:
- [ ] 1. Scan codebase: identify files to review
- [ ] 2. Check each dimension (naming, functions, DRY, YAGNI, magic numbers, clarity, conventions)
- [ ] 3. Rate severity (High/Medium/Low) for each issue
- [ ] 4. Generate report sorted by severity
All suggestions target implementation approach only—never suggest changing the code's functionality, output, or behavior.
Check for:
data1, temp, result, info, objget/fetch/retrieve mixed)// ❌
const d = new Date();
const data1 = fetchUser();
// ✅
const currentDate = new Date();
const userProfile = fetchUser();
Check for:
// ❌ 7 parameters
function processOrder(user, items, address, payment, discount, coupon, notes)
// ✅ Use parameter object
interface OrderParams { user: User; items: Item[]; shipping: Address; payment: Payment }
function processOrder(params: OrderParams)
Check for:
Check for:
if (config.legacyMode) branches that are never true// ❌ YAGNI violation: unused compatibility code
if (config.legacyMode) {
// 100 lines of compatibility code
}
Check for:
// ❌
if (retryCount > 3) // What is 3?
setTimeout(fn, 86400000) // How long is this?
// ✅
const MAX_RETRY_COUNT = 3;
const ONE_DAY_MS = 24 * 60 * 60 * 1000;
Check for:
// ❌ Nested ternary
const status = a ? (b ? 'x' : 'y') : (c ? 'z' : 'w');
// ✅ Use switch or if/else
function getStatus(a, b, c) {
if (a) return b ? 'x' : 'y';
return c ? 'z' : 'w';
}
Check for:
// ❌ Inconsistent style
import { api } from './api'
import axios from 'axios' // External lib should come first
const handle_click = () => { ... } // Mixed naming style
// ✅ Unified style
import axios from 'axios'
import { api } from './api'
function handleClick(): void { ... }
[!TIP] Project conventions should refer to
CLAUDE.md,AGENTS.md, or project-defined coding standards.
| Level | Criteria | |-------|----------| | High | Affects maintainability/readability, should fix immediately | | Medium | Room for improvement, recommended fix | | Low | Code smell, optional optimization |
### [Issue Type]: [Brief Description]
- **Principle**: [Clean Code principle]
- **Location**: `file:line`
- **Severity**: High/Medium/Low
- **Issue**: [Specific description]
- **Suggestion**: [Fix direction]
clean-code-review.md (human-readable report)clean-code-review.json (structured issue list for aggregation/deduplication/statistics)Detailed examples: See detailed-examples.md
Language patterns: See language-patterns.md
Split by the following dimensions for parallel multi-agent execution:
Example: /review-clean-code --scope=components or --dimension=naming
Deduplication and unified severity rating needed when aggregating.
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer