phase-gated-debugging
ما الذي تفعله
يساعدك هذا المساعد الذكي على إصلاح الأخطاء في الكود بطريقة منظمة. يتأكد من إيجاد المشكلة الحقيقية قبل إجراء أي تغييرات، باتباع عملية من 5 خطوات تمنع الإصلاحات المتسرعة.
متى تستخدمها
- ✓عندما يبدو أن الخطأ قد أُصلح لكنه يعود باستمرار.
- ✓عندما تحتاج إلى عملية خطوة بخطوة لإيجاد سبب الخطأ.
- ✓عندما يحدث الخطأ من حين لآخر ويصعب تتبعه.
رابط المهارة
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/phase-gated-debugging/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“يظهر خطأ في الكود الخاص بي ولا أستطيع معرفة سببه. هل تستطيع مساعدتي في البحث عنه باتباع عملية منظمة؟”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
يحاول الذكاء الاصطناعي أولاً إعادة إنتاج الخطأ، ثم يضيف ملاحظات لفهم مكان المشكلة، ويحلل السبب الجذري، وبعدها فقط يطبق الإصلاح. وأخيراً يتحقق من أن الخطأ زال فعلاً.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
Phase-Gated Debugging
Overview
AI coding agents see an error and immediately edit code. They guess at fixes, get it wrong, and spiral. This skill enforces a strict 5-phase protocol where you CANNOT edit source code until the root cause is identified and confirmed.
Based on claude-debug (full plugin with PreToolUse hook enforcement).
When to Use
Use this skill when:
- a bug keeps getting "fixed" without resolving the underlying issue
- you need to slow an agent down and force disciplined debugging before code edits
- the failure is intermittent, a regression, performance-related, or otherwise hard to isolate
- you want an explicit user confirmation checkpoint before any fix is applied
The Protocol
Phase 1: REPRODUCE
Run the failing command/test. Capture the exact error. Run 2-3 times for consistency.
- Do NOT read source code
- Do NOT hypothesize
- Do NOT edit any files
Phase 2: ISOLATE
Read code. Add diagnostic logging marked // DEBUG. Re-run with diagnostics. Binary search to narrow down.
- Only
// DEBUGmarked logging is allowed - Do NOT fix the bug even if you see it
Phase 3: ROOT CAUSE
Analyze WHY at the isolated location. Use "5 Whys" technique. Remove debug logging.
State: "This is my root cause analysis: [explanation]. Do you agree, or should I investigate further?"
WAIT for user confirmation. Do NOT proceed without it.
Phase 4: FIX
Remove all // DEBUG lines. Apply minimal change addressing confirmed root cause.
- Only edit files related to root cause
- Do NOT refactor unrelated code
Phase 5: VERIFY
Run original failing test — must pass. Run related tests. For intermittent bugs, run 5+ times. If verification fails: root cause was wrong, go back to Phase 2.
Bug-Type Strategies
| Type | Technique |
|---|---|
| Crash/Panic | Stack trace backward — trace the bad value to its source |
| Wrong Output | Binary search — log midpoint, halve search space each iteration |
| Intermittent | Compare passing vs failing run logs — find ordering divergence |
| Regression | git bisect — find the offending commit |
| Performance | Timing at stage boundaries — find the bottleneck |
Key Rules
- NEVER edit source code in phases 1-3 (except
// DEBUGin phase 2) - NEVER proceed past phase 3 without user confirmation
- ALWAYS reproduce before investigating
- ALWAYS verify after fixing
Example
User request:
a bug keeps getting "fixed" without resolving the underlying issue; diagnose it and return the concrete next action.
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
الأسئلة الشائعة
لماذا لا أستطيع تعديل الكود فوراً؟
تعديل الكود دون فهم السبب الجذري قد يزيد المشكلة سوءاً أو يخلق أخطاء جديدة. هذه العملية تضمن أن يستهدف الإصلاح مصدر المشكلة.
ما هي المراحل الخمس؟
هي: 1. إعادة إنتاج الخطأ، 2. عزل المشكلة بالملاحظات، 3. تحديد السبب الجذري، 4. تطبيق الإصلاح، 5. التحقق من زوال الخطأ.
ماذا يحدث إذا لم ينجح الإصلاح؟
إذا لم يُحل الخطأ في مرحلة التحقق، يعود الذكاء الاصطناعي إلى مرحلة العزل ليبحث من جديد.
التفاصيل
الوصف الأصلي من المؤلف
Use when debugging any bug. Enforces a 5-phase protocol where code edits are blocked until root cause is confirmed. Prevents premature fix attempts.
الشعبية
- نجوم GitHub
- 48k
- الترتيب
- #5438
- الترخيص
- MIT
- آخر تحديث
- 15/10/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
00-andruia-consultant
48kيساعد وكيلك على بدء مشاريع الذكاء الاصطناعي أو تحسينها. يحلل الكود ويقترح الأدوات ويُعد خطط عمل بالإسبانية.
007
48kيتيح لوكيلك إجراء تدقيقات أمنية ونمذجة التهديدات. مفيد لحماية المشاريع من الهجمات والثغرات الأمنية.
10-andruia-skill-smith
48kيساعد وكيلك على إنشاء أدوات الذكاء الاصطناعي أو تحسينها. يحدد طريقة عملها، ويكتب توثيقها، ويتحقق من بنيتها.
20-andruia-niche-intelligence
48kيتيح لوكيلك إعداد ملخص عن صناعة محددة. مفيد لفهم السياق والقواعد وأنماط الاستخدام والمخاطر لمشروع ما، باستخدام مصادر موثوقة.
مهارات مشابهة
diffs
394kيتيح لوكيلك إنتاج فرق تعديلات حقيقي يمكن مشاركته، كرابط عرض أو ملف صورة، بدلاً من ملخص مكتوب يدوياً.
coding-agent
394kيساعد وكيلك على تسليم مهمة برمجة كبيرة إلى Codex أو Claude Code أو OpenCode كعامل في الخلفية، ثم متابعة تقدمها.
gh-issues
394kيساعد وكيلك على إيجاد مشكلات GitHub واختيار ما ستعمل عليه، وفتح طلبات سحب بالإصلاحات، ومتابعة تعليقات المراجعة.