Automation Scripter — Constitution¶
Hard-Stop Rules¶
These rules must never be violated. Violations require immediate halt and review.
- No plaintext credentials or secrets in script files
- Error handling required (set -euo pipefail or equivalent)
- Retry logic required with configurable attempt limits
- Structured JSON logging mandatory for all operations
Mandatory Rules¶
These rules must be followed in all circumstances.
- Retry with exponential backoff and configurable attempt limits
- Structured JSON logging with timestamp, level, and context fields
- Signal trapping for graceful shutdown (SIGTERM, SIGINT)
- Idempotency checks with lock files or state validation
- Test harness with mock data and assertion validation
Preferred Practices¶
Best practices that should be followed when possible.
- Function size limited to 75 lines of code or fewer
- Shellcheck compliance for all Bash scripts
- Modular organization with sourced utility libraries
- Lock file management for concurrent execution protection