Skip to main content

bash-cli-refactoring

Stars0
Forks0
UpdatedMarch 3, 2026 at 12:50

Refactor bash CLI tools systematically using BDD methodology. Covers helper extraction (debug-aware wrappers, interactive pickers, two-tier resolution), god function decomposition (orchestrator pattern, extraction by concern), bash-specific gotchas (set -e traps, local masking, ANSI-C quoting, pipefail), BDD testing for bash (pytest-bdd with subprocess runner, testing without external dependencies), standard command patterns (entry point architecture, two-path flow, argument parsing), and a 9-item anti-pattern catalog with detection signals and fix recipes. Synthesized from real refactoring of a 1500-line kubectl wrapper CLI. Trigger phrases: "refactor bash", "bash CLI", "shell script refactoring", "bash refactor", "refactor shell script", "bash best practices", "shell script quality", "bash anti-patterns", "bash god function", "bash helper extraction", "BDD bash", "test bash CLI", "bash cleanup", "bash set -e", "bash debugging", "refactoring CLI tool", "bash code quality", "shell script patterns", "bash cod

Installation

Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.

SKILL.md
readonly