---
name: contentrain-bulk
description: "Batch operations on Contentrain content: copy locales, update status, delete multiple entries. Use when performing bulk content operations."
metadata:
  author: Contentrain
  version: "1.0.0"
---

# Skill: Run Bulk Content Operations

> Apply safe batch operations to existing content entries.

---

## When to Use

Use this when the user wants to:

- copy one locale to another
- update status on many entries
- delete multiple collection entries

This skill is for existing content, not for schema design.

---

## Steps

### 1. Inspect the Model

Call `contentrain_status` and `contentrain_describe(model: "<model-id>")` first.

Confirm:

- model kind
- whether `i18n` is enabled
- which locales are supported

### 2. Pick the Correct Bulk Operation

- `copy_locale`: clone one locale to another for i18n-enabled `collection`, `singleton`, or `dictionary` models
- `update_status`: update metadata state — many entries at once for `collection`, or the single record of a `singleton`/`dictionary`
- `delete_entries`: remove many collection entries at once

### 3. Apply Safety Rules

- never use `copy_locale` on non-i18n models
- `update_status` takes `entry_ids` for `collection` models and **rejects them** for `singleton`/`dictionary` — those have one meta record per locale, so omit `entry_ids` entirely. Document models are not supported (their meta is keyed by slug).
- `delete_entries` is collection-only
- `update_status` rewrites every supported locale unless you pass `locale`. Pass it when restoring one locale's status, or you will change the other's too.
- confirm entry IDs before delete operations
- batch only related entries together

### 4. Execute with `contentrain_bulk`

Examples:

```json
{
  "operation": "copy_locale",
  "model": "ui-labels",
  "source_locale": "en",
  "target_locale": "tr"
}
```

```json
{
  "operation": "update_status",
  "model": "blog-post",
  "entry_ids": ["post_001", "post_002"],
  "status": "in_review"
}
```

Scoped to one locale — leaves every other locale's status untouched:

```json
{
  "operation": "update_status",
  "model": "blog-post",
  "entry_ids": ["post_001"],
  "status": "published",
  "locale": "tr"
}
```

A singleton or dictionary — one meta record, so no `entry_ids`:

```json
{
  "operation": "update_status",
  "model": "site-settings",
  "status": "published"
}
```

```json
{
  "operation": "delete_entries",
  "model": "faq-items",
  "entry_ids": ["faq_01", "faq_02"],
  "confirm": true
}
```

### 5. Validate When Needed

After `copy_locale` or status-heavy cleanup, call `contentrain_validate` if content correctness may have changed.

### 6. Submit

Bulk operations still create branches/commits. Call `contentrain_submit` if the project is in review flow.

### 7. Final Summary

Report:

- operation performed
- model affected
- locale or entry count affected
- validation outcome if run
- submit status

## Related Skills

- **contentrain-content** — Single-entry content operations
- **contentrain-validate-fix** — Validate after bulk changes
- **contentrain-generate** — Regenerate SDK after bulk locale copy
- **contentrain** — Core architecture and MCP tool catalog
