/marks-languages:bashfrom marks-languages
Defensive Bash scripting patterns for reliable automation. Use when writing shell scripts.
Ships in marks-languages. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
#!/usr/bin/env bash
set -Eeuo pipefail
# -E: ERR traps inherited by functions
# -e: exit on error
# -u: error on undefined variables
# -o pipefail: pipe fails if any command fails
# Trap for cleanup
cleanup() {
rm -rf "$TEMP_DIR"
}
trap cleanup EXIT
# Error handler with line number
error_handler() {
echo "Error on line $1" >&2
exit 1
}
trap 'error_handler $LINENO' ERR
# Check command exists
require_cmd() {
command -v "$1" >/dev/null 2>&1 || {
echo "Required command not found: $1" >&2
exit 1
}
}
require_cmd jq
require_cmd curl
# Required variable with error message
: "${REQUIRED_VAR:?Error: REQUIRED_VAR not set}"
# Default value
: "${OPTIONAL_VAR:=default_value}"
# Always quote variables
echo "$FILE_PATH"
rm -rf "${DIR:?}/" # Prevents rm -rf /
usage() {
cat <<EOF
Usage: $(basename "$0") [OPTIONS] <arg>
Options:
-h, --help Show this help
-v, --verbose Verbose output
-f, --file Input file
EOF
exit 1
}
VERBOSE=false
FILE=""
while [[ $# -gt 0 ]]; do
case $1 in
-h|--help) usage ;;
-v|--verbose) VERBOSE=true; shift ;;
-f|--file) FILE="$2"; shift 2 ;;
-*) echo "Unknown option: $1" >&2; usage ;;
*) ARGS+=("$1"); shift ;;
esac
done
readonly LOG_FILE="/var/log/script.log"
log() {
local level="$1"; shift
echo "[$(date -Iseconds)] [$level] $*" | tee -a "$LOG_FILE"
}
info() { log INFO "$@"; }
warn() { log WARN "$@"; }
error() { log ERROR "$@" >&2; }
debug() { [[ "${DEBUG:-false}" == "true" ]] && log DEBUG "$@"; }
# Check before create
[[ -d "$DIR" ]] || mkdir -p "$DIR"
# Check before download
[[ -f "$FILE" ]] || curl -o "$FILE" "$URL"
# Atomic file write
tmp=$(mktemp)
generate_config > "$tmp"
mv "$tmp" "$CONFIG_FILE"
#!/usr/bin/env bash"$var"[[ over [ for conditionals$(command) over backticksreadonly for constantslocal in functionsmktemp for temp filesWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub malston/marks-marketplace --plugin marks-languages8 skills in this plugin
/cloud-designDesign resilient, scalable multi-cloud architectures with best practices for AWS, Azure, and GCP. Use when creating cloud architecture diagrams, planning cloud infrastructure, or designing cloud migration strategies./golangGo patterns for backend development, testing, and clean architecture. Use when writing Go code./k8s-architectureDesign and implement production-grade Kubernetes clusters with best practices for reliability, security, and scalability. Use when planning cluster architecture, designing K8s network models, or implementing multi-cluster strategies.