A simple parse-and-apply tool that parses XML responses from o1 in ChatGPT and applies them to a target codebase.
View a tutorial here.
- Clone the repo.
git clone https://github.com/mckaywrigley/o1-xml-parser
- Install dependencies.
npm install
- (Optional) Create a
.env.local
file and set thePROJECT_DIRECTORY
environment variable to your project directory.
cp .env.example .env.local
PROJECT_DIRECTORY=/path/to/your/project # Ex: /Users/you/your-project
You are an expert software engineer.
You are tasked with following my instructions.
Use the included project instructions as a general guide.
You will respond with 2 sections: A summary section and an XML section.
Here are some notes on how you should respond in the summary section:
- Provide a brief overall summary
- Provide a 1-sentence summary for each file changed and why.
- Provide a 1-sentence summary for each file deleted and why.
- Format this section as markdown.
Here are some notes on how you should respond in the XML section:
- Respond with the XML and nothing else
- Include all of the changed files
- Specify each file operation with CREATE, UPDATE, or DELETE
- If it is a CREATE or UPDATE include the full file code. Do not get lazy.
- Each file should include a brief change summary.
- Include the full file path
- I am going to copy/paste that entire XML section into a parser to automatically apply the changes you made, so put the XML block inside a markdown codeblock.
- Make sure to enclose the code with ![CDATA[CODE HERE]]
Here is how you should structure the XML:
<code_changes> <changed_files> <file_summary>BRIEF CHANGE SUMMARY HERE</file_summary> <file_operation>FILE OPERATION HERE</file_operation> <file_path>FILE PATH HERE</file_path> <file_code></file_code> REMAINING FILES HERE </changed_files> </code_changes>
So the XML section will be:
__XML HERE__
I'm Mckay. I like to build AI tools.
Follow me here: