agentleFS
drolosoftdrolosoft/immich-photo-manager/skills/travel-map/SKILL.md

travel-map

Skill51 starsChanged 3 months agoMITView on GitHub

Generate an interactive map showing every location where photos were taken, clustered by city/region with photo counts, date ranges, and album links. Outputs a standalone HTML file with Leaflet.js that can be hosted or viewed locally. Use when the user says "travel map", "show me everywhere I've been", "photo map", "map my photos", "where have I traveled", "GPS map", "location map", "map of my trips", "generate a map", "interactive map", or any variation of wanting to see their photos plotted on a map.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

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

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

    line 21
  3. Distinctive:

    Album link: If an Immich album exists for this location, link to it

    line 126
  4. Very specific:

    Create a standalone HTML file using Leaflet.js:

    line 130
  5. Distinctive:

    Search bar to find a specific location on the map.

    line 186

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

Travel Map

⚠️ 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 an interactive HTML map showing all locations where photos were taken. Clusters photos by geographic proximity, shows photo counts and date ranges per location, and optionally links to Immich albums.

When to Use

  • Visualize all travel destinations at a glance
  • Discover forgotten trips (photos with GPS you didn't remember)
  • Plan which geographic albums to create
  • Share a "places I've been" page

Map Generation Workflow

Step 1: Extract GPS Data

Get all geotagged photos:

SELECT
  "id",
  ("exifInfo"->>'latitude')::float as lat,
  ("exifInfo"->>'longitude')::float as lng,
  "localDateTime",
  "originalPath",
  ("exifInfo"->>'city') as city,
  ("exifInfo"->>'state') as state,
  ("exifInfo"->>'country') as country
FROM asset
WHERE "deletedAt" IS NULL
  AND "exifInfo"->>'latitude' IS NOT NULL
  AND ("exifInfo"->>'latitude')::float != 0
ORDER BY "localDateTime";

Or use the MCP tool get_map_markers for a lighter dataset.

Step 2: Cluster by Location

Group nearby photos into location clusters:

from collections import defaultdict
import math

def haversine(lat1, lng1, lat2, lng2):
    """Distance in km between two GPS points."""
    R = 6371
    dlat = math.radians(lat2 - lat1)
    dlng = math.radians(lng2 - lng1)
    a = math.sin(dlat/2)**2 + math.cos(math.radians(lat1)) * math.cos(math.radians(lat2)) * math.sin(dlng/2)**2
    return R * 2 * math.asin(math.sqrt(a))

def cluster_locations(photos, radius_km=15):
    """Simple greedy clustering by distance."""
    clusters = []
    for photo in photos:
        placed = False
        for cluster in clusters:
            if haversine(photo.lat, photo.lng, cluster.center_lat, cluster.center_lng) < radius_km:
                cluster.add(photo)
                placed = True
                break
        if not placed:
            clusters.append(Cluster(photo))
    return clusters

Alternatively, use the reverse-geocoded city/country from EXIF. search_cities lists every city that appears in the library with its country and one representative asset, and search_statistics(city=...) gives the photo count for each one, so the place list needs no database access. The query below is the optional fallback when the first and last visit dates and the cluster centre are wanted in one pass; the plugin never provides database access, so it only applies to a user who already has psql on their own Immich.

SELECT
  "exifInfo"->>'country' as country,
  "exifInfo"->>'city' as city,
  count(*) as photos,
  min("localDateTime") as first_visit,
  max("localDateTime") as last_visit,
  avg(("exifInfo"->>'latitude')::float) as center_lat,
  avg(("exifInfo"->>'longitude')::float) as center_lng
FROM asset
WHERE "deletedAt" IS NULL
  AND "exifInfo"->>'latitude' IS NOT NULL
  AND "exifInfo"->>'country' IS NOT NULL
GROUP BY country, city
ORDER BY photos DESC;

Step 3: Enrich Clusters

For each cluster:

  • Name: Use the most common city name from EXIF. For a cluster built from raw coordinates, where no photo carries a geocoded name, call reverse_geocode(lat, lon) on the cluster centre: it resolves the place from Immich's own offline geodata, so no external service is contacted and no API key is needed
  • Photo count: Total photos in the cluster
  • Date range: First to last visit
  • Visit count: Number of distinct visit periods (>30 days apart = separate visit)
  • Representative photo: The photo closest to the cluster center (for thumbnail)
  • Album link: If an Immich album exists for this location, link to it

Step 4: Generate Interactive HTML Map

Create a standalone HTML file using Leaflet.js:

<!DOCTYPE html>
<html>
<head>
  <title>My Travel Map</title>
  <link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" />
  <link rel="stylesheet" href="https://unpkg.com/leaflet.markercluster@1.5.3/dist/MarkerCluster.css" />
  <script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
  <script src="https://unpkg.com/leaflet.markercluster@1.5.3/dist/leaflet.markercluster.js"></script>
</head>
<body>
  <div id="map" style="height: 100vh; width: 100%"></div>
  <script>
    const locations = [/* cluster data injected here */];
    const map = L.map('map').setView([30, 0], 3);
    L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
      attribution: '© OpenStreetMap contributors'
    }).addTo(map);

    const markers = L.markerClusterGroup();
    locations.forEach(loc => {
      const marker = L.marker([loc.lat, loc.lng])
        .bindPopup(`
          <strong>${loc.name}</strong><br>
          ${loc.photos} photos<br>
          ${loc.first_visit} &mdash; ${loc.last_visit}<br>
          ${loc.visits} visit(s)
        `);
      markers.addLayer(marker);
    });
    map.addLayer(markers);
  </script>
</body>
</html>

Step 5: Add Optional Features

Heatmap layer:

<script src="https://unpkg.com/leaflet.heat@0.2.0/dist/leaflet-heat.js"></script>
<script>
  const heatData = locations.map(l => [l.lat, l.lng, l.photos]);
  L.heatLayer(heatData, {radius: 25}).addTo(map);
</script>

Timeline slider: Filter markers by year range using a slider control.

Country statistics panel: Side panel showing countries visited, photos per country, total distance traveled.

Search: Search bar to find a specific location on the map.

Output Options

FormatDescription
Standalone HTMLSelf-contained file, opens in any browser, shareable
Hosted pageDeploy to your own domain or static hosting
Markdown reportText summary with country list, no map
JSON exportRaw cluster data for custom visualization

Map Styles

  • Cluster map: markers clustered by proximity, expand on zoom (default)
  • Heatmap: density visualization, good for overview
  • Pin map: individual pins for every location (best for <100 clusters)
  • Country choropleth: countries colored by photo count

Important Notes

  • Read-only: this skill never modifies assets
  • Requires photos to have GPS data (check with library-health-report first)
  • Leaflet.js and MarkerCluster are loaded from CDN, so the HTML file needs internet access
  • For very large libraries (>100K geotagged photos), use the EXIF city/country grouping instead of GPS clustering to keep the HTML file manageable
  • OpenStreetMap tiles are free but have usage limits. For high-traffic hosted maps, consider a tile provider
  • Privacy: the map reveals where the user lives, works, and travels, so remind them before sharing publicly
  • Photos without GPS are excluded (noted in the report as "X photos not mapped")

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.