Toolverse
All skills

bash-defensive-patterns

by wshobson

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.

Installation

Pick a client and clone the repository into its skills directory.

Installation

Quick info

Author
wshobson
Category
DevOps
Views
28

About this skill

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.

How to use

  1. Zainstaluj umiejętność w swoim środowisku agenta, dodając ją do dostępnych pluginów shell-scripting.

  2. Na początku każdego skryptu bash, który piszesz, włącz strict mode poleceniem set -Eeuo pipefail. To natychmiast wyłapie błędy: wyjście na pierwszy błąd, referencje do niezdefiniowanych zmiennych, i awarie w potokach poleceń.

  3. Dodaj obsługę błędów za pomocą trap. Zdefiniuj co najmniej dwie pułapki: jedną na ERR (aby wypisać numer linii błędu) i jedną na EXIT (aby posprzątać pliki tymczasowe i zasoby).

  4. Zawsze cytuj zmienne w kodzie — zamiast cp $source $dest pisz cp "$source" "$dest". To zapobiega podziałowi słów i rozwinięciu globów, które mogą zniszczyć Twoje dane.

  5. Dla zmiennych wymaganych, które muszą być ustawione, użyj sprawdzenia : "${REQUIRED_VAR:?REQUIRED_VAR is not set}" na początku skryptu — skrypt się zatrzyma z jasnym komunikatem, jeśli zmienna brakuje.

  6. Przy pracy z tablicami i złożonymi danymi, używaj deklaracji tablic i bezpiecznej iteracji — umiejętność pokazuje przykłady, które chronią Cię przed błędami przy obsłudze danych zawierających spacje i znaki specjalne.

Related skills

file-organizer

by ComposioHQ

Intelligently organizes your files and folders across your computer by understanding context, finding duplicates, suggesting better structures, and automating cleanup tasks. Reduces cognitive load and keeps your digital workspace tidy without manual effort.

DevOps
1399

proxmox-full

by openclaw

Complete Proxmox VE management - create/clone/start/stop VMs and LXC containers, manage snapshots, backups, storage, and templates. Use when user wants to manage Proxmox infrastructure, virtual machines, or containers.

DevOps
1449

chrome-devtools

by mrgoonie

Browser automation, debugging, and performance analysis using Puppeteer CLI scripts. Use for automating browsers, taking screenshots, analyzing performance, monitoring network traffic, web scraping, form automation, and JavaScript debugging.

DevOps
29141

macos-cleaner

by daymade

Analyze and reclaim macOS disk space through intelligent cleanup recommendations. This skill should be used when users report disk space issues, need to clean up their Mac, or want to understand what's consuming storage. Focus on safe, interactive analysis with user confirmation

DevOps
1331

dashboard-creator

by mhattingpete

Create HTML dashboards with KPI metric cards, bar/pie/line charts, progress indicators, and data visualizations. Use when users request dashboards, metrics displays, KPI visualizations, data charts, or monitoring interfaces.

DevOps
21124

turborepo

by vercel

Turborepo monorepo build system guidance. Triggers on: turbo.json, task pipelines,\ndependsOn, caching, remote cache, the \

DevOps
1066