bash
Skill15 starsChanged 42 days agoMITView on GitHub
Expert Bash shell scripting assistance covering POSIX compliance, parameter expansion, pipelines, traps, and debugging. Use when writing robust shell scripts, automating DevOps tasks, or handling file processing.
- Deletes or force-pushes
8 other projects use a version of this.
Adopted by
Most recently taken up by
- Lukk17/agent-standardstheir own version, first seen Nov 7, 2026
- carapace-sh/carapacetheir own version, first seen Oct 8, 2026
- pgdogdev/pgdogtheir own version, first seen Oct 8, 2026
- vetr0s/skillstheir own version, first seen Aug 22, 2026
- kimtth/agent-skill-100-lines-or-lesstheir own version, first seen Jun 26, 2026
- Ahmadjamil888/imostheir own version, first seen May 1, 2026
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- pgdogdev/pgdog★ 5.6ksame name
- carapace-sh/carapace★ 1.5ksame name
- ffsshhttiikk/opencode-agents-skills★ 2same name
- kimtth/agent-skill-100-lines-or-less★ 2same name
- Ahmadjamil888/imos★ 1same name
- Lukk17/agent-standards★ 1same name
- tho/skills★ 1same name
- vetr0s/skills★ 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 repository350 other files it gives its agents.
- airflowSkill
- catboostSkill
- claudeSkill
- comfyuiSkill
- cursor-aiSkill
- dalleSkill
- daskSkill
- dbtSkill
- deepseekSkill
- fastaiSkill
- geminiSkill
- github-copilotSkill
- huggingfaceSkill
- jaxSkill
- jupyterSkill
- kerasSkill
- langchainSkill
- lightgbmSkill
- llamaindexSkill
- llamaSkill
- matplotlibSkill
- midjourneySkill
- mistralSkill
- mlflowSkill
- nltkSkill
- numpySkill
- ollamaSkill
- openai-gptSkill
- opencvSkill
- pandasSkill
- perplexitySkill
- plotlySkill
- polarsSkill
- pytorchSkill
- raySkill
- scikit-learnSkill
- seabornSkill
- spacySkill
- sparkSkill
- stable-diffusionSkill
- tensorflowSkill
- vaexSkill
- weights-biasesSkill
- whisperSkill
- xgboostSkill
- api-gatewaySkill
- clean-architectureSkill
- cqrsSkill
- domain-driven-designSkill
- event-drivenSkill
- event-sourcingSkill
- graphqlSkill
- grpcSkill
- hexagonalSkill
- microservicesSkill
- modular-monolithSkill
- monolithSkill
- rest-apiSkill
- sagaSkill
- serverlessSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 2 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 85
Use unofficial bash strict mode with automatic cleanup trap:
- Very specific: line 107
Always Quote Variables: Wrap variables in double quotes ("${MY_VAR}") to prevent word splitting and glob expansion bugs.
- Very specific: line 109
Use [[ ... ]] for Conditions: Prefer modern Bash conditional evaluation [[ $var == "val" ]] over legacy [ ...
- Very specific: line 110
Use Local Variables in Functions: Always declare variables inside functions with local var="value".
- Very specific: line 115
Use unquoted eval: eval executes arbitrary string inputs and introduces catastrophic shell injection vulnerabilities.
- Distinctive: line 116
Write multi-thousand line monolithic bash scripts: Transition complex scripts to Python or Go when logic grows large.
“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
Bash
Bourne Again SHell, the standard shell for Linux and macOS.
When to Use
- Linux System Administration & Automation: Scripting OS maintenance, cron jobs, file backups, and package management.
- CI/CD Pipeline Glue Code: Orchestrating build, test, and container push steps in GitHub Actions and GitLab CI.
- Docker Entrypoint Scripts: Configuring environment variables, secrets, and database wait-for loops during container startup.
- Command-Line Wrappers: Wrapping multi-step CLI commands into simple, repeatable internal developer utilities.
Quick Start
#!/bin/bash
NAME="World"
echo "Hello, $NAME!"
if [ -f "file.txt" ]; then
echo "File exists"
else
echo "File not found"
fiCore Concepts
Strict Error Handling (set -euo pipefail)
Guarantees script execution aborts on unhandled errors, unset variables, and piped command failures:
#!/usr/bin/env bash
set -euo pipefail
IFS=$'
'
# -e: Exit immediately if a command exits with a non-zero status
# -u: Treat unset variables as an error and exit immediately
# -o pipefail: Pipeline exit status matches the last failing commandRobust Parameter Expansion & Default Values
Safely handles optional and required script variables:
# Provide fallback default if variable unset
TARGET_ENV="${1:-staging}"
# Throw descriptive error if variable is unset or empty
DATABASE_URL="${DATABASE_URL:?Error: DATABASE_URL environment variable is required}"
# Extract filename without extension
filename="archive_2026.tar.gz"
base="${filename%%.*}" # "archive_2026"Trap Signals for Reliable Cleanup
Ensures temporary files and child processes are cleaned up upon exit or interruption:
TEMP_DIR="$(mktemp -d)"
cleanup() {
echo "Cleaning up temporary files..."
rm -rf "${TEMP_DIR}"
}
trap cleanup EXIT INT TERMCommon Patterns
Safe Script Header with Error and Signal Traps
Problem: Shell scripts fail silently halfway through, leaving orphaned temp files and corrupted state.
Solution: Use unofficial bash strict mode with automatic cleanup trap:
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
TMP_DIR=$(mktemp -d)
cleanup() {
rm -rf "$TMP_DIR"
echo "Cleaned up temporary workspace."
}
trap cleanup EXIT ERR INT TERM
# Script business logic
echo "Working in: $TMP_DIR"Best Practices
Do:
- Always Quote Variables: Wrap variables in double quotes (
"${MY_VAR}") to prevent word splitting and glob expansion bugs. - Lint with ShellCheck: Run
shellcheckin CI to catch syntax pitfalls, portability bugs, and quoting errors automatically. - Use
[[ ... ]]for Conditions: Prefer modern Bash conditional evaluation[[ $var == "val" ]]over legacy[ ... ]. - Use Local Variables in Functions: Always declare variables inside functions with
local var="value".
Don't:
- Parse
lsoutput: Use globbing loops (for file in *.txt; do ... done) instead of parsingls. - Use unquoted
eval:evalexecutes arbitrary string inputs and introduces catastrophic shell injection vulnerabilities. - Write multi-thousand line monolithic bash scripts: Transition complex scripts to Python or Go when logic grows large.
Troubleshooting
| Error | Cause | Solution |
syntax error: unexpected end of file | Unclosed quotes, missing fi, done, or unbalanced parentheses. | Run bash -n script.sh to validate syntax without executing. |
command not found: $'\r' | Windows CRLF line endings present in shell script. | Convert line endings with dos2unix script.sh. |
unbound variable (with set -u) | Referencing unset environment or script variable. | Provide default value: ${VAR:-default_val}. |
References
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.

