Production-Ready AI Agents: 5 Lessons from Refactoring a Monolith | Endigest