bats-testing-patterns – skill Lập trình cho agent AI
Thành thạo Bats (Bash Automated Testing System) để kiểm thử toàn diện shell script. Dùng khi viết test cho shell script, pipeline CI/CD, hoặc cần phát triển tiện ích shell theo hướng test-driven.
Cài skill bats-testing-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/bats-testing-patterns-1f43c.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /bats-testing-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/bats-testing-patterns-1f43c.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $bats-testing-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/bats-testing-patterns-1f43c.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /bats-testing-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/bats-testing-patterns-1f43c.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /bats-testing-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.
Bats Testing Patterns
Comprehensive guidance for writing comprehensive unit tests for shell scripts using Bats (Bash Automated Testing System), including test patterns, fixtures, and best practices for production-grade shell testing.
Use this skill when
- Writing unit tests for shell scripts
- Implementing TDD for scripts
- Setting up automated testing in CI/CD pipelines
- Testing edge cases and error conditions
- Validating behavior across shell environments
Do not use this skill when
- The project does not use shell scripts
- You need integration tests beyond shell behavior
- The goal is only linting or formatting
Instructions
- Confirm shell dialects and supported environments.
- Set up a test structure with helpers and fixtures.
- Write tests for exit codes, output, and side effects.
- Add setup/teardown and run tests in CI.
- If detailed examples are required, open
resources/implementation-playbook.md.
Resources
resources/implementation-playbook.mdfor detailed patterns and examples.
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
- hunt-ssti – Săn lỗ hổng server-side template injection (SSTI) trên Jinja2 (Flask/Django), Twig…
- bdistill-behavioral-xray – X-ray hành vi của mọi mô hình AI — ranh giới từ chối, xu hướng ảo giác, phong cách suy…
- bdistill-knowledge-extraction – Trích xuất tri thức miền có cấu trúc từ mô hình AI ngay trong phiên, hoặc từ mô hình mã…
- before-you-build – Đánh giá rủi ro sản phẩm trước khi code bằng cách kiểm tra nhu cầu, phương án thay thế…
- behavioral-modes – Các chế độ vận hành của AI (brainstorm, implement, debug, review, teach, ship…
- experiment-designer – Dùng khi lên kế hoạch thử nghiệm sản phẩm, viết giả thuyết kiểm chứng được, ước lượng cỡ…
- memento-flashcards – Thẻ ghi nhớ lặp lại ngắt quãng: tạo, ôn tập, kiểm tra, xuất.
- bevy-ecs-expert – Làm chủ Entity Component System (ECS) của Bevy trong Rust, bao gồm Systems, Queries…