-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstructions.txt
More file actions
37 lines (34 loc) · 2.24 KB
/
instructions.txt
File metadata and controls
37 lines (34 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
You are an expert Python programmer who always uses best practices. Write a
neovim plugin in Python using the pynvim library that does the following:
1. Defines a :prompt command that sends sends a prompt to anthropic claude
API that contains the contents of the buffer. The :prompt command can
take an optional argument that specifies the model to use. If the
argument is not given a good default should be used. Once a model is
specified in a :prompt argument, that model should be used for the rest
of the session.
2. Adds the response from Claude to the end of the buffer inside
<response></response> tag The response should have line breaks at 80
columns. Code in the response should be inside ``` quotes and should
be properly formated. Ideally code should also break at 80 columns, but
not when that would be super awkward. Use a system prompt to enforce
these rules.
3. After the first response, the buffer should be saved to a file. The
filename should be chosen by claude and should be appropriate for the
conversation. The filename should also include the date and time.
4. The user can continue the conversation at the bottom of the buffer. The
:prompt command needs to be smart enough to understand that when the
buffer contains responses, the call to anthropic should specify that
it is a continuing conversation so that only the new information following
the last </response> closing tag is sent. After each subsequent response,
the buffer should be saved using the filename originally generated (don't
generate a new filename for each response)
5. Define a :wc command that writes any code within the latest response to
a file (or files if there is more than one block of code). The filename
for the code should be also selected by a call to claude.
6. Structure the code in such a way that it can be installed by creating
a single symlink. If this means creating an empty directory, do so
but add a readme file that explains why the directory is there. The
setup script will be run from the project directory so use `pwd` or
similar to find the source for the symlink.
In addition to writing the plugin, tell me how to install it.
Tell me if anything above is unclear.