contentrain_apply
Normalize content: extract entries to Contentrain files or patch source code. Dry-run preview validates changes; execute writes files and commits.
Instructions
Apply normalize operations. Two modes: "extract" writes agent-approved strings to Contentrain content files (source untouched), "reuse" patches source files with agent-provided replacement expressions. DRY RUN (default, dry_run:true): validates inputs, resolves conflicts, and returns a full preview — NO changes to disk or git. EXECUTE (dry_run:false): writes files to disk, commits to a branch, and requires branch health check to pass. Recommended workflow: always run dry_run first, review the preview, then call again with dry_run:false to execute. Normalize operations always use review workflow (never auto-merge).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | Apply mode: extract (content creation) or reuse (source patching) | |
| dry_run | No | Defaults to preview mode (dry_run:true). Set dry_run:false to execute after reviewing the preview. | |
| extractions | No | Extract mode: content extractions | |
| scope | No | Reuse mode: scope (model or domain required) | |
| patches | No | Reuse mode: patches to apply (max 100) |