本文へスキップ
Skillpedia
テスト101k · #1150

export-download-debugging

できること

このツールは、ダウンロードや書き出しを試みたファイルがうまくいかなかった原因を調べるのに役立ちます。特に画像について、ファイルを保存する前に正しく作成されているかを確認します。

使う場面

  • ✓ダウンロードや書き出しは成功したように見えるのに、ファイルが空になってしまうとき。
  • ✓ダウンロードした画像ファイルが開けない、または壊れているとき。
  • ✓ブラウザやアプリの「名前を付けて保存」機能で問題が起きているとき。

スキルのリンク

https://github.com/nexu-io/open-design/blob/main/skills/export-download-debugging/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/nexu-io/open-design/blob/main/skills/export-download-debugging/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“書き出した画像が0 KBのファイルになってしまいます。直す方法を教えてもらえますか?”

毎週5つの新しいスキル。1分で読めます。

仕組み

まず、ファイルのデータが正しく生成されているかを確認します。正しく生成されていれば、より単純で信頼性の高い方法でファイルを保存しようとします。これにより、空のファイルができてしまうよくある問題を避けられます。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)を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-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 <a download> 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.
よくある質問

なぜファイルが空になるのですか?

多くの場合、システムがパソコン上にファイルを作成したものの、実際のデータの書き込みが完了する前に失敗したりブロックされたりすることが原因です。

「ペイロード」とは何ですか?

ペイロードとは、書き出しやダウンロードしようとしている情報やデータのことです。画像のピクセルデータや、文書の内容などが該当します。

「Blob/Data URL」とは何ですか?

画像などのデータを、別個のファイルを用意せずにブラウザ内で直接扱うための方式です。このツールは、それらが正しく機能しているかを確認します。

詳細

作者による元の説明

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

人気

GitHubのスター
101k
ランキング
#1150
ライセンス
Apache-2.0
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル