Principle:21st dev Magic mcp Generation Review
| Knowledge Sources | |
|---|---|
| Domains | AI_Generation, Retrieval |
| Last Updated | 2026-10-19 16:40 GMT |
Overview
A retrieval pattern that reads back the code of a previously-generated UI (by generation id and take id), so drafts can be reviewed, selected, and installed.
Description
Generation review is the act of reading the stored output of an AI UI generation — the generation record (all takes/variants) and the code of a single take. It addresses the fact that generation is non-deterministic and produces variants: the caller must be able to inspect and choose among them before installing. Crucially, reads remain available even when AI access is off, so drafts created while AI was enabled stay reviewable after entitlement lapses.
Usage
Use this principle after `generate` has produced a generation, to inspect its takes and read the code of the one to install. Also use it to review existing sketch drafts regardless of current AI status.
Theoretical Basis
The core operation is a two-stage read:
# Abstract algorithm description (NOT real implementation)
generation = get_generation(generationId) # list of takes with takeIds
take_code = get_take(generationId, takeId) # source for one take
Reads are pure retrieval; they do not consume credits and are not gated by the AI entitlement (only generation is).
Practical Guide
- Call `get_generation` first to list takes.
- Then `get_take` for the chosen `takeId` to read its code.
- Reads work even with AI off — use this to review old drafts.
- After reading, install the code or iterate with another `generate` call.
Related Pages
Implemented By
Notes
- Companion to Principle:21st_dev_Magic_mcp_AI_UI_Generation, which produces the drafts.
- Reads are ungated; only `generate` is gated by AI entitlement.