Agent skill
bash-quality-gate
Runs shell script quality checks. Use when checking shell script quality, linting bash code, or validating scripts. Covers formatting with shfmt, static analysis with shellcheck, and portability checks.
Install this agent skill to your Project
npx add-skill https://github.com/philoserf/claude-code-setup/tree/main/skills/bash-quality-gate
SKILL.md
Bash Quality Gate
Run a standardized set of shell script quality checks. Auto-fix what's fixable, report the rest with specific locations.
Prerequisites
Verify these tools are available before running checks. Both are installed via Homebrew.
shfmt— shell formatter (brew install shfmt)shellcheck— static analysis (brew install shellcheck)
Check Sequence
Run checks in this order. Formatting first so shellcheck analyzes clean code.
1. Format (auto-fix)
Run shfmt -w -i 2 -ci -bn . on all .sh files — report which files were modified. If no files changed, report "formatting clean."
Flags:
-i 2— 2-space indent-ci— indent switch cases-bn— binary ops start of line
If a project has an .editorconfig, shfmt picks it up automatically — skip the explicit flags.
2. Lint (report)
Run shellcheck -x *.sh **/*.sh — report issues with file, line, rule code, and severity. The -x flag follows source directives.
If scripts lack a shebang, shellcheck defaults to sh. Note any scripts missing shebangs and suggest adding them.
3. Portability (report)
Run shellcheck --shell=sh *.sh **/*.sh — check POSIX compliance. Report bash-specific constructs that would break on sh/dash. Skip this step if all scripts explicitly declare #!/bin/bash or #!/usr/bin/env bash — they've opted into bash.
Output
After all checks complete, present a summary table:
| Check | Status | Details |
|-------------|--------|----------------------|
| shfmt | FIXED | 2 files formatted |
| shellcheck | WARN | 3 issues (1 error) |
| portability | SKIP | All scripts use bash |
Then list specific issues grouped by file, with line numbers and ShellCheck codes (e.g., SC2086). Offer to fix reported issues if the user wants.
Gate Criteria
The gate passes when all of these are true:
shfmtreports no formatting differences (or auto-fixed successfully)shellcheckreports zero errors (severity: error)- All scripts have a shebang line
The gate fails if any shellcheck error-severity issues remain after the run.
Advisory (non-blocking): warnings and info-level shellcheck findings. Report them but don't fail the gate.
| Severity | ShellCheck Flag | Gate Impact |
|---|---|---|
| error | (default) | Blocks |
| warning | -S warning |
Advisory |
| info | -S info |
Advisory |
| style | -S style |
Advisory |
File Discovery
- Find scripts by extension:
*.sh - Find scripts by shebang:
#!/bin/bash,#!/bin/sh,#!/usr/bin/env bash - Check the current directory and subdirectories
- Skip
node_modules/,.git/, andvendor/directories
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
pre-release
Validates a project is ready to tag and ship. Use when tagging a release, cutting a version, shipping a package, or asking "are we ready to release?" Checks repo hygiene, CI status, docs, version sync, and build verification. Optimized for Obsidian plugins with fallback detection for other project types.
local-issues
Reviews a codebase for bugs, design issues, and code cleanliness problems with specific file paths and line numbers. Use when auditing code quality, finding bugs, doing a code review, finding problems, or reviewing a project for issues. Creates issue files in `.issues/` directory.
skill-improve
Generates prioritized improvement recommendations for Claude Code skills. Use when improving skills, enhancing customizations, or wanting actionable feedback on how to make a skill better. Provides impact/effort prioritization with specific fix suggestions.
release
Executes the final release workflow for Obsidian plugins after pre-release checks pass. Use when tagging a release, publishing a version, or shipping an Obsidian plugin. Bumps version via bun run script, creates git tag, pushes to trigger GitHub Actions, and updates GitHub release notes from CHANGELOG.md.
skill-quality
Scores Claude Code skills (1-5) across 6 weighted quality dimensions aligned with official Anthropic docs. Use when evaluating skill quality, rating skills, scoring customizations, comparing skill effectiveness, or checking if a skill follows best practices. Produces per-dimension scores with evidence, weighted totals, quality tier classification, and actionable improvement recommendations.
obsidian-cli
Interacts with Obsidian vaults using the Obsidian CLI to read, create, and manage notes, tasks, properties, tags, and more. Also supports plugin and theme development with commands to reload plugins, run JavaScript, capture errors, take screenshots, and inspect the DOM. Use when the user asks to interact with their Obsidian vault, manage notes, add to daily note, find notes about a topic, check tasks, append to a note, query the vault, list tags, list files, manage bookmarks, check sync status, view file history, use templates, query bases, run QuickAdd, perform vault operations from the command line, or develop and debug Obsidian plugins and themes.
Didn't find tool you were looking for?