Skip to content

Commit 4165d52

Browse files
author
vijay upadya
committed
Simplify prompt text and update snap
1 parent 7168dcd commit 4165d52

File tree

73 files changed

+973
-853
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+973
-853
lines changed

src/extension/prompts/node/agent/anthropicPrompts.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,7 @@ class DefaultAnthropicAgentPrompt extends PromptElement<DefaultAgentPromptProps>
9999
{this.props.availableTools && <McpToolInstructions tools={this.props.availableTools} />}
100100
<NotebookInstructions {...this.props} />
101101
<Tag name='outputFormatting'>
102-
Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and code locations, follow `FileLinkificationInstructions` (markdown links with line anchors; never backticks).<br />
103-
<Tag name='example'>
104-
See FileLinkificationInstructions for file path link and line anchor rules and examples.
105-
</Tag>
102+
Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section<br />
106103
<FileLinkificationInstructions />
107104
<MathIntegrationRules />
108105
</Tag>

src/extension/prompts/node/agent/fileLinkificationInstructions.tsx

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,27 @@ import { Tag } from '../base/tag';
88

99
export class FileLinkificationInstructions extends PromptElement<{}> {
1010
render() {
11-
return <Tag name='file_linkification'>
12-
ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer.<br />
13-
Format examples:<br />
11+
return <Tag name='fileLinkification'>
12+
ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root.<br />
13+
<br />
14+
**Inline references:** Use the file path as link text within sentences:<br />
1415
- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line)<br />
15-
- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.`<br />
16+
- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range)<br />
1617
- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file)<br />
17-
- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses)<br />
18-
When you need a bullet list of references with line numbers, you can use descriptive text:<br />
19-
- [Await chat view](path/to/chatQuick.ts#L142)<br />
20-
- [Show widget](path/to/chatQuick.ts#L321)<br />
18+
<br />
19+
**Bullet lists:** Explains what each reference is, so readers understand the context without clicking:<br />
20+
- [Await chat view](path/to/file.ts#L142)<br />
21+
- [Show widget](path/to/file.ts#L321)<br />
22+
Don't just list bare file paths like `file.ts#L142`<br />
23+
<br />
2124
NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).`<br />
25+
<br />
2226
Critical rules:<br />
23-
- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`.<br />
2427
- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not.<br />
2528
- Path format: Strip drive letters and workspace parent folders - use only path after workspace root<br />
2629
- Transform `c:\Repos\workspace\src\file.ts` → `[src/file.ts](src/file.ts)`<br />
2730
- Always use forward slashes `/`, never backslashes `\`<br />
28-
- Do not use URIs like file://, vscode://, or https://.<br />
31+
- Do not use URIs like file://, vscode:// for file paths.<br />
2932
- Percent-encode spaces in target only: `[My File.md](My%20File.md)`<br />
3033
- Each file reference needs complete path (don't abbreviate repeated files)<br />
3134
- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges<br />

src/extension/prompts/node/agent/geminiPrompts.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,7 @@ export class DefaultGeminiAgentPrompt extends PromptElement<DefaultAgentPromptPr
102102
{this.props.availableTools && <McpToolInstructions tools={this.props.availableTools} />}
103103
<NotebookInstructions {...this.props} />
104104
<Tag name='outputFormatting'>
105-
Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and code locations, do NOT use backticks — rely on markdown links with line anchors per `FileLinkificationInstructions` below.<br />
106-
<Tag name='example'>
107-
Identifiers: `Person`, `calculateTotal`, `AppConfig`.<br />
108-
File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below.
109-
</Tag>
105+
Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section<br />
110106
<FileLinkificationInstructions />
111107
<MathIntegrationRules />
112108
</Tag>

src/extension/prompts/node/agent/openai/defaultOpenAIPrompt.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export class DefaultOpenAIAgentPrompt extends PromptElement<DefaultAgentPromptPr
103103
Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths or specific code locations, do NOT use backticks—convert them to markdown links with line anchors; file path and line anchor link rules are defined in `FileLinkificationInstructions` below. Avoid duplicating those examples here.<br />
104104
<Tag name='example'>
105105
Identifiers only: `calculateTotal`, `Person`, `AppConfig`.<br />
106-
File path link examples live in FileLinkificationInstructions.<br />
106+
File path link examples live in fileLinkification section below.<br />
107107
</Tag>
108108
<MathIntegrationRules />
109109
</Tag>

src/extension/prompts/node/agent/openai/gpt51CodexPrompt.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class Gpt51CodexPrompt extends PromptElement<DefaultAgentPromptProps> {
7171
- Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help.<br />
7272
- Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent.<br />
7373
- Monospace: backticks for commands, env vars, and code identifiers; never combine with **.<br />
74-
- File path + line anchor link rules are defined in `FileLinkificationInstructions` below.<br />
74+
- File path and line number formatting rules are defined in the fileLinkification section below.<br />
7575
- Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible.<br />
7676
- Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task.<br />
7777
- Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording.<br />

src/extension/prompts/node/agent/openai/gpt51Prompt.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ class Gpt51Prompt extends PromptElement<DefaultAgentPromptProps> {
223223
- Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``).<br />
224224
- Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command.<br />
225225
- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`).<br />
226-
- File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below.<br />
226+
- File path and line number formatting rules are defined in the fileLinkification section below.<br />
227227
<br />
228228
**Structure**<br />
229229
<br />

src/extension/prompts/node/agent/openai/gpt5CodexPrompt.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class CodexStyleGpt5CodexPrompt extends PromptElement<DefaultAgentPromptProps> {
7676
- Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording.<br />
7777
- Don'ts: no nested bullets/hierarchies; no ANSI codes; don't cram unrelated keywords; keep keyword lists short—wrap/reformat if long; avoid naming formatting styles in answers.<br />
7878
- Adaptation: code explanations → precise, structured with code refs; simple tasks → lead with outcome; big changes → logical walkthrough + rationale + next actions; casual one-offs → plain sentences, no headers/bullets.<br />
79-
- File path and line anchor link rules are defined in `FileLinkificationInstructions` below (do not duplicate examples).<br />
79+
- File path and line anchor link rules are defined in fileLinkification section below.<br />
8080
<FileLinkificationInstructions />
8181
</InstructionMessage>;
8282
}

src/extension/prompts/node/agent/openai/gpt5Prompt.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ class DefaultGpt5AgentPrompt extends PromptElement<DefaultAgentPromptProps> {
187187
- Wrap all commands, env vars, and code identifiers in backticks (`` `...` ``).<br />
188188
- Apply to inline examples and to bullet keywords if the keyword itself is a literal file/command.<br />
189189
- Never mix monospace and bold markers; choose one based on whether it's a keyword (`**`).<br />
190-
- File path and line anchor link rules are defined in `FileLinkificationInstructions` below.<br />
190+
- File path and line number formatting rules are defined in the fileLinkification section below.<br />
191191
<br />
192192
Structure:<br />
193193
- Place related bullets together; don't mix unrelated concepts in the same section.<br />

src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-claude-sonnet-4.5.spec.snap

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,30 +78,33 @@ Use proper Markdown formatting. When referring to symbols (classes, methods, var
7878
<example>
7979
File path and line anchor formatting rules are defined in `FileLinkificationInstructions` below.
8080
</example>
81-
<file_linkification>
82-
ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer.
83-
Format examples:
81+
<fileLinkification>
82+
ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root.
83+
84+
**Inline references:** Use the file path as link text within sentences:
8485
- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line)
85-
- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.`
86+
- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range)
8687
- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file)
87-
- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses)
88-
When you need a bullet list of references with line numbers, you can use descriptive text:
89-
- [Await chat view](path/to/chatQuick.ts#L142)
90-
- [Show widget](path/to/chatQuick.ts#L321)
88+
89+
**Bullet lists:** Explains what each reference is, so readers understand the context without clicking:
90+
- [Await chat view](path/to/file.ts#L142)
91+
- [Show widget](path/to/file.ts#L321)
92+
Don't just list bare file paths like `file.ts#L142`
93+
9194
NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).`
95+
9296
Critical rules:
93-
- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`.
9497
- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not.
9598
- Path format: Strip drive letters and workspace parent folders - use only path after workspace root
9699
- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)`
97100
- Always use forward slashes `/`, never backslashes `/`
98-
- Do not use URIs like file://, vscode://, or https://.
101+
- Do not use URIs like file://, vscode:// for file paths.
99102
- Percent-encode spaces in target only: `[My File.md](My%20File.md)`
100103
- Each file reference needs complete path (don't abbreviate repeated files)
101104
- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges
102105
- Don't wrap links in backticks; only cite existing paths from context
103106

104-
</file_linkification>
107+
</fileLinkification>
105108

106109
</outputFormatting>
107110

src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-all_non_edit_tools-gemini-2.0-flash.spec.snap

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,35 +43,34 @@ Important Reminder: Avoid referencing Notebook Cell Ids in user messages. Use ce
4343
Important Reminder: Markdown cells cannot be executed
4444
</notebookInstructions>
4545
<outputFormatting>
46-
Use proper Markdown formatting. Backtick code identifiers (classes, functions, variables, commands). For file paths and code locations, do NOT use backticks — rely on markdown links with line anchors per `FileLinkificationInstructions` below.
47-
<example>
48-
Identifiers: `Person`, `calculateTotal`, `AppConfig`.
49-
File path and line anchor formatting rules and examples are defined in `FileLinkificationInstructions` below.
50-
</example>
51-
<file_linkification>
52-
ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations. Use links inside normal sentences, not as the entire answer.
53-
Format examples:
46+
Use proper Markdown formatting. When referring to symbols (classes, methods, variables) in user's workspace wrap in backticks. For file paths and line number rules, see fileLinkification section
47+
<fileLinkification>
48+
ALWAYS convert file paths to markdown links with 1-based line numbers whenever you cite specific code locations in the workspace. Paths should be relative to workspace root.
49+
50+
**Inline references:** Use the file path as link text within sentences:
5451
- `The handler lives in [path/to/file.ts](path/to/file.ts#L10).` (single line)
55-
- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.`
52+
- `See [path/to/file.ts](path/to/file.ts#L10-L12) for the range.` (line range)
5653
- `Configuration is defined in [path/to/file.ts](path/to/file.ts).` (whole file)
57-
- `The widget renderer attaches anchors ([src/renderer.ts](src/renderer.ts#L42-L48)).` (in parentheses)
58-
When you need a bullet list of references with line numbers, you can use descriptive text:
59-
- [Await chat view](path/to/chatQuick.ts#L142)
60-
- [Show widget](path/to/chatQuick.ts#L321)
54+
55+
**Bullet lists:** Explains what each reference is, so readers understand the context without clicking:
56+
- [Await chat view](path/to/file.ts#L142)
57+
- [Show widget](path/to/file.ts#L321)
58+
Don't just list bare file paths like `file.ts#L142`
59+
6160
NEVER cite file paths as plain text when referring to specific locations. For example, instead of saying `The function is in exampleScript.ts at line 25.`, say `The function is in [exampleScript.ts](exampleScript.ts#L25).`
61+
6262
Critical rules:
63-
- Link text must be the exact file path (no backticks, no `#L` in the visible text, no extra wording). Keep the `#L` anchor in the **link target**, e.g. `[src/file.ts](src/file.ts#L25)`.
6463
- Always include both brackets **and** parentheses. `[src/file.ts](src/file.ts#L25)` is valid; `[src/file.ts#L25]` is not.
6564
- Path format: Strip drive letters and workspace parent folders - use only path after workspace root
6665
- Transform `c:/Repos/workspace/src/file.ts` → `[src/file.ts](src/file.ts)`
6766
- Always use forward slashes `/`, never backslashes `/`
68-
- Do not use URIs like file://, vscode://, or https://.
67+
- Do not use URIs like file://, vscode:// for file paths.
6968
- Percent-encode spaces in target only: `[My File.md](My%20File.md)`
7069
- Each file reference needs complete path (don't abbreviate repeated files)
7170
- Integrate line numbers into anchor: `#L10` or `#L10-L12` for ranges
7271
- Don't wrap links in backticks; only cite existing paths from context
7372

74-
</file_linkification>
73+
</fileLinkification>
7574

7675
</outputFormatting>
7776

0 commit comments

Comments
 (0)