dotlottie-bundle-validation
Audit local dotLottie 2.0 (.lottie) ZIP archives offline for manifest schema, declared animations, image assets, themes, state machines, duplicate entries, and path safety.
Try your first task
A source-grounded starter task has not been verified for this skill yet.
SKILL.md
name: dotlottie-bundle-validationdescription: "Audit local dotLottie 2.0 (.lottie) ZIP archives offline for manifest schema, declared animations, image assets, themes, state machines, duplicate entries, and path safety."category: designrisk: safesource: selfsource_type: selfdate_added: "2026-12-01"author: Koushik-Katkamtags: [dotlottie, lottie, animation, zip-validation, manifest, jsonschema]dotLottie Bundle Validation
Overview
Audit local dotLottie 2.0 .lottie ZIP containers strictly offline without rendering animations, executing embedded Lottie expressions, extracting files to disk, or fetching external assets. Validates bounded ZIP archive integrity (duplicate central-directory entries, path traversal, symlinks, member size caps), enforces the dotLottie 2.0 vs. 1.0 boundary, schema-validates manifest.json (jsonschema==4.26.0), verifies declared animation paths (a/<id>.json), external image asset references (i/...), themes (t/<id>.json), and state machines (s/<id>.json).
Distinction from existing Lottie/video skills:
hyperframes: embeds@lottiefiles/dotlottie-webinto HTML video compositions (window.__hfLottie.push(player)) and drives frame-seek timelines rather than validating.lottieZIP bundle integrity andmanifest.jsonreferences.remotion-to-hyperframesandremotion-best-practices: translate@remotion/lottieand Lottie components into Remotion/HyperFrames compositions rather than auditing dotLottie2.0package structure offline.
When to Use
- Validating
.lottie2.0 asset bundles in CI or design-asset pipelines before shipping mobile/web builds. - Catching missing animation JSON files (
a/<id>.json), missing image assets referenced inside Lottieassets[], dangling theme/state-machine references, duplicate ZIP members, or dotLottie1.0(animations/) vs.2.0(a/) structure mismatches. - Do not use this skill to execute animation expressions, render frames, or extract untrusted
.lottiearchives to disk.
Prerequisites
- Python
3.10+withjsonschemaandpytest(tested with Python3.12.10,jsonschema==4.26.0,pytest==9.1.1). - Local or synthetic
.lottieZIP files. - No browser/WASM dotLottie player runtime, network asset fetch, or filesystem extraction required.
How It Works
1. Enforce pre-central-directory archive bounds & reject dotLottie 1.0 cleanly
- Enforce an archive-input byte bound (
<= 64 MiBregular non-symlink file read into bounded memory) before callingzipfile.ZipFileso oversized inputs cannot trigger central-directory allocation. - Inspect each original
info.orig_filenamestring before normalization (PurePosixPath/posixpath.normpath): reject empty names, leading/,\, Windows drive prefixes (C:), NUL bytes, empty//segments,.or..path components, symlink attributes (S_ISLNK), duplicate raw or normalized entry names (DUPLICATE_ARCHIVE_ENTRY), member count (> 500), and uncompressed size caps (16 MiBmember /64 MiBtotal). Use the normalizedinfo.filenamefor lookups only after the original decoded name passes. - Require root
manifest.jsonand parse JSON cleanly (INVALID_INPUTon corrupt ZIP/JSON). Explicitly reject dotLottie"1"/"1.0"packages asUNSUPPORTED(UNSUPPORTED_DOTLOTTIE_V1) because v1.0 usesanimations/+images/rather than the v2.0a/,i/,t/,s/,f/layout. Strict dotLottie 2.0 validation requiresversion == "2";"2.0"is rejected unless explicitcompat_extensions=Truecompatibility mode is requested.
2. Validate strict dotLottie 2.0 manifest, animations, assets, themes, and state machines
Run the local verification suite in dotLottie 2.0 bundle harness:
- Schema-validate
manifest.jsonagainst strict dotLottie 2.0 rules (version == "2", unique non-emptyanimations[].idwith optional stringinitialTheme, uniquethemes[].id, uniquestateMachines[].id, andinitialobject{"animation": ..., "stateMachine": ...}). Legacy/compatibility forms (manifestversion: "2.0", rootstatesalias, animationthemesarrays, dict-shaped state-machinestates) fail strict validation and are accepted only under explicitcompat_extensions=Truewith explicitWARNfindings. - Enforce canonical dotLottie 2.0 archive paths strictly (
a/<id>.jsonfor animations, rejecting non-canonical"file"overrides or traversal IDs), verify everyanimations[].initialThemereferences a declaredthemes[].id(MISSING_INITIAL_THEME_REF), and verify every animation parses as a JSON object containingv,fr,ip,op,layers, and a valid list ofdictitems forassets[](INVALID_LOTTIE_ASSETSotherwise). - Inspect each animation's
assets[]: skip embeddeddata:base64 assets (e == 1orp.startswith("data:")), reject externalhttp:///https://remote URLs asEXTERNAL_ASSET_DISALLOWED, and confirm local image references resolve canonically insidei/to existing archive members (MISSING_ASSET_FILE). - Confirm every declared theme (
t/<id>.json) and state machine (s/<id>.json) exists at its canonical path, parses as a structured JSON object, satisfies declaredinitial/initialThemecross-references, and in strict mode requires state-machinestatesto be a non-empty array of state objects (namenon-empty string) withinitialas a string naming an existing state instates.
Examples
Run the self-contained verification suite in dotLottie 2.0 bundle harness:
User request: "Validate hero-banner.lottie against the dotLottie 2.0 packaging spec before release."
Inputs: Synthetic or local .lottie ZIP archive inspected read-only in memory.
Expected result: Valid v2.0 bundle with a/hero.json, i/badge.png, t/dark.json, and s/interactive.json passes;
missing animation file, missing image asset, missing theme/state-machine, or duplicate ZIP entry fails loudly;
v1.0 returns UNSUPPORTED; traversal member returns UNSAFE_ARCHIVE.
Limitations
- Targets dotLottie 2.0 (
version: "2",initialTheme, arraystates, stringinitial) in default strict mode; compatibility aliases (version: "2.0", manifeststates, animationthemes, dict-shaped state-machinestates) require explicitcompat_extensions=True, while dotLottie1.0bundles (animations/*.json) returnUNSUPPORTED. - Verifies JSON presence and structural keys (
v,fr,ip,op,layers), not full Lottie expression AST validity, pixel rendering parity, or@lottiefiles/dotlottie-webWASM player compatibility.
Safety and Side Effects
- Strictly offline, read-only, and non-executing: inspects ZIP members in memory with bounded member counts and uncompressed byte limits (
16 MiBmember,64 MiBtotal). - Never runs JavaScript/Lottie expression evaluators, renders WebGL/WASM frames, or fetches external URLs.
Sources and related skills
- dotLottie 2.0 Specification
- Related skills: hyperframes, remotion-to-hyperframes, remotion-best-practices.