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

Slash Commands

Slash commands are an efficient way to interact, allowing the agent to quickly execute common tasks within a chat. CodeArts Agent has been preconfigured with some common commands. You can also customize commands as needed.

Through custom commands, you can encapsulate frequently used operations or complex instructions into simple commands, thereby simplifying your workflow and enhancing collaboration efficiency with the AI. In CodeArts Agent, using custom slash commands offers the following advantages:

  • Reusing common prompts: Boosting efficiency and reducing repetitive typing

    Encapsulate frequently used prompts into shortcut commands to avoid typing the same instructions manually every time. For example, a custom command /code_explain can be used to explain the functionality, design mindset, and dependencies of the selected code.

  • Standardizing output formats: Unifying team standards and decreasing collaborative friction

    Enforce the AI to generate outputs that align with team standards through preset templates or rules, ensuring consistency. For example, a custom /api_doc_format can be used to convert API descriptions into a unified Markdown or Swagger format, making it easier for frontend integration or document platform synchronization.

  • Automating common development workflows: Triggering multi-step tasks with one click

    Package multiple operations or analysis steps into a single command to achieve "one-click trigger, end-to-end execution." For example, a custom command /code_review can be used to automatically scan the code of the current branch, identify potential bugs, performance bottlenecks, or style inconsistencies, and generate a comprehensive report.

Built-in Slash Commands

CodeArts Agent has been preconfigured with the commands listed in Table 1. You can directly invoke them without additional configuration.

Table 1 Built-in slash commands

Mode

Command

Description

Intelligent Q&A

/optimize

Code optimization

Allows CodeArts Agent to analyze code performance bottlenecks and provide optimizations, helping users improve the readability and maintainability of code.

/comment

Code commenting

Allows the system to analyze the code's architecture and logic, then auto-generate clear, meaningful comments. It facilitates standardizing the comment style across your entire repository, so readability becomes second nature and code archaeology is a thing of the past.

/explain

Code explanation

Allows the system to walk you through complex code with function, purpose, application scenario, and main logic. This clear explanation helps you get up to speed faster, and make knowledge flows smoothly, keeping the whole team in sync.

/tests

Unit test

Powers up your coding with generated unit test cases that slot into various test frameworks, such as JUnit, JMockit, pytest, unittest, and GTest. From single method to comprehensive class-wide tests, the code quality is guaranteed and defect risks are reduced.

/help

Help

Displays shortcut operation tips.

/clear

Clear screen

Clears the Q&A window content and opens a new one.

Agent

Custom agent

/clear

Clear screen

Clears the agent window content and opens a new one.

/init

Agent.md one-click initialization

Automatically generates the specification configuration file Agent.md for stock projects.

/review

Code review

Initiates a review on code, automatically identifying and fixing issues.

/sdd-new

Creation of requirement specifications

Generates the requirement specification document spec.md based on requirement descriptions.

/sdd-design

Creation of SDD technical design

Generates design.md based on spec.md.

/sdd-tasks

Creation of SDD coding tasks

Generates the task list tasks.md based on spec.md and design.md.

/sdd-apply

Execution of SDD coding tasks

Executes coding tasks one by one based on tasks.md.

Agent

/bugfix

Automatically invokes the repair expert agent to fix code issues based on the descriptions in the trouble tickets submitted by users.

For details, see /bugfix.

Agent

/fix-review

Fixes a single piece of code based on the review comment from the code review agent.

For details, see /fix-review.

Agent

/fix-review-batch

Fixes multiple pieces of code based on the review comments from the code review agent.

For details, see /fix-review-batch.

Agent

/fix-codeartscheck-batch

Batch fixes alert issues generated by CodeArts Check.

For details, see /fix-codeartscheck-batch.

Custom Slash Commands

CodeArts Agent allows you to create a Markdown file in the commands/ directory under a specified path to customize slash commands. After the command is loaded successfully, you can run it in CodeArts Agent by using /. Custom slash commands can be used only in agent mode.

Table 2 Categories of custom slash commands

Command Type

Command File Storage Path

Priority and Overriding Relationship

Description

Project

Root directory of the current project: ./codeartsdoer/commands/

The priority of a command depends on its loading sequence. Commands loaded later have higher priority and will override previously loaded commands with the same name.

Valid only for the current project.

User

Local %USERPROFILE%/.codeartsdoer/commands/

Valid for all projects of the current user.

User-level configurations apply globally to all projects. Project-level configurations take effect only to the current project. Both can be used simultaneously, but care must be taken regarding potential naming conflicts.

  1. Log in to CodeArts Agent IDE as instructed in Quick Start.
  2. Create a dedicated directory named commands to store related command files.

    In the explorer, right-click the .codeartsdoer directory of the corresponding project and choose New Folder. Enter commands in the displayed input box.

  3. Create a Markdown file to define commands.

    1. Right-click the created commands directory and choose New File from the shortcut menu to create a Markdown file.

      To ensure clear mapping between commands and functions, name Markdown files according to the following rules:

      • File name as the slash command

        The file name of a Markdown file should be identical to its corresponding slash command. For example, if the file creation function is executed via the /create-file command, the Markdown file corresponding to this function should be named create-file.md.

      • Single file for a single function

        Each Markdown file should correspond to only one function. Avoid mixing descriptions of multiple functions within a single file to keep the content concise.

      Figure 1 Creating create-file.md
    2. Define the file content and save it.

      In CodeArts Agent, you can use the $ARGUMENTS placeholder to capture all parameters passed to the command, or use positional parameters like $N to accurately access a specific parameter. For example, if you want to define a command that creates a file based on specific parameter content, the configuration example for create-file.md is as follows:

      ---
      description: Create a new file with the specified content
      ---
      Create a file named $1 in the directory $2,  
      with the following content:  
      $3

      In the preceding example, three location parameters are defined. $1 indicates the name of the file to be created, $2 indicates the file storage path, and $3 indicates the file content.

  4. After the file is saved, restart the IDE for the configuration to take effect.

    Restart CodeArts Agent IDE. After login, open the chat panel. Switch to the agent mode and enter a / in the input box. The custom project-level command /create-file is displayed in the shortcut menu.

    If the target command is not displayed, terminate the Bun processes in the task manager, and then re-login to CodeArts Agent IDE.

    Figure 2 Displaying the custom project-level command /create-file

  1. Create a Markdown file to define commands.

    Windows 11 (x64) is used as an example.
    1. Create a commands folder in the local %USERPROFILE%/.codeartsdoer/ directory (C:\Users\Your username\.codeartsdoer).
    2. Go to the commands directory and create a Markdown file named delete-file.md.
    3. Define the file content and save it.

      In CodeArts Agent, you can use the $ARGUMENTS placeholder to capture all parameters passed to the command, or use positional parameters like $N to accurately access a specific parameter. For example, if you want to define a command that deletes a file based on specific parameter content, the configuration example for delete-file.md is as follows:

      ---
      description: Delete an existing file
      ---
      Delete the file named $1 located in the directory $2.

      $1 indicates the name of the file to be deleted, and $2 indicates the path of the file.

  2. Restart CodeArts Agent IDE. After login, open the chat panel. Switch to the agent mode and enter a / in the input box. The custom user-level command /delete-file is displayed in the shortcut menu.

    If the target command is not displayed, terminate the Bun processes in the task manager, and then re-login to CodeArts Agent IDE.

Using Custom Commands

  1. Log in to CodeArts Agent IDE as instructed in the quick start.
  2. At the bottom of the input box on the chat panel, choose Agent to switch to the agent mode.
  3. In the input box, enter a / and choose the custom command /create-file from the shortcut menu.
  4. Enter the command and click .

    In the preceding example, create-file.md defines three location parameters: file name ($1), storage path ($2), and file content ($3). You need to pass specific values for these parameters when using the command.

    Figure 3 Specifying parameter values

    You only need to enter parameters here if they are defined in the Markdown file; separate multiple parameters with spaces. If the number of parameters entered exceeds the number defined in the file, the excess part will be merged into the content of the last parameter.

  5. After the command is executed, go to the specified directory (for example, D:\TestCode) and check whether the file and its content meet the expectation.

    Figure 4 File created

    In the specified directory, you can view the generated file sample.txt, whose content is "Hello, world!"