mcpField
S
shell

shell

github.com/pproencaDevelopment218695 installsUpdated 11w ago
Repository

About shell

A shell scripting guide for AI agents and LLMs, with 49 impact-prioritized rules and examples. It covers safety, portability, error handling, and performance.

Key features

  1. 01Covers 9 scripting categories
  2. 02Provides 49 prioritized rules
  3. 03Includes incorrect and correct examples
  4. 04Covers safety and portability
  5. 05Offers error handling and performance guidance

Use cases

  1. 01Writing Bash or POSIX shell scripts
  2. 02Reviewing scripts for security risks
  3. 03Troubleshooting silent script failures
  4. 04Porting scripts across environments

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/pproenca/dot-skills --skill shell

After installing, type/shellin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

AGENTS.md
metadata.json
README.md
assets/templates/
_template.md
references/
_sections.md
err-check-commands.md
err-debug-tracing.md
err-exit-codes.md
err-pipefail.md
err-shellcheck.md
err-stderr-messages.md
err-strict-mode.md
err-trap-cleanup.md
func-avoid-aliases.md
func-documentation.md
func-main-pattern.md
func-return-values.md
func-single-purpose.md
perf-avoid-subshells.md
perf-batch-operations.md
perf-builtins-over-external.md
perf-parameter-expansion.md
perf-process-substitution.md
perf-read-files.md
port-avoid-bashisms.md
port-export-syntax.md
port-printf-over-echo.md
port-shebang-selection.md
port-test-portability.md
quote-always-quote-variables.md

Details

From the project README

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)
2. Portability (CRITICAL)
3. Error Handling (HIGH)
4. Variables & Data (HIGH)
5. Quoting & Expansion (MEDIUM-HIGH)
6. Functions & Structure (MEDIUM)
7. Testing & Conditionals (MEDIUM)
8. Performance (LOW-MEDIUM)
9. Style & Formatting (LOW)

How to Use

Read individual reference files for detailed explanations and code examples:

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

Comments

Markdown supported