Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Shell Script Linter and Safety Review

    by Saizul Amin

    1

    This skill gives your agent a proven procedure plus scripts that check the facts, so you get the same correct answer every time, with exact fixes instead of vague advice.

    Free

    Security scanned
    Shell Script Linter and Safety Review

    Shell Script Linter and Safety Review

    Example session with this skill installed

    Run the Shell Script Linter and Safety Review skill on my project and give me a prioritised list of what to fix, with exact changes.

    • Read your context and instructions
    • Compiled the shell script linter

    Here is what the Shell Script Linter and Safety Review skill produced.

    Demo: real, unedited output of the skill's bundled script on a sample input from its test suite.

    Output

    -Users-SaizulAmin-Saizul-Old-PC-Saizul-com/bc16f08c-2133-4c9b-92e4-fd071b48ec64/scratchpad/src/bash-shell-skills/tests/fixtures/scripts/bad_deploy.sh (bash): 3 high, 10 medium, 5 low, 1 info
      MEDIUM SH002 line 1: the script keeps running after a failing command
             fix: add 'set -euo pipefail' (bash) or 'set -eu' (sh) after the shebang; handle expected failures explicitly with '|| true' or 'if'
      MEDIUM SH003 line 6: $BUILD_DIR is unquoted: values with spaces or * break into several words or globs
             > cd $BUILD_DIR
             fix: quote it: "$BUILD_DIR"
      MEDIUM SH005 line 6: if cd fails, the following commands run in the wrong directory
             > cd $BUILD_DIR
             fix: use 'cd "$dir" || exit 1' (or set -e)
      HIGH   SH004 line 7: rm -r on '$TARGET/*': if $TARGET is empty or unset this deletes from / or the current directory
             > rm -rf $TARGET/*
             fix: use "${TARGET:?}" (aborts when empty), e.g. rm -rf -- "${TARGET:?}/"*, and set -u
      MEDIUM SH003 line 7: $TARGET is unquoted: values with spaces or * break into several words or globs
             > rm -rf $TARGET/*
             fix: quote it: "$TARGET"
      HIGH   SH004 line 8: rm -r on '$BUILD_DIR/': if $BUILD_DIR is empty or unset this deletes from / or the current directory
             > rm -rf "$BUILD_DIR/"
             fix: use "${BUILD_DIR:?}" (aborts when empty), e.g. rm -rf -- "${BUILD_DIR:?}/"*, and set -u
      MEDIUM SH010 line 9: ls output breaks on names with spaces, newlines or leading dashes
             > for f in $(ls *.tar.gz); do
             fix: use a glob (for f in ./*.log; do [ -e "$f" ] || continue; ...) or find -print0 | xargs -0
      MEDIUM SH003 line 10: $f is unquoted: values with spaces or * break into several words or globs
             > tar xzf $f -C $TARGET
             fix: quote it: "$f"
      LOW    SH006 line 12: backticks nest badly and mangle backslashes
             > VERSION=`git describe --tags`
             fix: use $(command) instead
      INFO   SH009 line 13: cat of a single file into a pipe adds a process
             > cat config.ini | grep version
             fix: pass the file directly (grep x file) or redirect (< file)
      HIGH   SH007 line 14: runs code downloaded from the network without review or checksum; a cut-off download runs half a script
             > curl -fsSL https://example.com/install.sh | sudo bash
             fix: download to a file, verify a pinned checksum or signature, then run it
      MEDIUM SH008 line 15: eval re-parses data as code: any $ ; ` in the value runs as commands
             > eval "deploy_$VERSION"
             fix: use arrays (bash), case statements or printf -v instead of eval
      MEDIUM SH012 line 16: a fixed /tmp path can collide between runs and be pre-created as a symlink by another user
             > echo "log" > /tmp/deploy.log
             fix: use tmp=$(mktemp) or tmpdir=$(mktemp -d) and trap 'rm -rf -- "$tmpdir"' EXIT
      MEDIUM SH003 line 17: $TARGET is unquoted: values with spaces or * break into several words or globs
             > chmod -R 777 $TARGET
             fix: quote it: "$TARGET"
      MEDIUM SH013 line 17: world-writable files or directories let any local user change them
             > chmod -R 777 $TARGET
             fix: grant only what is needed (755 for dirs, 644 for files, or group permissions)
      LOW    SH011 line 18: read without -r treats backslashes as escapes
             > while read line; do echo "$line"; done < hosts.txt
             fix: use read -r (and IFS= read -r line to keep leading spaces)
      LOW    SH016 line 19: file names with spaces or newlines are split by xargs
             > find . -name '*.bak' | xargs rm
             fix: use find ... -print0 | xargs -0 ..., or find ... -exec cmd {} +
      LOW    SH015 line 21: 'local x=$(cmd)' returns the status of local, so set -e and $? miss a failing cmd
             > local out=$(du -sh "$TARGET")
             fix: declare first, then assign: local x; x=$(cmd)
      LOW    SH014 line 24: temporary files are left behind when the script fails or is interrupted
             fix: add trap 'rm -rf -- "$tmpdir"' EXIT right after mktemp
    

    What you do next

    1. Fix the highest-severity items first.
    2. Ask your agent to apply the fixes it suggests, then run the skill again to confirm.
    3. Keep the skill installed and re-run it whenever the project changes.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Review bash and sh scripts for safety bugs with a deterministic, offline linter - missing set -euo pipefail, unquoted variables, rm -rf $VAR without a guard, cd without a failure check, backticks, curl | sh, eval, useless cat, parsing ls, read without -r, fixed /tmp names, chmod 777, mktemp without trap, local x=$(cmd), find | xargs without -print0. Optionally merges ShellCheck results when it is installed (never required). Text or JSON output and CI exit codes.

    Who it's for

    Use when the user shares a .sh/.bash file or shell snippet, asks to review, harden or "make this script safe", sees word-splitting or globbing bugs, or wants a pre-commit/CI check for shell scripts.

    What's inside

    • Tested, offline Python script(s): shell_lint.py (deterministic results, standard library only unless noted)
    • Reference guides: strict-mode.md, checks.md
    • Step-by-step agent instructions in SKILL.md covering: When to use; When not to use; Workflow; Suppressions; CI usage

    Why it's worth it

    Generic prompts guess. This skill gives your agent a proven procedure plus scripts that check the facts, so you get the same correct answer every time, with exact fixes instead of vague advice. See the real demo below.

    Works with every major AI agent

    Built on the open SKILL.md standard: Claude Code, Codex CLI, Cursor, VS Code Copilot, Gemini CLI, Windsurf and 20+ other agents.

    Requirements

    • Python 3.8+ for the bundled scripts
    • No API keys, no account, runs locally

    Open source: saizul/bash-shell-skills on GitHub (MIT licence, by Saizul Amin).

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse All Claude Skills.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free to use

    No account required to browse

    Frequently Asked Questions

    Review bash and sh scripts for safety bugs with a deterministic, offline linter - missing set -euo pipefail, unquoted variables, rm -rf $VAR without a guard, cd without a failure check, backticks, curl | sh, eval, useless cat, parsing ls, read without -r, fixed /tmp names, chmod 777, mktemp witho...

    This skill uses the open SKILL.md standard. Use it through an MCP-compatible agent connected to Agensi, and check the compatibility information on this page for confirmed agents and required capabilities.

    Connect your AI agent to Agensi through MCP, then ask it to use Shell Script Linter and Safety Review on your task. Your agent loads the latest approved version each time. Paid skills require a purchase or active subscription. Skill files are not available for download; your licence does not allow you to save, copy or export any part of a skill.

    Free