Designing Autonomous AI Agents: Principles and Best Practices