Back to course overview
Module 2From idea to spec with AI 25 min
Lab: Generate your spec and data model
Produce your own SPEC.md and data model — for DayOne or an idea of your own — and add them to the project.
Outcome of this lab
A SPEC.md file and an Entry.swift data model committed to your project. If you're using your own idea instead of DayOne, this lab adapts it to your app.
Step 1 — Narrow your idea
- 1Write your app as one sentence.
- 2Run the "skeptical product manager" prompt from the earlier lesson and answer its questions honestly.
- 3Write a v1 bullet list of 3-5 things the app does, and a short "NOT in v1" list.
Step 2 — Generate and save the spec
- 1Run the spec prompt with your v1 bullets pasted in.
- 2Read the output critically. Delete anything that smells like scope creep. Rename screens so they make sense to you.
- 3In Xcode choose File ▸ New ▸ File…, scroll down to Other ▸ Empty, name it
SPEC.md, and save it at the project root (the folder containing the.xcodeproj). Paste in the final version.
Step 3 — Generate the data model
- 1Run the data-model prompt referencing your spec.
- 2In Xcode, choose File ▸ New ▸ File ▸ Swift File, name it after your main entity (e.g.
Entry.swift), and paste the@Modelclass. - 3Build with ⌘B. It should compile with no errors. If it doesn't, paste the error back to your assistant and ask it to fix it.
Read before you accept
Skim the generated model out loud. Does each field make sense? Are the optionals right? This 60-second read is where you catch the model inventing a field you don't want, or forgetting the date. Accepting code you haven't read is the fastest way to a confusing app.
Step 4 — Commit
bashbash
git add .
git commit -m "Add v1 spec and data model"You now have the two documents that steer the rest of the build: a spec that keeps the AI consistent, and a data model that anchors every screen. Next module, you turn them into a working interface.