A developer shares their comprehensive automated code-quality setup for an Elixir project used as an AI code generation testbed. The concern is 'AI drift' — where generated code gradually degrades quality by copying prior low-quality patterns. The solution is a layered set of automated checks including: compiler warnings-as-errors, formatter enforcement, unused dependency detection, compile-time coupling checks via xref, Credo linting with custom checks (Jump's test-quality checks, Oeditus concurrency checks, and two project-local checks targeting AI-generated patterns), Dialyzer for type analysis, Boundary for context enforcement, Sobelow and mix_audit for security, and documentation integrity checks. All code-facing checks are bundled into a single `mix precommit` alias. The post also covers workflow hygiene (actionlint, semantic PR titles, Dependabot with custom changelog analysis), AI-assisted code review layers, and an honest list of gaps not yet addressed (Rust guardrails, secret scanning, visual regression testing).