CommunityImagegithub.com

jingxu-photos

Organize, analyze, and naturally enhance landscape photos on macOS with Display P3 and HDR Gain Map preservation. Use for Apple Photos and iCloud Photo Library, Live Photos, local image files or Alfred, screenshot and WeChat album archiving, adaptive editing templates, and reviewing, applying, or reverting photo edits.

What is jingxu-photos?

jingxu-photos is a Claude Code agent skill that organize, analyze, and naturally enhance landscape photos on macOS with Display P3 and HDR Gain Map preservation. Use for Apple Photos and iCloud Photo Library, Live Photos, local image files or Alfred, screenshot and WeChat album archiving, adaptive editing templates, and reviewing, applying, or reverting photo edits.

Works with✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/kalarita/jingxu/tree/HEAD

Installed? Explore more Image skills: steipete/songsee, affaan-m/frontend-design, mattpocock/improve-codebase-architecture · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

景序 · 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.app via 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

  1. Use photo plan --days 3 --limit 12 --allow-download for recent iCloud Photos; use --album "相簿名" for an entire ordinary album, --shared-album "共享相簿名" --allow-download for an iCloud Shared Album (use photo shared-albums to list available shared albums first), or combine with an explicit date window. Use photo plan FILE [FILE ...] for Finder files. If the user has chosen a single photo for a preview or confirms the scene, --include-balanced and --force-landscape can override the candidate and landscape heuristics. Quote paths. Pass actual filenames as arguments, not shell expressions.
  2. 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.
  3. 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 check for a test recipe, template add for a reusable version, template remove ID to delete a custom template, and replan JOB --item N --template NAME to 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, run photo publish JOB to list candidates, then photo publish JOB --commit to 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 N to target a subset. Published previews preserve HDR Gain Map for HDR photos; Live Photo review previews are still JPEGs.
  • photo review JOB reads 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 the jx: prefix) and captions (any line without [景序]) on 修图 · 重修 previews.
    • When a redo item has needsLLM: true (user wrote adjustment keywords/notes): act as the parameter planner ONLY — never edit pixels directly. First check photo recipe list to see if an existing saved recipe already fits; otherwise read the item's userKeywords / userNote, beforeMetrics / afterMetrics, and currentParameters, translate the user's intent into iPhone Photos-style -100..100 sliders (exposure, brilliance, highlights, shadows, contrast, brightness, blackPoint, saturation, vibrance, warmth, tint, definition, sharpness 0..100), write a JSON file, and run photo 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 in recipes.json for future reuse (--recipe ID).
    • When a redo item has no user keywords/notes: replan with a template or saved recipe without extra LLM tuning.
  • A preview in both decision albums is a conflict. photo apply JOB lists ready items. If the user asks to apply approved edits, or has already instructed the system to apply them after album approval, use photo 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-previews to 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 during plan; on apply --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 by importedAssetID so retries never duplicate and revert still 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 JOB for redo/template-needed items after refreshing review. The new job has its own approval. If the user requests a rollback, use photo revert JOB --item N --commit. This only reverts a current edit that belongs to that job.
  • Use photo cleanup JOB to list disposable managed previews in Apple Photos, and add --commit when the user requests cleanup. Use photo jobs to list recent local jobs and photo prune --days 14 (add --commit to delete) to free old local preview caches without touching Apple Photos.

Archive, permissions, and repeat runs

  • photo archive --days 7 previews how screenshots would be filed into 截图归档. Add --wechat to 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 --commit for 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-home to keep it), interpolates nearby same-day non-GPS indoor photos (±2h), and groups photos by month and city into albums named YYYY.M·地点 (e.g. 2026.7·南京, 2026.8·南京). Optional overrides: --place to narrow to specific cities, --folder "旅行足迹" to nest newly created albums inside a Photos folder, --include-videos to include videos, and --commit to apply. Reverse geocoding uses a local spatial cache (geocode-cache.json).
  • Use photo plan --incremental --days 7 --allow-download for 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-incremental for 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.

Related Skills