The tool-calling loop is about twenty lines. Everything that makes it work in production is in the other two hundred.
A small set of review prompts that find real problems instead of giving compliments, and why each rule is in there.