Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add vikasudasi/skill-vault --skill bash-scripting-safegit clone --depth 1 https://github.com/vikasudasi/skill-vaultWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/vikasudasi/skill-vault/bash-scripting-safe)<a href="https://agentmods.dev/skills/vikasudasi/skill-vault/bash-scripting-safe"><img src="https://agentmods.dev/badge/skills/vikasudasi/skill-vault/bash-scripting-safe/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/vikasudasi/skill-vault/bash-scripting-safe"><img src="https://agentmods.dev/badge/skills/vikasudasi/skill-vault/bash-scripting-safe.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00038 | $0.01121 |
| Opus 5.5 | $0.00015 | $0.00448 |
| Sonnet 5.5 | $0.00008 | $0.00224 |
| Haiku 4.5 | $0.00004 | $0.00112 |
Grade A, and why
bash-scripting-safe scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 123 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Safe Bash Scripting
Use when writing a shell script that must not corrupt files, delete the wrong thing, or silently fail. Bash is powerful precisely because it's dangerous — the discipline below is what makes it safe.
Always start with these three lines
#!/usr/bin/env bash
set -euo pipefail
-e— exit on first failing command (no silent mid-script failure).-u— error on unset variable (catches typos like$filevs$files).-o pipefail— a failing command anywhere in a pipeline fails the pipeline.
Add IFS=$'\n\t' when you parse output: it changes Bash's default word-splitting
(space, tab, newline) to just newline + tab, so filenames containing spaces no
longer get split into multiple arguments.
Quote everything (word splitting is the #1 data-loss path)
dir="$1" # quote expansions
for f in "$dir"/*.txt; do # quotes + glob
cp "$f" "$dest/"
done
Unquoted $var undergoes word splitting (splits on spaces) and globbing
(* and ? expand). The classic disaster:
# WRONG — if "$file" contains a space, rm deletes multiple files; glob expansion is worse
rm $file
# RIGHT
rm -- "$file"
A variable is only safe unquoted when you intend splitting/globbing. Prefer
"$@"-style quoting everywhere else.
Redirects and atomic file writes
- Use a temp file +
mvfor atomic writes; never>straight onto a file you also read later in the same script (it truncates the input mid-run):
tmp="$(mktemp)"
trap 'rm -f "$tmp"' EXIT # clean up scratch even on error
grep foo input.txt > "$tmp"
mv "$tmp" output.txt # atomic swap
mktempfor scratch files (safer than hard-coded/tmp/namewhich can collide or be a symlink).trap ... EXITguarantees cleanup on failure.- Beware
set -e+ empty globs:"$dir"/*.txtwith no matches stays a literal*.txtstring — check withshopt -s nullglobor test existence.
Error handling
if ! command -v jq >/dev/null 2>&1; then
echo "jq is required" >&2
exit 1
fi
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 123 lines · 38 tokens per session scan A 4c194271d342
bash-scripting-safe is a skill published in the GitHub repository vikasudasi/skill-vault (0 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 38 tokens to every session and 1,121 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
shell-scripting
Use this skill when writing bash or zsh scripts, parsing arguments, handling errors, or automating CLI workflows. Triggers on bash scripting, shell scripts, argument parsing, process substitution, here documents, signal trapping, exit codes, and any task requiring portable shell script development.
shell-scripting
A guide to writing Bash shell scripts, which automate command-line tasks on Linux and similar systems. It covers variables, arrays, conditions, loops, functions, and safer script structure.
bash-scripting
Use when writing or hardening a shell script that must survive another machine — a CI step, install script, cron job, git hook, devcontainer entrypoint: strict-mode leaks, quoting/word-splitting, arrays, trap cleanup, bash-vs-POSIX portability, ShellCheck findings. NOT CI workflow structure, runners, caching or matrix…
mainframe
Discover MAINFRAME read-only shell helpers and route durable agent authority through its control plane when available.
mainframe
Pi shell policy, explicit task checkpoints, and runtime status. Use for Mainframe status, shell-policy questions, or resuming checkpointed project work.
bash-defensive-patterns
Master defensive Bash programming techniques for production-grade scripts. Use when writing robust shell scripts, CI/CD pipelines, or system utilities requiring fault tolerance and safety.