Updated on 2026-07-29 GMT+08:00

Code Review

CodeArts Agent IDE automates code reviews by efficiently coordinating two core commands, /codeagent-review-rules and /review, offering precise and powerful code quality control.

Constraints

Table 1 Constraints

Category

Description

Environment requirements

The /review command must be executed in a Git repository whose working directory contains staged, unstaged, or untracked file changes.

Supported file formats

Only code files in the supported programming languages can be reviewed. Non-code files (such as .json, .md, and .css) are automatically excluded from the review process.

  • JavaScript/TypeScript: .ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, .cts
  • Python: .py, .pyi, .pyw, .pyx
  • Java: .java
  • C/C++: .c, .cpp, .cc, .cxx, .h, .hpp, .hh, .hxx
  • Go: .go

Command Usage

The following sections describe how to use the two core commands: /review and /codeagent-review-rules.

/review

Function: Starts the code review process to comprehensively review the current code changes or those in a specified commit.

Syntax: Select the syntax that suits your needs and press Enter to trigger a comprehensive review of the specified code changes.

Table 2 /review command syntax

Syntax

Description

/review

Reviews all code changes in the current working directory, including staged changes, unstaged changes, and newly untracked files.

/review <commitId>

Reviews all code changes (separated by spaces) in a single commit.

/review commitid:<commitId>

Reviews all code changes (separated by colons) in a single commit.

/review commitid=<commitId>

Reviews all code changes (separated by equal signs) in a single commit.

/review Review the code changes in <commitId>

Reviews a specified commit using a natural language description.

Table 3 /review command parameters

Parameter

Type

Description

commitId

String (7 to 40 hexadecimal characters)

The commit SHA to be reviewed. If this parameter is not specified, the changes in the current working directory are reviewed by default.

Supported commit ID formats:

  • Raw SHA (7 to 40 hexadecimal characters): 8b480d1 or 8b480d1a3b5c...
  • Colon: commitid:8b480d1
  • Equal sign: commitid=8b480d1
  • Natural language: Audit 8b480d1, Check 8b480d1, or Review 8b480d1

Examples: The following three examples demonstrate how to call /review in different ways and what are the differences.

  • Reviewing all uncommitted code changes
    /review
  • Reviewing all code changes in a specified commit
    /review 8b480d1a3b5c4d6e7f8a9b0c1d2e3f4a5b6c7d8e
  • Reviewing a specified commit using a natural language description
    /review Review the code changes in commit 8b480d1a3b5c4d6e7f8a9b0c1d2e3f4a5b6c7d8e

/codeagent-review-rules

Function: Manages code review rule sets, including generating, displaying, and deleting rules.

Syntax: Table 4 provides four types of syntax for the /codeagent-review-rules command and their functions. Select the operation you need and press Enter to execute it.

Table 4 /codeagent-review-rules syntax

Syntax

Description

/codeagent-review-rules <File path><Rule set name>

Generates a new rule set based on a specification file.

/codeagent-review-rules --generate <File path><Rule set name>

/codeagent-review-rules --show-rules <Rule set name>

Lists enabled rules (enabled=true).

/codeagent-review-rules --delete-rules <Rule set name> <Rule ID_1,Rule ID_2,...>

Disables a specified rule by setting its enabled field to false.

Table 5 /codeagent-review-rules command parameters

Parameter

Description

File path

Local path for storing a specification file. Currently, only specification files in the following formats are supported:

  • PDF (.pdf)
  • WORD (.docx or .doc)
  • Markdown (.md)

Rule set name

Name of a rule set generated based on a specification file. The rule set name facilitates subsequent reference and management.

Rule ID list

ID of the rule to be disabled. Use commas (,) to separate multiple IDs, for example, rule_001,rule_002.

Examples: The following examples demonstrate how to use /codeagent-review-rules to automate the management of code review rules.

  • Generating a rule set based on a PDF specification file
    /codeagent-review-rules --generate /path/to/Python Coding Style Guide.pdf Python Coding Style Guide V3.0
  • Viewing enabled rules
    /codeagent-review-rules --show-rules Python Coding Style Guide V3.0
  • Disabling specified rules
    /codeagent-review-rules --delete-rules Python Coding Style Guide V3.0 RULE_001,RULE_005

Using These Commands

  1. Log in to CodeArts Agent IDE as instructed in Quick Start.
  2. Run /codeagent-review-rules to generate a rule set based on a local specification file.

    1. Click in the chat box, choose Shortcuts, and select /codeagent-review-rules from the displayed menu.
    2. Enter the location of the specification file and the name of the rule set to generate, and click .
      Figure 1 Generating a rule set
    3. View the generated rule set.

      A rule set folder named codeagent-custom-review-rules is generated in the .codeartsdoer/skills directory of the explorer's project root directory.

      Figure 2 Viewing a generated rule set

  3. Run /review to comprehensively review code changes based on the generated rule set.

    1. Click in the chat box and choose Shortcuts.
    2. Select /review from the displayed menu and click .
    3. Check the code review result.

      In the .codeartsdoer/review directory of the explorer's project root directory, a folder named in the format "year-month-day_hour-minute-second-millisecond_random string" is generated. Each folder contains two subdirectories: preprocess and report. preprocess stores preprocessed files including code changes. report stores the final review report.