bew/dotfiles/coder-bash
Claude Code and agent skill by bew/dotfiles
- community
Checking that the SKILL.md file is still in the repository.
Bash code writing guidelines: shebang, strict mode, bash idioms, and full boilerplate. Always load when asked to draft/write/edit/refactor/review bash code files.
Install
npx vskill@latest install bew/dotfiles/coder-bashSKILL.md
Goal
Write bash scripts following strict-mode conventions and bash idioms, building on coder-generic rules.
REQUIRES: load coder-generic skill first.
In bash, module code is a .sh file sourced by other scripts (no shebang). Script code is an executable run directly: no file extension, shebang + main "$@" at end.
If working on module code: read <./module-rules.md>. If working on script code: read <./script-rules.md>.
Rules
- Use
[[ ... ]]over[ ... ]for all conditional expressions. - Use
(( ... ))over[[ ... ]]for numeric comparisons. - Always quote variables:
"$var","$@","${arr[@]}". - Use
function name() { ... }style — always include thefunctionkeyword. - Use
${VAR:-default}for optional arguments and env var defaults with fallback values. - In bash, also add what comments when the syntax itself is non-obvious —
e.g. symbol-heavy expressions, unusual pipeline ordering, or constructs that read backwards.
- When a pipeline step may cause SIGPIPE (e.g. piping into
head): temporarily disable
pipefail with set +o pipefail, then re-enable. Always add a comment explaining why it is disabled.
Function parameters
Always assign positional parameters to named local variables at the start of the function. Never use $1, $2, etc. directly in the function body (except trivial one-liners).
Conditions with computations
When a condition requires a computation or function call, extract the result to a local variable first. Avoid embedding calls inside if expressions.
Quoting and interpolation
Single-quote literals that need no interpolation — nothing to escape, nothing expands:
Build an interpolated string with printf -v and a single-quoted format when the result embeds quotes or other characters you would otherwise escape:
printf -v assigns without printing and does not mark the variable exported. Inside a function, declare the target local — printf -v writes a global otherwise. Add export when the value must reach a child process.
Output capture
When capturing command output to a local variable, declare separately from the assignment. local always exits 0 in bash, swallowing the real exit code otherwise:
Check success when capturing potentially-failing output:
Disable pipefail for SIGPIPE-prone pipelines:
Testing
The standard testing system for bash scripts in this repo is Bats (Bash Automated Testing System).
Load coder-bats skill when writing or running tests for a bash script.
When writing a bash script, propose the companion .bats test file — do not wait to be asked.
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 repositoryCheckingopencode/skills/coder-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/bew/dotfiles/coder-bash)