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.localfile and set thePROJECT_DIRECTORYenvironment variable to your project directory.
cp .env.example .env.localPROJECT_DIRECTORY=/path/to/your/project # Ex: /Users/you/your-projectYou 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.
- Provide a brief overall summary.
- Provide a 1-sentence summary for each changed file and explain why it was changed.
- Provide a 1-sentence summary for each deleted file and explain why it was deleted.
- Format this section as Markdown.
- XML Section (as an XML code block).
Only return the XML, nothing else, inside this code block.
- Include all changed, created, or deleted files.
- For each file, create a
<file>element containing:<file_summary>: A brief summary of the change.<file_operation>:CREATE,UPDATE, orDELETE.<file_path>: The full path to the file.<file_code>: ForCREATEandUPDATE, include the complete file code without omissions.
ForDELETE,<file_code>is not necessary.
- Each file should be in its own
<file>element. - Enclose everything in a
<code_changes>block with a nested<changed_files>block. - Use a
<![CDATA[ ... ]]>block for the code inside<file_code>to avoid breaking the XML with special characters.
<code_changes>
<changed_files>
<file>
<file_summary>BRIEF CHANGE SUMMARY HERE</file_summary>
<file_operation>CREATE|UPDATE|DELETE</file_operation>
<file_path>/full/path/to/file</file_path>
<file_code><![CDATA[
__FULL FILE CODE HERE__
]]></file_code>
</file>
<!-- Additional <file> blocks for other files -->
</changed_files>
</code_changes>I'm Mckay. I like to build AI tools.
Follow me here: