Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Generate trap handlers for cleanup, signal handling, and graceful shutdown in shell scripts.
.claude/skills/a5c-ai-trap-handler-generator/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 2% | 0% |
| case-02 | ✗→✓ | ▲ Improved | -4% | 0% |
| case-03 | ✗→✓ | ▲ Improved | -2% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 10% | 0% |
| case-17 | ✗→✓ | ▲ Improved | -41% | 0% |
Generate trap handlers for shell scripts.
bash#!/usr/bin/env bash # Temporary resources to clean up declare -a CLEANUP_ITEMS=() CLEANUP_DONE=false # Register cleanup item register_cleanup() { CLEANUP_ITEMS+=("$1") } # Cleanup function cleanup() { if [[ "$CLEANUP_DONE" == true ]]; then return fi CLEANUP_DONE=true local exit_code=$? echo "Cleaning up..." for item in "${CLEANUP_ITEMS[@]}"; do if [[ -d "$item" ]]; then rm -rf "$item" 2>/dev/null elif [[ -f "$item" ]]; then rm -f "$item" 2>/dev/null elif [[ -n "$item" ]]; then # Command to run eval "$item" 2>/dev/null fi done return $exit_code } # Error handler on_error() { local exit_code=$? local line_no=$1 echo "Error on line ${line_no}: command exited with ${exit_code}" >&2 cleanup exit $exit_code } # Signal handlers on_sigint() { echo -e "\nInterrupted by user" cleanup exit 130 } on_sigterm() { echo "Terminated" cleanup exit 143 } # Set up traps trap cleanup EXIT trap 'on_error ${LINENO}' ERR trap on_sigint INT trap on_sigterm TERM # Usage TEMP_DIR=$(mktemp -d) register_cleanup "$TEMP_DIR" TEMP_FILE=$(mktemp) register_cleanup "$TEMP_FILE" register_cleanup "docker stop mycontainer"
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 14,071 | 11,644 | -17% | 1 | 1 | 0% | 2,870 | 2,920 | +2% | 0 | 0 | — |
case-02 | fail→pass | 16,459 | 13,546 | -18% | 1 | 1 | 0% | 3,325 | 3,192 | -4% | 0 | 0 | — |
case-03 | fail→pass | 15,272 | 13,230 | -13% | 1 | 1 | 0% | 3,028 | 2,979 | -2% | 0 | 0 | — |
case-04 | fail→fail | 11,845 | 14,472 | +22% | 1 | 1 | 0% | 2,353 | 3,385 | +44% | 0 | 0 | — |
case-05 | fail→fail | 9,185 | 9,707 | +6% | 1 | 1 | 0% | 1,701 | 2,286 | +34% | 0 | 0 | — |
case-06 | fail→fail | 7,939 | 6,315 | -20% | 1 | 1 | 0% | 1,351 | 1,604 | +19% | 0 | 0 | — |
case-07 | fail→fail | 8,268 | 3,431 | -59% | 1 | 1 | 0% | 1,374 | 1,127 | -18% | 0 | 0 | — |
case-08 | fail→pass | 11,143 | 9,686 | -13% | 1 | 1 | 0% | 2,016 | 2,224 | +10% | 0 | 0 | — |
case-09 | pass→pass | 8,941 | 8,935 | -0% | 1 | 1 | 0% | 1,700 | 2,131 | +25% | 0 | 0 | — |
case-10 | fail→fail | 14,946 | 10,420 | -30% | 1 | 1 | 0% | 2,696 | 2,200 | -18% | 0 | 0 | — |
case-11 | fail→fail | 3,631 | 3,452 | -5% | 1 | 1 | 0% | 723 | 1,215 | +68% | 0 | 0 | — |
case-12 | fail→fail | 9,972 | 11,956 | +20% | 1 | 1 | 0% | 1,952 | 2,927 | +50% | 0 | 0 | — |
case-13 | fail→fail | 7,189 | 4,926 | -31% | 1 | 1 | 0% | 1,211 | 1,345 | +11% | 0 | 0 | — |
case-14 | fail→fail | 8,102 | 6,891 | -15% | 1 | 1 | 0% | 1,633 | 1,915 | +17% | 0 | 0 | — |
case-15 | fail→fail | 12,379 | 9,896 | -20% | 1 | 1 | 0% | 2,564 | 2,522 | -2% | 0 | 0 | — |
case-16 | fail→fail | 7,459 | 5,257 | -30% | 1 | 1 | 0% | 1,273 | 1,544 | +21% | 0 | 0 | — |
case-17 | fail→pass | 7,970 | 1,680 | -79% | 1 | 1 | 0% | 1,368 | 801 | -41% | 0 | 0 | — |
case-18 | fail→fail | 6,390 | 3,878 | -39% | 1 | 1 | 0% | 1,261 | 1,244 | -1% | 0 | 0 | — |
case-19 | fail→fail | 3,009 | 4,960 | +65% | 1 | 1 | 0% | 440 | 1,521 | +246% | 0 | 0 | — |
case-20 | fail→fail | 9,506 | 12,484 | +31% | 1 | 1 | 0% | 1,988 | 3,349 | +68% | 0 | 0 | — |
case-21 | fail→fail | 21,649 | 18,845 | -13% | 1 | 1 | 0% | 3,355 | 3,357 | +0% | 0 | 0 | — |
case-22 | fail→fail | 9,829 | 15,688 | +60% | 1 | 1 | 0% | 2,091 | 3,156 | +51% | 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. 22 cases were attempted. The headline lift of +23 percentage points is the difference between those two pass rates over the 22 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.