bnadlerjr/dotfiles/developing-bash
Claude Code and agent skill by bnadlerjr/dotfiles
- community
Checking that the SKILL.md file is still in the repository.
Shell scripting expertise covering POSIX-compliant and Bash-specific patterns, defensive scripting practices, cross-platform compatibility, and command-line automation. Use when working with .sh files, shell scripts, or when the user mentions Bash, POSIX, shell scripting, shebang, pipelines, or CLI automation. Also use for set -e, traps, parameter expansion, or cross-platform shell compatibility.
Install
npx vskill@latest install bnadlerjr/dotfiles/developing-bashSKILL.md
Developing Bash
Expert guidance for writing robust, portable shell scripts.
Quick Start
For immediate help, identify your task type and consult the relevant reference:
| Working On | Reference File | Key Topics | |
|---|---|---|---|
| Portable scripts, sh compatibility | posix-scripting | POSIX subset, portability | |
| Arrays, advanced expansion | bash-features | Bash-specific extensions | |
| Error handling, safety flags | defensive-patterns | set flags, traps, validation | |
| macOS vs Linux differences | cross-platform | GNU vs BSD, path differences |
Core Principles
These principles apply across all shell scripting:
Defensive by Default
- Start every script with safety flags:
set -euo pipefail - Quote all variable expansions:
"$var"not$var - Use
[[ ]]for conditionals in Bash (more predictable than[ ]) - Validate inputs before using them
- Clean up resources with traps
Explicit Over Clever
- Prefer readable pipelines over dense one-liners
- Use descriptive variable names:
input_filenotf - Add comments for non-obvious shell constructs
- Avoid relying on shell-specific behavior without documenting it
Fail Fast, Fail Loud
- Exit immediately on errors (
set -e) - Treat unset variables as errors (
set -u) - Propagate pipeline failures (
set -o pipefail) - Provide meaningful error messages with context
Portability Awareness
- Know your target: POSIX sh, Bash 3.x, Bash 4+, or Zsh
- Document shell requirements in script header
- Test on target platforms, not just development machine
- Prefer POSIX when portability matters more than features
Script Template
Anti-Patterns to Avoid
Safety Violations
- Unquoted variables:
$varinstead of"$var" - Missing error handling: no
set -eor explicit checks - Parsing
lsoutput instead of using globs orfind -print0 - Using
evalwith untrusted input
Portability Traps
- Bash arrays in
#!/bin/shscripts - GNU-specific flags without fallbacks
- Hardcoded paths (
/usr/local/binvs/usr/bin) - Assuming
echobehavior (useprintffor portability)
Maintainability Issues
- Magic numbers without explanation
- Deep nesting instead of early returns
- Massive functions doing multiple things
- No usage message or help flag
Reference File IDs
For programmatic access: posix-scripting · bash-features · defensive-patterns · cross-platform
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingclaude/skills/developing-bash/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/bnadlerjr/dotfiles/developing-bash)