export-download-debugging
🤖 AI Summary
This skill debugs exports or downloads that produce empty, missing, or unusable files by first verifying the payload has non-zero bytes, then inspecting browser APIs like `showSaveFilePicker`, `createWritable`, and `URL.createObjectURL`, plus Electron’s `will-download` path.
How to Install
Claude Code:
git clone --depth 1 https://github.com/nexu-io/open-design.git && cp open-design/skills/export-download-debugging ~/.claude/skills/export-download-debugging -r# Export Download Debugging
Use this when an export or download appears to run but produces an empty,
missing, or unusable file. It is tuned for browser previews, iframe capture,
and Electron shells.
## Core rule
Separate capture from save. Prove the export payload has non-zero bytes before
debugging the destination path. A 0 KB file often means the native picker or
host created the target file, then the write failed or was blocked.
## Evidence
- Record the payload type, MIME type, byte length, object URL or data URL path,
and thrown error name/message.
- Check browser console output and app logs around `showSaveFilePicker`,
`createWritable`, ``, `URL.createObjectURL`, and URL revocation.
- In Electron, inspect the `will-download` path: filename, MIME, file extension,
save dialog filters, cancellation, and final file size.
- Confirm the actual downloaded file size on disk and whether it opens in a
normal image viewer.
## Fix order
1. Prepare and validate the export payload first; disable Save until bytes are
available.
2. Prefer the simplest stable save channel for the host. If
`showSaveFilePicker().createWritable()` fails, is sandboxed, or creates empty
files, route to `` or Electron's download manager instead.
3. Avoid opening a native picker before the payload is ready. This prevents the
host from creating an empty destination file on later write failure.
4. For PNG fallback, prefer a verified non-empty data URL when blob URLs,
revocation timing, CSP, or iframe sandboxing are suspicious.
5. In Electron, add explicit Save As filters for exported image extensions
(`.png`, `.jpg`, `.jpeg`, `.webp`) so users can choose a real image target.
6. Keep the UI restrained: format selection, filename/path hint, clear pending
and error states, and one primary save action.
## Validation
- Add or update tests for non-empty payload preparation, fallback save behavior,
file extension/MIME mapping, and UI disabled/error states.
- Run focused export tests, then `pnpm --filter @open-design/web typecheck`.
- If Electron download handling changed, also run
`pnpm --filter @open-design/desktop typecheck`.
- Before landing, run `pnpm guard`, inspect the staged diff for unrelated files,
generated artifacts, and accidental secrets, then use the repository's PR
quality-gate workflow if the fix is being prepared for review.
Details
| Category | Design → ui |
| Source | nexu-io/open-design |
| SKILL.md | View on GitHub → |
| Repo Stars | ★ 70.0K |
| Est. per Skill | 503 (shared across 139 skills from this repo) |
| Difficulty | Intermediate |
| Risk Level | N/A |
Related Skills
cirq
Cirq - Quantum Computing with Python Cirq is Google Quantum AI's open-source framework for designing
error-detective
Use this skill when Working on error detective tasks or workflows Needing guidance, best practices,
expo-tailwind-setup
Tailwind CSS Setup for Expo with react-native-css This guide covers setting up Tailwind CSS v4 in Ex
conductor-revert
Revert Track Revert changes by logical work unit with full git awareness. Supports reverting entire
Works Well With
Skills from the same repository — often designed to work together
8-bit-orbit-video-template
Hyperframes Video Template Ship a premium template-mode Hyperframes composition with a ready default
ad-creative
ad-creative > Curated from Corey Haines. What it does Generate and iterate ad creative including hea
after-hours-editorial-template
After Hours Editorial Template Produce a self-contained HTML editorial motion artifact in a dark lux