> just have the LLM setup whatever dom manipulation you want and have it write decent JS without slop.
Hmm, yes, simply have the LLM write good with no mistakes.