photo-export — local deterministic non-destructive export packaging
photo-export does no new rendering math, no culling, no develop
itself. It chains existing sibling skills in order by calling their exact
documented scripts/run_pipeline.py CLIs as subprocesses (CPU-only; no network;
no sibling modification), then copies the finished images. It never
reimplements a sibling; it never invents a sibling flag; it never deletes
sources; it never mutates source files or source *.xmp.
Sibling dependencies (must be installed next to this skill; never modified)
- photo-cull
C:\...\skills\photo-cull\scripts\run_pipeline.py - photo-develop
C:\...\skills\photo-develop\scripts\run_pipeline.py - photo-render
C:\...\skills\photo-render\scripts\run_pipeline.py
(Resolved as siblings of this skill directory; OPENCODE_SKILLS_DIR env can
override the skills root. A missing sibling script or missing python is a
clear error, not a silent skip. Sibling runtime deps are the siblings'
own — e.g. photo-cull needs opencv-python numpy exifread, mediapipe
(imported unconditionally; --no-faces only skips model loading) + bundled
models; photo-develop needs rawpy + Pillow; photo-render needs numpy +
Pillow + reuses photo-develop raw.py + a bundled sRGB.icc. Optional
lightcraft-cli backend only if present (--lightcraft-cli); no network.)
Run
python "$env:USERPROFILE\.config\opencode\skills\photo-export\scripts\run_pipeline.py" `
--source "C:\path\to\session"
Windows/PowerShell; quote paths. --source = session folder, read-only.
Bounded scans (siblings). CPU-only (CUDA_VISIBLE_DEVICES=-1, etc.).
Chaining (order; reuse; do NOT reimplement)
- photo-cull
python <photo-cull>\scripts\run_pipeline.py --source <SOURCE> --output <WORK>\pre-cull-report [--no-faces]Only--source/--output/[--no-faces]. Produces<WORK>\pre-cull-report\scores.jsonmetadata.json+thumbs. Keepers =is_keeper==true. Conservative keep; no deletion; originals read-only; output redirected into<WORK>(never parent). No keepers => clear error. Malformedscores.json=> clear error. NOTE: photo-cull scans only top-level.jpg(non-recursive).
- photo-develop
python <photo-develop>\scripts\run_pipeline.py --source <SOURCE> --cull <WORK>\pre-cull-report --output <WORK>\photo-ai [--sample N] [--no-previews] --profile <read-only-neutral> [--lightcraft-cli PATH]CPU; non-destructive; reusesscores.json. Produces<WORK>\photo-ai+<WORK>\photo-ai\xmp\<stem>.xmp(Adobe Camera Raw, PV201211.0, with a per-frameToneCurvePV2012, read-only suggestions) +.state.json. NOT--adjacent-sidecars. The LightCraft executable is auto-detected and passed to this stage too, so the tone curve is calibrated against the same renderer that produces the export; previews and exports then show the same image. NOT--force. Never writes source XMP. Style read-only / no style written: a shipped all-zeroassets\neutral-profile.jsonis passed as photo-develop's documented--profile; this prevents photo-develop from auto-creating~/.config/opencode/photo-develop/style-profile.json; nothing is learned or written. NOTphoto-style-edit. NOTE: photo-develop only emits XMP for keepers with a matching.ARW; per-image errors are surfaced, not silently dropped (no silent unsupported drop). - photo-render
python <photo-render>\scripts\run_pipeline.py --source <SOURCE> --cull <WORK>\pre-cull-report --xmp <WORK>\photo-ai\xmp --output <WORK>\photo-render [--sample N] [--format jpeg|tiff|png] [--jpeg-quality 92] [--max-long-edge N] [--recursive] [--keep-pairs] [--emit-xmp] [--require-xmp] [--renderer auto|builtin|lightcraft] [--lightcraft-cli PATH]--require-xmpis always added unless--allow-missing-xmpis given: a frame without a sidecar was deliberately not selected for development, so it is reported asskippedinstead of being exported with default settings. Applies ONLY already-present XMP; prefers<WORK>\photo-ai\xmp(photo-develop output); source read-only; no source-XMP overwrite; sRGB (only); JPEG q92; full resolution unless--max-long-edge; output<WORK>\photo-render\rendered\*+summary.json+report.html(+rendered-xmp\*.xmpiff--emit-xmp; verbatim copies; never overwrite source); no style learning; no retouching; no network; no Adobe pixel parity;applied_fields/unsupported_fields/unsupported_field_countsreported; sample =>status=sample&full_pipeline_claim=false.
Passthrough (forwarded; nothing else invented)
--no-faces, --no-previews, --sample N, --format, --jpeg-quality,
--max-long-edge, --recursive, --keep-pairs, --emit-xmp, --renderer,
--lightcraft-cli, --no-cull, --no-develop, --no-render,
--reuse-cull, --cull, --xmp, --overwrite-export, --export-dir,
--work-dir, --dry-run. Defaults: format=jpeg, jpeg-quality=92,
max-long-edge=full, renderer=auto, color_space=sRGB.
Export rule (the point)
<SOURCE>session folder read-only.<parent> = os.path.abspath(<source>).- Final images are COPIED, not moved, from
<WORK>\photo-render\rendered*(finishedrendered/; only image files) into<parent>\Exporti.e.<source>\Export. Create it. Name exactlyExport.<parent>= abspath (source); nothing else is written into<parent>. Only<parent>\Export<WORK>are touched.
--export-diroverrides the target (absolute or relative; honored).- no-op if already inside
Export: don't createExport\Export, don't re-copy content already inside the export dir, don't nest when<parent>is already inside anExportdirectory. - Only these go in
Export: final rendered images + optional render-summary (summary.json, copied) + optional report (report.html, copied) + optionalExport\export-summary.jsonmanifest- optional emitted XMP (
<WORK>\photo-render\rendered-xmp\*.xmp, only with--emit-xmp, verbatim; never overwrites source XMP). Nothing else.
- optional emitted XMP (
- Stable order (sorted case-insensitive then name). Deterministic unique
names. Don't overwrite existing
Exportfiles unless--overwrite-export. collision ->name-2.ext(thenname-3.ext, …; also against names added this run). Never overwrite sources. No source EXIF/XMP rewrite. - All intermediates (
pre-cull-report,photo-ai,photo-render,rendered/, logs,.state.json, rendered-xmp source, …) go to<WORK>(default<parent>.photo-export-work; or--work-dir; temp allowed; never insideExport; never inside read-only<SOURCE>; nothing in<parent>outsideExport+<WORK>). Nophoto-ai/pre-cull-reportin source. No style written. No adjacent writes. - CLI
--work-dir,--export-dir,--overwrite-export,--dry-run,--reuse-cull/--cull,--xmp,--no-cull/--no-develop/--no-render, and all listed passthrough flags.
Reuse
--reuse-cull: skip photo-cull; reuse<work>\pre-cull-report.--cull <dir|scores.json>: reuse existing cull; skip photo-cull.--xmp <dir>: reuse existing XMP; default<work>\photo-ai\xmp.--no-cull/--no-develop/--no-render: skip stage; reuse artifacts in<work>(pre-cull-report,photo-ai+xmp,photo-render+renderedsummary.json).
- Reuse
<work>pre-cull-report,photo-ai\xmp, and.state.json. <work>\.state.json(photo-export resume; no secrets) +<work>\photo-ai\.state.json(photo-develop checkpoint) written.--dry-run: print planned stage commands + planned export targets; write nothing; run no siblings;full_pipeline_claim=false.
Manifest (Export\export-summary.json, optional; no secrets)
schema_version, tool, status, full_pipeline_claim, sample,
sample_mode, source, parent, work_dir, export_dir, rendered_dir,
stages (cull/develop/render/export status + reused artifacts + errors),
counts (total_records/keepers/rendered/exported/render ok+error/applied +
unsupported instances; unsupported_dropped=0), keepers, applied_fields,
unsupported_fields, unsupported_field_counts, renderer, renderer_used,
renderer_backend, render_status, render_full_pipeline_claim, format,
jpeg_quality, color_space=sRGB, max_long_edge, recursive, keep_pairs,
emit_xmp, overwrite_export, no_op, exported_images, render_summary,
report, emitted_xmp, reused_artifacts, reused, honesty, no_secrets.
full_pipeline_claim = NOT sample AND render full_pipeline_claim AND no stage
errors AND not no-op AND rendered>0. Sample != full. No secrets/credentials.
Clear per-stage errors
Missing sibling tool/script, missing python, missing/unreadable source,
malformed scores.json, no keepers, malformed XMP, per-image render error,
photo-develop per-image errors, missing reuse artifact, bad flags — all produce
a clear [stage=...] error and nonzero exit; nothing is silently dropped.
unsupported_fields always carried through.
Honesty / non-goals
Local CPU-only; deterministic; non-destructive; originals read-only; no network;
no source/XMP mutation; no adjacent writes; no source photo-ai /
pre-cull-report; no style learning; not photo-style-edit; no retouching;
no new renderer math; no source deletion; no invented flags; no reimplementing
siblings; no sibling modification; no silent unsupported drop; sample !=
full claim; no Adobe Lightroom / Capture One / Aftershoot pixel parity;
not GPU. Underlying model/provider internals are private.
Remaining limits
- Inherits siblings' limits verbatim (see photo-cull / photo-develop /
photo-render SKILL.md): photo-cull scans only top-level
.jpg, non-recursive, conservative; photo-develop needs matching.ARWper keeper to emit XMP (otherwise rendered unedited + reported; per-image errors surfaced), reads an existing profile read-only but applies photo-develop's own conservative suggestions; photo-render builtin renderer is a documented approximation (not Adobe-exact),crs:CameraProfile/HSL/split-toning/lens/local-adjust/noise+ sharpen (builtin)/named-curve-without-points/EXIF-only/AlreadyAppliedre-derivation etc. unsupported & reported, sRGB-in→sRGB-out, crop/WB/contrast approximations, LightCraft (if used) not Adobe, output determinism depends on installedrawpy/Pillow/numpy, RAW decode depends on LibRaw version. - Photo-export itself adds no pixels; final quality == photo-render output.
<parent>\Exportre-run: collisionname-2.extunless--overwrite-export.- On
--recursivere-runs, photo-render itself scans<source>; excludeExportoutputs manually if re-rendering an already-exported source. no-op if already inside Exportinterpretation (see Export rule) is applied conservatively;--export-dirinto source root is honored but source originals are still never overwritten.- Default
<work>is sibling<parent>.photo-export-work;--work-dirrejected if inside read-only source or inside Export.
Tests
python -m py_compile "$env:USERPROFILE\.config\opencode\skills\photo-export\scripts\run_pipeline.py"
python -m unittest discover -s "$env:USERPROFILE\.config\opencode\skills\photo-export\tests" -v
Stdlib unittest; no network; no sibling modification; uses synthetic temp
sources + temp fake sibling tree for chaining/order/error tests + (where real
sibling deps + real .ARW are available) real end-to-end. Covers chaining
order, scores.json keepers, photo-ai/xmp produced+preferred, sample,
<source>\Export created + rendered copied, nothing in parent outside
Export+work, source bytes + source XMP unchanged (sha256), no adjacent writes,
no source photo-ai/pre-cull-report, no style written, sRGB, q92, max-long-edge,
collision, overwrite, dry-run, missing tool/source/malformed/no-keepers clear
error, manifest schema, no silent drop, no network, stable order.