bash-linting
Skill8 starsChanged 7 months agoApache-2.0View on GitHub
Lint and format Bash/shell scripts using shellcheck and shfmt according to standard conventions. Use when asked to lint, format, or check style issues in shell scripts.
- Installs packages
In this repository54 other files it gives its agents.
- alibabacloud-cliSkill
- ansible-cliSkill
- appdynamics-cliSkill
- argocd-cliSkill
- aws-cliSkill
- aws-cloudwatch-cliSkill
- azure-cliSkill
- betterstack-cliSkill
- bitbucket-cliSkill
- chef-cliSkill
- code-reviewSkill
- commit-codeSkill
- create-dockerfileSkill
- create-terraform-helm-upgrade-planSkill
- datadog-cliSkill
- digitalocean-cliSkill
- dockerfile-lintingSkill
- dynatrace-cliSkill
- elasticsearch-cliSkill
- gcp-cliSkill
- github-cliSkill
- gitlab-cliSkill
- go-lintingSkill
- grafana-cliSkill
- grafana-loki-cliSkill
- graylog-cliSkill
- helm-cliSkill
- hetzner-cliSkill
- huaweicloud-cliSkill
- jaeger-cliSkill
- jenkins-cliSkill
- jira-and-confluence-cliSkill
- kibana-cliSkill
- kubernetes-cliSkill
- loggly-cliSkill
- maintenance-check-aws-eksSkill
- maintenance-create-ticket-on-jiraSkill
- ms-teams-cliSkill
- mysql-cliSkill
- newrelic-cliSkill
- oci-cliSkill
- packer-cliSkill
- papertrail-cliSkill
- postgresql-cliSkill
- prometheus-cliSkill
- python-lintingSkill
- rollbar-cliSkill
- salesforce-cliSkill
- sentry-cliSkill
- slack-cliSkill
- splunk-cliSkill
- terraform-cliSkill
- terraform-lintingSkill
- vault-cliSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 3 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Run this skill when asked to lint, format, or check style for Bash/shell scripts.
- Distinctive: line 16
If neither tool is installed, inform the user and ask before installing:
- Very specific: line 70
Always quote variable expansions: "$var", not $var (SC2086).
- Very specific: line 71
Use [[ ... ]] over [ ... ] for conditionals in Bash scripts.
- Very specific: line 72
Use set -euo pipefail at the top of scripts to fail fast on errors, unset variables, and pipeline failures.
- Very specific: line 73
Use $(...) command substitution, not backticks.
- Very specific: line 79
NEVER install shellcheck/shfmt without asking the user first.
- Distinctive: line 80
Always run in check/diff mode first — only apply auto-fixes after the user confirms.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Bash Linting Skill
Run this skill when asked to lint, format, or check style for Bash/shell scripts.
Step 1 — Detect available tooling
which shellcheck shfmt 2>/dev/nullIf neither tool is installed, inform the user and ask before installing:
brew install shellcheck shfmtStep 2 — Find shell scripts
find . -type f \( -name "*.sh" -o -name "*.bash" \) -not -path "*/node_modules/*" -not -path "*/.git/*"Also lint any file with a #!/usr/bin/env bash or #!/bin/bash shebang but no .sh extension:
grep -rl '^#!.*\(bash\|sh\)' . --include="*" -l 2>/dev/null | grep -v -E '\.(sh|bash)$'Step 3 — Run linting (read-only check)
shellcheck <file>Report all findings grouped by file, with line numbers and SC rule codes (e.g. SC2086).
Step 4 — Run formatting check
shfmt -d -i 2 -ci <file>Show the proposed diff to the user before applying any formatting changes. -i 2 sets 2-space indentation and -ci indents switch-case bodies — adjust to match the project's existing style if it differs.
Step 5 — Apply formatting (only with user confirmation)
shfmt -w -i 2 -ci <file>shellcheck findings almost always require a manual code change (not a safe auto-fix) — present each finding with its suggested fix and apply only after user confirmation.
Standard conventions enforced
- Always quote variable expansions:
"$var", not$var(SC2086). - Use
[[ ... ]]over[ ... ]for conditionals in Bash scripts. - Use
set -euo pipefailat the top of scripts to fail fast on errors, unset variables, and pipeline failures. - Use
$(...)command substitution, not backticks. - Declare function-local variables with
local. - Indentation: 2 spaces, no tabs (unless the project's
.editorconfigspecifies otherwise).
Rules
- NEVER install
shellcheck/shfmtwithout asking the user first. - Always run in check/diff mode first — only apply auto-fixes after the user confirms.
- Respect the project's existing
.shellcheckrcor.editorconfigif present — do not override its settings. - Report the exact command run and its full output — do not summarize away findings.
- Flag any
eval, unquoted glob expansion, or command injection risk (e.g. unsanitized input passed to a shell command) as a security finding, even ifshellcheckdoes not flag it directly.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

