# Build Reliable Bash Scripts

Shell automation can fail when inputs, errors, cleanup, and tests are overlooked. This workflow guides structured design, defensive implementation, testing, and documentation.

## Install

```bash
npx skillstore add sickn33/bash-scripting
```

## Metadata

- Status: approved
- Slug: sickn33-bash-scripting
- Skillstore revision: r2
- Version status: missing
- Tree hash: a96835183bec85c30f2f641035e0e7ea1eda572fbec3bec9ffd8c585925f2c4a
- Author: sickn33
- GitHub username: sickn33
- License: MIT
- Repository: https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/bash-scripting
- Ref: 5a26d1d61d694db29af9b138c661c1981076d9df
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands
- Quality score: 78
- Quality tier: bronze
- Public page: https://skillstore.pages.dev/skills/sickn33-bash-scripting
- Manifest: https://skillstore.pages.dev/api/skills/sickn33-bash-scripting/manifest

## Capabilities

- Plans script purpose, inputs, outputs, logging, and error handling.
- Structures scripts with strict mode, argument parsing, usage text, and cleanup handlers.
- Guides input validation, helper functions, edge cases, and progress reporting.
- Adds traps, retries, exit codes, rollback behavior, and clear error messages.
- Defines ShellCheck and Bats testing gates for scripts.
- Creates documentation sections for usage, dependencies, examples, and troubleshooting.

## Use Cases

- Automate System Operations: Create maintainable administration scripts with validation, logging, cleanup, and predictable exit codes.
- Build Deployment Utilities: Design deployment scripts with strict failure handling, rollback planning, tests, and operational documentation.
- Standardize Shell Contributions: Apply consistent structure, ShellCheck rules, Bats tests, and documentation to team shell scripts.

## Prompt Templates

### Plan a Simple Script

```
Plan a Bash script that [goal]. Identify inputs, outputs, dependencies, errors, and success criteria before writing the implementation.
```

### Create a Defensive Script

```
Create a Bash script for [task]. Include strict mode, validated arguments, usage text, structured logging, cleanup traps, and meaningful exit codes.
```

### Harden an Existing Script

```
Review this Bash script for unsafe expansion, missing validation, weak error handling, cleanup failures, and unclear logging. Propose focused corrections.
```

### Prepare Production Validation

```
Design a production validation plan for this Bash script. Include ShellCheck, Bats tests, edge cases, failure injection, rollback checks, and documentation updates.
```

## Limitations

- The workflow provides guidance and a starter template, not environment-specific validation.
- Referenced companion skills may be unavailable in some installations.
- Generated scripts still require ShellCheck, Bats, and testing in the target environment.
- The workflow does not define platform-specific commands or deployment permissions.

## Best Practices

- Define inputs, outputs, permissions, and failure behavior before implementation.
- Quote expansions, validate external data, and use cleanup traps for temporary resources.
- Run ShellCheck and Bats tests in the same environment used for deployment.

## Anti Patterns

- Do not copy the starter template without adapting validation and dependencies.
- Do not suppress command failures without logging context and handling recovery.
- Do not deploy generated automation before testing permissions, edge cases, and rollback behavior.

## Security Audit

- Audited at: 2026-08-14T10:11:07.236\+00:00
- Summary: All 37 static findings are false positives caused by Markdown backticks, code fences, benign shell substitutions, and a Bats testing checklist item. The skill is documentation-only and shows no prompt injection, network reconnaissance, data exfiltration, or malicious command execution intent.

## Stats

- Views: 88
- Downloads: 11
- Favorites: 0
- Popularity score: 0
