Agent skill

Bash Defensive Patterns

by promovaweb in promovaweb/setupvibe

Master defensive Bash programming techniques for production-grade scripts.

GPL-3.0Auto-check passedDevOps & Cloud

Install Bash Defensive Patterns

skills CLI
$ npx skills add promovaweb/setupvibe --skill bash-defensive-patterns -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install promovaweb/setupvibe bash-defensive-patterns --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/promovaweb/setupvibe.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.codex/skills/bash-defensive-patterns .claude/skills/bash-defensive-patterns && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
bash-defensive-patterns
GitHub stars
101
Used in
13 other repos
Token cost
~572 tokens
SKILL.md length
260 words
Files
2
Skills in repo
8
Repo updated
First seen
Licence
GPL-3.0

At a glance

Master defensive Bash programming techniques for production-grade scripts.

  • Works in 4 steps: Confirm the target shell, OS, and… → Enable strict mode and safe defaults… → Validate inputs, quote variables, and… → …
  • Writing robust shell scripts
  • SKILL.md covers Platform Notes, Use this skill when, Do not use this skill when and Instructions, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Bash Defensive Patterns is an agent skill from promovaweb/setupvibe. Master defensive Bash programming techniques for production-grade scripts. Use when writing robust shell scripts, CI/CD pipelines, or system utilities requiring fault tolerance and safety.

Its SKILL.md is about 570 tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `resources/implementation-playbook.md`).

It sits in DevOps & Cloud, covering Shell scripting and CI/CD. It works with Bash. The repository describes itself as: O script definitivo de configuração de ambiente de desenvolvimento multiplataforma. The licence is GPL-3.0.

When your agent uses it

  • Writing robust shell scripts
  • CI/CD pipelines
  • System utilities requiring fault tolerance and safety

Example prompts

  • “/bash-defensive-patterns”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Confirm the target shell, OS, and execution environment.
  2. Enable strict mode and safe defaults from the start.
  3. Validate inputs, quote variables, and handle files safely.
  4. Add logging, error traps, and basic tests.

What it can do on your machine

Read from SKILL.md and the folder at commit e86a16d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Bash Defensive Patterns loads about 572 tokens when it runs. Until then it costs about 53 tokens; SKILL.md has 260 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~53
When it runs · the whole SKILL.md, loaded when a task matches
~572

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from promovaweb/setupvibe at commit e86a16d, republished under its GPL-3.0 licence (© promovaweb). 260 words, ~572 tokens.

Download SKILL.mdSave it as .claude/skills/bash-defensive-patterns/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
bash-defensive-patterns
description
Master defensive Bash programming techniques for production-grade scripts. Use when writing robust shell scripts, CI/CD pipelines, or system utilities requiring fault tolerance and safety.

Bash Defensive Patterns

Comprehensive guidance for writing production-ready Bash scripts using defensive programming techniques, error handling, and safety best practices to prevent common pitfalls and ensure reliability.

Platform Notes

This is the Codex version of the skill.

  • Use rg and sed for repository inspection.
  • Use apply_patch for manual script edits.
  • Use exec_command for ShellCheck, syntax checks, and targeted script runs.
  • Keep this skill functionally aligned with .claude/skills/bash-defensive-patterns.

Use this skill when

  • Writing production automation scripts
  • Building CI/CD pipeline scripts
  • Creating system administration utilities
  • Developing error-resilient deployment automation
  • Writing scripts that must handle edge cases safely
  • Building maintainable shell script libraries
  • Implementing comprehensive logging and monitoring
  • Creating scripts that must work across different platforms

Do not use this skill when

  • You need a single ad-hoc shell command, not a script
  • The target environment requires strict POSIX sh only
  • The task is unrelated to shell scripting or automation

Instructions

  1. Confirm the target shell, OS, and execution environment.
  2. Enable strict mode and safe defaults from the start.
  3. Validate inputs, quote variables, and handle files safely.
  4. Add logging, error traps, and basic tests.

Safety

  • Avoid destructive commands without confirmation or dry-run flags.
  • Do not run scripts as root unless strictly required.

Refer to resources/implementation-playbook.md for detailed patterns, checklists, and templates.

Resources

  • resources/implementation-playbook.md for detailed patterns, checklists, and templates.

Regra Obrigatória — Markdown

Ao criar ou modificar qualquer arquivo .md, você DEVE invocar a skill /markdown-format antes de concluir a tarefa. As regras de formatação estão em MARKDOWN.md. Esta regra é inegociável e se aplica a qualquer skill, independente do seu escopo.

© promovaweb, GPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in .codex/skills/bash-defensive-patterns of promovaweb/setupvibe.

  • SKILL.md
  • resources/implementation-playbook.md

Open the folder on GitHubat commit e86a16d

Used in 13 other repositories

We found 30 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 13 other GitHub owners. This page covers the copy in promovaweb/setupvibe, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Bash Defensive Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Bash Defensive Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Bash Defensive Patterns this skillpromovaweb/setupvibe10113 repos~572Automated safety check: PassGPL-3.0
Headless Codex CLI AutomationXiaomiMiMo/MiMo-Code14k—~2.7kAutomated safety check: PassMIT
Bats Shell Testing Patternswshobson/agents40k11 repos~1.3kAutomated safety check: PassMIT
Shell Scriptingancoleman/ai-design-components526—~2.2kAutomated safety check: PassMIT
Shellpproenca/dot-skills214—~1.9kAutomated safety check: PassMIT
ShellCheck Configurationwshobson/agents40k10 repos~403Automated safety check: PassMIT

Similar skills

  • Headless Codex CLI Automation

    XiaomiMiMo/MiMo-Code

    Runs OpenAI Codex CLI as a non-interactive worker for CI, Docker, Kubernetes or remote servers, with sandbox modes and JSONL-friendly output.

    14k GitHub stars~2.7k tokensUpdated 4 days ago
    DevOps & CloudAuto-check passed
  • Writes unit tests for shell scripts with Bats: error-condition tests, fixtures and mocks, cross-shell checks, parallel runs, helper files and CI integration.

    40k GitHub starsUsed in 11 repos~1.3k tokens
    Testing & QAAuto-check passed
  • Shell Scripting

    ancoleman/ai-design-components

    Write robust, portable shell scripts with proper error handling, argument parsing, and testing.

    526 GitHub stars~2.2k tokensUpdated 10 mo ago
    DevelopmentAuto-check passed
  • Shell

    pproenca/dot-skills

    Shell scripting best practices for writing safe, portable, and maintainable bash/sh scripts.

    214 GitHub stars~1.9k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Master ShellCheck static analysis configuration and usage for shell script quality. Use when setting up linting infrastructure, fixing code issues, or…

    40k GitHub starsUsed in 10 repos~403 tokens
    DevelopmentAuto-check passed
  • Diagnose a failed, stuck, or never-triggered CI run on a GitHub PR, apply a local fix if possible, push it, and document the result in a single running PR comment.

    317 GitHub stars~2.6k tokensUpdated yesterday
    DevOps & CloudAuto-check passed

More from promovaweb/setupvibe

All 8 skills in this repo
  • Bash Scripting

    promovaweb/setupvibe

    Bash scripting workflow for creating production-ready shell scripts with defensive patterns, error handling, and testing.

    101 GitHub starsUsed in 4 repos~1.2k tokens
    Auto-check passed
  • Bash Pro

    promovaweb/setupvibe

    Master of defensive Bash scripting for production automation, CI/CD pipelines, and system utilities.

    101 GitHub starsUsed in 9 repos~4.7k tokens
    Auto-check passed
  • Markdown Format

    promovaweb/setupvibe

    Enforce and apply SetupVibe Markdown formatting standards when creating or editing any .md file in the repository.

    101 GitHub stars~938 tokensUpdated 1 mo ago
    Auto-check passed
  • Documentation

    promovaweb/setupvibe

    Workflow mestre para gestão de documentação do SetupVibe. An agent skill from promovaweb/setupvibe.

    101 GitHub stars~477 tokensUpdated 1 mo ago
    Auto-check passed
  • Documentation

    promovaweb/setupvibe

    Workflow mestre para gestão de documentação do SetupVibe. An agent skill from promovaweb/setupvibe.

    101 GitHub stars~489 tokensUpdated 1 mo ago
    Auto-check passed
  • Make Changelog

    promovaweb/setupvibe

    Gerencia entradas no CHANGELOG.md seguindo Keep a Changelog.

    101 GitHub stars~470 tokensUpdated 1 mo ago
    Auto-check passed

Works with

Questions about Bash Defensive Patterns

What does Bash Defensive Patterns do?

Master defensive Bash programming techniques for production-grade scripts. Bash Defensive Patterns is an agent skill from promovaweb/setupvibe. Master defensive Bash programming techniques for production-grade scripts.

When should I use Bash Defensive Patterns?

Bash Defensive Patterns fits situations like: writing robust shell scripts; CI/CD pipelines; system utilities requiring fault tolerance and safety.

How do I install Bash Defensive Patterns in Claude Code?

Run `npx skills add promovaweb/setupvibe --skill bash-defensive-patterns -a claude-code`. Or copy the skill folder (.codex/skills/bash-defensive-patterns in promovaweb/setupvibe) into .claude/skills/bash-defensive-patterns in your project. Claude Code loads it when a task matches its description.

How do I install Bash Defensive Patterns in Codex?

Run `npx skills add promovaweb/setupvibe --skill bash-defensive-patterns -a codex`. Or copy the skill folder (.codex/skills/bash-defensive-patterns in promovaweb/setupvibe) into .agents/skills/bash-defensive-patterns in your project. Codex loads it when a task matches its description.

Can I use Bash Defensive Patterns in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add promovaweb/setupvibe --skill bash-defensive-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/bash-defensive-patterns, .gemini/skills/bash-defensive-patterns, .github/skills/bash-defensive-patterns and .opencode/skills/bash-defensive-patterns in your project.

What does Bash Defensive Patterns need to run?

SKILL.md names no scripts, command-line tools or credentials: Bash Defensive Patterns is instructions for the agent only.

Does Bash Defensive Patterns access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Bash Defensive Patterns safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Bash Defensive Patterns use?

Bash Defensive Patterns is published under the GPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Bash Defensive Patterns use?

About 572 tokens (SKILL.md is roughly 2.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Bash Defensive Patterns?

Skills that share tags, products or a category with Bash Defensive Patterns: Headless Codex CLI Automation (XiaomiMiMo/MiMo-Code, 14k stars), Bats Shell Testing Patterns (wshobson/agents, 40k stars), Shell Scripting (ancoleman/ai-design-components, 526 stars) and Shell (pproenca/dot-skills, 214 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Bash Defensive Patterns?

promovaweb (a GitHub organization) maintains it in promovaweb/setupvibe, which has 101 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on August 21, 2026.

Source: promovaweb/setupvibe on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.