shell-scripting
Skill20 starsChanged 7 months agoMITView on GitHub
Apply when writing or reviewing Bash or POSIX shell scripts — automation, CI steps, deploy scripts, or any shell-based tooling.
10 other projects use a version of this.
Adopted by
Most recently taken up by
- iuliandita/skillstheir own version, first seen Sep 24, 2026
- 2867203296/hermes-agenttheir own version, first seen Aug 19, 2026
- AntheaLaffy/missing-semester-skills-dshtheir own version, first seen Aug 16, 2026
- AntheaLaffy/the-missing-semester-skillstheir own version, first seen Aug 16, 2026
- DAAF-Contribution-Community/daaftheir own version, first seen Aug 9, 2026
- Himeyama/DESIGNtheir own version, first seen Aug 8, 2026
Used with
Projects with it also use ci-cd, testing and 1 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
JohnJBorenSkillci-cd
CI/CD pipeline design, GitHub Actions, testing automation, and deployment strategies
Also in 3 projects that use this
NVIDIASkilltesting
Run Python and Rust tests for physicsnemo-curator using uv + pytest with coverage reporting via pytest-cov, and cargo-nextest for Rust tests. Includes benchmark workflows with pytest-benchmark and criterion.
Also in 3 projects that use this
GoogleSkillcode-review
Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.
Also in 3 projects that use this
Other versions10 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 10
- mylee04/code-notify★ 289same name
- DAAF-Contribution-Community/daaf★ 236same name
- iuliandita/skills★ 7same name
- CodingKaiser/kaiser-skills★ 6same name
- FutureJJ/claude-skills★ 3same name
- ffsshhttiikk/opencode-agents-skills★ 2same name
- AntheaLaffy/the-missing-semester-skills★ 1same name
- 2867203296/hermes-agent★ 0same name
- AntheaLaffy/missing-semester-skills-dsh★ 0same name
- Himeyama/DESIGN★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository49 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/brainstorming.mdcCursor rule
- .cursor/rules/branch-finishing.mdcCursor rule
- .cursor/rules/code-quality.mdcCursor rule
- .cursor/rules/db-schema.mdcCursor rule
- .cursor/rules/debugging.mdcCursor rule
- .cursor/rules/docker.mdcCursor rule
- .cursor/rules/domain-template.mdcCursor rule
- .cursor/rules/drawio.mdcCursor rule
- .cursor/rules/error-log.mdcCursor rule
- .cursor/rules/fastapi.mdcCursor rule
- .cursor/rules/git-conventions.mdcCursor rule
- .cursor/rules/github-cli.mdcCursor rule
- .cursor/rules/implementation-plan.mdcCursor rule
- .cursor/rules/langchain.mdcCursor rule
- .cursor/rules/python.mdcCursor rule
- .cursor/rules/react.mdcCursor rule
- .cursor/rules/review-deployment.mdcCursor rule
- .cursor/rules/security-review.mdcCursor rule
- .cursor/rules/self-extension-workflow.mdcCursor rule
- .cursor/rules/shell-scripting.mdcCursor rule
- .cursor/rules/svg-check.mdcCursor rule
- .cursor/rules/tdd.mdcCursor rule
- .cursor/rules/typescript.mdcCursor rule
- skill-everythingSkill
- brainstormingSkill
- branch-finishingSkill
- code-qualitySkill
- db-schemaSkill
- debuggingSkill
- dockerSkill
- domain-templateSkill
- drawioSkill
- error-logSkill
- fastapiSkill
- git-conventionsSkill
- github-cliSkill
- implementation-planSkill
- langchainSkill
- pythonSkill
- reactSkill
- review-deploymentSkill
- security-reviewSkill
- self-extension-workflowSkill
- svg-checkSkill
- tddSkill
- <kebab-case-name>Skill
- typescriptSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. 0 are common, 1 is distinctive, and 15 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
15
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 26
Fail-fast header: Always begin every shell script with set -euo pipefail so that unset variables, failed commands, and pipeline errors …
- Very specific: line 28
Trap cleanup: Always register a trap 'cleanup' EXIT function to remove temp files and release locks even when the script exits early due to …
- Very specific: line 30
Meaningful exit codes: Always exit with a non-zero code that reflects the failure category (e.g., exit 1 for usage errors, exit 2 for …
- Very specific: line 32
No eval: Never use eval to construct or execute dynamic commands.
- Very specific: line 36
Quote every variable: Always double-quote variable expansions ("$var", "$@") to prevent word-splitting and glob expansion on values …
- Very specific: line 38
Declare locals: Always declare variables inside functions with local to prevent accidental global namespace pollution.
- Very specific: line 40
Readonly constants: Use readonly for values that must not change after assignment (e.g., readonly SCRIPT_DIR="$(cd "$(dirname "$0")" && …
- Very specific: line 44
POSIX shebang: Always start scripts with #!/usr/bin/env bash (or #!/bin/sh for strict POSIX).
- Very specific: line 46
Portable syntax: Prefer POSIX-compatible constructs ([ ] over [[ ]], $(...) over backticks) when the script must run under /bin/sh.
- Very specific: line 48
ShellCheck clean: Ensure every script passes shellcheck -S warning with zero warnings before committing.
- Distinctive: line 52
Use functions: Always decompose scripts longer than ~30 lines into named functions with a main entry point called at the bottom.
- Very specific: line 54
Argument parsing with getopts: Use getopts for option parsing in scripts that accept flags.
- Very specific: line 56
Temp file handling: Always create temporary files with mktemp and store the path in a variable cleaned up by the EXIT trap.
- Very specific: line 60
Structured logging: Use a log() helper that prefixes output with a timestamp and level (INFO, WARN, ERROR) and routes errors to stderr …
- Very specific: line 62
Idempotent operations: Ensure scripts can be run multiple times without side effects — use guards like [ -d "$dir" ] || mkdir -p "$dir" and …
- Very specific: line 64
Heredocs for multi-line strings: Prefer heredocs (<<'EOF' ...
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Sub-Skill: Bash / POSIX Scripting
<!-- target: tokens_target above. Run `python tools/render_readme_table.py` to update README. -->Purpose: Prevent silent failures, portability bugs, and security holes in shell scripts by enforcing safe defaults, clean structure, and ShellCheck compliance.
Rules
Safety & Error Handling
- Fail-fast header. Always begin every shell script with
set -euo pipefailso that unset variables, failed commands, and pipeline errors abort execution immediately. Reference: ERR-2026-021 - Trap cleanup. Always register a
trap 'cleanup' EXITfunction to remove temp files and release locks even when the script exits early due to an error. - Meaningful exit codes. Always exit with a non-zero code that reflects the failure category (e.g.,
exit 1for usage errors,exit 2for dependency missing); never exit with0on failure. - No eval. Never use
evalto construct or execute dynamic commands; prefer arrays or explicit argument lists to avoid injection vulnerabilities.
Variables & Quoting
- Quote every variable. Always double-quote variable expansions (
"$var","$@") to prevent word-splitting and glob expansion on values containing spaces or special characters. - Declare locals. Always declare variables inside functions with
localto prevent accidental global namespace pollution. - Readonly constants. Use
readonlyfor values that must not change after assignment (e.g.,readonly SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)").
Portability & Compatibility
- POSIX shebang. Always start scripts with
#!/usr/bin/env bash(or#!/bin/shfor strict POSIX); never rely on/bin/bashbeing present at a fixed path on all target systems. - Portable syntax. Prefer POSIX-compatible constructs (
[ ]over[[ ]],$(...)over backticks) when the script must run under/bin/sh; use Bash-specific features only when the shebang explicitly targets Bash. - ShellCheck clean. Ensure every script passes
shellcheck -S warningwith zero warnings before committing; treat ShellCheck output as mandatory, not advisory.
Structure & Maintainability
- Use functions. Always decompose scripts longer than ~30 lines into named functions with a
mainentry point called at the bottom; avoid top-level imperative code scattered throughout the file. - Argument parsing with getopts. Use
getoptsfor option parsing in scripts that accept flags; never parse$1,$2manually for flag-style arguments. - Temp file handling. Always create temporary files with
mktempand store the path in a variable cleaned up by theEXITtrap; never hard-code paths like/tmp/myfile.
Logging & Idempotency
- Structured logging. Use a
log()helper that prefixes output with a timestamp and level (INFO,WARN,ERROR) and routes errors to stderr (>&2); never mix diagnostic output into stdout used for data. - Idempotent operations. Ensure scripts can be run multiple times without side effects — use guards like
[ -d "$dir" ] || mkdir -p "$dir"andcommand -v tool >/dev/null 2>&1 || install_toolbefore acting. - Heredocs for multi-line strings. Prefer heredocs (
<<'EOF' ... EOF) over concatenatedechocalls for multi-line output or embedded config; use the quoted form (<<'EOF') to suppress variable expansion when the content is literal.
See also
skills/code-quality/SKILL.mdskills/error-log/SKILL.md
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.

