agentleFS
drolosoftdrolosoft/immich-photo-manager/skills/rotate-photos/SKILL.md

rotate-photos

Skill51 starsChanged 3 months agoMITView on GitHub

Bulk rotate photos in an Immich library, by album or asset IDs. Non-destructive, original files are never modified. Supports undo/revert. Use when the user says "rotate photos", "rotate album", "fix rotation", "photos are sideways", "rotate 90", "rotate clockwise", "rotate counterclockwise", "upside down photos", "wrong orientation", "bulk rotate", "rotate multiple", or any variation of wanting to rotate one or more photos.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 1 is distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If ping succeeds → proceed with the skill normally.

    line 19
  2. Very specific:

    If ping fails or the MCP tools are not available → STOP.

    line 20
  3. Very specific:

    If wrong direction: call again (rotation accumulates) or revert_asset_edits(album_id="...")

    line 56
  4. Distinctive:

    Clean up: Delete the temporary album when done (photos are not affected)

    line 57
  5. Very specific:

    Use get_asset_info(asset_id) and check:

    line 98
  6. Very specific:

    When generating HTML galleries or visual reports, thumbnails must be fetched with ?edited=true to reflect rotation.

    line 106

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Rotate Photos

Connection Required: ALWAYS CHECK FIRST

Before doing ANYTHING else in this skill, call ping on the Immich MCP server.

  • If ping succeeds → proceed with the skill normally.
  • If ping fails or the MCP tools are not available → STOP. Do not continue. Tell the user:

Immich is not connected. This plugin needs a running Immich MCP server to work.

Run /setup-immich-photo-manager to configure your Immich connection.

Do NOT skip this check. Do NOT try to run any other tool first. Always ping, always block if it fails.

How It Works

Rotation uses Immich's non-destructive edits API. The original file is never modified. Immich stores the rotation as a display transform that is applied when serving thumbnails and previews.

Key Architecture Details

ConceptDetail
API endpointPUT /assets/{id}/edits
StorageServer-side, persists in Immich database forever
Original fileNever touched
ThumbnailsServed rotated via ?edited=true query parameter
AccumulationEach PUT replaces all edits, so the tool must read the current angle and add
Full circle360° → edits are deleted entirely (isEdited returns to false)

MCP Tools

ToolPurpose
rotate_assetsRotate by album_id or asset_ids. Accumulates with existing rotation.
revert_asset_editsRemove all edits (rotation, crop, mirror), back to original.

Recommended User Workflow

  1. In Immich web UI: Browse library, spot wrongly-rotated photos
  2. Multi-select the rotated photos and add them to an album (e.g., "Fix Rotation")
  3. Use this skill: rotate_assets(album_id="...", angle=90)
  4. Verify in the Immich web UI: photos should appear rotated
  5. If wrong direction: call again (rotation accumulates) or revert_asset_edits(album_id="...")
  6. Clean up: Delete the temporary album when done (photos are not affected)

Rotation Angles

AngleDirectionUse when
90ClockwisePhoto tilted left
180Upside downPhoto inverted
270Counter-clockwisePhoto tilted right

Calling rotate_assets multiple times accumulates:

Current+ angleResult
0°+90°90°
90°+90°180°
180°+90°270°
270°+90°0° (edits removed, back to original)

Examples

Rotate an entire album 90° clockwise

rotate_assets(album_id="uuid-of-album", angle=90)

Rotate specific photos 270° (counter-clockwise)

rotate_assets(asset_ids=["uuid-1", "uuid-2", "uuid-3"], angle=270)

Undo all rotation on an album

revert_asset_edits(album_id="uuid-of-album")

Check current rotation state of an asset

Use get_asset_info(asset_id) and check:

  • isEdited: true if any edits exist
  • width / height: swapped if rotated 90° or 270°

For the exact angle, the tool reads GET /assets/{id}/edits internally.

Showing Results to the User

When generating HTML galleries or visual reports, thumbnails must be fetched with ?edited=true to reflect rotation. The MCP thumbnail tools (get_asset_thumbnail, get_album_thumbnails, get_thumbnails_batch) do this by default.

Limitations

  • No auto-detection: There is no reliable way to automatically find wrongly-rotated photos. The user must identify them visually and add them to an album.
  • CLIP search doesn't help: Searching for "sideways photo" returns semantically similar images, not actually misrotated ones.
  • EXIF orientation: Immich already handles EXIF orientation tags when generating thumbnails. Photos that appear wrong in the UI have a genuine orientation problem that needs manual correction.
  • Angle must be a multiple of 90: Arbitrary angles are not supported.
  • Images only: Immich's edits API applies to images, not videos, so a video inside a mixed album is not rotated. get_capabilities reports this behaviour for whichever server version is connected, and anything the server rejects comes back in the failed count with its reason.

Common Mistakes

MistakeFix
Calling rotate_assets twice expecting it to stack without the accumulation fixThe tool handles this: it reads the current angle and adds. No action needed.
Trying to detect rotated photos with CLIP searchDon't. Have the user identify them visually and create an album.
Applying CSS rotation to thumbnails instead of using ?edited=trueAlways use the real edited thumbnail from the API. Never fake it with CSS.
Forgetting that edits are per-asset, not per-albumA photo rotated in Album A will also appear rotated in Album B.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.