How and why would one script things like this? I thought the process was basically just talking to the agent and telling it what you want to do and reviewing the changes before they are committed.
Well. Agents use context and context window has limit. If you add too much to context you will get poor result. You can split your task in smaller ones and in result you might get much better result. E.g. migration of tests to new version of library.