export-download-debugging
Helps fix issues with file downloads and exports, especially images. It's useful when files aren't saved correctly or become corrupted.
What it does
This tool helps figure out why a file you tried to download or export didn't work. It checks if the file was created correctly before trying to save it, especially for images.
When to use it
- ✓When a download or export seems to work, but the file ends up empty.
- ✓If a downloaded image file won't open or is corrupted.
- ✓When having trouble with the 'Save As' function in a browser or app.
Example of what to ask your AI
“My exported image is coming out as a 0 KB file, can you help me fix it?”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
It first checks if the file's data was generated correctly. If it was, it tries to use a simpler, more reliable method to save the file, avoiding common issues that create empty files.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add nexu-io/open-design --skill export-download-debuggingOr download just the file:
curl -L https://raw.githubusercontent.com/nexu-io/open-design/main/skills/export-download-debugging/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
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,<a download>,URL.createObjectURL, and URL revocation. - In Electron, inspect the
will-downloadpath: 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
- Prepare and validate the export payload first; disable Save until bytes are available.
- Prefer the simplest stable save channel for the host. If
showSaveFilePicker().createWritable()fails, is sandboxed, or creates empty files, route to<a download>or Electron's download manager instead. - Avoid opening a native picker before the payload is ready. This prevents the host from creating an empty destination file on later write failure.
- For PNG fallback, prefer a verified non-empty data URL when blob URLs, revocation timing, CSP, or iframe sandboxing are suspicious.
- In Electron, add explicit Save As filters for exported image extensions
(
.png,.jpg,.jpeg,.webp) so users can choose a real image target. - 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.
FAQ
Why does the file end up empty?
This often happens because the system created the file on your computer, but writing the actual data failed or was blocked before it finished.
What is a 'payload'?
A payload is the information or data you are trying to export or download, like the pixels of an image or the content of a document.
What are 'Blob/Data URLs'?
These are ways to represent data (like images) directly in the browser without needing a separate file. The tool checks if they are working correctly.
Details
Original description by the author
Diagnose and fix browser, preview, or Electron export/download failures, especially image export issues involving Save As, Blob/Data URLs, the File System Access API, createWritable failures, and 0 KB files.
repo: nexu-io/open-design
Popularity
- GitHub stars
- 101k
- Ranking position
- #690
- License
- Apache-2.0
- Updated
- 10/16/2026
Comments
- …
More skills from this repository
sample-plugin
Makes your agent create a metadata file for tests. It helps ensure code works correctly in different situations.
nexu-io/open-design
aster-atelier
Helps your agent create an artistic website with a classic look. It uses elegant imagery, blue skies, and serif fonts for a cinematic feel.
nexu-io/open-design
audio-jingle
Makes your agent generate audio like jingles and sound effects. It can create music and voices, saving the result as an audio file.
nexu-io/open-design
blog-post
Helps your agent write long articles or blog posts. It includes space for images, quotes, and author information.
nexu-io/open-design
Similar skills
cpp-testing
Makes your agent write and improve tests for C++ code. It helps set up testing tools and fix errors.
affaan-m/ECC
csharp-testing
Helps your agent create tests for C# and .NET code. It uses best practices to ensure tests are efficient and reliable.
affaan-m/ECC
django-tdd
Enables your agent to apply testing strategies for Django with pytest-django and TDD. It's useful for writing robust tests and ensuring code quality, especially for DRF APIs.
affaan-m/ECC