Catalogue / developing-posix-shell-scripts
developing-posix-shell-scripts
MITSignedUse when writing, reviewing, or refactoring a POSIX shell script (/bin/sh), or when targeting Alpine, BusyBox, or any environment where Bash cannot be assumed.--- name: developing-posix-shell-scripts description: Use when writing, reviewing, or refactoring a POSIX shell script (/bin/sh), or when targeting Alpine, BusyBox, or any environment where Bash cannot be assumed. ---
developing-posix-shell-scripts skill
Do not use Bash-specific features. See references/common.md for the full list of bash-isms to avoid.
Step 1 - Classify the Script
Audit flags before classifying. Ask for each proposed flag: would a real caller ever pass a different value, or can it be a readonly constant? Beyond that, apply common sense - not everything that _could_ vary _should_ be a flag. Internal paths, fixed timeouts, log levels for non-CLI tools, and similar values are typically hardcoded in practice even if they could theoretically differ. When reviewing an existing script, re-classify from scratch; the current number of flags is not evidence of correct classification.
Simple - all of: < 50 lines of logic, 0-2 genuine flags, no structured logging, no -h/help output, no resource cleanup, not shared across systems/environments.
Complex - any of: >= 50 lines, 3+ genuine flags, structured logging, -h/help output, resource cleanup, shared across systems/environments.
When in doubt, prefer Simple.
Step 2 - Follow the Reference Document
Load [references/common.md](references/common.md) first, then load the matching document:
- [references/developing-simple-posix-shell-scripts.md](references/developing-simple-posix-shell-scripts.md) - Load this when classified as Simple.
- [references/developing-complex-posix-shell-scripts.md](references/developing-complex-posix-shell-scripts.md) - Load this when classified as Complex. Also load [references/reference-code-blocks.md](references/reference-code-blocks.md) to compose only the blocks the script actually needs.
| File | Size | SHA-256 |
|---|---|---|
| SKILL.md | 1.9 kB | 1c9d98beab60 |
| SKILVAULT_SOURCE.json | 1.7 kB | 21a382aa7ddb |
| THIRD_PARTY_NOTICES.md | 1.0 kB | 57ebecc7600a |
| agents/openai.yaml | 262 B | 1a092b837887 |
| references/common.md | 2.5 kB | 36e025dc26b1 |
| references/developing-complex-posix-shell-scripts.md | 1.1 kB | 298985be09b0 |
| references/developing-simple-posix-shell-scripts.md | 1.1 kB | 680ea4372d1d |
| references/reference-code-blocks.md | 6.6 kB | cb4c40cfbf4d |
Published verbatim from the pinned commit. Nothing is rewritten.
| Version | Pinned commit | Signed | |
|---|---|---|---|
| 0.1.0 Current | 2e883f08c8fe | 29 Nov 2026 |
Locking a skill to one version needs Pro.