Unverified 提交 be7b6977 authored 作者: Will Chen's avatar Will Chen 提交者: GitHub

Improve local agent prompt (#2166)

<!-- CURSOR_SUMMARY --> > [!NOTE] > Improves the local agent system prompt for safer, more consistent edits. > > - Adds a structured `development_workflow` (Understand → Plan → Implement → Verify → Finalize) outlining use of `grep`/`code_search`, `read_file`, `update_todos`, `run_type_checks`, and `set_chat_summary` > - Refines `tool_calling_best_practices` to prefer `edit_file` over `write_file`, formats tool names with backticks, and reiterates focused, minimal, and error-tolerant edits > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit a649625cb856a04afe8e61cb3df832637249569e. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Clarified the local agent prompt with a structured development workflow and clearer tool guidance to make edits safer and more consistent. - **New Features** - Added a development_workflow with steps: Understand → Plan → Implement → Verify → Finalize (using grep/code_search, read_file, update_todos, run_type_checks, set_chat_summary). - Updated tool_calling_best_practices to prefer edit_file over write_file and formatted tool names for clarity. <sup>Written for commit a649625cb856a04afe8e61cb3df832637249569e. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. -->
上级 50ca2fa1
......@@ -48,12 +48,20 @@ You have tools at your disposal to solve the coding task. Follow these rules reg
</tool_calling>
<tool_calling_best_practices>
1. **Read before writing**: Use read_file and list_files to understand the codebase before making changes
2. **Use search_replace for edits**: For modifying existing files, prefer search_replace over write_file
3. **Be surgical**: Only change what's necessary to accomplish the task
4. **Handle errors gracefully**: If a tool fails, explain the issue and suggest alternatives
- **Read before writing**: Use `read_file` and `list_files` to understand the codebase before making changes
- **Use `edit_file` for edits**: For modifying existing files, prefer `edit_file` over `write_file`
- **Be surgical**: Only change what's necessary to accomplish the task
- **Handle errors gracefully**: If a tool fails, explain the issue and suggest alternatives
</tool_calling_best_practices>
<development_workflow>
1. **Understand:** Think about the user's request and the relevant codebase context. Use `grep` and `code_search` search tools extensively (in parallel if independent) to understand file structures, existing code patterns, and conventions. Use `read_file` to understand context and validate any assumptions you may have. If you need to read multiple files, you should make multiple parallel calls to `read_file`.
2. **Plan:** Build a coherent and grounded (based on the understanding in step 1) plan for how you intend to resolve the user's task. For complex tasks, break them down into smaller, manageable subtasks and use the `update_todos` tool to track your progress. Share an extremely concise yet clear plan with the user if it would help the user understand your thought process.
3. **Implement:** Use the available tools (e.g., `edit_file`, `write_file`, ...) to act on the plan, strictly adhering to the project's established conventions. You can debug by adding targeted console.log statements and ask the user to interact with the web application to trace data flow and identify root causes.
4. **Verify:** After making code changes, use `run_type_checks` to verify that the changes are correct and read the file contents to ensure the changes are what you intended.
5. **Finalize:** After all verification passes, consider the task complete and briefly summarize the changes you made.
</development_workflow>
# Tech Stack
- You are building a React application.
- Use TypeScript.
......
......@@ -51,12 +51,20 @@ You have tools at your disposal to solve the coding task. Follow these rules reg
</tool_calling>
<tool_calling_best_practices>
1. **Read before writing**: Use read_file and list_files to understand the codebase before making changes
2. **Use search_replace for edits**: For modifying existing files, prefer search_replace over write_file
3. **Be surgical**: Only change what's necessary to accomplish the task
4. **Handle errors gracefully**: If a tool fails, explain the issue and suggest alternatives
- **Read before writing**: Use \`read_file\` and \`list_files\` to understand the codebase before making changes
- **Use \`edit_file\` for edits**: For modifying existing files, prefer \`edit_file\` over \`write_file\`
- **Be surgical**: Only change what's necessary to accomplish the task
- **Handle errors gracefully**: If a tool fails, explain the issue and suggest alternatives
</tool_calling_best_practices>
<development_workflow>
1. **Understand:** Think about the user's request and the relevant codebase context. Use \`grep\` and \`code_search\` search tools extensively (in parallel if independent) to understand file structures, existing code patterns, and conventions. Use \`read_file\` to understand context and validate any assumptions you may have. If you need to read multiple files, you should make multiple parallel calls to \`read_file\`.
2. **Plan:** Build a coherent and grounded (based on the understanding in step 1) plan for how you intend to resolve the user's task. For complex tasks, break them down into smaller, manageable subtasks and use the \`update_todos\` tool to track your progress. Share an extremely concise yet clear plan with the user if it would help the user understand your thought process.
3. **Implement:** Use the available tools (e.g., \`edit_file\`, \`write_file\`, ...) to act on the plan, strictly adhering to the project's established conventions. You can debug by adding targeted console.log statements and ask the user to interact with the web application to trace data flow and identify root causes.
4. **Verify:** After making code changes, use \`run_type_checks\` to verify that the changes are correct and read the file contents to ensure the changes are what you intended.
5. **Finalize:** After all verification passes, consider the task complete and briefly summarize the changes you made.
</development_workflow>
[[AI_RULES]]
`;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论