Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

ShellCheck

$ shellcheck Community Low Risk
Vidar Holen · Code & DevOps · GPL-3.0 · macos / linux / windows

Industry-standard static analyzer for POSIX sh, bash, dash, and ksh scripts, catching quoting bugs, undefined variables, and portability traps. Strictly read-only with native -f json / -f json1 structured diagnostics and severity thresholds (-S).

FCRS-1.0 Score
93 /100
Excellent
Medium Confidence
Zero-Friction Install
brew install shellcheck
CLI vs MCP Decision CLI Only

Runs instantaneous local AST checks on shell scripts with -f json1; MCP adds zero value here.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
✓ NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 23 / 25

Native -f json and -f json1 (including replacement suggestions), -S severity filtering, --color=never, and stdin - support.

  • -f json1 emits line/column/code/fix JSON diagnostics
  • Supports stdin - and --color=never
Trust & Safety 25 / 25

Strictly read-only static parser; never modifies scripts or executes analyzed code.

  • Zero side effects; never executes target scripts
Setup & Portability 15 / 15

Prebuilt static binaries across macOS, Linux, and Windows via Homebrew, distro repos, and GitHub Releases.

  • Standalone static binaries with zero runtime deps
Utility & Efficiency 14 / 15

Prevents subtle shell quoting, globbing, and exit-code bugs in agent-generated scripts.

  • Emits exact SCxxxx codes and automated fix patches in json1
Maintenance & Lineage 8 / 10

Long-running gold-standard community tool (koalaman/shellcheck) under GPL-3.0.

  • Ubiquitous industry-standard shell linter
Docs & Verifiability 8 / 10

Every SCxxxx rule has a dedicated wiki explanation page at shellcheck.net/wiki/.

  • Searchable per-code wiki and man page

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

Purely local static analysis; no credentials stored or required.

Side Effects
Read-Only
Cost & Quotas

GPL-3.0 open-source Haskell binary; completely free.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# ShellCheck Agent Rules
- Run `shellcheck -f json1` on every created or edited `.sh` / `.bash` script.
- Never silence rules globally with `-e` unless justified; prefer targeted `# shellcheck disable=SCXXXX` with a comment.

Agent-Ready Command Recipes

Safe Read-Only Queries

Lint a shell script with structured JSON1 diagnostics
shellcheck -f json1 -S warning scripts/deploy.sh

Analyzes the script at warning severity or higher and emits a rich JSON object with line/column spans and fix suggestions.

Lint inline shell code via stdin
printf '%s\n' '#!/usr/bin/env bash' 'echo $FOO' | shellcheck -f json -

Validates generated shell snippets from stdin before writing them to disk.

Strengths for Agents

  • + -f json1 returns exact spans and machine-applicable fix replacements without touching files.
  • + Strictly read-only static binary available in virtually every CI and dev environment.

Caveats & Pitfalls

  • ! Does not format or apply fixes directly (pair with shfmt or git apply on diff output).
  • ! Follows sourced files only when -x (--external-sources) is enabled.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI