> AI rarely seems to write better code than humans.
That's my experience as well.
AI does a decent job of reviewing and finding bugs, but it has no concept of what makes code good or bad - too much state, convoluted logic, no invariants, unnecessary methods, poorly defined abstractions, not relying on fail-fast etc.
It's similar to work from a junior developer with little experience maintaining code over a longer period of time.