Building a coding agent in Swift from scratch