← All courses ← Course home

Lesson 02 of 05

Store versions, not view strings

Keep each instruction set as a record with an id, a body, and a status. The view reads the live record.

Agent brief (llms.md)

A registry is a list of prompt records. Apple does not host this list for you. You can start with a JSON file in the app bundle. Each record needs an id, a human title, the instruction text, a status, and the id it replaces.

Recordid and text
Recordid and text
Statusdraft, live, or retired
Recordid and text
Statusdraft, live, or retired
ListJSON in the app
struct PromptRecord: Codable, Identifiable {
    var id: String
    var title: String
    var instructions: String
    var status: String // draft | live | retired
    var replaces: String?
}

struct PromptRegistry: Codable {
    var feature: String
    var records: [PromptRecord]

    var live: PromptRecord? {
        records.first(where: { $0.status == "live" })
    }
}

One live record per feature. Drafts can sit in the file. Retired records stay so you can roll back. Do not delete the last good version.

Put the live id in your logs and in eval samples. Test AI behavior before you ship needs that id. Stream tokens and measure speed needs it too, because a longer instruction can raise TTFT.

Rule. One live version per feature. Keep the retired text.

Next, feed the live text into a Dynamic Profile.

Key concepts

  • The registry is a list of prompt records. Apple does not host it.
  • Start with JSON in the app bundle. One live record per feature.
  • Retired records stay for rollback. Do not delete the last good version.
  • Put the live id in logs and eval samples.

Takeaways

  • Keep one live version per feature.
  • Do not edit live records in place.
  • Pin the prompt version on every log and eval row.