/whetstone:ia-linux-bash-scriptingfrom whetstone
Defensive Bash scripting for Linux: safe foundations, argument parsing, production patterns, and ShellCheck compliance. Use when writing bash scripts, shell scripts, cron jobs, or CLI tools in bash.
Ships in whetstone. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Produce bash scripts that pass shellcheck --enable=all and shfmt -d with zero warnings.
Target: GNU Bash 4.4+ on Linux. No macOS/BSD workarounds, no Windows paths, no POSIX-only restrictions.
#!/usr/bin/env bash
main() (
set -Eeuo pipefail
shopt -s inherit_errexit
SCRIPT_DIR=$(dirname -- "${BASH_SOURCE[0]}") || exit "$?"
SCRIPT_DIR=$(cd -- "${SCRIPT_DIR}" && pwd -P) || exit "$?"
readonly SCRIPT_DIR
trap 'printf "Error at %s:%d\n" "${BASH_SOURCE[0]}" "$LINENO" >&2' ERR
_tmpdir=""
trap 'if [[ -n ${_tmpdir} ]]; then rm -rf -- "${_tmpdir}"; fi' EXIT
printf '%s\n' "${SCRIPT_DIR}"
)
if [[ ${BASH_SOURCE[0]} == "${0}" ]]; then
main "$@"
fi
-E propagates ERR traps into functionsinherit_errexit propagates errexit into $() command substitutionsSCRIPT_DIR, never the caller's cwd or git rev-parse --show-toplevel. A shared linter invoked from another project's git hook, a cron job, or a wrapper runs with someone else's cwd, so a caller-relative rules path resolves to a file that does not exist: the rule set loads empty, zero violations are found, exit 0. It is a silent no-op, not an error, and running it from inside its own repo passes for the wrong reason. Exercise it once from a scratch directory that is not the script's own tree_tmpdir=$(mktemp -d)main. Use a subshell body to contain them when tests call the function. Guard the call so sourcing only defines functions.10# before applying the sign; 10#-08 is invalid.local and readonly declarations from command substitutions.sh, GNU utility modes behave like syscall modes, or a configured fallback path is usable.Read the relevant reference before implementing the matching behavior:
${path%/*} not dirname, ${path##*/} not basename, ${var//old/new} not sed(( )) over expr; [[ =~ ]] over echo | grepval=$(cmd) once, reuse $valxargs -0 -P "$(nproc)" for parallel workdeclare -A map for lookups instead of repeated grep${var@Q} shell-quoted (Bash 4.4+); ${var@U} uppercase and ${var@L} lowercase (Bash 5.1+)declare -n ref=varname nameref for indirect accesswait -n wait for any background job$EPOCHSECONDS, $EPOCHREALTIME: timestamps without forking date (Bash 5.0+)sed -i (no '' suffix), grep -P (PCRE support), readlink -f (canonical path)timeout 30s cmd to prevent automation hangssed -i replaces a symlink with a regular file: it writes a temp file and renames it over the path, so the two copies diverge later with no error. Use sed -i --follow-symlinks or edit the target by name, and check git status --short for T (typechange) after scripted editsRun shellcheck --enable=all script.sh. Key rules:
cd dir || exit${BASH_REMATCH[n]}, not positional parametersPre-commit: shellcheck *.sh && shfmt -i 2 -ci -d *.sh
Run shellcheck --enable=all and shfmt -d with zero warnings before declaring done. Test edge cases: empty input, missing files, spaces in paths.
If shellcheck or shfmt is not installed (command -v shellcheck fails), the check was skipped, not passed: report "static analysis not run: shellcheck unavailable" and fall back to bash -n for syntax only. A skipped linter is the same silent no-op as the empty rules file above.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub iliaal/whetstone --plugin whetstone29 skills in this plugin
/ia-agent-native-architectureDesign agent-native applications where agents replace UI users as the primary actor. Use when designing MCP tools, agent-loop architectures, system prompt design, hooks policy, shared-workspace file patterns, or self-modifying agent systems./ia-brainstormingPre-implementation exploration: deep interview, approach comparison, design doc. Use when exploring a vague feature idea, clarifying ambiguous requirements, or comparing approaches before coding. For the full workflow, use the ia-brainstorm command (Claude Code)./ia-code-reviewStructured code reviews with severity-ranked findings and deep multi-agent mode. Use when performing a code review, auditing code quality, or critiquing PRs, MRs, or diffs, including a diff or patch pasted inline, even when the review looks quick from reading it. For the full multi-agent workflow, use the ia-review command (/ia-review in Claude Code)./ia-cpp-systemsModern C++ patterns: RAII and ownership, rule of zero/five, exceptions and error handling, API and ABI boundaries, templates, and CMake tooling. Use when writing, reviewing, refactoring, or debugging C++, working with smart pointers, move semantics, memory leaks, template errors, or gtest. For plain C, see ia-c-systems./ia-c-systemsC patterns for systems code, libraries, and native extensions: module layout, function decomposition, status-enum errors, memory safety, undefined behavior, and performance measurement. Use when writing, reviewing, refactoring, or debugging C, working with malloc lifetimes, buffer overflows, sanitizers, or Valgrind, or building native extensions. For C++, see ia-cpp-systems./ia-debuggingSystematic root-cause debugging with verification. Use for errors, stack traces, broken tests, flaky tests, regressions, or anything not working as expected, including a pasted stack trace or failing test whose cause looks obvious from reading it. For validating bug reports before fixing, use bug-reproduction-validator agent.Other plugins' skills for the same job