The Right Way to Implement AI: A Roadmap from Scripts to Autonomous Agents