shell

Enforces portable and safe Bash and POSIX shell scripting guidelines.

1|Updated Dec 30, 2025
One-click install
npx skills add https://github.com/Fidasek009/agents --skill shell-fidasek009
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: shell
Source: https://github.com/Fidasek009/agents/tree/main/.kilo/skills/shell
Command: npx skills add https://github.com/Fidasek009/agents --skill shell-fidasek009

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Shell scripts often break due to unquoted variables, missing error handling, non-portable syntax, and unsafe handling of destructive operations. This Skill provides a consistent set of standards for writing robust, portable, and maintainable shell scripts. ## Core Features & Use Cases - Shell Selection Guidance: Choose between POSIX sh, Bash, and Zsh based on required features, with matching shebangs and strict modes like set -eu and pipefail. - Safety Rules: Quote expansions, validate inputs, guard destructive operations with allowlists, use mktemp for temporary files, and register cleanup traps. - Portability & Verification: Keep scripts idempotent and independent of the working directory, and verify changes with shellcheck and clean-environment testing. - Use Case: When writing a CI deployment script, apply these guidelines to validate required environment variables, create temporary directories safely, and ensure the script runs identically across developer machines and CI runners. ## Quick Start Review my deploy.sh script against the shell scripting guidelines and fix any portability or safety issues.

Frequently Asked Questions about shell

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

FAQPage Schema
How do I write portable shell scripts?▼

Use POSIX sh as the interpreter, quote all variable expansions, use printf for output, and avoid shell-specific features. Enable set -eu for strict error handling and test the script from a clean environment.

When should I use Bash instead of POSIX sh?▼

Use Bash only when the script needs shell-specific features such as arrays or pipefail. Match the shebang to the features actually used, and prefer POSIX sh for portable automation scripts.

How do I make shell scripts safe for destructive operations?▼

Guard destructive commands with non-empty path checks and allowlisted directories. Validate required arguments and environment variables before any side effects, and register cleanup traps for temporary files and background processes.

Does shellcheck work with POSIX sh scripts?▼

Yes, shellcheck supports sh, Bash, and other shells, detecting quoting bugs, portability issues, and unsafe patterns. Run it on changed scripts whenever it is available in your environment.

Why does my shell script fail in CI but work locally?▼

Scripts often depend on the caller's working directory, exported variables, or PATH differences. Make scripts independent of the current directory and test them from a clean environment that matches CI conditions.