export-download-debugging
ما الذي تفعله
تساعد هذه المهارة على معرفة سبب فشل تنزيل ملف أو تصديره. تتحقق من أن الملف أُنشئ بشكل صحيح قبل محاولة حفظه، خاصةً بالنسبة للصور.
متى تستخدمها
- ✓عندما يبدو التنزيل أو التصدير ناجحًا لكن الملف يظهر فارغًا.
- ✓عندما لا تُفتح صورة منزّلة أو تكون تالفة.
- ✓عندما تواجه مشكلات في وظيفة «حفظ باسم» في المتصفح أو التطبيق.
رابط المهارة
https://github.com/nexu-io/open-design/blob/main/skills/export-download-debugging/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“الصورة التي صدّرتها تظهر كملف بحجم 0 كيلوبايت، هل يمكنك مساعدتي في إصلاحها؟”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
تتحقق المهارة أولًا من أن بيانات الملف أُنشئت بشكل صحيح. فإذا كانت كذلك، تحاول استخدام طريقة أبسط وأكثر موثوقية لحفظ الملف، لتتجنب المشكلات الشائعة التي تنتج ملفات فارغة.
المحتوى التقني (ملف 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-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.
الأسئلة الشائعة
لماذا يظهر الملف فارغًا؟
يحدث ذلك غالبًا عندما ينشئ النظام الملف على حاسوبك، لكن كتابة البيانات الفعلية تفشل أو تُمنع قبل أن تكتمل.
ما هي «payload»؟
هي المعلومات أو البيانات التي تحاول تصديرها أو تنزيلها، مثل بكسلات الصورة أو محتوى المستند.
ما هي «Blob/Data URLs»؟
هي طرق لتمثيل البيانات (مثل الصور) مباشرة في المتصفح دون الحاجة إلى ملف منفصل. وتتحقق المهارة من أنها تعمل بشكل صحيح.
التفاصيل
الوصف الأصلي من المؤلف
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
- آخر تحديث
- 15/10/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
sample-plugin
101kيجعل وكيلك ينشئ ملف بيانات وصفية للاختبارات. يساعد على ضمان عمل الكود بشكل صحيح في مواقف مختلفة.
aster-atelier
101kيساعد وكيلك على إنشاء موقع إلكتروني فني بطابع كلاسيكي. يستخدم صورًا أنيقة وسماءً زرقاء وخطوطًا بأسلوب السينما.
audio-jingle
101kيجعل وكيلك ينشئ صوتيات مثل الموسيقى التعريفية القصيرة والمؤثرات الصوتية. يمكنه إنشاء الموسيقى والأصوات وحفظ النتيجة كملف صوتي.
blog-post
101kيساعد وكيلك على كتابة المقالات الطويلة ومقالات المدونات. يتضمن أماكن للصور والاقتباسات ومعلومات الكاتب.
مهارات مشابهة
test-driven-development
311kيعلّم وكيلك كتابة اختبار فاشل أولًا، ثم رؤيته يفشل، ثم كتابة أصغر شيفرة تنجحه، قبل بناء أي ميزة أو إصلاح.
verification-before-completion
311kيعلّم وكيلك تشغيل فحوصات حقيقية وقراءة نتائجها قبل أن يقول إن المهمة أو الإصلاح أو البناء مكتمل أو ناجح.
migrate-to-shoehorn
310kيستبدل تأكيدات النوع الخطرة في ملفات الاختبار بمكتبة shoehorn، حتى تتمكن الاختبارات من استخدام بيانات جزئية وتجتاز فحوص الأنواع.