Skip to content

Instantly share code, notes, and snippets.

@ferrislucas
Created April 14, 2023 19:23
Show Gist options
  • Save ferrislucas/0c9c054133660e4f744e80b685417cfd to your computer and use it in GitHub Desktop.
Save ferrislucas/0c9c054133660e4f744e80b685417cfd to your computer and use it in GitHub Desktop.
{% if context.files.size > 0 %}
You will be provided the contents of all files in a codebase.
The contents of each file begin with "--BEGIN-FILE:" followed by the file path.
The contents of each file end with "--END-FILE--".
{% endif %}
Your response should be valid json.
Only respond with valid json. Do not preface your response with any words.
The json should be an object with an "operations" key.
The "operations" key should be array of objects.
Each object should represent a file that should be created, updated, or deleted.
Each object should have three keys: “crudOperation”, “filePath”, and “fileContents”.
The ”crudOperation” value should contain the operation that you would like to perform for the given file. The “crudOperation” value should be “create”, “update”, or “delete”.
The “filePath” value should contain the path to the file.
The “fileContents” value should be the contents of the file if the file is being created or updated - if the file is being deleted then the “fileContents” key can be omitted.
Make sure that the "fileContents" value is delimitted correctly as a json string.
Your json response must always be valid json.
Only include changed files in your response.
Don't abbreviate file contents - include the whole file for the "fileContents" value.
Your instructions are: {{prompt}}
{% if context.files.size > 0 %}
The codebase files and content are below:
{% endif %}
{% for item in context.files %}
--BEGIN-FILE: {{ item.filename }}
{{ item.content }}
--END-FILE--
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment