main-image-editor

TotalClaw 作者 kn7frhkbkm6t704dqdm2advyah82deej v1.0.0

通过重用 psd-automator 将屏幕截图 + 中文指令编排到 PSD 批量编辑中,并进行事务回滚。

安装 / 下载方式

TotalClaw CLI推荐
totalclaw install totalclaw:kn7frhkbkm6t704dqdm2advyah82deej~main-image-editor
cURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Akn7frhkbkm6t704dqdm2advyah82deej~main-image-editor/file -o main-image-editor.md
## 概述(中文)

通过重用 psd-automator 将屏幕截图 + 中文指令编排到 PSD 批量编辑中,并进行事务回滚。

## 原文

# main-image-editor

Orchestration layer for "main image modification" workflows:

1. Parse screenshot + Chinese instruction into structured edit tasks.
2. Convert tasks into `psd-automator` task JSON.
3. Execute serially with transaction rollback (rollback all on any failure).
4. Reuse `psd-automator` export + bundle output.

## Usage

```bash
node skills/main-image-editor/scripts/run-main-image-editor.js \
  --request skills/main-image-editor/examples/request.sample.json \
  --index ~/.openclaw/psd-index.json
```

Dry-run or force execute:

```bash
node skills/main-image-editor/scripts/run-main-image-editor.js \
  --request skills/main-image-editor/examples/request.sample.json \
  --dry-run
```

```bash
node skills/main-image-editor/scripts/run-main-image-editor.js \
  --request skills/main-image-editor/examples/request.sample.json \
  --force
```

## Request payload

`request` JSON supports:

- `text`: Chinese requirement text
- `screenshotPath`: screenshot path (used for match + audit)
- `confidenceThreshold`: optional (default `0.8`)
- `tasks`: optional pre-parsed tasks (skip regex parsing when provided)
- `execution`: optional runtime controls (`indexPath`, `dryRun`, `force`)

When `fileHint` is missing, parser will try to extract `.psd/.psb` filename from:

1. request `text`
2. OCR text from `screenshotPath` (local `tesseract` command or macOS Vision OCR fallback)

## Failure policy

- Default policy is `rollback_all`.
- Any single PSD failure restores all touched PSD files from transaction backups.
- Temporary outputs generated in the failed run are cleaned up before returning.