crush/skills/bash/SKILL.md
Create, edit, and improve bash scripts with automated linting and formatting. Use when working with shell scripts (.sh files), writing bash functions, fixing script errors, or when the user asks to create or modify any bash/shell script.
npx skillsauth add meowgorithm/dotfiles bashInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Write robust, well-formatted bash scripts with automated quality checks.
shfmt -w <file> if availableshellcheck <file> if availableAlways format before writing if shfmt is installed:
shfmt -w script.sh
Default style (POSIX-compatible):
Options:
-i 4 - 4-space indent instead of tabs-ci - indent switch cases-bn - binary operators start linesRun after writing/modifying scripts:
shellcheck script.sh
Common issues to address:
cd ... || exit for error handling$?#!/usr/bin/env bash
set -euo pipefail
# Check command success
if ! command -v foo &>/dev/null; then
echo "error: foo not found" >&2
exit 1
fi
# Safe cd
cd "$DIR" || exit 1
# Quote all variables
"$VAR"
"${ARRAY[@]}"
# Prefer local
local var="value"
# Defaults
: "${VAR:=default}"
my_func() {
local arg1="$1"
# ...
}
# Prefer [[ ]] over [ ]
[[ -f "$file" ]]
# String matching
[[ "$str" == *pattern* ]]
# Use pipefail to catch errors in pipelines
set -o pipefail
cmd1 | cmd2
tools
Convert video files (MP4, MOV, WebM, GIF, MKV, AVI, etc.) into animated WebP images with control over fps, size, quality, loop count, and trimming. Use when the user wants to turn a video or screen recording into an animated WebP, create a lightweight demo loop, replace an animated GIF with a smaller WebP, or produce a short clip as a .webp.
development
Convert images between formats (PNG, JPEG, WebP, GIF, BMP, TIFF, AVIF, HEIC) with quality control and resizing. Use when the user needs to convert images, batch process multiple files, optimize image sizes, or convert to modern formats like WebP or AVIF.
tools
Use charmtone colors via the `charmtone` CLI or Go API (`github.com/charmbracelet/x/exp/charmtone`). Triggers when the user asks to use charmtone colors, generate color palettes, get hex values, create CSS/SCSS/Vim color variables, or work with the CharmTone palette in Go code. Also triggers on mentions of specific charmtone color names (Cherry, Charple, Julep, Hazy, etc.) or requests to pick/choose/apply charmtone colors.
testing
Stage and commit changes with a Conventional Commits message. Invoke with /commit "optional scope hint". Inspects the diff, picks an appropriate type and scope, writes a concise message, and commits. Does not push.