Think of AI as a way to do what you were going to do anyway but quicker.
As AI can write code quicker, it can also ruin codebases quicker too. You can protect yourself from this by ensuring you support your code with functional tests, and also ensure you have a good version control strategy (ie learn git, commit small and often).
It's totally possible to follow test driven development strategy working with Agentic code tools. You need to stay focussed, keep a check on the outputs of your methods and continue to review your own code before you publish to production.
You should also look at writing an agents.md file to describe to your AI how your code base is structured and how you prefer to write code. My agents.md describes how my commit messages are made, how to run linting and what conventions our code base is following. This is essentially a glorified readme.md specifically targeted at AI. Be careful not to be too verbose in here though as this file is passed to your AI with every prompt so will chew through the credits.
Web developers have a great future ahead of them if they remember that they are solving problems with code, not just there to churn out code. For me it's like I've gone up a step and instead of writing code, I spend more time on the acceptance criteria, testing and planning.
Back when I started in web, we had to make html by hand. Now AI's are enabling speeding through this kind of work and now I'm able to concentrate on the quality of output and to be able to prototype quicker (and be less precious of throwing stuff away).
I can't wait to see what we're going to get next!!