AGENT SKILL

craft-photo-pipeline

Process a photo from RAW to delivery with ArtCraft apps - LightCraft develop and denoise, PhotoCraft retouch (content-aware removal, or generative replace-region when credentials exist), PNG/JPG/WebP/TIFF export set; verified and resumable. Use for "develop this RAW and retouch it", "remove the object and export for web and print".

License 许可
MIT
最近更新
2026-11-12
Stars
★ 348
Forks
56

01 前言 Front Matter

name
craft-photo-pipeline
description
Process a photo from RAW to delivery with ArtCraft apps - LightCraft develop and denoise, PhotoCraft retouch (content-aware removal, or generative replace-region when credentials exist), PNG/JPG/WebP/TIFF export set; verified and resumable. Use for "develop this RAW and retouch it", "remove the object and export for web and print".

03 SKILL.md 正文

craft-photo-pipeline — RAW → develop/denoise → retouch → export set

One photo through three apps: LightCraft develops (exposure, colour, noise reduction) and writes a lossless png; PhotoCraft retouches (a region removed or, with image credentials, regenerated); PhotoCraft exports the delivery set. Read lightcraft and photocraft first. Resumable-job rules are in the craft-studio router, section Craft jobs.

Step table

# Step Tool Input → Output Gate
0 Preflight + job agent request → job.json check: job
1 Develop + denoise LightCraft RAW/jpg/png → 01-develop/dev.png pi-craft verify --size
2 Retouch (optional) PhotoCraft dev.png → 02-retouch/retouched.png pi-craft verify --size --frame-diff
3 Export set PhotoCraft master → 03-export/photo-<w>.webp, photo-print.tif, photo.jpg pi-craft verify --size

Hand-off formats: png (lossless, 8-bit) between steps — never re-compress through jpg before the last step; tiff for print, webp/jpg for screens. --alpha is not asserted in this workflow (photos have none).

Step 0 — Preflight and job

Output: craft-jobs/<slug>/job.json (created or loaded). Gate: check: job.

Sibling Package Check If missing
pi-nano-banana already a dependency of craft-apps usable credentials (GEMINI_API_KEY, or --backend pi) no credentials: skip the generative replace-region and tell the user; use the content-aware removal of step 2, or stop when the request needs generated pixels

Camera RAW (DNG, ARW, NEF, RAF…) and png/jpg/tif inputs work; the synthetic DNGs from lightcraft-cli synth-merge are what this skill was checked with, so say so if a real camera RAW misbehaves. Ask for the delivery targets (web width, print) up front. Set up the job (Craft jobs in craft-studio: slug rule, job-helper) and run Resume. API keys are never written to job.json or reports.

# run from the directory that contains craft-jobs/ (SLUG set as in step 0)
jq -e '.name and .workflow and (.steps | type == "object")' "craft-jobs/$SLUG/job.json"

Step 1 — Develop and denoise

Output: 01-develop/dev.png. Gate: pi-craft verify — --size (the long edge you asked for, aspect ratio of the source).

lightcraft-cli render develops one file and writes the result; the original is never modified. Slider ids come from pi-craft lightcraft exec controls, never from memory; out-of-range values are clamped silently. Classic denoise is two sliders (detail.nrLuminance, detail.nrColor, 0–100). --size N is the long edge; without it you get the full size.

pi-craft lightcraft exec controls | grep -i -E "exposure|nrLuminance|nrColor"
pi-craft lightcraft exec render "$SRC" -o "$JOB/01-develop/dev.png" --size 3000 \
  --set light.exposure=0.3 --set detail.nrLuminance=30 --set detail.nrColor=25
pi-craft verify "$JOB/01-develop/dev.png" --size 3000x2000

AI denoise is a separate, opt-in model path (denoise.models.install / denoise.models.download need the user's explicit licence acceptance, acknowledged: true, and a model file or pinned download): offer it only if the user asks, never acknowledge a licence on their behalf, and gate its output the same way. pi-craft verify --frame-diff compares luma only: a pure colour edit can read ~0 % different — prove it with exposure or a derived property.

Step 2 — Retouch (optional)

Output: 02-retouch/retouched.png. Gate: pi-craft verify — --size (unchanged) and --frame-diff 0:<dev.png>>0.1 (the retouch changed pixels).

Selections live inside one run: select and fill in the same invocation. Remove (no generation, always available): select.rect, grow it a few px (select.modify.expand), edit.contentAwareFill. Replace (needs credentials): pi-photocraft replace-region — only the padded crop goes to the generator, pixels outside it stay identical; see photocraft for the options. With no credentials skip it and say so.

pi-craft photocraft exec run "$JOB/01-develop/dev.png" \
  --cmd select.rect --params '{"x":100,"y":100,"width":200,"height":150}' \
  --cmd select.modify.expand --params '{"radius":6}' --cmd edit.contentAwareFill --params '{}' \
  --out "$JOB/02-retouch/retouched.png"
pi-craft verify "$JOB/02-retouch/retouched.png" --size 3000x2000 --frame-diff "0:$JOB/01-develop/dev.png>0.1"

No retouch wanted? Skip the step and use dev.png as the master of step 3.

Step 3 — Export set

Output: 03-export/photo-1200.webp, 03-export/photo-print.tif, 03-export/photo.jpg. Gate: pi-craft verify — --size on every file.

PhotoCraft opens the master and writes each format by extension (--format/--quality for lossy ones); resize first with image.imageSize (keep the aspect ratio exactly). One --out per run: one run per file.

pi-craft photocraft exec run "$JOB/02-retouch/retouched.png" --cmd image.imageSize --params '{"width":1200,"height":800}' --out "$JOB/03-export/photo-1200.webp" --format webp --quality 85
pi-craft photocraft exec run "$JOB/02-retouch/retouched.png" --out "$JOB/03-export/photo-print.tif"
pi-craft photocraft exec run "$JOB/02-retouch/retouched.png" --out "$JOB/03-export/photo.jpg" --format jpg --quality 92
pi-craft verify "$JOB/03-export/photo-1200.webp" --size 1200x800
pi-craft verify "$JOB/03-export/photo-print.tif" --size 3000x2000

Resume

Follow the Craft jobs convention in craft-studio: read craft-jobs/<slug>/job.json as data, confirm the job name, and start at the first step with no passing report or whose recorded inputs (path, size, mtime) changed — a re-shot source, changed slider values. Re-run every step downstream of it (a new develop re-retouches and re-exports) and reuse the verified outputs before it. Record each step with the job-helper snippet after its gate passed; keep the slider values in the step directory so a result is reproducible.

When a gate fails

Stop at the failed gate; never continue past it. Re-discover the commands you used (pi-craft lightcraft exec controls / commands; pi-craft photocraft exec commands --filter <word> — LightCraft and PhotoCraft have no describe), repeat the step and re-run the gate. At most 2 retries per step; after the second failure stop and report the verify output and what was tried. pi-craft verify exit 3 means a probe tool is missing (ffprobe/ffmpeg): stop and report the missing tool — never treat it as a pass.

Recipes

# A synthetic DNG developed with denoise sliders -> a blemish removed (content-aware fill) -> webp/tif/jpg export set.
mkdir -p 01-develop 02-retouch 03-export
pi-craft lightcraft exec synth-merge hdr -o brackets
pi-craft lightcraft exec render brackets/bracket-1.dng -o 01-develop/dev.png --size 900 \
  --set light.exposure=0.3 --set detail.nrLuminance=30 --set detail.nrColor=25
pi-craft verify 01-develop/dev.png --size 900x600

# stand-in for a blemish: a red box drawn on the developed frame, then removed again by PhotoCraft
ffmpeg -v error -y -i 01-develop/dev.png -vf drawbox=x=100:y=100:w=200:h=150:color=red:t=fill blemish.png
pi-craft photocraft exec run blemish.png \
  --cmd select.rect --params '{"x":100,"y":100,"width":200,"height":150}' \
  --cmd select.modify.expand --params '{"radius":6}' --cmd edit.contentAwareFill --params '{}' \
  --out 02-retouch/retouched.png
pi-craft verify 02-retouch/retouched.png --size 900x600 --frame-diff 0:blemish.png\>0.1

pi-craft photocraft exec run 02-retouch/retouched.png --cmd image.imageSize --params '{"width":600,"height":400}' --out 03-export/photo-600.webp --format webp --quality 85
pi-craft photocraft exec run 02-retouch/retouched.png --out 03-export/photo-print.tif
pi-craft photocraft exec run 02-retouch/retouched.png --out 03-export/photo.jpg --format jpg --quality 92
pi-craft verify 03-export/photo.jpg --size 900x600
pi-craft verify 03-export/photo-print.tif --size 900x600
pi-craft verify 03-export/photo-600.webp --size 600x400

04 同仓库更多 Skills

BlackBeltTechnology
BlackBeltTechnology/pi-agent-dashboard

youtube-srt

Download YouTube subtitles (SRT + timestamped TXT) for a channel, playlist or video via yt-dlp, no media download; optionally mine them into a categorized catalog (e.g. AI models by function, open weights, local runnability, hardware tier). Use on "download the srt of this video", "transcripts of channel X for the last N months", "catalog the models AI Search talked about", "update docs/models".

★ 348
BlackBeltTechnology
BlackBeltTechnology/pi-agent-dashboard

video-transcription

Transcribe video and audio files to SRT subtitles with speaker diarization using the Soniox (default) or AssemblyAI API. Use when the user wants to transcribe meetings, videos, or audio files. Supports MKV, MP4, MOV, M4A, MP3. Triggers on "/transcribe", "transcribe my meetings", "transcribe videos in ~/Movies", or any request to convert audio/video to text.

★ 348
BlackBeltTechnology
BlackBeltTechnology/pi-agent-dashboard

speaker-id

Name anonymous diarized SRT speakers from a persistent local voiceprint library and repair speaker drift; local, CPU-only, no API key. Triggers "who is speaker 2", "put names on the transcript", "label the meeting SRT", "the diarization split one person into three", "enroll my voice". Backed by the pi-voiceid CLI.

★ 348
BlackBeltTechnology
BlackBeltTechnology/pi-agent-dashboard

veo-showreel-production-kit

Turn a video timeline + voiceover into a reproducible, sliceable Veo 3.1 prompt package with a consistency anchor and AI storyboard sketches.

★ 348
BlackBeltTechnology
BlackBeltTechnology/pi-agent-dashboard

veo-generator

Render a scripted video project into mp4 clips with the Google Veo 3.1 API. Reads a project's shot package (shots/*.md), one clip per camera cut, reusing each shot's prompt and sketch — world anchor only with `--with-reference`, seed unless `--no-seed`. Use on "render the Veo video for <project>", "generate the videos from the shot scripts", "make the clips with Veo".

★ 348
BlackBeltTechnology
BlackBeltTechnology/pi-agent-dashboard

hyperframes-showreel

Turn real screen and site footage into a rhythmic showreel rendered with HyperFrames: sampling, edit script, redacted clips, a generated composition, Veo only as additive FX, music edit + camera punches, delivery render and export QA. Use on "make a showreel from these recordings", "build the HyperFrames video", "assemble the footage edit", "render and QA the showreel".

★ 348