bats-testing-patterns
하는 일
이 도구는 명령줄 스크립트(셸 스크립트)의 자동 테스트를 만들도록 돕습니다. 스크립트의 출력, 오류, 기타 동작을 확인해 예상대로 작동하는지 검증합니다.
사용하는 경우
- ✓만든 스크립트에 대한 테스트를 작성할 때.
- ✓다양한 상황에서 스크립트가 올바르게 작동하는지 확인하고 싶을 때.
- ✓CI/CD 과정에서 스크립트 검증을 자동화할 때.
스킬 링크
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/bats-testing-patterns/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“백업 스크립트가 파일을 올바르게 저장하는지 확인하는 테스트는 어떻게 작성하나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
Bats라는 시스템을 사용해 테스트를 만들고 실행합니다. 스크립트가 예상한 오류 코드를 반환하는지, 올바른 출력을 만드는지, 원하는 작업을 수행하는지 확인합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
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.
자주 묻는 질문
「셸 스크립트」란 무엇인가요?
터미널에서 직접 실행되어 작업을 자동화하는 작은 프로그램입니다.
CI/CD란 무엇인가요?
소프트웨어 개발과 배포 과정을 자동화하는 방식으로, 테스트가 자동으로 실행됩니다.
「단위 테스트」란 무엇인가요?
함수나 스크립트처럼 프로그램의 작은 부분을 따로 떼어 올바르게 작동하는지 확인하는 테스트입니다.
상세 정보
작성자의 원본 설명
Master Bash Automated Testing System (Bats) for comprehensive shell script testing. Use when writing tests for shell scripts, CI/CD pipelines, or requiring test-driven development of shell utilities.
인기도
- GitHub 스타
- 48k
- 순위
- #4018
- 라이선스
- MIT
- 업데이트
- 2026. 10. 15.
댓글
- …
이 저장소의 다른 스킬
00-andruia-consultant
48k에이전트가 AI 프로젝트를 시작하거나 개선할 수 있도록 코드를 분석하고 스페인어로 실행 계획을 세워 줍니다.
007
48k에이전트가 보안 감사와 위협 모델링을 수행해 공격과 취약점으로부터 프로젝트를 보호하도록 돕습니다.
10-andruia-skill-smith
48k에이전트가 AI 도구의 작동 방식을 정의하고 문서를 쓰며 구조를 검증하도록 돕습니다.
20-andruia-niche-intelligence
48k에이전트가 신뢰할 수 있는 자료를 바탕으로 특정 산업의 맥락, 규칙, 사용 패턴, 위험을 정리한 요약을 만들도록 돕습니다.
비슷한 스킬
test-driven-development
311k에이전트가 기능이나 수정을 만들기 전에 실패하는 테스트를 먼저 쓰고, 그것을 통과시키는 가장 작은 코드를 작성하도록 가르칩니다.
verification-before-completion
311k에이전트가 작업, 수정, 빌드가 완료되었거나 통과했다고 말하기 전에 실제 점검을 실행하고 결과를 읽도록 가르칩니다.
migrate-to-shoehorn
310k테스트 파일의 위험한 타입 캐스팅을 shoehorn 라이브러리로 바꿔, 테스트가 일부 데이터만 써도 타입 검사를 통과하도록 돕습니다.