File tree Expand file tree Collapse file tree 4 files changed +10
-6
lines changed
kotlin/cc/unitmesh/devti/sketch Expand file tree Collapse file tree 4 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -73,11 +73,9 @@ data class SketchRunContext(
73
73
val projectRule = ProjectRule (project)
74
74
val rules = projectRule.getAllRules().map { it.nameWithoutExtension }
75
75
val rule = if (rules.isNotEmpty()) {
76
- val allRules = " - User custom coding rules file:" + rules.joinToString(" ," ) { it }
76
+ val allRules = " - User custom coding rules file names :" + rules.joinToString(" ," ) { it }
77
77
val string = if (projectRule.hasRule(" README" )) {
78
- projectRule.getRuleContent(" README" )?.let {
79
- " <rule> $it </rule>"
80
- } ? : " "
78
+ projectRule.getRuleContent(" README" ) ? : " "
81
79
} else " "
82
80
83
81
if (string.isNotEmpty()) {
Original file line number Diff line number Diff line change @@ -22,7 +22,8 @@ class ProjectRule(private val project: Project) {
22
22
val file = project.lookupFile(fullname)
23
23
24
24
if (file != null ) {
25
- return file.readText()
25
+ val content = file.readText()
26
+ return " <user-rule>\n $content \n </user-rule>"
26
27
}
27
28
28
29
return file
Original file line number Diff line number Diff line change @@ -224,6 +224,10 @@ It is EXTREMELY important that your generated code can be run immediately by the
224
224
- If you've suggested a reasonable code_edit that wasn't followed by the apply model, you should try reapplying the edit.
225
225
</making_code_changes>
226
226
227
+ <rule>
228
+ 用户可以通过 user-rule 来自定义编程规范,以生成更符合自己需要的代码。如果用户定制了规则,您需要在每次调用工具之前检查这些规则,并在代码中应用它们。
229
+ </rule>
230
+
227
231
<plan>
228
232
It is crucial to proceed step-by-step, waiting for the user's message after each tool use before moving forward with the task.
229
233
This approach allows you to:
Original file line number Diff line number Diff line change @@ -13,9 +13,10 @@ structure and configuration. The project rule is defined under `prompts/rules` d
13
13
For example, the project rule file is defined as follows:
14
14
15
15
``` bash
16
- promtps /rules/
16
+ prompts /rules/
17
17
├── service.md
18
18
├── controller.md
19
+ ├── repository.md
19
20
├── rpc.md
20
21
└── README.md # will always load this file default !!
21
22
```
You can’t perform that action at this time.
0 commit comments