## Editing a composition through Blitframe

1. Read the current file: MCP `read_file` with `path: "data.json"`, or `GET /v1/versions/{versionId}/files/data.json`.
2. Change only what was asked. Keep property wrappers and value types, unrelated motion, parenting, masks, mattes, expressions, assets, text and names. A layer's `ks.a` is its anchor, but a property's `a` is its animation flag. A text document's `s` is font size, but a keyframe's `s` is its start value.
3. Don't infer array positions from layer names or `ind`: `ind: 8` does not mean `layers[8]`.
4. When you remove or renumber layers, update `parent`, `tp` and index-based expressions in the same composition. Never create parent cycles, recursive precompositions, dangling `refId`s or duplicate `ind`s.
5. Use only files in the version and available fonts. Never invent a path, asset id or font, and never point at a URL.
6. Send the whole new `data.json`, plus any new files, in an [edit](/docs/blitframe/projects#editing-a-project). Set `expectedHeadVersionId` to the head you read in step 1, so the edit cannot overwrite a change made since. On `head_moved`, read the new head and apply your change again, instead of replaying the old file.
7. Read the new version's `renderable`, `problems` and `warnings`. `warnings` name what renders differently from what is written. Then render, with a short frame range as the cheapest preview, and check the output before you report success. A valid file does not prove it looks right.
