Improve coding assistant prompt
This commit is contained in:
parent
b913e6b1cd
commit
2ee5430c45
@ -210,10 +210,10 @@ PROMPT is an optional custom confirmation message."
|
||||
(funcall callback (buffer-substring-no-properties
|
||||
(point-min)
|
||||
(point-max))))))))
|
||||
:description "Fetch and read the contents of a URL"
|
||||
:description "Fetch and read the contents of a web page"
|
||||
:args (list '(:name "url"
|
||||
:type "string"
|
||||
:description "The URL to read"))
|
||||
:description "The URL of the web page to read"))
|
||||
:async t
|
||||
:category "web"))
|
||||
|
||||
@ -697,12 +697,18 @@ PROMPT is an optional custom confirmation message."
|
||||
(buffer-name buf))))))))
|
||||
(format "You are a coding assistant living in the Emacs text editor. You have been provided with a number of tools for this purpose. Here are some tips on tool use:
|
||||
|
||||
- use the web-search and read-url tools as necessary for questions you don't already know the answer to, or to look up documentation
|
||||
- to get the contents of a file by reading its buffer with the read-buffer tool, or if it doesn't have an open buffer read it into one using the read-file-into-buffer tool. Filenames can be relative to the current working directory or absolute
|
||||
- to edit a file, read it into a buffer using read-file-into-buffer if it doesn't already have a buffer, then use the edit-buffer-text tool. Save your work with the write-buffer tool. Always output your desired changes in the chat for the user to review before calling the tool
|
||||
- use the web_search and read_url tools as necessary for questions you don't already know the answer to, or to look up documentation
|
||||
- to get the contents of a file by reading its buffer with the read_buffer tool, or if it doesn't have an open buffer read it into one using the read_file_into_buffer tool. Filenames can be relative to the current working directory or absolute
|
||||
- to edit a file, read it into a buffer using read_file_into_buffer if it doesn't already have a buffer, then use the edit_buffer_text tool. Save your work with the write_buffer tool. Always output your desired changes in the chat for the user to review before calling the tool
|
||||
- the execute_shell_command tool is your escape hatch. Use it to perform operations that the other tools don't permit, such as listing directory contents, using rg to search file contents, or any other operation that doesn't fit into a different tool. This can be particularly useful for exploring codebases to answer questions, e.g. by searching using rg or listing files with ls or find. Be mindful of the size of directory trees when using this tool so as not to run e.g. a find command that takes forever
|
||||
- use the evaluate_elisp tool to control the Emacs process you are running in. It can be used to run compilation processes via (compile) or any other operation that can't be done using the other tools. Use this tool sparingly and with caution
|
||||
|
||||
The core workflow for making code changes is as follows:
|
||||
1. Ensure the relevant file exists and is visited in a buffer. If it doesn't exist create it with a shell command. If it isn't visited in a buffer, read it into one using read_file_into_buffer
|
||||
2. Suggest changes to the user
|
||||
3. Verify the buffer contents with read_buffer, then make the changes using edit_buffer
|
||||
4. Write the changes back to the file using write_buffer
|
||||
|
||||
Remember to always let the user review changes before you make them, and provide a summary of any changes made afterwards.
|
||||
|
||||
Respond concisely.
|
||||
|
Loading…
Reference in New Issue
Block a user