본문으로 건너뛰기
Skillpedia
일반 코딩48k · #4017

bash-scripting

하는 일

이 가이드는 견고하고 실제 운영에 쓸 수 있는 자동화 스크립트를 만드는 방법을 알려 줍니다. 안전성, 오류 처리, 테스트를 추가해 스크립트가 올바르게 작동하도록 하는 방법을 가르칩니다.

사용하는 경우

  • ✓반복적인 작업을 컴퓨터에서 자동화해야 할 때.
  • ✓시스템을 관리하는 도구를 만들 때.
  • ✓파일을 배포하거나 백업하는 스크립트를 만들고 싶을 때.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/bash-scripting/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“중요한 파일을 백업하는 안전한 스크립트를 만들도록 도와주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 가이드는 스크립트 계획, 핵심 코드 작성, 오류 처리 추가, 전체 테스트 같은 단계로 나뉩니다. 각 단계에 맞는 도구와 명령을 제안합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Bash Scripting Workflow

Overview

Specialized workflow for creating robust, production-ready bash scripts with defensive programming patterns, comprehensive error handling, and automated testing.

When to Use This Workflow

Use this workflow when:

  • Creating automation scripts
  • Writing system administration tools
  • Building deployment scripts
  • Developing backup solutions
  • Creating CI/CD scripts

Scope and execution

Choose the phases that match the user’s task; this document is an index, not an instruction to run every listed skill. Read a selected skill before using it. Respect repository and user constraints. Cloud calls, host configuration, publishing, destructive operations and spending require the applicable authorization; a workflow checklist does not grant it.

The template is a starting point, not a completed script: it does not implement argument parsing or rollback. Validate paths, quote expansions, test in a disposable directory, and make retries bounded and safe for the specific command. Never log credentials or imply strict mode catches every failure.

Workflow Phases

Phase 1: Script Design

Skills to Invoke

  • bash-pro - Professional scripting
  • bash-defensive-patterns - Defensive patterns

Actions

  1. Define script purpose
  2. Identify inputs/outputs
  3. Plan error handling
  4. Design logging strategy
  5. Document requirements

Copy-Paste Prompts

Use @bash-pro to design production-ready bash script

Phase 2: Script Structure

Skills to Invoke

  • bash-pro - Script structure
  • bash-defensive-patterns - Safety patterns

Actions

  1. Add shebang and strict mode
  2. Create usage function
  3. Implement argument parsing
  4. Set up logging
  5. Add cleanup handlers

Copy-Paste Prompts

Use @bash-defensive-patterns to implement strict mode and error handling

Phase 3: Core Implementation

Skills to Invoke

  • bash-linux - Linux commands
  • linux-shell-scripting - Shell scripting

Actions

  1. Implement main functions
  2. Add input validation
  3. Create helper functions
  4. Handle edge cases
  5. Add progress indicators

Copy-Paste Prompts

Use @bash-linux to implement system commands

Phase 4: Error Handling

Skills to Invoke

  • bash-defensive-patterns - Error handling
  • error-handling-patterns - Error patterns

Actions

  1. Add trap handlers
  2. Implement retry logic
  3. Create error messages
  4. Set up exit codes
  5. Add rollback capability

Copy-Paste Prompts

Use @bash-defensive-patterns to add comprehensive error handling

Phase 5: Logging

Skills to Invoke

  • bash-pro - Logging patterns

Actions

  1. Create logging function
  2. Add log levels
  3. Implement timestamps
  4. Configure log rotation
  5. Add debug mode

Copy-Paste Prompts

Use @bash-pro to implement structured logging

Phase 6: Testing

Skills to Invoke

  • bats-testing-patterns - Bats testing
  • shellcheck-configuration - ShellCheck

Actions

  1. Write Bats tests
  2. Run ShellCheck
  3. Test edge cases
  4. Verify error handling
  5. Test with different inputs

Copy-Paste Prompts

Use @bats-testing-patterns to write script tests
Use @shellcheck-configuration to lint bash script

Phase 7: Documentation

Skills to Invoke

  • documentation-templates - Documentation

Actions

  1. Add script header
  2. Document functions
  3. Create usage examples
  4. List dependencies
  5. Add troubleshooting section

Copy-Paste Prompts

Use @documentation-templates to document bash script

Script Template

#!/usr/bin/env bash
set -euo pipefail

SCRIPT_NAME=$(basename -- "$0")
readonly SCRIPT_NAME
SCRIPT_DIR=$(cd -- "$(dirname -- "$0")" && pwd)
readonly SCRIPT_DIR

log() { echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*"; }
error() { log "ERROR: $*" >&2; exit 1; }

usage() { cat <<EOF
Usage: $SCRIPT_NAME [OPTIONS]
Options:
    -h, --help      Show help
    -v, --verbose   Verbose output
EOF
}

main() {
    log "Script started"
    # Implementation
    log "Script completed"
}

main "$@"

Quality Gates

  • ShellCheck passes
  • Bats tests pass
  • Error handling works
  • Logging functional
  • Documentation complete

Related Workflow Bundles

  • os-scripting - OS scripting
  • linux-troubleshooting - Linux troubleshooting
  • cloud-devops - DevOps automation

Limitations

  • Use this skill only when the task clearly matches the scope described above.

…

자주 묻는 질문

「방어적 패턴」이란 무엇인가요?

사용하기 전에 파일이 존재하는지 확인하는 등, 스크립트를 더 안전하고 오류에 덜 취약하게 만드는 프로그래밍 방식입니다.

「오류 처리」란 무엇인가요?

명령 실패 같은 예상치 못한 문제를 스크립트가 다루는 방식입니다. 갑자기 작동을 멈추지 않고 무엇이 잘못되었는지 보고하도록 합니다.

왜 스크립트를 테스트하나요?

테스트는 스크립트가 다양한 상황에서 의도한 대로 작동하는지, 그리고 중요한 작업에 쓰기 전에 오류 처리가 예상대로 작동하는지 확인합니다.

상세 정보

작성자의 원본 설명

Bash scripting workflow for creating production-ready shell scripts with defensive patterns, error handling, and testing.

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#4017
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬