Programming AVRs with another device. Use SPI mode (bitbang or hardware) or UPDI (hardware uart).
UPDI code is all from https://gitlab.com/bradanlane/portaprog available under MIT license https://gitlab.com/bradanlane/portaprog/-/blob/master/LICENSE