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
Copy file name to clipboardExpand all lines: src/core/prompts/__tests__/__snapshots__/system.test.ts.snap
+41-41Lines changed: 41 additions & 41 deletions
Original file line number
Diff line number
Diff line change
@@ -2543,43 +2543,6 @@ Example: Requesting to list all top level source code definitions in the current
2543
2543
<path>.</path>
2544
2544
</list_code_definition_names>
2545
2545
2546
-
## write_to_file
2547
-
Description: Request to write full content to a file at the specified path. If the file exists, it will be overwritten with the provided content. If the file doesn't exist, it will be created. This tool will automatically create any directories needed to write the file.
2548
-
Parameters:
2549
-
- path: (required) The path of the file to write to (relative to the current working directory /test/path)
2550
-
- content: (required) The content to write to the file. ALWAYS provide the COMPLETE intended content of the file, without any truncation or omissions. You MUST include ALL parts of the file, even if they haven't been modified. Do NOT include the line numbers in the content though, just the actual content of the file.
2551
-
- line_count: (required) The number of lines in the file. Make sure to compute this based on the actual content of the file, not the number of lines in the content you're providing.
2552
-
Usage:
2553
-
<write_to_file>
2554
-
<path>File path here</path>
2555
-
<content>
2556
-
Your file content here
2557
-
</content>
2558
-
<line_count>total number of lines in the file, including empty lines</line_count>
2559
-
</write_to_file>
2560
-
2561
-
Example: Requesting to write to frontend-config.json
2562
-
<write_to_file>
2563
-
<path>frontend-config.json</path>
2564
-
<content>
2565
-
{
2566
-
"apiEndpoint": "https://api.example.com",
2567
-
"theme": {
2568
-
"primaryColor": "#007bff",
2569
-
"secondaryColor": "#6c757d",
2570
-
"fontFamily": "Arial, sans-serif"
2571
-
},
2572
-
"features": {
2573
-
"darkMode": true,
2574
-
"notifications": true,
2575
-
"analytics": false
2576
-
},
2577
-
"version": "1.0.0"
2578
-
}
2579
-
</content>
2580
-
<line_count>14</line_count>
2581
-
</write_to_file>
2582
-
2583
2546
## apply_diff
2584
2547
Description: Request to replace existing code using a search and replace block.
2585
2548
This tool allows for precise, surgical replaces to files by specifying exactly what content to search for and what to replace it with.
@@ -2640,6 +2603,43 @@ Your search/replace content here
2640
2603
<end_line>5</end_line>
2641
2604
</apply_diff>
2642
2605
2606
+
## write_to_file
2607
+
Description: Request to write full content to a file at the specified path. If the file exists, it will be overwritten with the provided content. If the file doesn't exist, it will be created. This tool will automatically create any directories needed to write the file.
2608
+
Parameters:
2609
+
- path: (required) The path of the file to write to (relative to the current working directory /test/path)
2610
+
- content: (required) The content to write to the file. ALWAYS provide the COMPLETE intended content of the file, without any truncation or omissions. You MUST include ALL parts of the file, even if they haven't been modified. Do NOT include the line numbers in the content though, just the actual content of the file.
2611
+
- line_count: (required) The number of lines in the file. Make sure to compute this based on the actual content of the file, not the number of lines in the content you're providing.
2612
+
Usage:
2613
+
<write_to_file>
2614
+
<path>File path here</path>
2615
+
<content>
2616
+
Your file content here
2617
+
</content>
2618
+
<line_count>total number of lines in the file, including empty lines</line_count>
2619
+
</write_to_file>
2620
+
2621
+
Example: Requesting to write to frontend-config.json
2622
+
<write_to_file>
2623
+
<path>frontend-config.json</path>
2624
+
<content>
2625
+
{
2626
+
"apiEndpoint": "https://api.example.com",
2627
+
"theme": {
2628
+
"primaryColor": "#007bff",
2629
+
"secondaryColor": "#6c757d",
2630
+
"fontFamily": "Arial, sans-serif"
2631
+
},
2632
+
"features": {
2633
+
"darkMode": true,
2634
+
"notifications": true,
2635
+
"analytics": false
2636
+
},
2637
+
"version": "1.0.0"
2638
+
}
2639
+
</content>
2640
+
<line_count>14</line_count>
2641
+
</write_to_file>
2642
+
2643
2643
## execute_command
2644
2644
Description: Request to execute a CLI command on the system. Use this when you need to perform system operations or run specific commands to accomplish any step in the user's task. You must tailor your command to the user's system and provide a clear explanation of what the command does. For command chaining, use the appropriate chaining syntax for the user's shell. Prefer to execute complex CLI commands over creating executable scripts, as they are more flexible and easier to run. Commands will be executed in the current working directory: /test/path
2645
2645
Parameters:
@@ -2758,7 +2758,7 @@ CAPABILITIES
2758
2758
- When the user initially gives you a task, a recursive list of all filepaths in the current working directory ('/test/path') will be included in environment_details. This provides an overview of the project's file structure, offering key insights into the project from directory/file names (how developers conceptualize and organize their code) and file extensions (the language used). This can also guide decision-making on which files to explore further. If you need to further explore directories such as outside the current working directory, you can use the list_files tool. If you pass 'true' for the recursive parameter, it will list files recursively. Otherwise, it will list files at the top level, which is better suited for generic directories where you don't necessarily need the nested structure, like the Desktop.
2759
2759
- You can use search_files to perform regex searches across files in a specified directory, outputting context-rich results that include surrounding lines. This is particularly useful for understanding code patterns, finding specific implementations, or identifying areas that need refactoring.
2760
2760
- You can use the list_code_definition_names tool to get an overview of source code definitions for all files at the top level of a specified directory. This can be particularly useful when you need to understand the broader context and relationships between certain parts of the code. You may need to call this tool multiple times to understand various parts of the codebase related to the task.
2761
-
- For example, when asked to make edits or improvements you might analyze the file structure in the initial environment_details to get an overview of the project, then use list_code_definition_names to get further insight using source code definitions for files located in relevant directories, then read_file to examine the contents of relevant files, analyze the code and suggest improvements or make necessary edits, then use the write_to_file or apply_diff tool to apply the changes. If you refactored code that could affect other parts of the codebase, you could use search_files to ensure you update other files as needed.
2761
+
- For example, when asked to make edits or improvements you might analyze the file structure in the initial environment_details to get an overview of the project, then use list_code_definition_names to get further insight using source code definitions for files located in relevant directories, then read_file to examine the contents of relevant files, analyze the code and suggest improvements or make necessary edits, then use the apply_diff or write_to_file tool to apply the changes. If you refactored code that could affect other parts of the codebase, you could use search_files to ensure you update other files as needed.
2762
2762
- You can use the execute_command tool to run commands on the user's computer whenever you feel it can help accomplish the user's task. When you need to execute a CLI command, you must provide a clear explanation of what the command does. Prefer to execute complex CLI commands over creating executable scripts, since they are more flexible and easier to run. Interactive and long-running commands are allowed, since the commands are run in the user's VSCode terminal. The user may keep commands running in the background and you will be kept updated on their status along the way. Each command you execute is run in a new terminal instance.
2763
2763
2764
2764
====
@@ -2775,11 +2775,11 @@ RULES
2775
2775
- You cannot \`cd\` into a different directory to complete a task. You are stuck operating from '/test/path', so be sure to pass in the correct 'path' parameter when using tools that require a path.
2776
2776
- Do not use the ~ character or $HOME to refer to the home directory.
2777
2777
- Before using the execute_command tool, you must first think about the SYSTEM INFORMATION context provided to understand the user's environment and tailor your commands to ensure they are compatible with their system. You must also consider if the command you need to run should be executed in a specific directory outside of the current working directory '/test/path', and if so prepend with \`cd\`'ing into that directory && then executing the command (as one command since you are stuck operating from '/test/path'). For example, if you needed to run \`npm install\` in a project outside of '/test/path', you would need to prepend with a \`cd\` i.e. pseudocode for this would be \`cd (path to project) && (command, in this case npm install)\`.
2778
-
- When using the search_files tool, craft your regex patterns carefully to balance specificity and flexibility. Based on the user's task you may use it to find code patterns, TODO comments, function definitions, or any text-based information across the project. The results include context, so analyze the surrounding code to better understand the matches. Leverage the search_files tool in combination with other tools for more comprehensive analysis. For example, use it to find specific code patterns, then use read_file to examine the full context of interesting matches before using write_to_file to make informed changes.
2778
+
- When using the search_files tool, craft your regex patterns carefully to balance specificity and flexibility. Based on the user's task you may use it to find code patterns, TODO comments, function definitions, or any text-based information across the project. The results include context, so analyze the surrounding code to better understand the matches. Leverage the search_files tool in combination with other tools for more comprehensive analysis. For example, use it to find specific code patterns, then use read_file to examine the full context of interesting matches before using apply_diff or write_to_file to make informed changes.
2779
2779
- When creating a new project (such as an app, website, or any software project), organize all new files within a dedicated project directory unless the user specifies otherwise. Use appropriate file paths when writing files, as the write_to_file tool will automatically create any necessary directories. Structure the project logically, adhering to best practices for the specific type of project being created. Unless otherwise specified, new projects should be easily run without additional setup, for example most projects can be built in HTML, CSS, and JavaScript - which you can open in a browser.
2780
-
- For editing files, you have access to these tools: write_to_file (for creating new files or complete file rewrites), apply_diff (for replacing lines in existing files).
2781
-
- When using the write_to_file tool to modify a file, use the tool directly with the desired content. You do not need to display the content before using the tool. ALWAYS provide the COMPLETE file content in your response. This is NON-NEGOTIABLE. Partial updates or placeholders like '// rest of code unchanged' are STRICTLY FORBIDDEN. You MUST include ALL parts of the file, even if they haven't been modified. Failure to do so will result in incomplete or broken code, severely impacting the user's project.
2780
+
- For editing files, you have access to these tools: apply_diff (for replacing lines in existing files), write_to_file (for creating new files or complete file rewrites).
2782
2781
- You should always prefer using other editing tools over write_to_file when making changes to existing files since write_to_file is much slower and cannot handle large files.
2782
+
- When using the write_to_file tool to modify a file, use the tool directly with the desired content. You do not need to display the content before using the tool. ALWAYS provide the COMPLETE file content in your response. This is NON-NEGOTIABLE. Partial updates or placeholders like '// rest of code unchanged' are STRICTLY FORBIDDEN. You MUST include ALL parts of the file, even if they haven't been modified. Failure to do so will result in incomplete or broken code, severely impacting the user's project.
2783
2783
- Some modes have restrictions on which files they can edit. If you attempt to edit a restricted file, the operation will be rejected with a FileRestrictionError that will specify which file patterns are allowed for the current mode.
2784
2784
- Be sure to consider the type of project (e.g. Python, JavaScript, web application) when determining the appropriate structure and files to include. Also consider what files may be most relevant to accomplishing the task, for example looking at a project's manifest file would help you understand the project's dependencies, which you could incorporate into any code you write.
2785
2785
* For example, in architect mode trying to edit app.js would be rejected because architect mode can only edit files matching "\\.md$"
0 commit comments