You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(prompts): enhance clarity of prompt instructions
The changes improve explicit behavior requirements in prompt templates by:
- Adding instruction to handle line-numbered code snippets
- Expanding code review criteria to cover more quality aspects
- Clarifying exact line number requirements for code generation
- Adding more specific formatting and completeness requirements
- Improving explanation focus to cover non-obvious code aspects
The updates make the prompts more precise and help ensure more consistent
and higher quality AI responses across different usage scenarios.
Closes#760
Copy file name to clipboardExpand all lines: lua/CopilotChat/config/prompts.lua
+20-8Lines changed: 20 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,7 @@ The user is working on a %s machine. Please respond with system specific command
19
19
20
20
localCOPILOT_INSTRUCTIONS=[[
21
21
You are a code-focused AI programming assistant that specializes in practical software engineering solutions.
22
+
You will receive code snippets that include line number prefixes - use these to maintain correct position references but remove them when generating output.
22
23
]] ..base
23
24
24
25
localCOPILOT_EXPLAIN=[[
@@ -27,6 +28,9 @@ When explaining code:
27
28
- Balance high-level concepts with implementation details
28
29
- Highlight key programming principles and patterns
29
30
- Address any code diagnostics or warnings
31
+
- Focus on non-obvious parts rather than explaining basic syntax
32
+
- Use short, focused paragraphs
33
+
- Include performance implications where relevant
30
34
]] ..base
31
35
32
36
localCOPILOT_REVIEW=COPILOT_INSTRUCTIONS
@@ -39,14 +43,18 @@ Check for:
39
43
- Unclear or non-conventional naming
40
44
- Comment quality (missing or unnecessary)
41
45
- Complex expressions needing simplification
42
-
- Deep nesting
43
-
- Inconsistent style
44
-
- Code duplication
46
+
- Deep nesting or complex control flow
47
+
- Inconsistent style or formatting
48
+
- Code duplication or redundancy
49
+
- Potential performance issues
50
+
- Error handling gaps
51
+
- Security concerns
52
+
- Breaking of SOLID principles
45
53
46
54
Multiple issues on one line should be separated by semicolons.
47
55
End with: "**`To clear buffer highlights, please ask a different question.`**"
48
56
49
-
If no issues found, confirm the code is well-written.
57
+
If no issues found, confirm the code is well-written and explain why.
50
58
]]
51
59
52
60
localCOPILOT_GENERATE=COPILOT_INSTRUCTIONS
@@ -57,14 +65,18 @@ Your task is to modify the provided code according to the user's request. Follow
57
65
58
66
2. IMPORTANT: Every code block MUST have a header with this exact format:
0 commit comments