Better CLAUDE instructions

This commit is contained in:
Simon Martens
2025-07-25 15:25:42 +02:00
parent 2fcca94fe1
commit a0a4210e14

View File

@@ -14,7 +14,7 @@
- What to do when an XML transformation is requested:
- Before transforming the XML, give a few examples of how you understand the users request and how you would transform the XML. Try to use a diverse set of test cases, from the start, middle and end of a file.
- After giving examples, you'll likely will need to write a python script to transform the XML. Use the `lxml.etree` library to parse the XML in python and transform it. It is important that this library and no other library is used! If text should be transformed, try to find the right place in XML witth said library, then you are allowed to use regex to transform text.
- Before running the script, make sure to test it on a small subset of the XML data, so you can see if it works as expected. Alternatively, generate test data to test the transformations against. You are only allowed to do the transformations the user asked for, and nothing else.
- All XML comments must be preserved. All other data must be preserved. You should use the ptyhon library to format the output XML.
- After transformations on the test data, ask the user to confirm the transformation on the real production data. Then run the script on the production data. Replace the original files, so the user can run git diff to see tthe changes made.
- Before running the script, make sure to test it on a subset of the XML data, with a variety of test cases, from a variety of places from the target file, so the user can see if it works as expected. Alternatively, generate test data to test the transformations against. You are only allowed to do those transformations the user asked for, and nothing else.
- All XML comments must be preserved. All other data must be preserved. You should use the ptyhon library to format the output XML, if the file is meta.xml or references.xml. All other files shold be formatted the way they were, so look at the formatting to get an impression.
- After running all the transformations on the test data successfully show (and preserve) the test data, for user review. Then, ask the user to confirm the transformation on the real production data. If the user agreesm, run the script on the production data. Replace the original files, so the user can run git diff to see the changes made.
- Save all generated scripts in the `scripts/` directory with the current date and a meaningful name, so they can be reused later.