Marketplace bash-scripting
Bash scripting workflow for creating production-ready shell scripts with defensive patterns, error handling, and testing.
install
source · Clone the upstream repo
git clone https://github.com/aiskillstore/marketplace
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/aiskillstore/marketplace "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/sickn33/bash-scripting" ~/.claude/skills/aiskillstore-marketplace-bash-scripting && rm -rf "$T"
manifest:
skills/sickn33/bash-scripting/SKILL.mdsource content
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
Workflow Phases
Phase 1: Script Design
Skills to Invoke
- Professional scriptingbash-pro
- Defensive patternsbash-defensive-patterns
Actions
- Define script purpose
- Identify inputs/outputs
- Plan error handling
- Design logging strategy
- Document requirements
Copy-Paste Prompts
Use @bash-pro to design production-ready bash script
Phase 2: Script Structure
Skills to Invoke
- Script structurebash-pro
- Safety patternsbash-defensive-patterns
Actions
- Add shebang and strict mode
- Create usage function
- Implement argument parsing
- Set up logging
- Add cleanup handlers
Copy-Paste Prompts
Use @bash-defensive-patterns to implement strict mode and error handling
Phase 3: Core Implementation
Skills to Invoke
- Linux commandsbash-linux
- Shell scriptinglinux-shell-scripting
Actions
- Implement main functions
- Add input validation
- Create helper functions
- Handle edge cases
- Add progress indicators
Copy-Paste Prompts
Use @bash-linux to implement system commands
Phase 4: Error Handling
Skills to Invoke
- Error handlingbash-defensive-patterns
- Error patternserror-handling-patterns
Actions
- Add trap handlers
- Implement retry logic
- Create error messages
- Set up exit codes
- Add rollback capability
Copy-Paste Prompts
Use @bash-defensive-patterns to add comprehensive error handling
Phase 5: Logging
Skills to Invoke
- Logging patternsbash-pro
Actions
- Create logging function
- Add log levels
- Implement timestamps
- Configure log rotation
- Add debug mode
Copy-Paste Prompts
Use @bash-pro to implement structured logging
Phase 6: Testing
Skills to Invoke
- Bats testingbats-testing-patterns
- ShellCheckshellcheck-configuration
Actions
- Write Bats tests
- Run ShellCheck
- Test edge cases
- Verify error handling
- 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
- Documentationdocumentation-templates
Actions
- Add script header
- Document functions
- Create usage examples
- List dependencies
- Add troubleshooting section
Copy-Paste Prompts
Use @documentation-templates to document bash script
Script Template
#!/usr/bin/env bash set -euo pipefail readonly SCRIPT_NAME=$(basename "$0") readonly SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) 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 scriptingos-scripting
- Linux troubleshootinglinux-troubleshooting
- DevOps automationcloud-devops