agentleFS
drolosoftdrolosoft/immich-photo-manager/skills/library-health-report/SKILL.md

library-health-report

Skill51 starsChanged 3 months agoMITView on GitHub

Run a full health check on an Immich photo library: asset counts, storage usage, metadata completeness, orphaned files, and quality indicators. Use when the user says "library health", "health report", "library status", "library audit", "how healthy is my library", "photo stats", "library overview", "what's in my library", "library report", or any variation of wanting a full overview of their photo library's state.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 5 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    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 18
  2. Very specific:

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

    line 19
  3. Distinctive:

    After bulk imports to verify everything landed correctly

    line 38
  4. Distinctive:

    Before cleanup operations to understand baseline

    line 39
  5. Very specific:

    Start with get_statistics.

    line 49
  6. Distinctive:

    Check for gaps in critical metadata fields:

    line 100
  7. Distinctive:

    Always ask the user which format they prefer.

    line 183
  8. Distinctive:

    Always show the query execution time so users know what to expect

    line 191

≈ “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

Library Health Report

⚠️ 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. You'll need:

  1. Your Immich server URL (e.g., http://192.168.1.100:2283)
  2. An Immich API key (how to create one)
  3. The MCP server configured (see /setup-immich-photo-manager)

Nothing in this plugin will work until the connection is configured.

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

Generate a full health assessment of an Immich photo library. Covers asset inventory, storage breakdown, metadata quality, and recommendations to act on.

When to Use

  • First time exploring a new Immich library
  • Periodic checkups (monthly/quarterly)
  • After bulk imports to verify everything landed correctly
  • Before cleanup operations to understand baseline

Report Sections

Section 0: What this server can do

Call get_capabilities once before anything else: it reports the server version, which features are switched on (OCR, smart search, facial recognition, map) and the quirks of that Immich major. A health report that says "GPS coverage 0%" is misleading when the map feature is simply off, and a section about OCR text makes no sense on a server without OCR. Mention the version in the report header.

Section 1: Asset Inventory

Start with get_statistics. It is the official Immich count of photos, videos and storage used, in one call and with no database access. search_statistics(...) answers any narrower count ("how many videos", "how many favorites") with one more call.

The query below is an optional fallback for the columns the API does not expose, such as the trash breakdown by type. The plugin never provides database access, so it only applies if you already have psql on your own Immich:

-- Total assets by type
SELECT type, count(*) as total,
  pg_size_pretty(sum(("exifInfo"->>'fileSizeInByte')::bigint)) as total_size
FROM asset
WHERE "deletedAt" IS NULL
GROUP BY type;

-- Trash contents
SELECT type, count(*) as trashed
FROM asset
WHERE "deletedAt" IS NOT NULL
GROUP BY type;

Present as:

ASSET INVENTORY
  Photos:          39,596
  Videos:           4,983
  Total live:      44,579
  In trash:         8,433
  Storage used:    ~180 GB

Section 2: Import Sources

Identify where photos came from:

SELECT
  CASE
    WHEN "originalPath" LIKE '%Apple Fotos%' OR "originalPath" LIKE '%Apple Photos%' THEN 'Apple Photos'
    WHEN "originalPath" LIKE '%Google Fotos%' OR "originalPath" LIKE '%Google Photos%' THEN 'Google Photos'
    WHEN "originalPath" LIKE '%upload%' THEN 'Direct Upload'
    ELSE split_part("originalPath", '/', 5)
  END as source,
  count(*) as total,
  min("localDateTime") as earliest,
  max("localDateTime") as latest
FROM asset WHERE "deletedAt" IS NULL
GROUP BY source ORDER BY total DESC;

Section 3: Metadata Completeness

Check for gaps in critical metadata fields:

-- GPS coverage
SELECT
  count(*) as total,
  count(*) FILTER (WHERE "exifInfo"->>'latitude' IS NOT NULL) as has_gps,
  round(100.0 * count(*) FILTER (WHERE "exifInfo"->>'latitude' IS NOT NULL) / count(*), 1) as gps_pct
FROM asset WHERE "deletedAt" IS NULL AND type = 'IMAGE';

-- Date quality
SELECT
  count(*) FILTER (WHERE "exifInfo"->>'dateTimeOriginal' IS NOT NULL) as has_exif_date,
  count(*) FILTER (WHERE extract(hour from "localDateTime") = 12
    AND extract(minute from "localDateTime") = 0) as suspicious_noon,
  count(*) FILTER (WHERE extract(hour from "localDateTime") = 0
    AND extract(minute from "localDateTime") = 0) as suspicious_midnight
FROM asset WHERE "deletedAt" IS NULL AND type = 'IMAGE';

-- Camera info
SELECT
  count(*) FILTER (WHERE "exifInfo"->>'make' IS NOT NULL) as has_camera_make,
  count(*) FILTER (WHERE "exifInfo"->>'lensModel' IS NOT NULL) as has_lens
FROM asset WHERE "deletedAt" IS NULL AND type = 'IMAGE';

Present as:

METADATA QUALITY
  GPS coverage:        72.3% (28,616 of 39,596 photos)
  EXIF dates:          89.1% (35,280 photos)
  Suspicious dates:    1,204 (noon/midnight, likely recovered from paths)
  Camera info:         68.4% (27,072 photos)
  Lens info:           52.1% (20,623 photos)

Section 4: Time Distribution

get_timeline_buckets() returns one bucket per month with its asset count in a single call, which is the whole year-by-year picture already: sum the buckets per year and the low years stand out. get_calendar_heatmap(from_date=..., to_date=...) adds the per-day detail for a year that needs a closer look. Pass an explicit range: on Immich 2.x the counts are built from the timeline, one request per month in range, and an omitted bound falls back to the last 365 days.

The query below is the optional fallback when the photo/video split per year matters:

SELECT extract(year from "localDateTime") as year,
  count(*) as photos,
  count(*) FILTER (WHERE type = 'VIDEO') as videos
FROM asset WHERE "deletedAt" IS NULL
GROUP BY year ORDER BY year;

Highlight years with unusually low counts (potential missing imports).

Section 5: File Format Breakdown

SELECT
  upper(split_part("originalPath", '.', -1)) as format,
  count(*) as total,
  pg_size_pretty(sum(("exifInfo"->>'fileSizeInByte')::bigint)) as size
FROM asset WHERE "deletedAt" IS NULL
GROUP BY format ORDER BY total DESC
LIMIT 15;

Section 6: Recommendations

Based on findings, generate recommendations the user can act on:

  • Low GPS coverage? → Suggest metadata-fixer skill
  • Suspicious dates? → Suggest metadata-fixer skill
  • Multiple import sources? → Suggest duplicate-report skill
  • Large trash? → Suggest reviewing and permanently deleting
  • Year gaps? → Suggest timeline-gaps skill
  • Heavy storage? → Suggest storage-optimizer skill

Output Format

The report can be presented as:

  1. Inline: formatted text in the conversation
  2. Markdown file: saved to the user's vault/workspace
  3. HTML dashboard: interactive file with charts (uses Chart.js or Recharts)

Always ask the user which format they prefer.

Important Notes

  • This skill is read-only: it never modifies assets or metadata
  • The whole report can be produced with the MCP tools alone: get_capabilities, get_statistics, search_statistics, get_timeline_buckets and get_calendar_heatmap
  • The SQL blocks are an optional fallback for the few columns Immich's API does not expose (original paths, format breakdown). The plugin exposes no database tool, so running them means the user's own psql against their own Immich. Never ask for database credentials
  • For libraries >50K assets, some queries may take 10-30 seconds
  • Always show the query execution time so users know what to expect

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.