Skillpedia
برمجة عامة48k · #4014

bash-defensive-patterns

ما الذي تفعله

تساعد هذه المهارة على كتابة سكربتات سطر الأوامر (Bash) بأمان وموثوقية أكبر. تعلّمك تجنّب الأخطاء الشائعة وضمان عمل السكربتات بشكل صحيح، حتى في الظروف غير المتوقعة.

متى تستخدمها

  • ✓عند كتابة سكربتات لأتمتة المهام على جهازك.
  • ✓عند بناء أدوات تعمل على الخوادم أو في السحابة.
  • ✓عندما تحتاج إلى أن تكون السكربتات متينة ولا تتعطل بسهولة.

رابط المهارة

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/bash-defensive-patterns/SKILL.md

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

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

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

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

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

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

“كيف أكتب سكربت Bash يتحقق من وجود ملف قبل محاولة حذفه؟”

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

كيف تعمل

تقترح المهارة ممارسات مثل التحقق مما ستفعله قبل تنفيذه، والتأكد من صحة المعلومات التي يستقبلها السكربت، وضبطه للإبلاغ عن الأخطاء.

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

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

Bash Defensive Patterns

Comprehensive guidance for writing production-ready Bash scripts using defensive programming techniques, error handling, and safety best practices to prevent common pitfalls and ensure reliability.

Use this skill when

  • Writing production automation scripts
  • Building CI/CD pipeline scripts
  • Creating system administration utilities
  • Developing error-resilient deployment automation
  • Writing scripts that must handle edge cases safely
  • Building maintainable shell script libraries
  • Implementing comprehensive logging and monitoring
  • Creating scripts that must work across different platforms

Do not use this skill when

  • You need a single ad-hoc shell command, not a script
  • The target environment requires strict POSIX sh only
  • The task is unrelated to shell scripting or automation

Instructions

  1. Confirm the target shell, OS, and execution environment.
  2. Enable strict mode and safe defaults from the start.
  3. Validate inputs, quote variables, and handle files safely.
  4. Add logging, error traps, and basic tests.

Safety

  • Avoid destructive commands without confirmation or dry-run flags.
  • Do not run scripts as root unless strictly required.

Refer to resources/implementation-playbook.md for detailed patterns, checklists, and templates.

Resources

  • resources/implementation-playbook.md for detailed patterns, checklists, and templates.

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.
الأسئلة الشائعة

ما هي «سكربتات Bash»؟

هي تسلسلات صغيرة من الأوامر تكتبها ليُنفّذها الكمبيوتر تلقائيًا لإنجاز مهمة.

لماذا أحتاج إلى «سكربتات دفاعية»؟

لمنع السكربتات من التسبب في مشكلات غير مقصودة، مثل حذف ملفات مهمة أو التوقف المفاجئ.

هل ستكتب هذه المهارة السكربت بدلًا مني؟

لا، بل تعلّمك أفضل الممارسات لتكتب سكربتات أفضل وأكثر أمانًا بنفسك.

التفاصيل

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

Master defensive Bash programming techniques for production-grade scripts. Use when writing robust shell scripts, CI/CD pipelines, or system utilities requiring fault tolerance and safety.

repo: sickn33/agentic-awesome-skills

الشعبية

نجوم GitHub
48k
الترتيب
#4014
الترخيص
MIT
آخر تحديث
15‏/10‏/2026

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

0

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

التعليقات

  • …

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

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