Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
akin-ozer avatar

Bash Script Generator

  • 420 installs
  • 286 repo stars
  • Updated July 26, 2026
  • akin-ozer/cc-devops-skills

bash-script-generator is an agent skill that generates production-ready bash scripts with strict mode, argument parsing, logging, ShellCheck validation, and templates for deployment hooks, cron jobs, and CI automation.

About

bash-script-generator is a DevOps agent skill from akin-ozer/cc-devops-skills that walks agents through a mandatory requirements-capture and generation workflow for maintainable shell automation. Its SKILL.md spans roughly 25.9 KB of patterns for strict mode, traps, grep/awk/sed pipelines, API client scripts, and cron-friendly utilities, and it pairs with devops-skills:bash-script-validator for ShellCheck-backed iteration. The parent cc-devops-skills plugin advertises 31 generator and validator skills across Terraform, Docker, Kubernetes, GitHub Actions, and more. Reach for bash-script-generator when converting manual CLI steps into validated .sh files for deployment hooks, scheduled jobs, or CI glue instead of writing brittle shell from scratch.

  • Produces runnable bash with argument parsing and error handling
  • Fits CI/CD hooks and local developer workflows
  • Reduces copy-paste shell mistakes across environments
  • Speeds repeatable ops tasks into versioned scripts

Bash Script Generator by the numbers

  • 420 all-time installs (skills.sh)
  • Ranked #129 of 550 CLI & Terminal skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/akin-ozer/cc-devops-skills --skill bash-script-generator

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs420
repo stars286
Last updatedJuly 26, 2026
Repositoryakin-ozer/cc-devops-skills

How do you generate reliable bash scripts for CI glue?

Generate reliable bash scripts for deployment hooks, cron jobs, local dev setup, and CI glue without hand-writing brittle shell from scratch.

Who is it for?

DevOps engineers and backend developers who need validated shell scripts for deployment hooks, cron jobs, log processing, or CI utilities.

Skip if: Skip bash-script-generator when you only need to lint an existing script—use bash-script-validator for validation-only requests.

When should I use this skill?

A developer asks to create, generate, or write a bash script for automation, cron, deployment, or text-processing pipelines.

What you get

Executable .sh scripts with shebang, strict mode, logging helpers, argument parsing, and a validation checklist.

  • executable shell script
  • requirements capture table
  • validation report

By the numbers

  • SKILL.md documentation is approximately 25.9 KB
  • Part of akin-ozer/cc-devops-skills with 31 DevOps generator and validator skills

Files

SKILL.mdMarkdownGitHub ↗

Bash Script Generator

Overview

Generate production-ready Bash scripts with clear requirements capture, deterministic generation flow, and validation-first iteration.

Trigger Phrases

Use this skill when the user asks to:

  • Create, generate, write, or build a Bash/shell script
  • Convert manual CLI steps into an automation script
  • Build a text-processing script using grep, awk, or sed
  • Create an operations helper script, cron script, or CI utility script

Do not use this skill for validating an existing script only. Use devops-skills:bash-script-validator for validation-only requests.

Execution Model

Follow stages in order. Do not skip a stage; use the documented fallback when blocked.

Stage 0: Preflight

1. Confirm scope and target output path. 2. Confirm shell target:

  • Default: bash
  • If portability is requested: POSIX sh

3. Check capabilities and pick fallback path:

CapabilityDefault PathFallback Path
Requirement clarificationAskUserQuestion toolAsk same questions in normal chat; mark unresolved items as assumptions
Script scaffoldbash scripts/generate_script_template.sh ...Copy assets/templates/standard-template.sh manually or hand-craft minimal scaffold
Validationdevops-skills:bash-script-validatorLocal checks: bash -n, shellcheck if available, sh -n for POSIX mode

If a fallback path is used, state it explicitly in the final summary.

Stage 1: Capture Requirements

Collect only what is needed to generate the script correctly:

  • Input source and format
  • Output destination and format
  • Error handling behavior (fail-fast/retry/continue)
  • Security constraints (sensitive data, privilege level)
  • Performance constraints (large files, parallelism)
  • Portability requirement (Bash-only vs POSIX)

Then create a Captured Requirements table with stable IDs.

## Captured Requirements

| Requirement ID | Description | Source | Implementation Plan |
|---|---|---|---|
| REQ-001 | Parse nginx logs from file input | User | `parse_args()` + `validate_file()` + `awk` parser |
| REQ-002 | Output top 10 errors | User | `analyze_errors()` + `sort | uniq -c | head -10` |
| REQ-003 | Handle large files efficiently | Assumption | Single-pass `awk`; avoid multi-pass loops |

Rules:

  • Every major design decision maps to at least one REQ-*.
  • Keep assumptions explicit and minimal.

Stage 2: Choose Generation Path

Use this deterministic decision tree:

Need multi-command architecture, unusual control flow, or strict non-template conventions?
├─ Yes -> Custom generation
└─ No
   Need standard CLI skeleton (usage/logging/arg parsing/cleanup)?
   ├─ Yes -> Template-first generation
   └─ No -> Custom generation

Template-first is the default for single-purpose CLI utilities.

Stage 3: Load Only Relevant References

Use progressive disclosure. Read only docs needed for the current request.

NeedReference
Tool choice (grep vs awk vs sed)docs/text-processing-guide.md
Script structure and argument patternsdocs/script-patterns.md
Strict mode, shell differences, safetydocs/bash-scripting-guide.md
Naming, organization, and quality baselinedocs/generation-best-practices.md

Citation format (required):

  • [Ref: docs/<file>.md -> <section>]

Stage 4: Generate Script

Path A: Template-first (default)

1. Generate scaffold:

bash scripts/generate_script_template.sh standard output-script.sh

2. Replace placeholders and add business logic. 3. Keep logging to stderr and data output to stdout unless requirements say otherwise. 4. Add comments only where logic is non-obvious.

Path B: Custom generation

Build a script with at least:

  • Shebang and strict mode
  • usage()
  • parse_args()
  • Input validation and dependency checks
  • Main workflow function(s)
  • Predictable exit codes

Stage 5: Validate and Iterate

Default validation path: 1. Invoke devops-skills:bash-script-validator 2. Apply fixes 3. Re-run validation 4. Repeat until checks pass or blocker is identified

Fallback validation path (when validator skill is unavailable):

# Deterministic local gate for this skill:
bash scripts/run_ci_checks.sh --skip-shellcheck

# CI gate (shellcheck required):
bash scripts/run_ci_checks.sh --require-shellcheck

If any check is skipped, include Skipped check, Reason, and Risk in the output.

Stage 6: Final Response Contract

Always return: 1. Generated script path 2. Requirements traceability (REQ-* -> implementation) 3. Validation results with rerun status 4. Citations in standard format 5. Any assumptions/fallbacks used

Canonical Example Flows

Example A: Full Flow (Template-first)

1. Clarify missing data format and output expectations. 2. Capture REQ-* table. 3. Choose template-first path. 4. Generate scaffold with scripts/generate_script_template.sh. 5. Implement logic and map functions to REQ-*. 6. Validate with devops-skills:bash-script-validator and rerun until clean. 7. Return final summary with citations.

Example B: Constrained Environment Flow

Use this when AskUserQuestion, validator skill, or shellcheck is unavailable: 1. Ask clarifying questions in chat. 2. Mark unresolved items as assumptions in Captured Requirements. 3. Generate from template script or template file copy fallback. 4. Run bash -n (and sh -n if relevant). 5. If shellcheck is missing, report skip with risk and mitigation.

Done Criteria

The task is complete only when all items are true:

  • Trigger matched and scope confirmed
  • Captured Requirements table exists with REQ-* IDs
  • Template-first vs custom decision is documented
  • Script is generated with deterministic structure
  • Validation executed and rerun policy applied
  • Any skipped checks include explicit reason and risk
  • Final response includes traceability, citations, and assumptions

Helper Scripts and Assets

  • Script generator: scripts/generate_script_template.sh
  • Deterministic CI gate: scripts/run_ci_checks.sh
  • Regression test suite: scripts/test_generator.sh
  • Standard scaffold: assets/templates/standard-template.sh
  • Example output style: examples/log-analyzer.sh

Reference Docs

  • docs/bash-scripting-guide.md
  • docs/script-patterns.md
  • docs/generation-best-practices.md
  • docs/text-processing-guide.md

External References

Related skills

How it compares

Use bash-script-generator to author new shell automation; pair with bash-script-validator when reviewing scripts you did not generate here.

FAQ

Does bash-script-generator validate its output?

bash-script-generator defaults to invoking devops-skills:bash-script-validator, running bash -n and ShellCheck when available, then iterating until checks pass. Validation is a mandatory stage in the documented six-step generation workflow.

What scripts can bash-script-generator create?

bash-script-generator covers deployment hooks, cron jobs, CI utilities, log analysis pipelines, and API client shell tools. It enforces requirement clarification tables before choosing templates for text processing or systems administration tasks.

CLI & Terminalinfradeploy

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.