bash-defensive-patterns – skill Viết lách & Nội dung cho agent AI
Làm chủ kỹ thuật lập trình Bash phòng thủ cho script chuẩn production. Dùng khi viết shell script bền vững, pipeline CI/CD, hoặc tiện ích hệ thống cần khả năng chịu lỗi và an toàn.
Cài skill bash-defensive-patterns bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/bash-defensive-patterns-45b1f.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /bash-defensive-patterns – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/bash-defensive-patterns-45b1f.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $bash-defensive-patterns – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/bash-defensive-patterns-45b1f.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /bash-defensive-patterns – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/bash-defensive-patterns-45b1f.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /bash-defensive-patterns – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
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.mdfor 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.
Skill liên quan
- eu-ai-act-specialist – Tuân thủ vận hành EU AI Act (Quy định (EU) 2024/1689) cho đội ngũ tuân thủ. Ba quyết…
- video – Khi người dùng muốn tạo, sinh hoặc sản xuất nội dung video bằng công cụ AI hoặc…
- beautiful-prose – Bộ quy tắc phong cách viết cứng cáp, cho văn xuôi tiếng Anh súc tích, mạnh mẽ, không…
- executive-mentor – Đối tác tư duy phản biện cho founder và lãnh đạo. Stress-test kế hoạch, chuẩn bị cho các…
- blog-title-generator – Blog Title Generator. Dùng khi làm việc với chủ đề hoặc tóm tắt trang.
- blog-writing-guide – Skill này áp dụng tiêu chuẩn viết blog của Sentry cho mọi bài đăng — dù bạn đang giúp kỹ…
- mono-color – Tạo ảnh poster biên tập in ấn chỉ dùng một hoặc hai màu mực.
- bluebook-writing – Viết sách và bài báo về thiết kế bằng ngôn ngữ dễ hiểu theo khung hai lớp: trước tiên là…