Seven-Dimension Code Review
Paste the following prompt into your AI chat to install this skill:
Please refer to https://skillhub.cn/install/skillhub.md to install @user_19b9fbd9/code-review93.
About this skill
What It Solves
Code review is critical for software quality, but two common pitfalls undermine its effectiveness. First, reviewers often mix diagnosis with remediation—"making quick fixes" during review—which blurs problem tracking and can introduce new bugs. Second, with the rise of AI-assisted coding, generated code might "look correct" but harbor issues unique to AI, such as hallucinated API calls or silent degradations. Traditional checklists often miss these dimensions.
The code-review skill is a read-only, structured AI coding agent designed to address these challenges. Its core value lies in enforcing a strict separation between audit and remediation, while introducing unique inspection dimensions tailored for AI-generated code.
How It Works
Core Principle: Audit-Remediation Separation
This is the skill's iron rule. When triggered by commands like review/check/diagnose, it enters a read-only mode. It performs a comprehensive audit and outputs a structured issue list, then stops. It never附带任何代码修改 (appends any code fixes) during the review. The decision to fix rests entirely with the user. Each item in the issue list strictly follows a five-field format: Location (file:line_number), Root Cause, Impact, Dimension + Severity, and Remediation Direction (a one-line suggestion, not an implementation).
Key Steps: From Environment Probing to Seven-Dimension Review
Before auditing, the skill conducts environment probing: determining if the target is a single file, directory, or git diff; forcibly reading the entire target file for context; performing project-wide searches for suspected dead code; and recording runtime environment versions (OS, language, dependencies). This ensures accurate conclusions and avoids fragmented analysis.
The review itself is guided by its core Seven-Dimension Checklist, covering traditional bugs to AI-specific issues:
- ① Correctness Bugs: Tests edge cases (empty集合/None/单元素/0/极值/NaN/跨日/停牌) and cross-environment traps (paths, encoding, timezones).
- ② AI-Specific: Hallucinations & Silent Degradations: Validates API signatures against official docs, hunts for except: pass error-swallowing code, and requires quality flags for any degradation.
- ③ Performance & Resources: Identifies inefficient loops, resource leaks, uncached computations, and unguarded external calls.
- ④ Redundancy & Consistency: Finds dead code (verified via project-wide grep), debug leftovers, duplicate logic (following the rule of three), and orphaned variables.
- ⑤ Security & Leaks: Scans for hardcoded secrets, SQL injection, and sensitive info in logs.
- ⑥ Product & Over-Engineering: Assesses if functionality is unnecessary or over-abstracted, and suggests simplifications.
- ⑦ Verifiability & Rollback: Ensures changes have a baseline and critical paths have test coverage.
The entire process adheres to a strict evidence discipline: Conclusions must be based on actual verification (e.g., running code, checking official docs). When verification isn't directly possible, it only flags a "most likely cause + verification action needed." For performance advice, without before/after profiling data, it only states "expected" improvement, never "will be faster."
Boundaries and Caveats
This skill is an audit specialist, not a remediation executor. Its capability boundaries are clear:
- Audit Only, No Fixing: If a user requests fixes after reviewing the list, it must hand off to a normal coding workflow.
- No Performance Tuning Implementation: It only reports performance issues and their required baselines.
- No Professional Penetration Testing: It only scans for common leak patterns.
When using it, note that for large repositories, you should layer analysis by import dependencies, reviewing one module at a time. For AI code that "looks correct," always verify via documentation or local testing. If unsure whether an issue is stylistic or substantive, apply the "deletion test"—if removing the code has no visible effect, it's low-priority or should not be reported.
Use Cases
- A developer uses an AI tool to generate core business logic. Before merging into the main branch, they need a comprehensive, structured review of that code to systematically identify correctness, performance, and security risks, going beyond a simple visual check.
- A tech lead or architect is drafting guidelines for AI-assisted coding within their team. They need a detailed checklist to define what constitutes "high-quality AI code" and use it to explain to team members why AI-generated code requires stricter review on specific dimensions (like hallucinations, degradation).
- A complex data processing module, generated by AI and used as a dependency, is producing erratic errors at runtime. A read-only "diagnostic review" is needed first, strictly following the seven-dimension checklist and evidence discipline to pinpoint the issue, clarify its root cause, and outline verification steps—providing a precise input for subsequent fixes and avoiding new bugs from blind changes.
Best For
- Software engineers who frequently use AI-assisted coding tools like GitHub Copilot or Cursor in their daily work. Their need is to systematically review and ensure the quality of AI-generated code, beyond mere manual inspection.
- A Tech Lead or software architect responsible for team code quality, review processes, or coding standards. They require a concrete, actionable review framework—especially one with dimensions specific to AI code—to guide the team and implement standards.
- Researchers and engineers working on AI model integration, MLOps platform development, or building AI applications. They need to deeply inspect the reliability, performance boundaries, and potential silent failures of code that is output by models or auto-generated.
Related Skills
A systematic code error fixing skill that follows a five-step workflow: Reproduce, Isolate, Understand, Fix, Verify, to help developers resolve code errors.
Supports inline SVG/HTML rendering and Mermaid code output, covering common technical diagram creation like architecture and flow diagrams.
A comprehensive browser automation guide covering navigation, interaction, multi-tab management, and data collection, tailored for domestic web ecosystems and tools like Playwright/Selenium.
This skill provides end-to-end automation for WeChat Mini Program development, covering building, debugging, previewing, testing, and publishing, with integrated code quality analysis and dependency management.