Foundations of Spec Driven Development for AI Applications