Written by the author, AI-editedAI-assisted, author-verified How this module was made
Welcome to Module 2! We are going to use AI to explore a legacy iOS codebase before trying to change it.
BabyTrack mixes Objective-C, Swift, UIKit, and SwiftUI. That does not automatically make any of it bad. Our job is to understand how it works, verify the AI’s claims, and separate real technical debt from personal preference.
I’ve run the BabyTrack app and captured a couple of events in our feed. You can also see in Xcode that we have folders for SwiftUI and UIKit, some boilerplate shared across both, as well as some model information.
BabyTrack records events such as feeding, sleeping, diaper changes, and photo moments. I am only doing a quick orientation because I want the source code, not the folder names, to support our conclusions.
I’m going to type a prompt asking the AI agent to help us explore BabyTrack, map entry points, data, screen flows, dependencies, tests, etc. Now, I’m going to also ask it to tell us the specific files or label anything that is very uncertain. So in Xcode, I will switch to the coding assistant tab, and I’ll start a new conversation with Codex. I’ll make sure that I have a good model selected. So in this case, I’m pretty happy using GPT 5.6 Terra, and I’ll go ahead and write my prompt.
Explore BabyTrack. Map its entry points, screens, data flow, dependencies, and tests, then identify its most important potential technical debt. Cite files and clearly label anything uncertain.
I’ll go ahead and submit this. Perfect. Let’s take a look at what it returned. So we can see here that we have a project map with the entry point called out. We have screens and user flows, data flow and dependencies, tests and verification. Next up, it’s going to tell us the most important technical debt. So it’s labeled items one, two, three, four, and five for us to review.
I’m not looking, nor do I need a particular answer here. I am checking whether the response cites real files and whether those files support the explanation.
I want to have the AI agent recheck things a little bit, so I’ll go ahead and ask it to do that in a new prompt. I’ll go ahead and submit this prompt.
Recheck your findings against the source. Remove unsupported claims, separate actual debt from age or style preferences, and prioritize verified issues as address now, plan later, or monitor. Explain the tradeoffs briefly.
Let’s take a look at what it returned. And we have a section for address now, plan later, and monitor, not necessarily debt by itself. A useful priority list considers risk and impact. It does not call something technical debt just because it uses Objective-C, UIKit, or an older pattern.
Now I want it to create the assessment, so I’m going to ask it to do so in a markdown file with the next prompt.
Create the complete Markdown for `codebase-assessment.md` from the verified findings and my corrections. Include the codebase map, prioritized debt, rejected or unverified claims, open questions, and next investigation. Cite the source, do not propose implementation work, and return only the Markdown file.
Awesome. Let’s take a look at the file it created. And here we can see our markdown file with the different sections that we asked it to, the data flow, the screens and user flow, entry points, basically our complete code base map. It also has the prioritized technical debt list. Fantastic.
The AI handled the synthesis, but the final assessment reflects the evidence and the decisions we actually accepted.
You now have a verified map of BabyTrack and a prioritized technical-debt list. In the next lesson, we will use the same evidence-first approach to create a high-level modernization plan without rewriting the app. See you in the next lesson. Bye for now.