景序 · Jingxu Photos(macOS 照片整理与修图)
Resolve scripts/photo relative to the directory containing this SKILL.md (do not assume the current working directory is the skill directory). It compiles one native helper (Jingxu Photos.app) under ~/Library/Application Support/Jingxu Photos/ and shares it across coding agents and Alfred.
- Sandbox & permissions: The first run compiles Swift and signs the helper; Apple Photos commands launch
Jingxu Photos.appvia LaunchServices (/usr/bin/open) and may prompt macOS to allow Jingxu Photos in System Settings → Privacy & Security → Photos. If your agent runs commands inside an OS sandbox that blocks~/Library/Application Support/,xcrun/codesign, or LaunchServices, run these commands with host permissions (or ask the user to approve). Always treat the JSON response as the source of truth.
Plan and preview
- Use
photo plan --days 3 --limit 12 --allow-downloadfor recent iCloud Photos; use--album "相簿名"for an entire ordinary album,--shared-album "共享相簿名" --allow-downloadfor an iCloud Shared Album (usephoto shared-albumsto list available shared albums first), or combine with an explicit date window. Usephoto plan FILE [FILE ...]for Finder files. If the user has chosen a single photo for a preview or confirms the scene,--include-balancedand--force-landscapecan override the candidate and landscape heuristics. Quote paths. Pass actual filenames as arguments, not shell expressions. - Report the number of previews, skipped photos, HDR/RAW status, and any failures. Include the job ID and selected preview links. A plan creates local previews (preserving Display P3 and HDR Gain Map when present) and a job report. Screenshots are excluded from library repair; ordinary photos with balanced tones can be skipped.
- The engine tries matching recipes first. If there is no usable recipe, or if the user wants a new style, read Adaptive templates. Use local reports and a few representative metrics for a proposed rule. Read representative photo pixels only if the user asks for visual judgment or agrees to selected images. Use
template checkfor a test recipe,template addfor a reusable version,template remove IDto delete a custom template, andreplan JOB --item N --template NAMEto render a revised preview.
Review and write back
- Local previews are available in the plan response; every preview includes a subtle corner watermark (
景序 · 预览) and embedded system metadata (jx:prefixed IPTC keywords and a[景序]caption listing the exact adjustments) so the user can tell previews apart from originals. If the user requests iPhone or Photos album review, runphoto publish JOBto list candidates, thenphoto publish JOB --committo add both the watermarked previews and their paired originals (for personal library items, sorted adjacent by timestamp) to 修图 · 待审核. Tell the user to add satisfactory previews to 修图 · 通过, adjustments-needed previews to 修图 · 重修, or photos they want to leave untouched to 修图 · 不修 — they do not need to manually remove items from 修图 · 待审核, and should never delete the original photo. Use repeated--item Nto target a subset. Published previews preserve HDR Gain Map for HDR photos; Live Photo review previews are still JPEGs. photo review JOBreads album membership across 通过 / 重修 / 不修 (being in 2+ decision albums is a conflict), automatically removes decided items (both preview and paired original, album membership only — never deleting originals) from 修图 · 待审核, automatically deletes verified managed previews in 修图 · 不修 (leaving originals untouched and skipping them in future incremental scans), and reads user-written keywords (any keyword without thejx:prefix) and captions (any line without[景序]) on 修图 · 重修 previews.- When a
redoitem hasneedsLLM: true(user wrote adjustment keywords/notes): act as the parameter planner ONLY — never edit pixels directly. First checkphoto recipe listto see if an existing saved recipe already fits; otherwise read the item'suserKeywords/userNote,beforeMetrics/afterMetrics, andcurrentParameters, translate the user's intent into iPhone Photos-style-100..100sliders (exposure,brilliance,highlights,shadows,contrast,brightness,blackPoint,saturation,vibrance,warmth,tint,definition,sharpness0..100), write a JSON file, and runphoto replan JOB --item N --params-file PATH --save-recipe ID --recipe-title "..." --recipe-prompt "..."so the native Core Image engine renders the revised preview and saves the recipe inrecipes.jsonfor future reuse (--recipe ID). - When a
redoitem has no user keywords/notes: replan with a template or saved recipe without extra LLM tuning.
- When a
- A preview in both decision albums is a conflict.
photo apply JOBlists ready items. If the user asks to apply approved edits, or has already instructed the system to apply them after album approval, usephoto apply JOB --commit. Full-resolution writebacks NEVER have a watermark. After each approved item is safely applied, the helper removes the preview from 修图 · 通过 / 修图 · 待审核 and automatically deletes the verified managed preview asset (JingxuPhotos-Preview-*+jx:预览metadata; pass--keep-previewsto retain previews; original photos are NEVER deleted). The helper rechecks membership and the original version, protects existing adjustments, and records the writeback:- Gain Map HDR stills (HEIC/JPEG with Apple or ISO Gain Map) and HDR Live Photos with SDR paired video preserve Display P3 and HDR Gain Map on writeback.
- iCloud Shared Album items (
--shared-album) are not copied into the personal library duringplan; onapply --commit, each approved item is cloned into the personal library (placed in 共享修图 · <相簿名>), non-destructively edited with the template (preserving Display P3 and HDR Gain Map whenever present on the shared item), and tracked byimportedAssetIDso retries never duplicate andrevertstill restores the cloned copy to its original state. - RAW / ProRAW, non-gain-map HDR stills, and HLG/PQ/Dolby Vision HDR Live Photo videos remain preview-only and are never modified automatically.
- Use
photo replan JOBfor redo/template-needed items after refreshing review. The new job has its own approval. If the user requests a rollback, usephoto revert JOB --item N --commit. This only reverts a current edit that belongs to that job. - Use
photo cleanup JOBto list disposable managed previews in Apple Photos, and add--commitwhen the user requests cleanup. Usephoto jobsto list recent local jobs andphoto prune --days 14(add--committo delete) to free old local preview caches without touching Apple Photos.
Archive, permissions, and repeat runs
photo archive --days 7previews how screenshots would be filed into 截图归档. Add--wechatto also match WeChat-saved photos into 微信图片, or use--wechat-only(optionally--wechat-album "微信") to file only WeChat-saved photos without touching screenshots; add--library "/path/Photos Library.photoslibrary"if the library uses a custom path. Only use--commitfor a requested archive change. Missing source labels remain unknown; report database access errors without asking for broad disk access.photo trips --days 180(or--from YYYY-MM-DD --to YYYY-MM-DD) automatically computes visited cities from photo GPS coordinates without needing manual place arguments, automatically detects and skips the user's home city (pass--include-hometo keep it), interpolates nearby same-day non-GPS indoor photos (±2h), and groups photos by month and city into albums namedYYYY.M·地点(e.g.2026.7·南京,2026.8·南京). Optional overrides:--placeto narrow to specific cities,--folder "旅行足迹"to nest newly created albums inside a Photos folder,--include-videosto include videos, and--committo apply. Reverse geocoding uses a local spatial cache (geocode-cache.json).- Use
photo plan --incremental --days 7 --allow-downloadfor repeat scans. The first call seeds a date window. Later calls follow the macOS Photos change history, filter out videos/managed previews/self-applied updates, cap per-item error retries, and leave unread items queued. Use--reset-incrementalfor a new seed if the token cannot resume. Running this command does not create a recurring schedule. - For command options, multi-agent installation, storage locations, Alfred, or unusual outcomes, read Operations.