@@ -37,7 +37,9 @@ features:
37
37
best code.
38
38
- Related code. Based on recently file changes, AutoDev will call calculate similar chunk to generate best code.
39
39
- AI assistant. AutoDev will help you find bug, explain code, trace exception, generate commits, and more.
40
- - Custom prompt. You can customize your prompt in ` Settings ` -> ` Tools ` -> ` AutoDev `
40
+ - Custom prompt.
41
+ - Custom spec
42
+ - Custom intention action.
41
43
- Custom LLM Server. You can customize your LLM Server in ` Settings ` -> ` Tools ` -> ` AutoDev `
42
44
- Auto Testing. create unit test intention, auto run unit test and try to fix test.
43
45
@@ -55,40 +57,44 @@ You can:
55
57
56
58
![ Code completion] ( https://unitmesh.cc/auto-dev/completion-mode.png )
57
59
58
- ### Custom prompt
60
+ ### Custom Action
61
+
62
+ ![ Code completion] ( https://unitmesh.cc/auto-dev/custom-action.png )
63
+
64
+ You can customize your prompt in ` Settings ` -> ` Tools ` -> ` AutoDev `
59
65
60
66
``` json
61
67
{
62
- "auto_complete" : {
63
- "instruction" : " " ,
64
- "input" : " "
65
- },
66
- "auto_comment" : {
67
- "instruction" : " " ,
68
- "input" : " "
69
- },
70
- "code_review" : {
71
- "instruction" : " " ,
72
- "input" : " "
73
- },
74
- "refactor" : {
75
- "instruction" : " " ,
76
- "input" : " "
77
- },
78
- "write_test" : {
79
- "instruction" : " " ,
80
- "input" : " "
81
- },
82
68
"spec" : {
83
69
"controller" : " - 在 Controller 中使用 BeanUtils.copyProperties 进行 DTO 转换 Entity\n - 禁止使用 Autowired\n -使用 Swagger Annotation 表明 API 含义\n -Controller 方法应该捕获并处理业务异常,不应该抛出系统异常。" ,
84
70
"service" : " - Service 层应该使用构造函数注入或者 setter 注入,不要使用 @Autowired 注解注入。" ,
85
71
"entity" : " - Entity 类应该使用 JPA 注解进行数据库映射\n - 实体类名应该与对应的数据库表名相同。实体类应该使用注解标记主键和表名,例如:@Id、@GeneratedValue、@Table 等。" ,
86
72
"repository" : " - Repository 接口应该继承 JpaRepository 接口,以获得基本的 CRUD 操作" ,
87
73
"ddl" : " - 字段应该使用 NOT NULL 约束,确保数据的完整性"
88
- }
74
+ },
75
+ "prompts" : [
76
+ {
77
+ "title" : " Code complete" ,
78
+ "autoInvoke" : true ,
79
+ "matchRegex" : " .*" ,
80
+ "template" : " Code complete:\n ${SPEC_controller}\n\n ${SELECTION}"
81
+ },
82
+ {
83
+ "title" : " Translate to Kotlin" ,
84
+ "autoInvoke" : false ,
85
+ "matchRegex" : " .*" ,
86
+ "template" : " Translate follow code to Kotlin \n ${SELECTION}"
87
+ }
88
+ ]
89
89
}
90
90
```
91
91
92
+ - title: the action name
93
+ - autoInvoke: auto invoke this action when you perform action
94
+ - matchRegex: TODO()
95
+ - template: the template of the action, you can use ` ${SPEC_controller} ` to insert spec, ` ${SELECTION} ` to insert
96
+ selected code.
97
+
92
98
### AutoCRUD mode
93
99
94
100
1 . add ` // devti://story/github/1 ` comments in your code.
0 commit comments