prompts.chatprompts.chatprompts.chat
BotsPromptsSkillsWorkflowsCategoriesTagsPromptmastersTaste
Developers
LoginRegister
CC0 2026 prompts.chat
GitHub

Shell Scripting taste

Opinionated conventions for writing safe, readable and maintainable Bash scripts.

F
@f
about 7 hours agoOctober 30, 2026 at 03:52 PM
Coding•DevOpsLinuxCLITerminal
Automation

Content

Variables
# Shell scripting taste of a DevOps engineer - Start every script with #!/usr/bin/env bash and set -euo pipefail. Confidence: 0.90 - Switch to Python or Go once a script passes about 100 lines or needs real data structures. Confidence: 0.85 - Run ShellCheck in CI and fix warnings instead of silencing them. Confidence: 0.95 - Format scripts with shfmt so diffs stay small. Confidence: 0.75 - Quote every variable expansion ("$var") unless word splitting is intended and commented. Confidence: 0.95 - Use [[ ]] for tests and $(...) for command substitution, never backticks. Confidence: 0.90 - Declare variables inside functions with local. Confidence: 0.85 - Put the logic in functions and call a main "$@" at the bottom of the file. Confidence: 0.80 - Clean up temporary files with mktemp and trap '...' EXIT. Confidence: 0.90 - Write errors and logs to stderr and keep stdout for data other tools can pipe. Confidence: 0.85 - Exit with a non-zero status and a clear message when something fails. Confidence: 0.90 - Provide a usage function and handle -h and --help. Confidence: 0.80 - Parse options with getopts or a simple case loop, not ad hoc positional checks. Confidence: 0.75 - Check required commands up front with command -v and fail early when one is missing. Confidence: 0.85 - Read configuration from environment variables with defaults, such as . Confidence: 0.80 - Never parse ls output; use globs or find -print0 with xargs -0. Confidence: 0.90 - Read files line by line with while IFS= read -r line. Confidence: 0.85 - Use arrays for argument lists instead of building command strings. Confidence: 0.85 - Avoid eval, and never pass untrusted input to it. Confidence: 0.95 - Make scripts idempotent so running them twice is safe. Confidence: 0.85 - Add a --dry-run flag to anything that deletes or changes remote state. Confidence: 0.80 - Stick to POSIX sh only when the script must run in minimal containers; otherwise target bash 4+. Confidence: 0.70

Comments (0)

Related Skills

Shell Script Safety Reviewer

Skill

Reviews bash and POSIX sh scripts before they run in CI, cron or production. Flags missing strict mode, rm -rf on variables that may be empty, curl piped to a shell, eval, unquoted expansions, unchecked cd, parsing ls, chmod 777, hardcoded secrets, predictable /tmp files, ssh eating a read loop, masked exit codes and bashisms under /bin/sh, then returns a fixed script. Includes a stdlib Python linter with --self-test.

F@f
0

Cron Schedule Explainer and Validator

Skill

Explains any cron expression in plain English, lists the next run times, and flags pitfalls such as the day-of-month OR day-of-week rule, dates that never occur, DST gaps, UTC versus local time, and overlapping jobs. Includes a tested stdlib Python checker for crontab files.

F@f
0

Dotenv Config and Secrets Linter

Skill

Lints .env and .env.example files for secrets committed by mistake, weak names, duplicate keys, export prefixes, spaces around equals, empty required values, and unsafe interpolation, then suggests a cleaned example file. Use when a user asks "is this .env safe to commit?", "why won't dotenv load?", or "diff my .env.example". Includes a tested stdlib Python linter.

F@f
0

Disk Capacity Runway Forecaster

Skill

Forecasts when disks and volumes will fill up from usage samples (CSV of timestamp, volume, used and size). Fits overall and last-week growth rates, removes one-off jumps from the trend, and gives days and dates to 80, 90, 95 and 100% full plus a size that keeps 90 days of headroom. Flags volumes filling soon, accelerating growth, sudden jumps, noisy trends and thin data. Includes a stdlib Python forecaster with --self-test.

F@f
0