Skip to content
Back to skills

Bash Patterns

ASecurity

Bash and shell patterns for safety flags, quoting, traps, and ShellCheck. Load before any edit to a .sh, .bash, or .zsh file, shebang script, or Makefile recipe, however small, or for shell questions.

  • 2 stars
  • 0 votes
  • 0 copies
  • 6 views
  • Added October 5, 2026
ai-agentsshellbash

Security analysis

A100/100

Pro scans all 9 files and shows the line behind each finding

Scanned December 3, 2026

npx -y skills add ku5ic/claude-kit --skill bash-patterns --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Bash Patterns?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Bash Patterns
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ku5ic-bash-patterns/badge)](https://www.skillsdirectory.com/skills/ku5ic-bash-patterns)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: bash-patterns
description: Bash and shell patterns for safety flags, quoting, traps, and ShellCheck. Load before any edit to a .sh, .bash, or .zsh file, shebang script, or Makefile recipe, however small, or for shell questions.
---

# Bash patterns

Default assumption: Bash 5.3 and ShellCheck 0.11, per the GNU Bash NEWS file and the ShellCheck changelog.

A row applies when the bash that runs the script is at least its version. Stock macOS `/bin/bash` is 3.2, so a 4.x or 5.x row fails under a `#!/bin/bash` script there; `#!/usr/bin/env bash` runs the first bash on PATH, on the user's machine the Homebrew 5.x build.

## Reference files

Loading this skill isn't enough. Before your next edit, read the file of every row that matches it. The rules live in those files, and this one only points at them.

| Before                                                                                 | Read                                                     |
| -------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| Writing bash, or upgrading bash or ShellCheck                                          | [reference/upgrades.md](reference/upgrades.md)           |
| Writing, changing, or reviewing bash code                                              | [reference/anti-patterns.md](reference/anti-patterns.md) |
| Starting a script, or writing a function, trap, test, expansion, heredoc, or pipeline  | [reference/practices.md](reference/practices.md)         |
| Running or silencing ShellCheck, or formatting with shfmt                              | [reference/tooling.md](reference/tooling.md)             |
| Typing a command at a zsh prompt, or moving a snippet tested in zsh into a bash script | [reference/quoting.md](reference/quoting.md)             |

Files in this skill

  • SKILL.md3.5 KB
  • reference/anti-patterns.md2 KB
  • reference/conditionals.md1.2 KB
  • reference/functions-and-traps.md3.2 KB
  • reference/parameter-expansion.md989 B
  • reference/quoting.md3.7 KB
  • reference/safety-flags.md4.2 KB
  • reference/shellcheck.md2.6 KB
  • reference/subshells-and-pipes.md3.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.