Unfortunately not, it's private company code. But I can share the prompt I used for the refactoring:
- 1. Read the whole code of the repository.
- 2. Read the TASKS.md file if it exists.
- 2.1. If it exists and is not empty, pick a refactoring task from the list. Choose the most appropriate.
- 2.1.1. Refactor the code according to the task description.
- 2.1.2. Commit the changes to git.
- 2.1.3 Remove the task from TASKS.md
- 2.1.3. You are done.
- 2.2. If it doesn't exist or is empty:
- 2.2.1. Identify the parts of the code that could be refactored, following the following principles
- A class should have a single responsability
- The dependencies of the class should be mockable and injected at class instanciation
- Repeated code should be factored into functions
- Files shouldn't be longer than 1.5K lines
- 2.2.2: If using the previous insights you think there is valuable refactoring work to be done:
- 2.2.2.1 Write a list of refactoring tasks in TASKS.md
- 2.2.2.2: You are done.
- 2.2.3: If there is no more refactoring to be done, notify me with 'say "I am done with refactoring"'
The TASKS.md file will be created and filled by the model. The prompt needs to be run repeatedly in a loop until it decides there's nothing to be done anymore.