@archibate/writing-bash-scripts
BCreate and refactor Bash scripts following conventions (strict mode, fct_ naming, quoting). Includes shellcheck linting. Use when creating shell scripts, refactoring existing scripts, debugging shell errors, or linting scripts.
Install
agr install @archibate/writing-bash-scripts --target claudeWrites 1 file into .claude/skills/, pinned to git-134232e5.
- .claude/skills/writing-bash-scripts/SKILL.md
Document
name: writing-bash-scripts description: Create and refactor Bash scripts following conventions (strict mode, fct_ naming, quoting). Includes shellcheck linting. Use when creating shell scripts, refactoring existing scripts, debugging shell errors, or linting scripts.
Bash
Use this skill whenever the user asks to create/update/refactor a Bash script (.sh) or lint shell scripts.
Defaults
- Shebang:
#!/usr/bin/env bash - Strict mode:
set -Eeuo pipefail - Functions:
fct_<descriptive_snake_case>() { ... } - Variables: quote expansions like
"${var}", preferprintf, usereadonlyfor constants andlocalinside functions
Workflow
Creating/Refactoring Scripts
- Copy
scripts/pref_bash_script_template.shto the target path and rename it. - Update the SCRIPT INFO / USAGE header blocks.
- Implement behavior in
fct_execute_this, keepfct_main+trapstructure. - Follow the detailed conventions in
references/pref_bash.md. - Run shellcheck linting (see below).
Linting Scripts
Run shellcheck on scripts using the provided wrapper:
# Lint all scripts in scripts/ directory (default)
.opencode/skill/bash/scripts/run_shellck.sh
# Lint specific files or directories
.opencode/skill/bash/scripts/run_shellck.sh path/to/script.sh
.opencode/skill/bash/scripts/run_shellck.sh scripts/ other/dir/
The linting script:
- Automatically detects shell scripts by extension (
.sh,.bash,.zsh) or shebang - Exits non-zero on shellcheck failures
- Defaults to scanning
scripts/when no arguments provided
See references/pref_bash.md section 14 for shellcheck integration details.
Trustgrade B
- passBody integrity
Whether the stored document is plausibly the kind of file the artifact declares, rather than something fetched by mistake.
- passType matchnot applicable to this artifact type
Whether the artifact is really the kind of thing its metadata claims it is.
- passFreshness
How long since the source repository was last pushed to.
- passPrompt injection
Scans the artifact's own text for instructions aimed at your agent rather than at you.
- warnLicenseno SPDX license detected
Whether the source repository declares an SPDX license permissive enough to redistribute.
How the grade is calculated
Each check contributes 0 points when it passes, 1 when it warns, and 2 when it fails. The total maps to a letter:
- Aevery check passed
- Bone warning
- Ctwo warnings
- Dprompt injection or body integrity failed, or three warnings
- Fone of those failed, and something else is wrong
These are automated hygiene checks, not a security audit, and not a dependency or vulnerability scan. A grade of A means nothing was flagged — not that the artifact is safe.
Versions
git-134232e503732026-07-31