shell-guide

Guide AI-assisted Bash scripting with guardrails, patterns, and best practices.

7|1|Updated Nov 3, 2025
One-click install
npx skills add https://github.com/ar4mirez/samuel --skill shell-guide
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: shell-guide
Source: https://github.com/ar4mirez/samuel/tree/main/template/.claude/skills/shell-guide
Command: npx skills add https://github.com/ar4mirez/samuel --skill shell-guide

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive guardrails, patterns, and best practices for writing robust, secure, and maintainable shell scripts, ensuring AI-assisted development adheres to high standards.

Core Features & Use Cases

  • Best Practices Enforcement: Guides AI on strict mode, quoting, error handling, and security.
  • Pattern Library: Offers reusable code snippets for common tasks like parameter expansion, traps, and argument parsing.
  • Tooling Integration: Recommends and explains the use of linters like ShellCheck and formatters like shfmt.
  • Use Case: When generating a new deployment script, the AI will use this guide to ensure it includes set -euo pipefail, proper error handling, and secure temporary file creation.

Quick Start

Use the shell-guide skill to generate a new bash script that safely processes command-line arguments and handles errors.

Frequently Asked Questions about shell-guide

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

FAQPage Schema
How do I write a secure bash script with proper error handling?

To write robust shell scripts, apply strict mode using `set -euo pipefail`, ensure proper quoting, and implement traps for error handling. This guide provides AI with patterns to enforce these best practices automatically.

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

Best practices for shell scripting in CI/CD pipelines include strict mode, secure temporary file creation, and portable commands. This guide supplies reusable patterns for parameter expansion and argument parsing tailored for automation and Makefiles.

How do I use shellcheck and shfmt for bash scripting?

Use ShellCheck to lint bash scripts for common errors and shfmt to enforce consistent formatting. This guide integrates these tools to ensure AI-generated scripts maintain high security and maintainability standards.

Does this bash scripting guide support testing with bats-core?

Yes, this bash scripting guide supports testing with bats-core to validate script behavior. It also covers parameter expansion, arrays, functions, and here documents to ensure comprehensive script robustness and portability.

What is the best way to handle command-line arguments in a bash script?

The best way to handle command-line arguments in a bash script is through structured argument parsing and safe parameter expansion. This guide provides reusable code snippets to process arguments safely while adhering to strict mode and error handling guardrails.