SuperAPI AI Directory

code-review-architect

Testing & quality

View repository

Updated 10-15 20:06

About this skill

Code Review Specifications

Perceive (Analysis Phase)

  1. Scope Identification:

    • Analyze the provided code diffs or file contents.
    • Identify the languages and frameworks involved (e.g., TypeScript, C#, Python, React).
    • Determine the nature of the change (e.g., Feature, Bugfix, Refactor, Config).
  2. Context Gathering:

    • Look for surrounding code to understand the impact of changes.
    • Check for relevant configuration files (e.g., tsconfig.json, .eslintrc, security policies) if available in the provided context.

Reason (Evaluation Phase)

Evaluate the code against the following dimensions:

  1. Correctness & Logic:
    • Does the code do what it's supposed to do?
    • Are there any edge cases missing?
    • Are there potential concurrency issues (race conditions, deadlocks)?
  1. Security (Critical):

    • Injection Flaws: SQLi, XSS, Command Injection.
    • Data Exposure: Hardcoded secrets, sensitive data logging.
    • Auth: Improper authentication or authorization checks.
    • Dependencies: Use of known insecure functions or patterns.
  2. Performance:

    • Efficiency: Algorithmic complexity (Big O).
    • Resources: Memory leaks, unclosed file handles/connections.
    • Database: N+1 queries, missing indexes.
  3. Maintainability & Readability:

    • Clarity: Variable/function naming, comment quality.
    • Complexity: Cyclomatic complexity, function length.
    • Modularity: DRY (Don't Repeat Yourself), SOLID principles.
    • Testing: Is the code testable? Are tests included?
  4. Style & Standards:

    • Adherence to language-specific conventions (e.g., PEP8 for Python, Airbnb for JS).
    • Consistency with the existing project style.

Act (Reporting Phase)

Generate a structured Code Review Report in Traditional Chinese (Taiwan) with the following sections:

  1. 🔍 Review Summary:

    • Brief overview of the changes.
    • Overall assessment (e.g., "Ready to merge", "Needs changes", "Major rework needed").
  2. 🔴 Critical Issues:

    • Must-fix items (Security vulnerabilities, Logic bugs, Breaking changes).
    • Clear explanation of why it is critical.
  3. 🟡 Suggestions:

    • Performance improvements.
    • Refactoring opportunities (Clean Code).
    • Edge case handling.
  4. 🟢 Praise (Optional):

    • Highlight well-written code or clever solutions.
  5. ❓ Questions (Optional):

    • Clarification needed on business logic or intent.

Style Guidelines for the Report:

  • Be constructive and respectful.
  • Use code snippets to illustrate the problem or suggested fix.
  • Focus on the code, not the coder.