Skillpedia
برمجة عامة8.1k · #12568

dead-code-cleanup

ما الذي تفعله

تساعد هذه المهارة ذكاءك على تحديد الكود الميت واقتراح ما يمكن إزالته. وهي لمطورين يريدون تقليل الفوضى أو حجم الحزم أو الديون التقنية.

متى تستخدمها

  • ✓عندما تطلب إزالة الكود غير المستخدم أو تقليل حجم المشروع.
  • ✓عندما تريد إيجاد الملفات التي لا يمكن الوصول إليها أو التصديرات غير المستخدمة أو الحزم المتبقية.
  • ✓عندما تخطط لتنظيف وتحتاج إلى قائمة مرتبة حسب درجة الثقة.

رابط المهارة

https://github.com/repowise-dev/repowise/blob/main/plugins/claude-code/skills/dead-code-cleanup/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/repowise-dev/repowise/blob/main/plugins/claude-code/skills/dead-code-cleanup/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“اعثر على الكود الميت في هذا المشروع الذي يمكن حذفه بأمان، وأرني سبب ظن أن كل عنصر غير مستخدم.”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

تطلب المهارة من Repowise نتائج الكود الميت مرتبة حسب الثقة. وتقترح الحذف فقط للعناصر المعلَّمة كآمنة، وتعرض العناصر ذات الثقة الأقل كأشياء تحتاج إلى تحقيق، وتطلب تأكيدك قبل أي حذف.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

Dead Code Cleanup with Repowise

Repowise detects dead code through graph analysis — no LLM needed, works even with a template-rendered wiki.

When the user asks about dead/unused code

Call get_dead_code() to get findings sorted by confidence tier. Useful parameters:

  • safe_only=true — only findings confirmed safe to delete (confidence >= 0.7)
  • kind="unreachable_file" — files with no importers
  • kind="unused_export" — public symbols nobody uses
  • kind="zombie_package" — monorepo packages with no consumers
  • directory="src/old/" — limit to a specific directory
  • tier="high" — only high-confidence findings (>= 0.8)
  • min_confidence=0.7 — raise the floor (default is 0.5) for a release-ready cleanup
  • group_by="directory" or group_by="owner" — roll up to see where the dead code concentrates and who owns the most of it

How to present findings

  • Only suggest deletion for findings with safe_to_delete: true
  • For lower-confidence findings, present them as "candidates to investigate" not "things to delete"
  • Dynamically-loaded code (plugins, handlers, adapters) may appear as dead code but isn't — Repowise filters common patterns but edge cases exist

Before deleting anything

  1. Confirm with the user. Present the file/symbol name, confidence score, and why Repowise thinks it's dead.
  2. Call get_risk(targets=["path/to/file"]) to double-check dependents.
  3. Recently-modified "dead" code is more likely a false positive — flag this if the finding has recent git activity.

Safe deletion order

  1. Unreachable files first (whole file removal, cleanest)
  2. Unused internal symbols next
  3. Unused exports last (highest false-positive risk due to potential dynamic imports)
الأسئلة الشائعة

هل ستحذف الكود بنفسها؟

لا. تطلب المهارة تأكيدك قبل كل حذف.

هل يمكن أن تخطئ مع الإضافات أو الكود الديناميكي؟

نعم. الكود المحمَّل ديناميكيًا قد يبدو غير مستخدم، لذلك تنبه المهارة إلى وجود حالات حدّية.

ماذا تفحص قبل الحذف؟

تفحص التبعيات على الملف أولًا، باستخدام فحص المخاطر، قبل أن توصي بالإزالة.

التفاصيل

الوصف الأصلي من المؤلف

Use when the user asks about cleanup, removing unused code, refactoring, reducing bundle size, or identifying dead code in a Repowise-indexed codebase (.repowise/ directory exists). Also activates when discussing technical debt, code hygiene, or repository maintenance.

repo: repowise-dev/repowise

الشعبية

نجوم GitHub
8.1k
الترتيب
#12568
الترخيص
AGPL-3.0
آخر تحديث
2‏/11‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة