ai-debt-detector
ما الذي تفعله
يفحص هذا الكاشف «الديون» التقنية في الكود الذي يولّده الذكاء الاصطناعي، بحثاً عن مشكلات شائعة يتجنبها البشر عادةً. يبحث عن حالات الفشل، والموارد غير المحررة، والتبعيات غير الموجودة، والانحرافات عن معايير المشروع.
متى تستخدمها
- ✓بعد توليد الكود بالذكاء الاصطناعي.
- ✓قبل قبول اقتراحات الذكاء الاصطناعي أو دمج كوده.
- ✓عندما يعمل الكود لكنه يبدو غير مستقر أو غير مكتمل.
رابط المهارة
https://github.com/wshobson/agents/blob/main/plugins/skill-forge-essentials/skills/ai-debt-detector/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“افحص هذا الكود المولّد بالذكاء الاصطناعي بحثاً عن حالات الفشل، والموارد اليتيمة، والتبعيات غير الموجودة.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
تحلل هذه المهارة الكود بحثاً عن أنماط محددة يخطئ فيها الذكاء الاصطناعي غالباً، مثل غياب معالجة الأخطاء، وعدم تحرير الموارد، والحزم التي لا وجود لها. والهدف أن يكون الكود متيناً وآمناً.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
AI Debt Detector
Overview
AI agents generate code that passes the happy path but hides debt: missing error handling, orphaned resources, ignored failure modes, hallucinated packages, silent architectural drift. This skill forces a targeted audit for the exact patterns AI agents get wrong.
When to Use
- After any AI code generation session (20+ lines produced)
- Before merging AI-generated PRs
- When code works but something feels off
- After vibe-coding sprints where debt accumulates fastest
- When the agent claims done without showing verification
Process
After code generation, scan for these AI-specific debt patterns:
FAILURE MODES - What happens when this fails?
- Network timeout? Disk full? Permission denied? Null input?
- Is there a try/catch? Does it catch SPECIFIC errors or swallow everything?
- Are resources cleaned up on failure? (streams closed, connections returned, temp files deleted)
ORPHANS - What gets created but never cleaned up?
- Temp files, event listeners, intervals, subscriptions, connections
- Are there corresponding cleanup/dispose/close calls for every open/create?
- In React: does every addEventListener have a removeEventListener in cleanup?
EDGE CASES - What inputs break this?
- Empty array/string? null/undefined? Multi-MB input? Unicode? Concurrent calls?
- Does the code assume the happy path? (AI almost always does)
HALLUCINATED DEPS - Do all imports actually exist?
- Is every package in package.json/requirements.txt?
- Are API methods real? (AI invents plausible-sounding methods that don't exist)
- Does this library's latest version still export this function?
ARCHITECTURAL DRIFT - Does this match the project's patterns?
- Same error handling style as existing code?
- Uses the project's established utilities (not reinventing)?
- Follows the file structure convention?
Red Flags (stop and fix immediately)
catch (e) {}orcatch (e) { console.log(e) }- swallowed error- No
finallyblock when resources were opened // TODO: handle error- AI's way of punting- Import from a path that doesn't exist in the project
- Timeout set but no abort/cleanup on timeout
- Database connection opened but never released back to pool
Common Mistakes
- Trusting that compilation means correctness (compilation checks syntax, not logic)
- Reviewing only the diff without checking what the AI did NOT generate (missing error paths)
- Assuming the AI used the right library version (it often uses deprecated APIs)
- Skipping the orphan check because garbage collection handles it (it doesn't for connections, listeners, timers)
Why This Exists
AI agents systematically optimize for "looks correct" and "passes the happy path." They miss failure modes, orphan resources, and hallucinate dependencies at rates significantly higher than manual code. This skill forces an audit for those specific blind spots.
الأسئلة الشائعة
لماذا أحتاج إلى فحص كود الذكاء الاصطناعي؟
الذكاء الاصطناعي جيد في إنشاء كود يعمل في الظروف المثالية، لكنه قد ينسى معالجة الأخطاء أو تحرير الموارد أو استخدام الحزم الصحيحة، فيتراكم «دين» تقني قد يسبب مشكلات لاحقاً.
ما هي «الموارد اليتيمة»؟
هي أشياء ينشئها الكود (مثل اتصالات الشبكة أو الملفات المؤقتة) لكنه لا يغلقها أو يحذفها بعد الاستخدام، فتستهلك موارد النظام.
ماذا تعني «أنماط الفشل»؟
هي الحالات التي قد يفشل فيها الكود (مثل أخطاء الشبكة أو المدخلات غير الصحيحة) وطريقة تفاعله معها. الكود الجيد لديه خطة للتعامل مع هذه الحالات.
التفاصيل
الوصف الأصلي من المؤلف
Use after generating code, after accepting AI suggestions, or when reviewing AI-written modules. Also use when code works but feels brittle, when error handling seems thin, when orphaned resources or missing cleanup are suspected, or when the agent claims done but hidden debt may exist. Catches the specific failure patterns AI agents produce that humans would not.
repo: wshobson/agents
الشعبية
- نجوم GitHub
- 41k
- الترتيب
- #6788
- الترخيص
- MIT
- آخر تحديث
- 15/10/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
screen-reader-testing
41kيجعل وكيلك يختبر مواقع الويب باستخدام قارئات الشاشة للتأكد من أنها سهلة الوصول.
wcag-audit-patterns
41kيساعد وكيلك على تدقيق مواقع الويب من حيث إمكانية الوصول، وإصلاح المشكلات وفق إرشادات WCAG.
multi-reviewer-patterns
41kيمكّن وكيلك من تنسيق مراجعات الشيفرة المتوازية، مع إزالة التكرار في الملاحظات ودمج التقارير.
parallel-debugging
41kيتيح للوكيل تصحيح الأخطاء المعقدة عبر تحقيقات متوازية وتحليل السبب الجذري.
مهارات مشابهة
test-driven-development
311kيعلّم وكيلك كتابة اختبار فاشل أولًا، ثم رؤيته يفشل، ثم كتابة أصغر شيفرة تنجحه، قبل بناء أي ميزة أو إصلاح.
verification-before-completion
311kيعلّم وكيلك تشغيل فحوصات حقيقية وقراءة نتائجها قبل أن يقول إن المهمة أو الإصلاح أو البناء مكتمل أو ناجح.
migrate-to-shoehorn
310kيستبدل تأكيدات النوع الخطرة في ملفات الاختبار بمكتبة shoehorn، حتى تتمكن الاختبارات من استخدام بيانات جزئية وتجتاز فحوص الأنواع.