shell-scripting
Write robust, portable shell scripts. Use when parsing arguments, handling errors properly, writing POSIX-compatible scripts, managing temp files, running commands in parallel, managing background processes, or adding --help to scripts.
Why use this skill?
Master shell scripting with OpenClaw. Create robust, portable, and maintainable bash scripts for automation, data pipelines, and CLI tooling with industry best practices.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/gitgoodordietrying/shell-scriptingWhat This Skill Does
The shell-scripting skill empowers OpenClaw to write robust, maintainable, and portable POSIX-compliant Bash scripts. It serves as a structured blueprint for developers and automation engineers to generate high-quality code. By enforcing best practices like set -euo pipefail, the skill ensures that scripts fail fast, handle undefined variables, and propagate exit codes through pipes. It includes standardized templates for argument parsing using case blocks, temporary file management via mktemp and trap for automated cleanup, and logging mechanisms for debugging. This skill bridges the gap between quick-and-dirty one-liners and production-ready automation tools that are safe for team environments.
Installation
You can install this skill by running the following command in your terminal:
clawhub install openclaw/skills/skills/gitgoodordietrying/shell-scripting
Use Cases
- DevOps Automation: Creating infrastructure setup scripts or environment preparation routines that work consistently on both macOS and Linux environments.
- Data Pipelines: Writing wrapper scripts to process files, clean data, and move results to appropriate storage, with built-in error reporting.
- CLI Tooling: Extending terminal functionality by building custom command-line utilities that handle flags (e.g.,
--help,--output) and exit codes gracefully. - Process Orchestration: Managing concurrent tasks using background processes and wait mechanisms to speed up local workflows.
Example Prompts
- "Use the shell-scripting skill to create a template script that takes a directory path as an argument, validates that it exists, and converts all .jpg images within it to .png using ImageMagick, while cleaning up any temp files on exit."
- "Write a bash script that iterates through a list of URLs from a text file, downloads them in parallel using xargs or background jobs, and logs the exit status of each download."
- "Refactor this snippet to follow the OpenClaw shell-scripting standards: add proper argument parsing, ensure safe variable handling with set -eu, and implement a usage function for a --help flag."
Tips & Limitations
- Portability: While this skill focuses on Bash, always verify if your target environments have specific Bash versions, especially regarding modern shell features.
- Security: Always quote variables ($VAR) to prevent globbing and word splitting, a critical habit the templates in this skill reinforce.
- Complexity: This skill is best suited for medium-complexity automation. For extremely complex logic involving state management, consider recommending Python instead.
- Debugging: Leverage the
debug()function included in the template to avoid cluttering your terminal, but useset -xonly during deep troubleshooting sessions as it can leak sensitive data in logs.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-gitgoodordietrying-shell-scripting": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-write, file-read, code-execution
Related Skills
api-dev
Scaffold, test, document, and debug REST and GraphQL APIs. Use when the user needs to create API endpoints, write integration tests, generate OpenAPI specs, test with curl, mock APIs, or troubleshoot HTTP issues.
skill-writer
Write high-quality agent skills (SKILL.md files) for ClawdHub/MoltHub. Use when creating a new skill from scratch, structuring skill content, writing effective frontmatter and descriptions, choosing section patterns, or following best practices for agent-consumable technical documentation.
log-analyzer
Parse, search, and analyze application logs across formats. Use when debugging from log files, setting up structured logging, analyzing error patterns, correlating events across services, parsing stack traces, or monitoring log output in real time.
emergency-rescue
Recover from developer disasters. Use when someone force-pushed to main, leaked credentials in git, ran out of disk space, killed the wrong process, corrupted a database, broke a deploy, locked themselves out of SSH, lost commits after a bad rebase, or hit any other "oh no" moment that needs immediate, calm, step-by-step recovery.
data-validation
Validate data with schemas across languages and formats. Use when defining JSON Schema, using Zod (TypeScript) or Pydantic (Python), validating API request/response shapes, checking CSV/JSON data integrity, or setting up data contracts between services.