bash-style-guidelisted
Install: claude install-skill planifest/planifest-framework
# Bash Style Guide
## Scope Boundaries
- Use this skill when the task matches the trigger condition described in `description`.
- Do not use this skill when the primary task falls outside this skill's domain.
Use this skill to write and review Bash scripts that are safe, debuggable, and operable in CI and production automation.
## Trigger And Co-activation Reference
- If available, use `references/trigger-matrix.md` for canonical co-activation rules.
- If available, resolve style-guide activation from changed files with `python3 scripts/resolve_style_guides.py <changed-path>...`.
- If available, validate trigger matrix consistency with `python3 scripts/validate_trigger_matrix_sync.py`.
## Quality Gate Command Reference
- If available, use `references/quality-gate-command-matrix.md` for CI check-only and local autofix mapping.
## Quick Start Snippets
### Script skeleton with strict mode and cleanup trap
```bash
#!/usr/bin/env bash
set -euo pipefail
readonly SCRIPT_NAME="$(basename "$0")"
readonly TEMP_DIR="$(mktemp -d)"
cleanup() {
rm -rf -- "${TEMP_DIR}"
}
on_error() {
local line="$1"
local exit_code="$2"
echo "${SCRIPT_NAME}: failed at line ${line} (exit=${exit_code})" >&2
}
trap cleanup EXIT
trap 'on_error "$LINENO" "$?"' ERR
main() {
echo "working dir: ${TEMP_DIR}"
}
main "$@"
```
### Required environment variable check (fail fast)
```bash
: "${API_TOKEN:?API_TOKEN is required}"
: "${API_BASE_URL:?API_BASE_URL is required}"
```
### Safe command