
bash-script-generator
Create, generate, write, or scaffold bash/shell scripts (.sh), automation, or CLI tools.
- Installs
- 672
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/akin-ozer/cc-devops-skills --skill bash-script-generator- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads bash-script-generator automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
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, orsed - 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
- Confirm scope and target output path.
- Confirm shell target:
- Default:
bash - If portability is requested: POSIX
sh
- Check capabilities and pick fallback path:
| Capability | Default Path | Fallback Path |
|---|---|---|
| Requirement clarification | AskUserQuestion tool | Ask same questions in normal chat; mark unresolved items as assumptions |
| Script scaffold | bash scripts/generate_script_template.sh ... | Copy assets/templates/standard-template.sh manually or hand-craft minimal scaffold |
| Validation | devops-skills:bash-script-validator | Local 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.
| Need | Reference |
|---|---|
Tool choice (grep vs awk vs sed) | docs/text-processing-guide.md |
| Script structure and argument patterns | docs/script-patterns.md |
| Strict mode, shell differences, safety | docs/bash-scripting-guide.md |
| Naming, organization, and quality baseline | docs/generation-best-practices.md |
Citation format (required):
[Ref: docs/<file>.md -> <section>]
Stage 4: Generate Script
Path A: Template-first (default)
- Generate scaffold:
bash scripts/generate_script_template.sh standard output-script.sh
- Replace placeholders and add business logic.
- Keep logging to stderr and data output to stdout unless requirements say otherwise.
- 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:
- Invoke
devops-skills:bash-script-validator - Apply fixes
- Re-run validation
- 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:
- Generated script path
- Requirements traceability (
REQ-*-> implementation) - Validation results with rerun status
- Citations in standard format
- Any assumptions/fallbacks used
Canonical Example Flows
Example A: Full Flow (Template-first)
- Clarify missing data format and output expectations.
- Capture
REQ-*table. - Choose template-first path.
- Generate scaffold with
scripts/generate_script_template.sh. - Implement logic and map functions to
REQ-*. - Validate with
devops-skills:bash-script-validatorand rerun until clean. - Return final summary with citations.
Example B: Constrained Environment Flow
Use this when AskUserQuestion, validator skill, or shellcheck is unavailable:
- Ask clarifying questions in chat.
- Mark unresolved items as assumptions in
Captured Requirements. - Generate from template script or template file copy fallback.
- Run
bash -n(andsh -nif relevant). - If
shellcheckis 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 Requirementstable exists withREQ-*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.mddocs/script-patterns.mddocs/generation-best-practices.mddocs/text-processing-guide.md
External References
FAQ
What does the bash-script-generator skill do?
Create, generate, write, or scaffold bash/shell scripts (.sh), automation, or CLI tools.
How do I install bash-script-generator?
Run npx skills add https://github.com/akin-ozer/cc-devops-skills --skill bash-script-generator in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/bash-script-generator/ (personal) or .claude/skills/bash-script-generator/ (project).
Which AI agents can use bash-script-generator?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is bash-script-generator safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains bash-script-generator?
It is published by akin-ozer in akin-ozer/cc-devops-skills. It has 672 recorded installs.
More from akin-ozer/cc-devops-skills
ansible-validator
akin-ozer/cc-devops-skills
Validate, lint, audit, or debug Ansible playbooks, roles, inventories, FQCN, tasks.
terragrunt-generator
akin-ozer/cc-devops-skills
Generate/create/scaffold Terragrunt HCL files — root.hcl, terragrunt.hcl, child modules, stacks, multi-env layouts.
k8s-debug
akin-ozer/cc-devops-skills
Diagnose and fix Kubernetes pods, CrashLoopBackOff, Pending, DNS, networking, storage, and rollout failures with kubectl.
ansible-generator
akin-ozer/cc-devops-skills
Generate, create, or scaffold Ansible playbooks, roles, tasks, handlers, inventory, vars.
jenkinsfile-generator
akin-ozer/cc-devops-skills
Generate/create/scaffold Jenkinsfile — declarative, scripted, shared library, CI/CD pipelines.
dockerfile-validator
akin-ozer/cc-devops-skills
Validate, lint, audit, or scan a Dockerfile for security and best practices.
Popular devops & cloud skills
microsoft-foundry
microsoft/azure-skills
Build, deploy, evaluate, optimize, fine-tune, and manage Microsoft Foundry agents, models, and resources end to end. USE FOR: foundry, azd ai agent, azd provision/deploy, hosted agent scaffold/develop/run/deploy/troubleshoot, prompt agent create, managed harness agent create, GitHub Copilot harness agent, create agent, update agent, add tool to agent, invoke agent, agent insights, evaluate agent, batch eval, continuous eval, continuous monitoring, agent CI/CD, optimize prompt, improve prompt, optimize agent instructions, Agent Optimizer scaffold, dataset curation from traces, deploy model, model fine-tuning (SFT/DPO/RFT), Foundry project, RBAC, role assignment, permissions, quota, capacity, region, deployment failure, AI Services, create Foundry resource, knowledge index, customize deployment, onboard, availability, training-data, grader, distillation, large file upload. DO NOT USE FOR: Azure Functions, App Service, general Azure deploy (use azure-deploy), general Azure prep (use azure
azure-diagnostics
microsoft/azure-skills
Debug Azure production issues on Azure using AppLens, Azure Monitor, resource health, and safe triage. WHEN: debug production issues, troubleshoot app service, app service high CPU, app service deployment failure, troubleshoot container apps, container app 503 or target port mismatch, troubleshoot functions, function telemetry missing or stopped after a config/connection-string change, troubleshoot AKS, VM RDP, Linux SSH, VM black screen, can't connect to VM, reset VM password, NSG or firewall blocking, kubectl cannot connect, kube-system/CoreDNS failures, pod pending, crashloop, node not ready, upgrade failures, analyze logs, KQL, insights, image pull failures, cold start issues, health probe failures, resource health, root cause of errors, troubleshoot event hubs, troubleshoot service bus, messaging SDK error, AMQP connection failure, message lock lost, lock renewal during long-running processing, service bus dead letter.
azure-prepare
microsoft/azure-skills
Prepare azd-based Azure projects for deployment: generates azure.yaml, infrastructure (Bicep/Terraform), and Dockerfiles for the Azure Developer CLI (azd) workflow. USE ONLY when the user explicitly wants to use azd as the deployment tool, or the project already has an azure.yaml file. DO NOT USE FOR: non-azd deployments, Python App Service code-only deploys (use python-appservice-deploy), or cross-cloud migration (use azure-cloud-migrate). WHEN: prepare app for azd, create azure.yaml, set up azd infrastructure, modernize app for Azure with azd, deploy with azd, function app, timer trigger, service bus trigger, event-driven function, managed identity, generate Bicep, generate Terraform, create and deploy to Azure.
azure-ai
microsoft/azure-skills
Use for Azure AI: Search, Speech, OpenAI, Document Intelligence. Helps with search, vector/hybrid search, speech-to-text, text-to-speech, transcription, OCR. WHEN: AI Search, query search, vector search, hybrid search, semantic search, speech-to-text, text-to-speech, transcribe, OCR, convert text to speech.
azure-deploy
microsoft/azure-skills
Execute Azure deployments for ALREADY-PREPARED applications that have existing .azure/deployment-plan.md and infrastructure files. DO NOT use this skill when the user asks to CREATE a new application — use azure-prepare instead. This skill runs azd up, azd deploy, terraform apply, and az deployment commands with built-in error recovery. Requires .azure/deployment-plan.md from azure-prepare and validated status from azure-validate. WHEN: "run azd up", "run azd deploy", "execute deployment", "push to production", "push to cloud", "go live", "ship it", "bicep deploy", "terraform apply", "publish to Azure", "launch on Azure". DO NOT USE WHEN: "create and deploy", "build and deploy", "create a new app", "set up infrastructure", "create and deploy to Azure using Terraform" — use azure-prepare for these.
azure-validate
microsoft/azure-skills
Pre-deployment validation for Azure readiness. Run deep checks on configuration, infrastructure (Bicep or Terraform), RBAC role assignments, managed identity permissions, and prerequisites before deploying. WHEN: validate my app, check deployment readiness, run preflight checks, verify configuration, check if ready to deploy, validate azure.yaml, validate Bicep, test before deploying, troubleshoot deployment errors, validate Azure Functions, validate function app, validate serverless deployment, verify RBAC roles, check role assignments, review managed identity permissions, what-if analysis, validate Container Apps deployment.