---
name: c1-cloud-render
description: Batch process Phase One P25 / 飞思原图 through local Capture One and export JPEGs to the user's iCloud 飞思 folder. Use when the user says “飞思批量修图”, “C1 云渲染”, “修飞思图”, “修 CF 卡图片”, or asks to process P25 TIF/IIQ/EIP files with the Capture One “胶片改” preset, auto adjustments, and iCloud export.
---

# C1 Cloud Render

## Purpose

Run the user's fixed P25 workflow with Capture One:

1. Import CF card or provided P25 files into `$HOME/Pictures/p25.cocatalog`.
2. Apply Capture One style `胶片改`.
3. Run Capture One auto adjustments for exposure/HDR/levels/rotation.
4. Export JPEGs with recipe `JPEG - 最大尺寸，最高画质`.
5. Save outputs to iCloud: `$HOME/Library/Mobile Documents/com~apple~CloudDocs/飞思导出专用文件夹`.

“C1 云渲染” here means local Capture One rendering into an iCloud-synced folder. Do not claim it is remote/headless cloud compute.

## Core Script

Use the bundled script:

```bash
python3 $HOME/.codex/skills/c1-cloud-render/scripts/c1_p25_auto_export.py SOURCE --title "飞思扫街"
```

Supported source files: `.TIF`, `.TIFF`, `.IIQ`, `.EIP`.

The script is non-destructive toward source files: it explicitly disables `erase after copy`, `eject card`, and Capture One import backup side effects.

## Workflow

1. Determine the source path.
   - If the user provides files or a folder, use that path.
   - If the user says the files are on a CF card, inspect `/Volumes` and look for a `100PHASE` folder or P25 files.
   - If multiple likely source folders exist, ask before running a live import.

2. Confirm local Capture One prerequisites only when needed:
   - App: `/Applications/Capture One.app`
   - Catalog: `$HOME/Pictures/p25.cocatalog`
   - Style: `$HOME/Library/Application Support/Capture One/Styles/胶片改.costyle`
   - Output folder: `$HOME/Library/Mobile Documents/com~apple~CloudDocs/飞思导出专用文件夹`

3. Run a dry-run first unless the user explicitly asks to execute immediately:

```bash
python3 $HOME/.codex/skills/c1-cloud-render/scripts/c1_p25_auto_export.py SOURCE --title "标题" --dry-run
```

Check that the source count, catalog path, style name, recipe name, output directory, and generated batch name are correct.

4. Execute:

```bash
python3 $HOME/.codex/skills/c1-cloud-render/scripts/c1_p25_auto_export.py SOURCE --title "标题"
```

Capture One will open visibly. Do not promise a hidden/headless run.

5. Verify:
   - Count source files before/after.
   - Count exported files matching `YYMMDD 标题*.jpg` in the iCloud output folder.
   - If the export count is lower than source count, Capture One may still be processing; wait and re-count before reporting failure.
   - Open or reveal the output folder when done:

```bash
open -R "$HOME/Library/Mobile Documents/com~apple~CloudDocs/飞思导出专用文件夹"
```

## Exposure Adjustment

Default to Capture One auto adjustments only.

If the user says the whole batch is overexposed, add a small uniform exposure delta:

```bash
python3 $HOME/.codex/skills/c1-cloud-render/scripts/c1_p25_auto_export.py SOURCE --title "标题" --exposure-delta -0.15
```

Do not invent per-image highlight thresholds until at least one real batch has been reviewed and calibrated.

## Failure Handling

- If `osascript` fails with missing Capture One terms, verify `/Applications/Capture One.app/Contents/Resources/CaptureOne.sdef` exists.
- If recipe lookup fails, inspect Capture One recipes under `~/Library/Application Support/Capture One/Recipes*/`.
- If style lookup fails, inspect `~/Library/Application Support/Capture One/Styles/`.
- If no variants are found after import, increase `--import-wait` and rerun on a small test batch first.
- If the catalog is already open with unsaved user work or an active export queue, pause and ask before continuing.
