scripting-automation

scripting-automation is a skill for Claude Code, Codex from d-padmanabhan/agent-engineering-handbook. It costs 73 tokens per session (3,752 once invoked), scanned C, original, MIT.

A guide to writing reliable Bash scripts for automation, deployment tools, and continuous-integration helpers.

In plain words
What is it for?
Use it to add retries, locking, signal handling, safe file handling, performance improvements, cross-platform support, and BATS tests to shell automation.
Why use it?
It helps avoid scripts that fail silently, mishandle input, leave locks behind, or behave differently across operating systems.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Use it to add retries, locking, signal handling, safe file handling, performance improvements, cross-platform support, and BATS tests to shell automation.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/d-padmanabhan/agent-engineering-handbook/scripting-automation
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add d-padmanabhan/agent-engineering-handbook --skill scripting-automation
Clone the repo
git clone --depth 1 https://github.com/d-padmanabhan/agent-engineering-handbook

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for scripting-automation

README.md
[![agentmods](https://agentmods.dev/badge/skills/d-padmanabhan/agent-engineering-handbook/scripting-automation/github.svg)](https://agentmods.dev/skills/d-padmanabhan/agent-engineering-handbook/scripting-automation)
Your own site
<a href="https://agentmods.dev/skills/d-padmanabhan/agent-engineering-handbook/scripting-automation"><img src="https://agentmods.dev/badge/skills/d-padmanabhan/agent-engineering-handbook/scripting-automation/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for scripting-automation

Your own site · 80×15
<a href="https://agentmods.dev/skills/d-padmanabhan/agent-engineering-handbook/scripting-automation"><img src="https://agentmods.dev/badge/skills/d-padmanabhan/agent-engineering-handbook/scripting-automation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 73 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,752 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00073 $0.03752
Opus 5 $0.00036 $0.01876
Sonnet 5 $0.00015 $0.00750
Haiku 4.5 $0.00007 $0.00375

Measured 8d ago against content hash 5f375c28b66e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade C, and why

scripting-automation scanned grade C with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf "$TEST_DIR"

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

Use for: Diagnostics, cleanup operations, commands where failure is expected (grep, curl with retries).
skills/scripting-automation/SKILL.md · 572 lines

How it starts

The opening of the file, as written. The whole thing — 572 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Scripting & Automation

Use the Bash skill (${HANDBOOK_ROOT}/skills/bash-shell-scripting/SKILL.md) for baseline shell authoring. This skill owns automation-specific retries, locks, signals, idempotency, deployment workflows, and BATS patterns.

Guiding Principles

  • "Fail fast, fail clearly" - Use strict mode, validate early, provide clear error messages
  • "Quotes are your friend" - Always quote variables unless you explicitly want word splitting
  • "Explicit over implicit" - Use local, readonly, clear function names, document assumptions
  • "Security by default" - Sanitize inputs, use mktemp, avoid eval, validate file paths
  • "Composition over complexity" - Small functions, clear separation of concerns, reusable patterns
  • "Observability is essential" - Structured logging, proper exit codes, error context
  • "Test what you write" - Use shellcheck, test on multiple platforms, write BATS tests
  • "Format consistently" - Must pass shfmt -i 2 -ci -sr -bn (2-space indentation; prefer ~100-character lines)

Quick Reference

# Safety modes
set -euo pipefail           # Strict mode (fail-fast)
set -uo pipefail            # Controlled mode (explicit error handling)
set -Euo pipefail           # Strict + ERR trap propagation to functions

# Common patterns
command -v cmd >/dev/null   # Check if command exists (portable)
trap 'cleanup' EXIT         # Always cleanup
flock -n 200 || exit 1      # Prevent concurrent runs
readonly VAR="value"        # Immutable constant
local var="value"           # Function-local variable
shfmt -w -i 2 -ci -sr -bn . # Format with Google-style 2-space indentation

Standard Header + Prelude

Use this for new automation scripts. It documents purpose and usage, keeps debug tracing available but commented, creates a timestamped logfile named after the script, and uses a safe logging helper instead of raw echo.

#!/usr/bin/env bash
#
# Script Name         : <script_name>.sh
#
# Purpose             : <One or two sentences explaining what the script does.
#                       Wrap continuation lines under the value column.>
#
# Dependencies        : <List required commands, or "None">
#
# Script Usage        : ./<script_name>.sh [options] <arguments>
#
#                       <Examples and argument notes.>
#
##----------------------------------------------------------------------------------------##
# Turn debug on or off
# set -x
##----------------------------------------------------------------------------------------##

set -euo pipefail

readonly DTTM="$(date -u +"%Y%m%d_%H%M%S")"
readonly SCRIPT_NAME="$(basename "${0}" .sh)"
readonly LOGFILE="${SCRIPT_NAME}_${DTTM}.log"

logmsg() {
  local timestamp
  timestamp="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
  printf "%s: %s\n" "${timestamp}" "$*" | tee -a "${LOGFILE}" >&2
}

die() {
  logmsg "ERROR: $*"
  exit 1
}

debug() {
  [[ "${DEBUG:-0}" == "1" ]] && logmsg "DEBUG: $*"
}

require_command() {
  local command_name="$1"
  command -v "${command_name}" >/dev/null 2>&1 || die "Missing command: ${command_name}"
}

Read the full file on GitHub · 572 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 572 lines · 73 tokens per session scan C 5f375c28b66e

Subscribe to this mod's changes

scripting-automation is a skill published in the GitHub repository d-padmanabhan/agent-engineering-handbook (17 stars, last pushed today), licensed MIT. It adds 73 tokens to every session and 3,752 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it C with 2 findings (recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

Verification & Quality Assurance

Comprehensive truth scoring, code quality verification, and automatic rollback system with 0.95 accuracy threshold for ensuring high-quality agent outputs and codebase reliability.

ruvnet/ruflo · 36 tokens

ci

Configure Ginkgo for continuous integration — the recommended CLI flag set and the rationale for each flag (-r -p --randomize-all --randomize-suites --fail-on-pending --fail-on-empty --keep-going --cover --race --trace --json-report --timeout --poll-progress-after/-interval), invoking via go run to pin the CLI to…

onsi/ginkgo · 151 tokens

migrate-vstest-to-mtp

Use this skill before answering, planning, or editing whenever .NET tests or CI are switching from VSTest to Microsoft.Testing.Platform (MTP), or an MTP migration behaves differently. Triggers include "switch from VSTest"; MSTest/NUnit/xUnit MTP enablement; OutputType=Exe only for test projects in…

dotnet/skills · 191 tokens

playwright-ci

Production-ready CI/CD configurations for Playwright — GitHub Actions, GitLab CI, CircleCI, Azure DevOps, Jenkins, Docker, parallel sharding, reporting, code coverage, and global setup/teardown.

zebbern/claude-code-guide · 48 tokens

ci-maintenance-workflow

CI and GitHub Actions maintenance workflows — fix a failing test from a CI URL, fix a failing smoke test, add @pytest.mark.slow markers to slow tests, or review a PR against agent-checkable standards. Use when user asks to fix a failing test, fix a smoke test, mark slow tests, or review a PR. Trigger when the user…

UKGovernmentBEIS/inspect_evals · 120 tokens

playwright-testing

E2E testing with Playwright - Page Objects, cross-browser, CI/CD.

alinaqi/maggy · 20 tokens