← Back to Skills Marketplace
dyagil

Marathon Clip

by dyagil · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
44
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install dyagil-marathon-clip
Description
Render a 30-second vertical (1080x1920) running-recap video from per-workout data using Remotion + ffmpeg + royalty-free music. Use when the user wants a Str...
README (SKILL.md)

Marathon Clip — Weekly Running Recap

This skill is tuned for a specific personal data source (a local SQLite DB populated from Garmin Connect). The Remotion + ffmpeg pipeline and the visual composition are fully reusable — fork the data-extraction step and point it at your own source (Strava API, Apple Health export, CSV, etc.).

Render a 30-second 9:16 video summarizing the last week (or N days) of running activity. The output is a Stories-ready MP4 with animated stats, per-run bars, a stroke-animated GPS map, and royalty-free background music.

When to Use

Use this skill when the request matches:

  • "Make a clip of this week's runs"
  • "Weekly running summary video" / "Marathon recap"
  • "Strava-style story" / "Stories video of my runs"

Do not use this for:

  • Non-running activities (strength, swim) — needs a different template.
  • Generic video generation without per-workout data — use a general-purpose Remotion toolkit instead.

What It Does

Pulls the last N days of type='run' workouts from a local SQLite DB (\x3Cproject>/data/sahi.db by default), downloads GPX tracks via the Garmin Connect API, writes both to JSON, and renders six animated sequence types:

  1. Intro (4s) — Animated title with athlete name + period.
  2. Big Stats (9s) — Count-up animations for km / hours / kcal / runs.
  3. Map Scenes (4s each) — One per run with GPS: animated stroke-dash polyline, pulsing runner marker along the path, start/finish markers, per-run footer.
  4. Trends (8s) — Side-by-side comparison vs the prior week with arrows (▲ better / ▼ worse), an overall verdict (CRUSHING IT / STEADY / RECOVERY / EASIER WEEK), and per-metric deltas in %.
  5. Runs Breakdown (8s) — Average pace + horizontal bars per run.
  6. Outro (5s) — Closing card with totals.

Total length: typically 30–60s depending on number of runs with GPS data. A fade-in/fade-out royalty-free track plays through (public/music.mp3).

Run It

~/bin/marathon-clip                  # last 7 days, default music, → out/marathon-week.mp4
~/bin/marathon-clip --days 14
~/bin/marathon-clip --out /tmp/x.mp4
~/bin/marathon-clip --no-music
~/bin/marathon-clip --music other.mp3
~/bin/marathon-clip --send-telegram   # render and post to Telegram (requires openclaw CLI)

Default project location: \x3Cworkspace>/projects/sahi-video/.

Manual weekly invocation

bash \x3Cskills-dir>/marathon-clip/scripts/weekly.sh

Always renders the previous Monday→Sunday window regardless of when invoked, and writes out/weekly-YYYY-MM-DD.mp4. The last line of stdout is MARATHON_CLIP_OUT=\x3Cabsolute path>.

Automated weekly delivery (optional)

If you use the OpenClaw cron system, register a job to run scripts/weekly.sh every Monday 09:00 in your timezone. Manage it via:

openclaw cron list
openclaw cron show \x3Cid>
openclaw cron enable \x3Cid> / disable \x3Cid>
openclaw cron run \x3Cid>      # fire now (test)

The cron payload is a system event addressed to the main agent session; the agent runs weekly.sh and posts the resulting MP4.

Customization Knobs

Visual style

Edit \x3Cproject>/src/MarathonClip.tsx:

  • Colors: the green gradient lives in Background (~line 40). Replace with brand colors.
  • Logo: Logo component (top right).
  • Layout: each sequence is its own component (Intro, BigStats, RunsBreakdown, Outro).

Music

Drop an mp3 into \x3Cproject>/public/ and pass --music your-file.mp3. To trim/fade a new track:

ffmpeg -y -i source.mp3 -ss 0 -t 30 \
  -af "afade=t=in:st=0:d=0.5,afade=t=out:st=28.5:d=1.5" \
  -ac 2 -ar 44100 -b:a 192k music.mp3

Map / GPS

Map scenes are pure SVG with custom lat/lon projection (longitude scaled by cos(meanLat) for correctness). No tile loading, no external map service — fully headless. The polyline animates via stroke-dasharray + stroke-dashoffset for the drawing effect, with a pulsing marker following the head of the line.

To regenerate just the tracks without re-rendering: node scripts/build-tracks.cjs --days 7.

Data source

The extractor (scripts/build-data.cjs) runs:

SELECT local_date, duration_min, distance_km, calories, notes
FROM workouts
WHERE type='run' AND local_date >= date('now','-7 day')
ORDER BY local_date ASC

Adapting this skill: rewrite build-data.cjs to query your own data source (Strava, Apple Health export, CSV). It must produce a data.json with this shape:

{
  "athlete": "Name",
  "period": "May 8 – May 15",
  "totals": {"km": 42.1, "hours": 4.2, "kcal": 3100, "runs": 5},
  "runs": [
    {"date": "2026-05-09", "km": 8.2, "pace": "5:12/km", "calories": 620, "gpx": "...optional polyline data..."}
  ],
  "prev": { "...same shape, previous week..." }
}

Dependencies

  • Node.js + npm (Remotion v4)
  • ffmpeg (music trim/fade)
  • Chrome Headless Shell — auto-installed by Remotion on first render
  • Linux libs for headless Chrome: libnss3 libatk1.0-0 libgbm1 libxdamage1

If anything's missing, a sibling remotion-server skill has scripts/setup.sh that installs the apt deps.

Render Time + Cost

  • ~70–90 seconds on a 2-core VPS at concurrency=2.
  • Output size: ~3 MB MP4 (H.264 + AAC stereo).
  • No external API calls during render — everything local.

Delivery (OpenClaw note)

⚠️ Some chat delivery channels only accept files under ~/.openclaw/media/outbound/. Files under \x3Cproject>/out/ won't deliver. weekly.sh already copies the final MP4 to the outbound dir with a UUID. Use the MARATHON_CLIP_DELIVER env line (not MARATHON_CLIP_OUT) when assembling the MEDIA: line for chat delivery.

Troubleshooting

  • "no such table: activities" — the schema uses workouts, not activities. Adjust your build-data.cjs query.
  • Music doesn't play — Remotion v4 needs staticFile() and the file must be in public/. Use the Audio component, not \x3Caudio>.
  • "Cannot find module 'zod'" — run npm install zod in the project root.
  • Render hangs at "Spinning up browser" — first run only, downloading Chrome Headless Shell (~200 MB).
  • Empty data — check the date filter; if no runs synced recently the output will be empty. Trigger your data sync first.

Files

\x3Cskills-dir>/marathon-clip/
  SKILL.md
  scripts/
    build-data.cjs      ← SQL → data.json (customize for your data source)
    render.sh           ← end-to-end pipeline
  references/
    musical-sources.md  ← curated list of CC/PD music sources

\x3Cproject>/sahi-video/
  src/                  ← Remotion composition
  public/music.mp3      ← 30s royalty-free track
  data.json             ← generated each run
  out/                  ← rendered MP4s

~/bin/marathon-clip     ← symlink to scripts/render.sh
Usage Guidance
Install only if you are comfortable with the skill reading your local sahi-diet workout database, using GARMIN_EMAIL/GARMIN_PASSWORD from that project, and creating files that may contain precise route data. Do not use --send-telegram until you replace the hardcoded Telegram recipient with your own explicit destination, and only enable weekly cron delivery after confirming where the MP4 will be sent.
Capability Analysis
Type: OpenClaw Skill Name: dyagil-marathon-clip Version: 1.0.0 The skill contains a hardcoded Telegram recipient ID (6034574482) in 'scripts/render.sh', which would result in the user's rendered workout videos—containing sensitive GPS tracks and location data—being sent to a specific third party if the '--send-telegram' flag is invoked. While the 'SKILL.md' documentation frames this as a personal tool for a specific data source, the inclusion of a hardcoded destination for private data in a distributable bundle is a significant privacy risk. Additionally, the skill requires access to Garmin credentials and local databases, though these appear functionally necessary for the stated purpose.
Capability Assessment
Purpose & Capability
Rendering a running recap video matches the stated purpose, but the implementation also logs into Garmin and can post the generated media to a fixed Telegram recipient; those account and delivery capabilities need clearer user control.
Instruction Scope
The SKILL.md documents a --send-telegram option as posting to Telegram, but the script hardcodes the destination instead of requiring the user to choose or confirm the recipient.
Install Mechanism
There is no install spec; the scripts assume existing local sahi-video and sahi-diet projects and run local Node/Remotion commands. This is purpose-aligned but depends on unreviewed local project state.
Credentials
The skill reads a sibling project's SQLite database and .env Garmin credentials, then writes health/GPS-derived outputs. This is related to the purpose, but it is high-impact local account/data access and is not declared in the registry requirements.
Persistence & Privilege
Optional weekly cron delivery is disclosed and user-configured, but it creates recurring autonomous generation and posting of a potentially sensitive fitness/GPS video.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install dyagil-marathon-clip
  3. After installation, invoke the skill by name or use /dyagil-marathon-clip
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release
Metadata
Slug dyagil-marathon-clip
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Marathon Clip?

Render a 30-second vertical (1080x1920) running-recap video from per-workout data using Remotion + ffmpeg + royalty-free music. Use when the user wants a Str... It is an AI Agent Skill for Claude Code / OpenClaw, with 44 downloads so far.

How do I install Marathon Clip?

Run "/install dyagil-marathon-clip" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Marathon Clip free?

Yes, Marathon Clip is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Marathon Clip support?

Marathon Clip is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Marathon Clip?

It is built and maintained by dyagil (@dyagil); the current version is v1.0.0.

💬 Comments