bash-code-quality

Enforce defensive coding standards for Bash scripts in development and CI contexts.

3|Updated Mar 20, 2026
One-click install
npx skills add https://github.com/alkofu/ai-tpk --skill bash-code-quality
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bash-code-quality
Source: https://github.com/alkofu/ai-tpk/tree/main/claude/skills/bash-code-quality
Command: npx skills add https://github.com/alkofu/ai-tpk --skill bash-code-quality

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Defensive coding standards for Bash scripts authored as deliverables — files that are committed to the repository, installed on user machines, or executed in CI/CD environments — are defined to reduce runtime errors, security vulnerabilities, and maintenance burden.

Core Features & Use Cases

  • Enforce strict mode at script start to catch errors early and stop on failures.
  • Enforce safe quoting and variable handling to prevent word-splitting and globbing issues.
  • Ensure robust function scoping, trap-based cleanup, and structured logging for maintainable scripts.
  • Use as a reference during authoring, code reviews, and on-boarding to raise baseline quality across projects.

Quick Start

Run the Bash Code Quality guidelines on your project to apply strict-mode, safe quoting, and robust error handling to all Bash scripts.

Frequently Asked Questions about bash-code-quality

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce strict mode and safe quoting in Bash scripts?

Defensive coding standards enforce strict mode, safe quoting, and variable handling in Bash scripts to catch errors early and prevent word-splitting or globbing issues.

What is defensive Bash coding for CI/CD environments?

Defensive Bash coding applies strict mode, error trapping, and dependency checks to scripts committed to repositories or executed in CI/CD to reduce runtime errors and security vulnerabilities.

How do I add robust error trapping and cleanup to shell scripts?

Add robust error trapping and cleanup to shell scripts by enforcing standards for function scoping, trap-based cleanup, and structured logging to maintain reliable execution.

Can I use these Bash coding standards for scripts with dry-run support?

Yes, these Bash coding standards satisfy defensive programming requirements including dry-run support, idempotence, local variable scope, and dependency checks for reliable script execution.

What's the best way to prevent security vulnerabilities in Bash scripts?

Prevent security vulnerabilities in Bash scripts by enforcing safe quoting, strict mode, and robust error handling standards that reduce runtime errors during development and CI contexts.

Why does my Bash script fail on word-splitting and globbing issues?

Bash scripts fail on word-splitting and globbing when defensive coding standards for safe quoting and variable handling are not applied, causing runtime errors during execution.