shell-cli-dispatch-pattern

Community

Prevent silent CLI option bugs in Bash.

Authorsaintgo7
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill prevents Bash CLI bugs where sub-command argument forwarding is accidentally broken, causing user options to be silently ignored.

Core Features & Use Cases

  • Deterministic dispatcher pattern: Implements a standardized sub-command dispatcher using cmd separation with shift and strict "$@" forwarding.
  • Fail-fast and validation guardrails: Requires set -euo pipefail, enforces curl --fail-with-body -sS, and uses unknown-command handling to avoid silent failures.
  • Regression and static checks: Includes a dispatch lint script that heuristically flags missing "$@" in case branches, plus an example regression test strategy.
  • Use Case: When maintaining an admin/ops Bash CLI, ensure commands like list-users correctly honor filters such as --plan free instead of defaulting due to argument loss.

Quick Start

Ask the AI to implement a Bash admin-cli sub-command dispatcher that assigns cmd from the first argument, shifts once, forwards the remaining arguments with "$@" for every case branch, and includes a lint/regression check to ensure options are not silently ignored.

Dependency Matrix

Required Modules

None required

Components

scripts

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: shell-cli-dispatch-pattern
Download link: https://github.com/saintgo7/claude-skills/archive/main.zip#shell-cli-dispatch-pattern

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.