Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Validate scripts for POSIX compliance with portability checks, bashism detection, and cross-platform compatibility.
.claude/skills/a5c-ai-posix-shell-validator/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-08 | ✗→✓ | ▲ Improved | 46% | 0% |
| case-16 | ✗→✓ | ▲ Improved | 14% | 0% |
| case-17 | ✗→✓ | ▲ Improved | 12% | 0% |
| case-01 | ✗→✗ | = Same ✗ | 40% | 0% |
| case-02 | ✗→✗ | = Same ✗ | 92% | 0% |
Validate scripts for POSIX compliance and portability.
Invoke this skill when you need to:
bash# Bashism → POSIX Alternative # Arrays arr=(a b c) # Use: set -- a b c; or newline-separated ${arr[0]} # Use: $1 (after set --) # [[ ]] test [[ $x == y ]] # Use: [ "$x" = "y" ] [[ $x =~ regex ]] # Use: case or expr # String substitution ${var/old/new} # Use: $(echo "$var" | sed 's/old/new/') ${var,,} # Use: $(echo "$var" | tr '[:upper:]' '[:lower:]') ${var^^} # Use: $(echo "$var" | tr '[:lower:]' '[:upper:]') # Arithmetic ((x++)) # Use: x=$((x + 1)) $((x**2)) # Use: $(expr $x \* $x) or awk # Here strings cat <<< "$var" # Use: echo "$var" | cat # Process substitution diff <(cmd1) <(cmd2) # Use: temp files # Brace expansion {1..10} # Use: seq 1 10 file.{txt,md} # Use: file.txt file.md # Local variables local var # Use: var= (function-scoped in many shells) # Source source file # Use: . file # Function syntax function name { } # Use: name() { }
bash#!/bin/sh # POSIX compliance validator check_file() { file="$1" errors=0 # Check shebang head -1 "$file" | grep -q '^#!/bin/bash' && { echo "WARNING: $file uses bash shebang" errors=$((errors + 1)) } # Check for bashisms bashisms=' \[\[ \(\( \$\{[^}]*// \$\{[^}]*,, \$\{[^}]*\^\^ \$\{[^}]*:[-+=?][^}]*\} <<< <\( >\( \{[0-9]+\.\.[0-9]+\} function[[:space:]]+[a-zA-Z_] source[[:space:]] declare[[:space:]] local[[:space:]] readonly[[:space:]] ' for pattern in $bashisms; do if grep -En "$pattern" "$file" 2>/dev/null; then echo "BASHISM: $file contains: $pattern" errors=$((errors + 1)) fi done return $errors } # Run checkbashisms if available if command -v checkbashisms >/dev/null 2>&1; then checkbashisms -f "$1" else check_file "$1" fi
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 9,851 | 9,421 | -4% | 1 | 1 | 0% | 1,835 | 2,578 | +40% | 0 | 0 | — |
case-02 | fail→fail | 3,931 | 3,141 | -20% | 1 | 1 | 0% | 711 | 1,365 | +92% | 0 | 0 | — |
case-03 | fail→fail | 12,345 | 11,390 | -8% | 1 | 1 | 0% | 2,406 | 3,115 | +29% | 0 | 0 | — |
case-04 | fail→fail | 13,717 | 8,716 | -36% | 1 | 1 | 0% | 2,685 | 2,491 | -7% | 0 | 0 | — |
case-05 | fail→fail | 6,633 | 3,273 | -51% | 1 | 1 | 0% | 1,196 | 1,402 | +17% | 0 | 0 | — |
case-06 | fail→fail | 7,113 | 4,556 | -36% | 1 | 1 | 0% | 1,203 | 1,517 | +26% | 0 | 0 | — |
case-07 | fail→fail | 4,703 | 2,738 | -42% | 1 | 1 | 0% | 750 | 1,321 | +76% | 0 | 0 | — |
case-08 | fail→pass | 8,790 | 6,172 | -30% | 1 | 1 | 0% | 1,379 | 2,007 | +46% | 0 | 0 | — |
case-09 | fail→fail | 5,786 | 4,064 | -30% | 1 | 1 | 0% | 1,021 | 1,556 | +52% | 0 | 0 | — |
case-10 | fail→fail | 7,522 | 7,005 | -7% | 1 | 1 | 0% | 1,476 | 2,133 | +45% | 0 | 0 | — |
case-11 | fail→fail | 6,013 | 5,545 | -8% | 1 | 1 | 0% | 1,102 | 1,873 | +70% | 0 | 0 | — |
case-12 | fail→fail | 2,993 | 3,079 | +3% | 1 | 1 | 0% | 495 | 1,392 | +181% | 0 | 0 | — |
case-13 | fail→fail | 2,430 | 2,881 | +19% | 1 | 1 | 0% | 371 | 1,278 | +244% | 0 | 0 | — |
case-14 | fail→fail | 3,362 | 2,315 | -31% | 1 | 1 | 0% | 611 | 1,219 | +100% | 0 | 0 | — |
case-15 | fail→fail | 6,841 | 5,476 | -20% | 1 | 1 | 0% | 1,310 | 1,852 | +41% | 0 | 0 | — |
case-16 | fail→pass | 15,183 | 12,634 | -17% | 1 | 1 | 0% | 2,776 | 3,159 | +14% | 0 | 0 | — |
case-17 | fail→pass | 7,803 | 4,319 | -45% | 1 | 1 | 0% | 1,426 | 1,590 | +12% | 0 | 0 | — |
case-18 | fail→fail | 6,177 | 9,797 | +59% | 1 | 1 | 0% | 1,078 | 2,334 | +117% | 0 | 0 | — |
case-19 | fail→fail | 7,940 | 3,951 | -50% | 1 | 1 | 0% | 1,419 | 1,524 | +7% | 0 | 0 | — |
case-20 | fail→fail | 12,763 | 9,984 | -22% | 1 | 1 | 0% | 2,319 | 2,784 | +20% | 0 | 0 | — |
case-21 | fail→fail | 15,538 | 14,110 | -9% | 1 | 1 | 0% | 3,028 | 3,618 | +19% | 0 | 0 | — |
case-22 | fail→fail | 9,655 | 14,071 | +46% | 1 | 1 | 0% | 2,209 | 4,181 | +89% | 0 | 0 | — |
case-23 | fail→fail | 13,341 | 10,210 | -23% | 1 | 1 | 0% | 2,384 | 2,593 | +9% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +13 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.