Code Reviewer
Paste the following prompt into your AI chat to install this skill:
To install this skill into your AI assistant, please follow the official guide at https://skillhub.cn/install/skillhub.md and install @user_6cc7d052/code-reviewer.
About this skill
Addressing Manual and Subjective Issues in Code Review
Code review is critical for ensuring software quality, but traditional manual inspection is time-consuming and susceptible to oversights due to developer fatigue or inconsistent expertise. This challenge is amplified in cross-team environments where enforcing uniform coding standards is difficult.
This skill addresses these issues through automated static analysis, providing a standardized pipeline for code quality assessment and specification scoring.
Core Capabilities and Workflow
The tool operates via a clear two-step process:
1. Execute Code Analysis: By running the scripts/code_reviewer.py script, it first automatically detects the programming language (e.g., Python, Java, JavaScript) of files within the specified directory. It then performs multi-dimensional checks:
* Code Convention Checks: Evaluates adherence to general best practices.
* Potential Bug and Performance Detection: Identifies common anti-patterns through static analysis.
* Comment Coverage Statistics: Quantifies documentation completeness.
* Huawei Java Programming Standards Scoring: Specifically for Java files, it generates a 100-point score across five dimensions: formatting, comments, naming, coding practices, and performance/reliability.
This step outputs a structured review_results.json file.
- Generate Readable Report: The
scripts/report_generator.pyscript transforms the JSON data into an actionable Markdown report (code_review_report.md). The report includes: summary statistics, detailed Huawei standards scoring, issue lists categorized by severity, and file-level analysis. A key output is the specific, line-referenced recommendations.
Applicable Boundaries and Notes
While automation offers significant benefits, it is essential to understand its limitations:
* The tool relies on static analysis, meaning it cannot detect runtime state issues, complex business logic errors, or concurrency race conditions.
* The Huawei Java programming standards scoring feature applies only to Java files. Other languages receive general quality checks but do not generate a specification score.
* The review results should be considered the first layer of quality assurance. It is recommended to complement them with unit tests, integration testing, and manual code review for a comprehensive quality strategy.
* Check rules may vary slightly between programming languages; detailed definitions can be found in the references/review-guidelines.md document included in the skill package. Issues marked as "Critical" in the report should be prioritized for immediate remediation.
Use Cases
- Before merging Java enterprise project code into the main branch, scan the entire directory to detect non-compliance with Huawei programming standards and generate a scoring report for technical review meetings to quickly pinpoint areas for modification.
- Maintaining a multi-language microservices project, regularly run the tool to check code conventions and potential performance issues across all services, producing a structured report to guide refactoring priorities.
- As a code reviewer handling numerous PR submissions, quickly assess the code quality of files associated with each PR by using the tool to generate reports that help identify critical issues and optimization suggestions.
- When developing a Python library, quantify comment coverage and naming conventions to ensure code readability and maintainability meet team standards before release.
Best For
- Java backend developer needing to automatically detect compliance with internal Huawei coding standards before code submission to reduce review feedback cycles.
- Core maintainer of an open-source project, requiring efficient review of community-contributed code to quickly identify potential bugs and convention issues while maintaining project quality.
- Architect in a technical team wanting tools to provide multi-dimensional code quality assessment data to inform team coding guidelines and training plans.
- DevOps engineer managing CI pipelines who needs to integrate code review scripts to automate quality gates in the continuous integration process.
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.