From bash-expert
Create, review, or optimize bash/shell scripts following 2025 best practices and cross-platform standards
How this command is triggered — by the user, by Claude, or both
Slash command
/bash-expert:bash-scriptThe summary Claude sees in its command listing — used to decide when to auto-load this command
## 🚨 CRITICAL GUIDELINES ### Windows File Path Requirements ## MANDATORY: Always Use Backslashes on Windows for File Paths When using Edit or Write tools on Windows, you MUST use backslashes (`\`) in file paths, NOT forward slashes (`/`). **Examples:** - ❌ WRONG: `D:/repos/project/file.tsx` - ✅ CORRECT: `D:\repos\project\file.tsx` This applies to: - Edit tool file_path parameter - Write tool file_path parameter - All file operations on Windows systems ### Documentation Guidelines **NEVER create new documentation files unless explicitly requested by the user.** - **Priority**: Upd...
When using Edit or Write tools on Windows, you MUST use backslashes (\) in file paths, NOT forward slashes (/).
Examples:
D:/repos/project/file.tsxD:\repos\project\file.tsxThis applies to:
NEVER create new documentation files unless explicitly requested by the user.
Autonomously create professional, production-ready bash scripts or review/optimize existing scripts following 2025 industry standards.
Automatic Actions:
For Reviews:
Create a new script:
/bash-script Create a backup script that archives /data to S3 with error handling
Review existing script:
/bash-script Review backup.sh for security issues and best practices
Optimize performance:
/bash-script Optimize deploy.sh for better performance
#!/usr/bin/env bash shebang#!/usr/bin/env bash
#
# backup.sh - Archive data to S3 with error handling
# Version: 1.0.0
set -euo pipefail
IFS=$'\n\t'
readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
readonly SCRIPT_NAME="$(basename "${BASH_SOURCE[0]}")"
# Cleanup on exit
cleanup() {
local exit_code=$?
[[ -n "${TEMP_DIR:-}" ]] && rm -rf "$TEMP_DIR"
exit "$exit_code"
}
trap cleanup EXIT INT TERM
# Main function
main() {
local source_dir="${1:?Source directory required}"
local s3_bucket="${2:?S3 bucket required}"
# Validate source directory
if [[ ! -d "$source_dir" ]]; then
echo "Error: Source directory not found: $source_dir" >&2
return 1
fi
# Create archive
local archive_name="backup-$(date +%Y%m%d-%H%M%S).tar.gz"
tar -czf "$archive_name" -C "$source_dir" . || {
echo "Error: Failed to create archive" >&2
return 1
}
# Upload to S3
aws s3 cp "$archive_name" "s3://$s3_bucket/" || {
echo "Error: Failed to upload to S3" >&2
rm -f "$archive_name"
return 1
}
# Cleanup
rm -f "$archive_name"
echo "Backup completed successfully"
}
main "$@"
After running this command, you'll have production-ready, secure, optimized bash scripts following all 2025 best practices.
npx claudepluginhub thimslugga/thimslugga-cc-plugins --plugin bash-expert