File tree Expand file tree Collapse file tree 4 files changed +49
-32
lines changed
core/src/main/kotlin/cc/unitmesh/devti/sketch/rule Expand file tree Collapse file tree 4 files changed +49
-32
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,13 @@ class ProjectRule(private val project: Project) {
25
25
return " <user-rule>\n $content \n </user-rule>"
26
26
}
27
27
28
+ // / try .devin file
29
+ val devinFile = project.lookupFile(" $RULE_PATH /$filename .devin" )
30
+ if (devinFile != null ) {
31
+ val content = devinFile.readText()
32
+ return " <user-rule>\n $content \n </user-rule>"
33
+ }
34
+
28
35
return file
29
36
}
30
37
@@ -39,6 +46,6 @@ class ProjectRule(private val project: Project) {
39
46
*/
40
47
fun getAllRules (): List <VirtualFile > {
41
48
val ruleDir = project.guessProjectDir()?.findFileByRelativePath(RULE_PATH ) ? : return emptyList()
42
- return ruleDir.children.filter { it.extension == " md" }
49
+ return ruleDir.children.filter { it.extension == " md" || it.extension == " devin " }
43
50
}
44
51
}
Original file line number Diff line number Diff line change @@ -9,12 +9,14 @@ nav_order: 1
9
9
10
10
## Custom AI Composer
11
11
12
- follow [ Prompt Override] ( /customize/prompt-override ) , the AI Composer can be customized. in the ` prompt/code ` folder,
13
- you can create a file named ` sketch.vm ` to override the composer prompt.
12
+ follow [ Prompt Override] ( /customize/prompt-override ) , the AI Composer can be customized. in the ` prompt/code ` folder,
13
+ you can create a file named [ ` sketch.vm ` ] ( https://github.com/unit-mesh/auto-dev/blob/master/core/src/main/resources/genius/zh/code/sketch.vm )
14
+ to override the composer prompt.
14
15
15
16
## Use RipgrepSearch
16
17
17
- Since we don't have a full-text search feature, you can use ` RipgrepSearch ` to search for files in the project. You can install it via Homebrew:
18
+ Since we don't have a full-text search feature, you can use ` RipgrepSearch ` to search for files in the project. You can
19
+ install it via Homebrew:
18
20
19
21
``` bash
20
22
brew install ripgrep
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ ---
2
+ layout : default
3
+ title : Project Rule
4
+ parent : AutoDev Sketch/Composer
5
+ nav_order : 3
6
+ ---
7
+
8
+ # Project Rule
9
+
10
+ Notes: We prefer to use [ prompts override] ( https://ide.unitmesh.cc/customize/prompt-override.html ) to customize the
11
+ prompt, but if you want to use the project rule, you can use the following method to customize the prompt.
12
+
13
+ Since @2 .0.2 version, AutoDev supports project rule. The project rule is a set of rules that are used to validate the
14
+ project structure and configuration. The project rule is defined under ` prompts/rules ` directory.
15
+
16
+ ## Project Rule Example
17
+
18
+ The project rule is a Markdown file that contains the following fields:
19
+
20
+ For example, the project rule file is defined as follows:
21
+
22
+ ``` bash
23
+ prompts/rules/
24
+ ├── service.md
25
+ ├── controller.md
26
+ ├── repository.md
27
+ ├── rpc.md
28
+ └── README.md # will always load this file default !!
29
+ ```
30
+
31
+ Then the AutoDev will auto handle the project rule by RuleInsCommand, you can use the following command to check the project
32
+ rule:
33
+
34
+ ``` devin
35
+ /rule:service
36
+ ```
You can’t perform that action at this time.
0 commit comments