Home/
Part XIII — Expert Mode: Systems, Agents, and Automation/39. Prompt Engineering for Experts (The Real Stuff)/39.2 Prompt "APIs": stable interfaces between app and model
39.2 Prompt "APIs": stable interfaces between app and model
Overview and links for this section of the guide.
On this page
Prompts as Contracts
Treat your prompt like an API endpoint. - **Inputs:** What variables does it take? `{{user_query}}`, `{{file_context}}`. - **Outputs:** What schema does it return? `z.object({ code: z.string() })`. - **Tests:** Golden inputs that MUST pass.
Versioning
Do not edit prompts in place. Use `v1`, `v2`, `v3`.
If you change the prompt to "Make it funnier," you might break the JSON output for the billing system. Versioning allows you to roll back instantly.