Standard Workflow and Slash Command Practices in SDD
The Spec-Driven Development (SDD) mode of CodeArts Agent is a specification-centric software development method. After developers provide requirement descriptions, the agent generates specifications, design solutions, and task plans in sequence. This helps developers and the agent reach a consensus on the task objectives and implementation solutions before coding, ultimately producing high-quality code.
The SDD mode of CodeArts Agent uses a four-phase progressive process, as shown in Figure 1.
Based on this, CodeArts Agent provides two usage modes:
- Standard SDD workflow: After the agent's dialog switches to the spec-driven mode, the agent takes the lead in the process and executes the tasks in the sequence shown in Figure 1. After the outputs of each phase are manually confirmed, the next phase is executed.
- Slash command mode: Developers can use slash commands shown in Table 1 to skip or repeat any phase.
Table 1 SDD slash commands Command
Function
Input
Output
/sdd-new
Creates requirement specifications.
Requirement description
spec.md
/sdd-design
Creates a technical design document.
Name of the folder where spec.md is located
design.md
/sdd-tasks
Creates coding tasks.
Name of the folder where spec.md and design.md are located
tasks.md
/sdd-apply
Executes coding tasks.
Name of the folder where tasks.md is located
Code file
This section uses the example of developing user registration and login functions for a web application to compare the differences and application scenarios of the two modes.
Preparations
Before using CodeArts Agent, create a project to store various files in the project. After the project is created, enable the auto approval function. In this way, AI will automatically perform related operations without manual intervention.
- Log in to CodeArts Agent by referring to Quick Start.
- Create a project for storing files.
- On the top menu bar of the IDE, choose File > New > Create Project to go to the page for creating a project.
- Select a path for storing the project, enter the project name (for example, SDD_Demo), and click OK.
The project name must start with a letter, and can contain a maximum of 64 characters. Letters, digits, hyphens (-), and underscores (_) are allowed.
After the project is created, you can view the created SDD_DEMO project under EXPLORER.
- (Optional) Select the agent running mode and authorize automatic operations.
- Click
in the upper right corner of CodeArts Agent IDE to go to the Settings page. - Choose Chats > Agents > Terminal Command Running Mode, select the running policy for the agent to execute terminal commands. This section uses the default running policy (Running in Sandbox).
- Choose Chats > Auto-approve, and click
to enable the required items. After authorization, tasks for generating complex project-level code are executed automatically. Without authorization, some operations will need your manual confirmation when you code with CodeArts Agent.
Enabling auto approval can lead to operational risks. Assess these risks carefully first and only enable this feature in a secure and trustworthy environment.
Table 2 Parameters for auto approval Parameter
Description
Example
Edit
Allows the agent to call tools like edit, write, and deleteFile to edit files on your computer.
Enabled
Browser Access
Allows the agent to access websites in the browser.
Enabled
Web Crawler
Allows the agent to access and capture specified web page content.
Enabled
- Exit the current page to complete the authorization.
- Click
Standard SDD Workflow
The standard SDD workflow is a built-in spec-driven mode of CodeArts Agent. After you select spec-driven on the chat panel and enter the requirement description, the agent will execute the preset workflow step by step. First, it generates the requirement specification document spec.md. After you confirm that the document is correct, the agent automatically creates a solution and generates the design.md document. Then, it generates the task list tasks.md and finally executes the coding. The entire process is driven by AI, and you only need to confirm the key nodes (accept or reject the generated documents).
- At the bottom of the input box on the chat panel, choose Built-in > Agent to switch to the agent mode. The selected model is displayed on the right. You can select a model as required from the drop-down list.
If the chat panel of CodeArts Agent is not displayed, click
(Expand AI Sidebar) in the upper right corner of the top menu bar to open it. - On the chat panel, click Spec-driven.
- In the input box on the CodeArts Agent chat panel, enter the following prompts and click
: Develop a user login API that supports identity authentication using a username and password. After successful authentication, return a JWT token. If the login fails, record the number of failed attempts. If the login fails for five consecutive times, lock the account for 15 minutes.
- View the generated requirement specification document spec.md. Provide modification suggestions to enable CodeArts Agent to modify spec.md accordingly.
Resolve the following issues: After a successful login, return the token and basic user information (nickname and role). The lockout duration of 15 minutes is too long. Change it to 5 minutes. Add rate limiting to the API: maximum 10 requests per minute per IP address. Do not use the response code 200. Use the service code 20000 to indicate success.
- View the modified spec.md document again. After confirming that the requirements are correctly understood, click Start Create Solution.
- View the generated design.md document. After confirming that the technical solution is reasonable, click Start Plan Coding Tasks.
- View the generated tasks.md document. After confirming that the task breakdown is complete, click Start Execute Tasks.
- Wait until the task is complete. After it is complete, the complete code is generated, and three process documents are generated: spec.md, design.md, and tasks.md.
Slash Command Mode
CodeArts Agent encapsulates underlying skills to define four standard slash commands. Developers can execute commands as needed based on the existing process deliverables, without the need to re-execute the entire process. For example, if you find that the encryption library is outdated while executing the /sdd-apply command, manually modify the design.md document, and then run the /sdd-tasks and /sdd-apply commands in sequence.
- At the bottom of the input box on the chat panel, choose Built-in > Agent to switch to the agent mode. The selected model is displayed on the right. You can select a model as required from the drop-down list.
If the chat panel of CodeArts Agent is not displayed, click
(Expand AI Sidebar) in the upper right corner of the top menu bar to open it. - On the chat panel, click Vibe Coding.
- Execute commands as needed to complete SDD.
- /sdd-new: creates requirement specifications.
- Enter a slash (/) in the dialog box and choose /sdd-new from the displayed menu. Enter the following requirement description to generate a spec.md document in a unified format:
Help me develop a user registration and login module, including mobile number/email address registration, JWT-based login authentication, verification code sending, and password resetting.
- Go to <project_root>/.codeartsdoer/specs/<output_folder> to obtain the generated spec.md. Figure 2 Directory of spec.md
- Review the current requirement specification document. You can modify the spec.md document manually or using the agent until the requirement specification document meets the service expectations.
- Enter a slash (/) in the dialog box and choose /sdd-new from the displayed menu. Enter the following requirement description to generate a spec.md document in a unified format:
- /sdd-design: creates a technical design document.
If you already have a spec.md document, you can directly execute /sdd-design and enter the output folder name (for example, user_auth) to generate a design.md document that contains the architecture and API description.
- /sdd-tasks: creates a coding task list.
Enter a slash (/) in the dialog box, choose /sdd-tasks from the displayed menu, and enter the output folder name (for example, user_auth) to generate an executable task list tasks.md.
- /sdd-apply: executes coding tasks.
Enter a slash (/) in the dialog box, choose /sdd-apply from the displayed menu, and enter the output folder name (for example, user_auth). CodeArts Agent executes coding tasks one by one based on the tasks.md document.
- /sdd-new: creates requirement specifications.
Scenario-based Offerings
In actual development, the standard SDD workflow and slash command modes are not mutually exclusive. Instead, they can be flexibly switched based on different project phases and team roles. In the early stage of a new project, use the standard workflow to quickly set up the framework and establish a complete SDD documentation system. In the mid-term iteration, switch to the slash command mode and use the four commands for incremental development and partial refactoring.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot
