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

Code Review

CodeArts Agent Space supports automated code reviews, enabling you to effectively monitor and maintain high code quality.

Constraints

Table 1 Constraints

Category

Description

Environment requirements

The operation must be performed in the Git repository, and the working directory must contain 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

Code Review Example

  1. Switch to the agent team mode.

    1. Access CodeArts Agent Space by referring to Enabling CodeArts Agent Space.
    2. Click Coding.
    3. At the bottom of the input box, select AgentTeam to switch to the agent team mode. The selected model is displayed on the right. You can select a model as required from the drop-down list.

  2. Enter a prompt (must contain the keyword code-reviewer) in the box, and click or press Enter to submit your request.

    The following are two typical application scenarios and corresponding prompt examples:

    • Reviewing current code changes

      Prompt example: Use code-reviewer to review the current code changes.

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

    • Reviewing the code changes in a specified commit

      Prompt example: Use code-reviewer to review the code changes in commitId. commitId specifies the Git commit SHA of the commit to review. The value is a hexadecimal string containing 7 to 40 characters, for example, 8b480d1.

      AI action: Reviews all code changes contained in the specified commit.

  3. Check the code review result.

    In Editor > EXPLORER, the .codeartsdoer/review directory is created in the project root directory. Each review generates a subdirectory named in the format yyyy-MM-dd_HH-mm-ss-SSS_<random_string>. Each review directory contains the following subdirectories: preprocess (stores preprocessing files, such as the code changes to be reviewed) and report (stores the final review report review.json).