Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
pproenca avatar

Shell

  • 590 installs
  • 186 repo stars
  • Updated July 24, 2026
  • pproenca/dot-skills

shell is a Claude skill that enforces safe, portable bash and sh scripting practices for developers who write CI/CD pipelines, Dockerfiles, Makefiles, and automation scripts.

About

shell is a Claude skill from dot-skills that encodes comprehensive bash and POSIX shell best practices for AI agents and human reviewers. It organizes 49 rules across 9 categories, prioritized from critical safety and portability concerns down to incremental style guidance, with ShellCheck-aligned guidance on quoting, `set -euo pipefail`, variables, and error handling. Developers reach for shell when writing or refactoring scripts in GitHub Actions, GitLab CI, Dockerfile RUN commands, Makefile targets, cron jobs, or systemd unit ExecStart lines. Each rule includes explanations and real-world examples so agents produce maintainable scripts instead of fragile one-liners. The skill triggers on bash, sh, POSIX, ShellCheck, and pipeline automation keywords.

  • 49 rules across 9 priority categories from critical safety to style
  • 6 safety & security rules, 5 portability rules, 8 error handling rules
  • Real-world before/after code examples with impact metrics for every rule
  • Triggers on bash, sh, POSIX, ShellCheck, set -euo pipefail patterns
  • Hard-gate review for any script before merging into CI or production

Shell by the numbers

  • 590 all-time installs (skills.sh)
  • Ranked #385 of 2,725 Automation & Workflows skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Jul 31, 2026 (Skillselion catalog sync)
npx skills add https://github.com/pproenca/dot-skills --skill shell

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs590
repo stars186
Security audit3 / 3 scanners passed
Last updatedJuly 24, 2026
Repositorypproenca/dot-skills

How do you write safe portable bash for CI pipelines?

Generate safe, portable, and maintainable shell scripts for CI/CD, Dockerfiles, Makefiles, and automation tasks.

Who is it for?

DevOps and backend developers authoring bash for GitHub Actions, Dockerfiles, Makefiles, cron, or systemd who want 49 prioritized shell rules.

Skip if: Python or Node automation tasks where a typed scripting language is the better default.

When should I use this skill?

The user writes, reviews, or refactors bash, sh, Dockerfile RUN commands, Makefile recipes, or CI shell steps.

What you get

ShellCheck-aligned bash scripts, Dockerfile RUN commands, Makefile recipes, and CI pipeline scripts with proper error handling.

  • portable bash scripts
  • ShellCheck-clean CI steps

By the numbers

  • Includes 49 shell scripting rules across 9 categories

Files

SKILL.mdMarkdownGitHub ↗

Shell Scripts Best Practices (Community)

Comprehensive best practices guide for shell scripting, designed for AI agents and LLMs. Contains 49 rules across 9 categories, prioritized by impact from critical (safety, portability) to incremental (style). Each rule includes detailed explanations, real-world examples comparing incorrect vs. correct implementations, and specific impact metrics.

When to Apply

Reference these guidelines when:

  • Writing new bash or POSIX shell scripts
  • Reviewing shell scripts for security vulnerabilities
  • Debugging scripts that fail silently or behave unexpectedly
  • Porting scripts between Linux, macOS, and containers
  • Optimizing shell script performance
  • Setting up CI/CD pipelines with shell scripts

Rule Categories by Priority

PriorityCategoryImpactPrefixRules
1Safety & SecurityCRITICALsafety-6
2PortabilityCRITICALport-5
3Error HandlingHIGHerr-8
4Variables & DataHIGHvar-5
5Quoting & ExpansionMEDIUM-HIGHquote-6
6Functions & StructureMEDIUMfunc-5
7Testing & ConditionalsMEDIUMtest-5
8PerformanceLOW-MEDIUMperf-6
9Style & FormattingLOWstyle-3

Quick Reference

1. Safety & Security (CRITICAL)

  • `safety-command-injection` - Prevent command injection from user input
  • `safety-eval-avoidance` - Avoid eval for dynamic commands
  • `safety-absolute-paths` - Use absolute paths for external commands
  • `safety-temp-files` - Create secure temporary files
  • `safety-suid-forbidden` - Never use SUID/SGID on shell scripts
  • `safety-argument-injection` - Prevent argument injection with double dash

2. Portability (CRITICAL)

  • `port-shebang-selection` - Choose shebang based on portability needs
  • `port-avoid-bashisms` - Avoid bashisms in POSIX scripts
  • `port-printf-over-echo` - Use printf instead of echo for portability
  • `port-export-syntax` - Use portable export syntax
  • `port-test-portability` - Use portable test constructs

3. Error Handling (HIGH)

  • `err-strict-mode` - Use strict mode for error detection
  • `err-exit-codes` - Use meaningful exit codes
  • `err-trap-cleanup` - Use trap for cleanup on exit
  • `err-stderr-messages` - Send error messages to stderr
  • `err-pipefail` - Use pipefail to catch pipeline errors
  • `err-check-commands` - Check command success explicitly
  • `err-shellcheck` - Use ShellCheck for static analysis
  • `err-debug-tracing` - Use debug tracing with set -x and PS4

4. Variables & Data (HIGH)

  • `var-use-arrays` - Use arrays for lists instead of strings
  • `var-local-scope` - Use local for function variables
  • `var-naming-conventions` - Follow variable naming conventions
  • `var-readonly-constants` - Use readonly for constants
  • `var-default-values` - Use parameter expansion for defaults

5. Quoting & Expansion (MEDIUM-HIGH)

  • `quote-always-quote-variables` - Always quote variable expansions
  • `quote-dollar-at` - Use "$@" for argument passing
  • `quote-command-substitution` - Quote command substitutions
  • `quote-brace-expansion` - Use braces for variable clarity
  • `quote-here-documents` - Use here documents for multi-line strings
  • `quote-glob-safety` - Control glob expansion explicitly

6. Functions & Structure (MEDIUM)

  • `func-main-pattern` - Use main() function pattern
  • `func-single-purpose` - Write single-purpose functions
  • `func-return-values` - Use return values correctly
  • `func-documentation` - Document functions with header comments
  • `func-avoid-aliases` - Prefer functions over aliases

7. Testing & Conditionals (MEDIUM)

  • `test-double-brackets` - Use [[ ]] for tests in bash
  • `test-arithmetic` - Use (( )) for arithmetic comparisons
  • `test-explicit-empty` - Use explicit empty/non-empty string tests
  • `test-file-operators` - Use correct file test operators
  • `test-case-patterns` - Use case for pattern matching

8. Performance (LOW-MEDIUM)

  • `perf-builtins-over-external` - Use builtins over external commands
  • `perf-avoid-subshells` - Avoid unnecessary subshells
  • `perf-process-substitution` - Use process substitution for temp files
  • `perf-read-files` - Read files efficiently
  • `perf-parameter-expansion` - Use parameter expansion for string operations
  • `perf-batch-operations` - Batch operations instead of loops

9. Style & Formatting (LOW)

  • `style-indentation` - Use consistent indentation
  • `style-file-structure` - Follow consistent file structure
  • `style-comments` - Write useful comments

How to Use

Read individual reference files for detailed explanations and code examples:

  • Section definitions - Category structure and impact levels
  • Rule template - Template for adding new rules

Reference Files

FileDescription
AGENTS.mdComplete compiled guide with all rules
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for new rules
metadata.jsonVersion and reference information

Key Sources

Related skills

How it compares

Use shell for bash CI and container scripts; use DevOps CI/CD skills when you need pipeline architecture beyond individual shell script quality.

FAQ

How many rules does the shell skill include?

The shell skill includes 49 rules organized into 9 categories, ranked from critical safety and portability issues to incremental style guidance. Rules cover quoting, `set -euo pipefail`, variables, and ShellCheck-aligned patterns for CI and container scripts.

Where does the shell skill apply?

The shell skill applies when writing or reviewing bash and sh for CI pipelines, Dockerfile RUN commands, Makefile recipes, cron jobs, and systemd ExecStart directives. Agents trigger on bash, POSIX, ShellCheck, and pipeline automation keywords.

Is Shell safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

Automation & Workflowsdevopsintegrations

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.