I love the name "software carpentry" haha.
IMO, I found those specific example tasks to be better handled by my IDE's refactoring features, though support for that is going to vary by project/language/IDE. I'm still more of a ludite when it comes to LLM based development tools, but the best case I've seen thus far is small first bites out of a big task. Working on an older no-tests code base recently, it's been things like setting up 4-5 tests that I'll expand on into a full test suite. You can't take more than a few "big" bites out of a task before you have 0 context as to what direction the vector soup sloshed in.
So, in terms of carpentry, I don't want an LLM framer who's work I need to build off of, but an LLM millworker handing me the lumber is pretty useful.
Funny usually a lot of my code is software plumbing, and gardening.
In terms of ai assisted programming. I microanage my ai. Give it specific instructions with single steps. Don't really let it build ehoe files by itself as it usually makes a mess of things, bit it's useful when doing predictable changes and marginally faster than doing it manually.