You shouldn't be using an LLM directly (web chat style). A proper harness allows an agent to see the errors itself and correct as needed. You can the correct it at higher, more meaningful levels.
My experience is in doing this with Claude/Codex/OpenCode with a pretty rigorous setup (AGENTS.md/CLAUDE.md for specific subfolder rules, strict compile/test/lint rules. This isn't me copy-pasting from web chat.
I've been building a general linter tool to help keep repos in a consistent and clean shape when working with AI [0]. You can define repo and file layout, structure, hygiene rules and have them checked in pre-commit, in ci, or manually. It also integrates and plays well with AGENTS.md - allowing exporting agent instructions from the alint rule config [1].