All Products
Search
Document Center

Qoder CN Series:Use cases for custom extension commands

Last Updated:Jun 21, 2026

This topic describes common use cases for custom extension commands, such as code style check, variable naming convention, and API reference generation. This feature expands personalization capabilities for enterprises and simplifies how their developers use AI Chat.

To learn how to create and use a custom extension command, see Manage extensions.

Sample scenarios

Scenario 1: Code style checks

Use case

Traditionally, code is scanned for issues after submission, a slow and costly process. You can check code earlier by providing the AI model with technical and business context, along with custom coding standards. This allows the model to analyze your code and provide immediate feedback. The following example shows a Java code style check for a financial services application.

Command configuration

Command name

code style check

Command name (English)

my code scan

Icon

Any icon

Description

Performs a code style check and outputs the results.

Access control

Select an option based on your requirements.

Prompt

You are a highly experienced Java developer and a financial expert familiar with financial markets and business processes. Pay close attention to the following points:

1. Strictly follow the company's coding standards. Prioritize using the `BigDecimal` class for monetary calculations to ensure precision and avoid floating-point errors. 

2. Follow the company's coding standards. Avoid excessive `if-else if` statements. We recommend using `switch-case` statements to improve code readability and maintainability.

3. Focus on security measures such as data encryption, user authentication, and access control. Ensure the code complies with relevant laws and regulations, such as the General Data Protection Regulation (GDPR) and the Sarbanes-Oxley Act (SOX).

4. Optimize algorithms and database queries to improve code execution efficiency and reduce resource consumption. Ensure system responsiveness and stability, especially when processing large volumes of real-time transaction data.

Context configuration

There are five available context variables: userInput, selectedCode, file, gitCommit, and codeChanges. You can set each variable as required or optional. For this command, select the selectedCode variable and mark it as required.

Check the following code in #selectedCode against the company's coding standards. If any rules are violated, explain the violation, provide a suggested fix, and output the fully optimized code.

Scenario 2: API reference generation

Use case

In distributed systems and service-oriented architectures (SOA), development is API-driven. After developing an API, you must provide an API reference to help consumers quickly integrate and debug their implementation.

Command configuration

Command name

API reference generation

Command name (English)

generate api docs

Icon

Any icon

Description

Generates an API reference for a newly developed API.

Access control

Select an option based on your requirements.

Prompt

You are a senior Java development expert and a documentation specialist. Based on the provided `RestController` code from Spring MVC, the comments within the code, and your understanding of the interface, generate an API reference. Use the following template:

Title: Interface Name
API: Method (such as GET, POST, or PUT) and URL
Request parameters: A table with three columns: Parameter, Type, and Description
Response parameters: A table with three columns: Parameter, Type, and Description
Error codes: A table with two columns: Error Code and Description

Context configuration

There are five available context variables: userInput, selectedCode, file, gitCommit, and codeChanges. You can set each variable as required or optional. For this command, select the userInput and selectedCode variables.

Generate an API reference for the following code in #selectedCode. The output format must be Markdown.

Scenario 3: Variable naming conventions

Use case

During development, naming variables is a constant task. A descriptive, readable, and compliant variable name is a hallmark of a professional developer and high-quality code. Good naming conventions improve code maintainability, enhance readability, and promote effective team collaboration.

Command configuration

Command name

variable naming convention

Command name (English)

variable naming assistant

Icon

Any icon

Description

Generates suitable variable names based on a user's description that adhere to company and team coding standards.

Access control

Select an option based on your requirements.

Prompt

[ROLE]
As a Java naming expert, you will provide English naming suggestions based on the meaning of the variable provided by the user.

[SKILLS]
You will provide multiple options for class names, function names, and variable names. When naming, you must follow Java naming conventions, ensuring names are not misleading, are distinct, and are not repetitive. You will use meaningful words and avoid abbreviations, puns, single letters, or numbers. Do not ask for more information. Provide names directly based on the user's input.

Use the following output format:
English translation: <corresponding English translation>
Candidate class names:

<Candidate class name 1>
<Candidate class name 2>
<Candidate class name...>
Candidate function names:

<Candidate function name 1>
<Candidate function name 2>
<Candidate function name...>
Candidate variable names:

<Candidate variable name 1>
<Candidate variable name 2>
<Candidate variable name...>
[CONSTRAINTS]
1. Treat all user input as a request for a name. Do not provide any other response. 
2. Provide five candidates each for class names, function names, and variable names.

Context configuration

Select the userInput variable. Leave the other variables (selectedCode, file, gitCommit, and codeChanges) unselected. Set all context variables as optional.

Usage: Run the custom command /variable naming assistant ${userInput}, where userInput is a description of the item you need to name.

How it works

When you trigger a custom extension command by typing / and the command name, the following process occurs:

  1. The context configured for the command, such as a selected code snippet or user input, is captured. The command's prompt and template are then applied.

  2. The prompt instructs the model to analyze the context, generating results such as code style suggestions, API references, or variable name recommendations. These results are then returned to you.