- Home
- Skills
- Akin Ozer
- Cc Devops Skills
- Bash Script Generator
bash-script-generator_skill
- HCL
83
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill akin-ozer/cc-devops-skills --skill bash-script-generator- SKILL.md25.9 KB
Overview
This skill is a comprehensive toolkit for generating production-ready bash scripts that follow current standards and conventions. It produces scripts with strict mode, logging, robust error handling, argument parsing, validation, and clear documentation. Use it to create maintainable CLI tools, automation jobs, and text-processing workflows.
How this skill works
Before generating code, I clarify requirements with targeted questions about input formats, performance, error handling, portability, and security. I then explain the planned architecture, tool choices (grep/awk/sed/etc.), and customization points. The generator outputs a template or fully customized script with shebang, strict mode, logging functions, argument parsing, signal cleanup, core business logic, and a validation checklist to run shellcheck and bash -n.
When to use it
- Creating new bash scripts from scratch
- Converting manual command sequences into reusable automation
- Building CLI tools or cron jobs for production use
- Implementing text-processing pipelines (logs, CSV, JSON via jq)
- Writing system administration, deployment, or build automation scripts
Best practices
- Always clarify ambiguous requirements before coding (input format, large files, error policy, portability).
- Default to bash with strict mode (set -euo pipefail; IFS=$'\n\t') unless POSIX portability is required.
- Include centralized logging (DEBUG/INFO/WARN/ERROR) that writes to stderr; keep data output on stdout.
- Validate inputs and required commands early with helper functions (check_command, validate_file).
- Use appropriate tools: grep for filtering, awk for fielded data and calculations, sed for substitutions; prefer built-ins when possible.
- Run automated validation (bash -n, ShellCheck) and iterate until no critical warnings remain.
Example use cases
- Generate a cron-friendly log rotator that archives and rotates files with validation and cleanup traps.
- Create a CLI text processor that extracts and summarizes CSV or log fields using awk and outputs JSON or CSV.
- Build an API client wrapper that performs HTTP requests with retries and parses responses for downstream scripts.
- Convert an ad-hoc sequence of grep/sed/awk commands into a parameterized, robust script with usage/help and args.
- Produce a deployment helper that validates prerequisites, performs backups, and supports rollback in case of failure.
FAQ
I need the script purpose, input/output formats, whether files are large, error-handling expectations, target shell (bash vs POSIX), and any security or privilege constraints.
Will the generated script be portable across systems?
By default I target bash on modern systems. If you require maximum portability I will restrict features to POSIX sh and avoid bash-specific constructs on request.