projectbluefin/common/shell-scripts

Claude Code and agent skill by projectbluefin/common

Trust tier 3
  • community
  • ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Source check pending

Checking that the SKILL.md file is still in the repository.

Shell script authoring and testability. Use when writing or testing shell scripts under system_files/, removing scripts, or adding bats tests.

Install

npx vskill@latest install projectbluefin/common/shell-scripts

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

Shell Scripts — authoring and testability

This skill owns shell authoring and testability; CI tooling owns workflow policy and CI pitfalls owns failure diagnosis.

When to Use

  • Writing or modifying a shell script under system_files/
  • Writing bats tests for a shell script
  • Debugging a shellcheck failure in validate.yml
  • Removing a shell script from common (removal checklist)

When NOT to Use


Removing a shell script from common

When deleting system_files/bluefin/usr/bin/<script>, check its callers:

FileWhat to remove
.github/workflows/validate.ymlNothing for shellcheck (the set is derived from extension/shebang on disk); remove any candidates.append(Path("...")) entry in the Python OCI-ref guard
system_files/bluefin/usr/share/ublue-os/just/system.justThe just target and all aliases
docs/skills/The script's skill file (if any) and all cross-references under docs/
Dead apt step hazard

If the validate.yml shellcheck step was the only consumer of Install shellcheck in that job, delete the apt install step too — it becomes a silent no-op that wastes ~20 seconds per CI run and confuses future readers.

Cross-reference sweep

After deleting the script and its skill file, run:

bash
grep -rn "<script-name>" docs/ --include="*.md" --include="*.json"

Common survivors: devmode.md advisories and image-registry.md section headers.


Core Testability Idioms

Quick reference — full patterns with WRONG/CORRECT examples in references/testability-patterns.md.

PatternSummary
BASH_SOURCE main guardWrap main flow so source in bats only loads functions
${VAR:-default} overrideMake every /proc, /dev, /usr/share path overridable
PATH-stub mockingDrop executable stubs into ${WORKDIR}/bin, prepend to PATH
XDG_CONFIG_HOME isolationunset XDG_CONFIG_HOME in setup() alongside export HOME=...
stdin redirect overrideUse ${IMAGE_INFO_FILE:-/path} so bats can inject a fixture
Subshell export checkInstrument the $(...) call, not the exec'd process
Guard optional commandscommand -v foo >/dev/null before doing work
NO_COLOR propagationDisable ANSI from both the script and subprocesses; assert captured output has no ESC bytes

Bats Test Structure

Standard file layout, mocking, and pitfalls in references/bats-patterns.md.

Just recipe descriptions

Keep maintainer notes above the user-facing description comment. just --list uses the last comment line before a recipe's attributes as its description, so a note about dependency pins can accidentally replace the help text. Separate the notes with a blank line, then put the description immediately above the recipe's attributes.

Verify the displayed text without running the installer:

bash
just --justfile system_files/shared/usr/share/ublue-os/just/apps.just --list

Shellcheck Reference

Directive syntax, SC code notes, and quoting fix examples in references/shellcheck-examples.md.


Red Flags

  • A shell script reads from a hardcoded /proc, /dev, or /usr/share/... path without an env-var override — untestable in CI
  • A bats test overrides HOME but not XDG_CONFIG_HOME — leaks to the real runner config dir
  • A shellcheck disable= directive has an inline comment after it (SC1072/SC1073)
  • A script's main flow runs on source (no BASH_SOURCE guard) — breaks bats loading
  • --cov=tests in a pytest invocation — measures test files, not source under test

Verification

  • [ ] shellcheck -S warning <file> passes on the modified script
  • [ ] just test passes locally (bats + pytest)
  • [ ] If a shellcheck directive was added, verify its syntax against Context7 (shellcheck library) and confirm the SC code is correct
  • [ ] If a bats test uses env-var overrides, confirm the script uses ${VAR:-default} at the read site — the override does nothing without it
  • [ ] If a script was removed, all 4 touch-points were checked and the cross-reference sweep returned no survivors

References

FileContents
references/testability-patterns.mdAll testability patterns with full WRONG/CORRECT code examples
references/bats-patterns.mdStandard bats file structure, mocking, and assertion pitfalls
references/shellcheck-examples.mdShellcheck directive syntax, SC codes, and quoting fix examples

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

Popularity

7-day trend score
0

Not refreshed yet.

Extension points

  • hookPre/post lifecycle hooks

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/projectbluefin/common/shell-scripts/badge)](https://verified-skill.com/skills/projectbluefin/common/shell-scripts)

Something wrong with this skill or its page? Tell us.