skills/codingkaiser/shell-scripting/SKILL.md
Specialized knowledge of Bash and Zsh scripting, shell automation, command-line tools, and scripting best practices. Use when the user needs to write, debug, or optimize shell scripts, work with command-line tools, automate tasks with bash/zsh, or asks for shell script help.
npx skillsauth add aiskillstore/marketplace shell-scriptingInstall 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.
Expert guidance for writing robust, maintainable Bash and Zsh scripts with best practices for automation and command-line tool usage.
Start every script with:
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
set -e: Exit on errorset -u: Error on undefined variablesset -o pipefail: Catch errors in pipesIFS=$'\n\t': Safer word splitting"$variable" not $variable[[ for conditionals (Bash): if [[ "$var" == "value" ]]; thenif command -v git &> /dev/null; thenls: Use globs or find insteadfiles=("file1" "file2") not space-separated stringstrap cleanup EXIT
trap 'echo "Error on line $LINENO"' ERR
while [[ $# -gt 0 ]]; do
case $1 in
-h|--help) usage; exit 0 ;;
-v|--verbose) VERBOSE=true; shift ;;
-*) echo "Unknown option: $1"; exit 1 ;;
*) break ;;
esac
done
# Prefer this (handles spaces, newlines correctly):
while IFS= read -r -d '' file; do
echo "Processing: $file"
done < <(find . -type f -name "*.txt" -print0)
# Or with simple globs:
for file in *.txt; do
[[ -e "$file" ]] || continue # Skip if no matches
echo "Processing: $file"
done
read -rp "Continue? [y/N] " response
if [[ "$response" =~ ^[Yy]$ ]]; then
echo "Continuing..."
fi
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
echo -e "${GREEN}Success${NC}"
echo -e "${RED}Error${NC}" >&2
When appropriate, suggest these modern replacements:
ripgrep (rg) → faster than grepfd → faster than findfzf → interactive filteringjq → JSON processingyq → YAML processingbat → cat with syntax highlightingeza → enhanced lsusage() {
cat <<EOF
Usage: ${0##*/} [OPTIONS] <args>
Description of what this script does.
OPTIONS:
-h, --help Show this help
-v, --verbose Verbose output
EOF
}
main() {
# Main logic here
:
}
When user specifies Zsh:
**/*.txt (recursive), *.txt~*test* (exclude pattern)${var:u} (uppercase), ${var:l} (lowercase)typeset -A hash; hash[key]=valuesetopt extended_globeval untrusted inputmktemp for temporary files: TEMP_FILE=$(mktemp)rm -rf operations[[ ]] vs test, $(( )) vs expr)var=$(cat file) → var=$(<file)read not cat | while: while read -r line; do ... done < filexargs -P or GNU parallel for parallel processingSee references/template.sh for a complete, production-ready script template with all best practices incorporated.
development
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.