scripting

Create Bash scripts with shebang, set -euo pipefail, and structured main functions.

3|Updated Apr 12, 2026
One-click install
npx skills add https://github.com/mauriciodelrio/delriodev-skills --skill scripting-mauriciodelrio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: scripting
Source: https://github.com/mauriciodelrio/delriodev-skills/tree/main/es-skills/software/scripting
Command: npx skills add https://github.com/mauriciodelrio/delriodev-skills --skill scripting-mauriciodelrio

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Many developers write Bash or Zsh scripts without consistent safety measures, resulting in fragile scripts that fail silently or have insecure permissions.

Core Features & Use Cases

  • Safety: Enforces the use of a shebang line, the flags set -euo pipefail, and explicit error handling.
  • Structure: Provides a main function template, readonly constants, and reusable logging utilities.
  • Permissions: Guides proper file mode settings and Git handling of executable bits.
  • Reusable utilities: Includes shared styles and logging functions for consistent output. Typical use cases include deployment scripts, CI pipeline steps, and routine system maintenance automation.

Quick Start

Ask the scripting skill to create a bash script that deploys a Node.js app to a staging environment.

Frequently Asked Questions about scripting

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a reliable Bash script for deployment automation?

To write a reliable Bash script for deployment automation, include a proper shebang line, enable set -euo pipefail for strict error handling, and structure your code within a main function to prevent silent failures.

What are the best practices for safe shell scripting in CI pipelines?

Best practices for safe shell scripting in CI pipelines involve using readonly constants, explicit error handling, and reusable logging utilities to ensure consistent output and prevent insecure file permissions during execution.

Why does my Bash script fail silently during system maintenance tasks?

Your Bash script fails silently during system maintenance because it lacks the set -euo pipefail flags, which enforce immediate exit on errors, treat unset variables as errors, and catch pipe failures.

Can I use Zsh for scripting CI pipelines with the same safety guidelines?

Yes, you can apply the same safety guidelines to Zsh scripting in CI pipelines by enforcing proper shebang lines, explicit error handling, and structured main functions to ensure reliable execution.

How do I handle executable file permissions in Git for shell scripts?

To handle executable file permissions in Git for shell scripts, apply the proper file mode settings locally and configure Git to track the executable bit correctly, ensuring the script runs consistently across different environments.

What is the best way to structure a Bash script for routine automation?

The best way to structure a Bash script for routine automation is to use a main function template, define readonly constants, and incorporate reusable logging utilities to maintain consistent and readable output.