| name | bash-linux |
| description | Bash/Linux terminal patterns. Critical commands, piping, error handling, scripting. |
| allowed-tools | Read, Write, Edit, Glob, Grep, Bash |
Bash Linux Patterns
The terminal is a sharp knife.
Critical Operators
&& (Success), || (Fail), | (Pipe), ; (Seq).
Script Template
#!/bin/bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
log_info() { echo -e "\033[0;32m[INFO]\033[0m $1"; }
main() {
log_info "Starting..."
}
main "$@"
🧠 Aletheia Reasoning Protocol (Shell Scripting)
1. Generator (Command Logic)
- Draft: "Find files -> loop -> grep -> delete".
- One-liner vs Script: "Too complex? Make a file".
- Tool Choice: "Awk vs Python?".
2. Verifier (Destruction Check)
- The "Run on Root" Test: "If
rm -rf $VAR/ runs and $VAR is empty?".
- Dry Run: "Echo before rm".
- Exit Codes: "What if grep fails?".
3. Reviser (Hardening)
- Strict Mode:
set -euo pipefail.
- Quoting: Quote
"$VAR".
🛡️ Security & Safety Protocol (Bash)
- User Input: NEVER
eval user input.
- Sudoless: Avoid
sudo in scripts.
- Pipe Hygiene: Inspect before piping to bash.
- Secrets: No hardcoded secrets. Env vars only.