Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

bash-scripting — Claude Code skill: what it does, how to install

A structured workflow for building shell scripts with defensive patterns, error handling, ShellCheck, and Bats tests.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add sickn33/agentic-awesome-skills --skill bash-scripting -a claude-code
Open on GitHub

What bash-scripting does

The skill defines a seven-phase path for shell script development. It covers script structure with set -euo pipefail, core logic, error traps, logging, and automated testing via ShellCheck and Bats. The workflow serves as an index pointing to specialized skills such as bash-pro and bash-defensive-patterns.

The included template provides a minimal skeleton with script path resolution, logging helpers, and a main entry point. It intentionally omits argument parsing and rollback mechanisms. You must implement those parts according to the specific task.

Strict mode cannot prevent every runtime failure, so path validation and quoted variable expansions remain mandatory. Any destructive host command or cloud call still requires explicit user authorization before execution.

What it helps with

  • scaffold shell scripts with strict execution flags
  • set up error handling with trap handlers and exit codes
  • configure linting with ShellCheck and tests with Bats
  • implement timestamped logging and log rotation

Example prompts for the agent

  • Follow bash-scripting to design a backup script with strict mode
  • Add trap handlers and error cleanup using the bash-scripting workflow
  • Set up Bats tests and ShellCheck linting for my deployment script

How to install bash-scripting

1Skills CLI (Vercel)

npx skills add sickn33/agentic-awesome-skills --skill bash-scripting -a claude-code

2Manually: put the files in place

~/.claude/skills/bash-scripting/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/bash-scripting/

From the same set80

The whole set →
docker-expert sickn33 A skill that turns your AI agent into a Docker reviewer for Dockerfiles, multi-stage builds and container security. Useful when images and Compose files need a second look. Claude Code CX Codex Cursor +1 27,200installs typescript-expert sickn33 A skill for TypeScript and JavaScript work: it reads your project setup, fixes type errors and speeds up type checking. Useful once a TS codebase gets big. Claude Code CX Codex Cursor +1 12,600installs browser-automation sickn33 This skill builds browser checks around observed UI state and explicit outcomes. Use it for UI workflows, timing failures, or authorised page-data collection. Claude Code CX Codex Cursor +1 6,700installs nextjs-supabase-auth sickn33 This skill wires Supabase Auth into the Next.js App Router with clients, middleware, OAuth callbacks, and Server Actions. Use it when you need protected routes and session handling. Claude Code CX Codex Cursor +1 6,500installs 3d-web-experience sickn33 Helps build and debug web 3D scenes, product configurators, and portfolios. Covers stack choice, model loading, scroll interaction, and performance checks. Claude Code CX Codex Cursor +1 5,200installs prisma-expert sickn33 This skill helps inspect Prisma schemas, migrations, and queries. Use it to investigate an error or review database changes before deployment. Claude Code CX Codex Cursor +1 4,200installs playwright-skill sickn33 Write and run Playwright browser tests directly in Claude Code: responsive design checks, login flows, form submissions, screenshots. Executes locally via Node with a visible browser window. Claude Code CX Codex Cursor +1 3,900installs game-development sickn33 Guides game architecture decisions, platform choices, and core loop structure. Directs the assistant to specialized sub-skills for web, mobile, PC, or VR. Claude Code CX Codex Cursor +1 3,800installs

Similar

github-actions-efficiency official github This skill reviews GitHub Actions workflows, finds wasted CI minutes, and suggests cost-focused fixes. Use it when tuning workflow triggers, caching, or job layout. GitHub Copilot 2,000installs codeql official github Walks you through CodeQL code scanning: Actions workflows, CLI commands, SARIF output, and fixing failed analyses. GitHub Copilot 2,000installs paseo-help getpaseo Answers questions about Paseo setup, connections, providers, logs, and failures. Use it when you need to understand the daemon, workspaces, or app configuration. Claude Code CX Codex Cursor +1 1,400installs review-agent-setup Tom Farley This skill gates AI review actions behind manual human approval before pull requests or CI pipelines change. Every attempt generates an Ed25519-signed receipt for offline auditing. Claude Code CX Codex Cursor 5,200installs google-cloud-filestore-log-troubleshooting official google Diagnoses Google Cloud Filestore mount failures, access errors, and network timeouts. Use it when an NFS share stops mounting from a VM, GKE pod, or another supported workload. Claude Code Gemini CLI CX Codex 1,600installs flowstudio-power-automate-build official github Build, deploy, and test Power Automate cloud flows through the FlowStudio MCP server. Use it when an agent needs to create or edit a workflow without opening the portal. GitHub Copilot 1,900installs wizard Matt Pocock This skill creates an interactive bash wizard for manual setup steps, CI secrets, third-party dashboards, and one-off migrations. Claude Code 553,369installs hyperframes-cli heygen-com Controls HyperFrames video workflows from the CLI: audits layouts and contrast, edits timeline clips, captures snapshots, and renders locally or in cloud runtimes. Claude Code CX Codex Cursor +1 1,200,000installs

Questions about bash-scripting

How do I install bash-scripting in Claude Code?

Run npx skills add sickn33/agentic-awesome-skills --skill bash-scripting -a claude-code. Alternatively, place SKILL.md directly into ~/.claude/skills/bash-scripting/.

What does the bash-scripting workflow cover?

It provides a phased checklist spanning script design, strict mode configuration, input validation, error trapping, logging, and Bats testing.

What limitations does the starter template have?

The template is only a foundation: it does not include argument parsing or rollback logic, and strict mode alone does not catch every failure.

Source text

SKILL.md · MIT
---
name: bash-scripting
description: "Bash scripting workflow for creating production-ready shell scripts with defensive patterns, error handling, and testing."
category: granular-workflow-bundle
risk: safe
source: personal
date_added: "2026-02-27"
---

# Bash Scripting Workflow

## Overview

Specialized workflow for creating robust, production-ready bash scripts with defensive programming patterns, comprehensive error handling, and automated testing.

## When to Use This Workflow

Use this workflow when:
- Creating automation scripts
- Writing system administration tools
- Building deployment scripts
- Developing backup solutions
- Creating CI/CD scripts

## Scope and execution

Choose the phases that match the user’s task; this document is an index, not an instruction to run every listed skill. Read a selected skill before using it. Respect repository and user constraints. Cloud calls, host configuration, publishing, destructive operations and spending require the applicable authorization; a workflow checklist does not grant it.

The template is a starting point, not a completed script: it does not implement argument parsing or rollback. Validate paths, quote expansions, test in a disposable directory, and make retries bounded and safe for the specific command. Never log credentials or imply strict mode catches every failure.

## Workflow Phases

### Phase 1: Script Design

#### Skills to Invoke
- `bash-pro` - Professional scripting
- `bash-defensive-patterns` - Defensive patterns

#### Actions
1. Define script purpose
2. Identify inputs/outputs
3. Plan error handling
4. Design logging strategy
5. Document requirements

#### Copy-Paste Prompts
```
Use @bash-pro to design production-ready bash script
```

### Phase 2: Script Structure

#### Skills to Invoke
- `bash-pro` - Script structure
- `bash-defensive-patterns` - Safety patterns

#### Actions
1. Add shebang and strict mode
2. Create usage function
3. Implement argument parsing
4. Set up logging
5. Add cleanup handlers

#### Copy-Paste Prompts
```
Use @bash-defensive-patterns to implement strict mode and error handling
```

### Phase 3: Core Implementation

#### Skills to Invoke
- `bash-linux` - Linux commands
- `linux-shell-scripting` - Shell scripting

#### Actions
1. Implement main functions
2. Add input validation
3. Create helper functions
4. Handle edge cases
5. Add progress indicators

#### Copy-Paste Prompts
```
Use @bash-linux to implement system commands
```

### Phase 4: Error Handling

#### Skills to Invoke
- `bash-defensive-patterns` - Error handling
- `error-handling-patterns` - Error patterns

#### Actions
1. Add trap handlers
2. Implement retry logic
3. Create error messages
4. Set up exit codes
5. Add rollback capability

#### Copy-Paste Prompts
```
Use @bash-defensive-patterns to add comprehensive error handling
```

### Phase 5: Logging

#### Skills to Invoke
- `bash-pro` - Logging patterns

#### Actions
1. Create logging function
2. Add log levels
3. Implement timestamps
4. Configure log rotation
5. Add debug mode

#### Copy-Paste Prompts
```
Use @bash-pro to implement structured logging
```

### Phase 6: Testing

#### Skills to Invoke
- `bats-testing-patterns` - Bats testing
- `shellcheck-configuration` - ShellCheck

#### Actions
1. Write Bats tests
2. Run ShellCheck
3. Test edge cases
4. Verify error handling
5. Test with different inputs

#### Copy-Paste Prompts
```
Use @bats-testing-patterns to write script tests
```

```
Use @shellcheck-configuration to lint bash script
```

### Phase 7: Documentation

#### Skills to Invoke
- `documentation-templates` - Documentation

#### Actions
1. Add script header
2. Document functions
3. Create usage examples
4. List dependencies
5. Add troubleshooting section

#### Copy-Paste Prompts
```
Use @documentation-templates to document bash script
```

## Script Template

```bash
#!/usr/bin/env bash
set -euo pipefail

SCRIPT_NAME=$(basename -- "$0")
readonly SCRIPT_NAME
SCRIPT_DIR=$(cd -- "$(dirname -- "$0")" && pwd)
readonly SCRIPT_DIR

log() { echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*"; }
error() { log "ERROR: $*" >&2; exit 1; }

usage() { cat <<EOF
Usage: $SCRIPT_NAME [OPTIONS]
Options:
    -h, --help      Show help
    -v, --verbose   Verbose output
EOF
}

main() {
    log "Script started"
    # Implementation
    log "Script completed"
}

main "$@"
```

## Quality Gates

- [ ] ShellCheck passes
- [ ] Bats tests pass
- [ ] Error handling works
- [ ] Logging functional
- [ ] Documentation complete

## Related Workflow Bundles

- `os-scripting` - OS scripting
- `linux-troubleshooting` - Linux troubleshooting
- `cloud-devops` - DevOps automation

## Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

© sickn33 · MIT · sickn33/agentic-awesome-skills

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor